export type GetApiV1AdminDqSweepArgs = {source?: string | undefined, symbols?: string | undefined, asof?: string | undefined}; export type GetApiV1AdminDqSweepOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /v1/admin/dq/sweep */ export const getApiV1AdminDqSweep = async (args: GetApiV1AdminDqSweepArgs, options: GetApiV1AdminDqSweepOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.source != null) query.append("source", String(args.source)) if (args.symbols != null) query.append("symbols", String(args.symbols)) if (args.asof != null) query.append("asof", String(args.asof)) if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/admin/dq/sweep${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };