export type GetApiApiV1WorkspacesSlugMarketDataCoverageOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Declared coverage for every relation * * GET /api/v1/workspaces/{slug}/market-data/coverage */ export const getApiApiV1WorkspacesSlugMarketDataCoverage = async (options?: GetApiApiV1WorkspacesSlugMarketDataCoverageOptions) => { const {baseUrl = "https://api.trybrein.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/workspaces/${encodeURIComponent(String(args.slug))}/market-data/coverage${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 };