export type CreateApiV1AdminDqEarningsDatesRunArgs = {window?: number | undefined, threshold?: number | undefined, max_symbols?: number | undefined, throttle_ms?: number | undefined, write_back?: boolean | undefined}; export type CreateApiV1AdminDqEarningsDatesRunOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/admin/dq/earnings-dates/run */ export const createApiV1AdminDqEarningsDatesRun = async (args: CreateApiV1AdminDqEarningsDatesRunArgs, options: CreateApiV1AdminDqEarningsDatesRunOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.window != null) query.append("window", String(args.window)) if (args.threshold != null) query.append("threshold", String(args.threshold)) if (args.max_symbols != null) query.append("max_symbols", String(args.max_symbols)) if (args.throttle_ms != null) query.append("throttle_ms", String(args.throttle_ms)) if (args.write_back != null) query.append("write_back", String(args.write_back)) if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/admin/dq/earnings-dates/run${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };