export type GetApiApiV1WorkspacesSlugInvestigationsIdExportArgs = {id: string, format: string}; export type GetApiApiV1WorkspacesSlugInvestigationsIdExportOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/v1/workspaces/{slug}/investigations/{id}/export */ export const getApiApiV1WorkspacesSlugInvestigationsIdExport = async (args: GetApiApiV1WorkspacesSlugInvestigationsIdExportArgs, options?: GetApiApiV1WorkspacesSlugInvestigationsIdExportOptions) => { const {baseUrl = "https://api.trybrein.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.format != null) query.append("format", String(args.format)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/workspaces/${encodeURIComponent(String(args.slug))}/investigations/${encodeURIComponent(String(args.id))}/export${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 };