export type CreateApiV1AdminDqEarningsDatesCanonicalizeArgs = {symbols?: string | undefined, window?: number | undefined, threshold?: number | undefined, throttle_ms?: number | undefined, top_n?: number | undefined}; export type CreateApiV1AdminDqEarningsDatesCanonicalizeOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/admin/dq/earnings-dates/canonicalize */ export const createApiV1AdminDqEarningsDatesCanonicalize = async (args: CreateApiV1AdminDqEarningsDatesCanonicalizeArgs, options: CreateApiV1AdminDqEarningsDatesCanonicalizeOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.symbols != null) query.append("symbols", String(args.symbols)) if (args.window != null) query.append("window", String(args.window)) if (args.threshold != null) query.append("threshold", String(args.threshold)) if (args.throttle_ms != null) query.append("throttle_ms", String(args.throttle_ms)) if (args.top_n != null) query.append("top_n", String(args.top_n)) if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/admin/dq/earnings-dates/canonicalize${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 };