export type GetApiApiV1JobInstancesJobInstanceIdExportExcelArgs = {jobInstanceId: string, docJobInstanceId?: string | undefined}; export type GetApiApiV1JobInstancesJobInstanceIdExportExcelOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/v1/job-instances/{jobInstanceId}/export/excel */ export const getApiApiV1JobInstancesJobInstanceIdExportExcel = async (args: GetApiApiV1JobInstancesJobInstanceIdExportExcelArgs, options?: GetApiApiV1JobInstancesJobInstanceIdExportExcelOptions) => { const {baseUrl = "https://api-docs.gosure.ai", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.docJobInstanceId != null) query.append("docJobInstanceId", String(args.docJobInstanceId)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/job-instances/${encodeURIComponent(String(args.jobInstanceId))}/export/excel${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 };