export type GetApiV1AdminDqValidateTickerArgs = {ticker: string, source?: string | undefined, asof?: string | undefined}; export type GetApiV1AdminDqValidateTickerOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /v1/admin/dq/validate/{ticker} */ export const getApiV1AdminDqValidateTicker = async (args: GetApiV1AdminDqValidateTickerArgs, options: GetApiV1AdminDqValidateTickerOptions) => { 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.asof != null) query.append("asof", String(args.asof)) if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/admin/dq/validate/${encodeURIComponent(String(args.ticker))}${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 };