export type JobInstanceFilterData = {fieldName?: string | undefined, condition?: string | undefined, value: unknown, betweenRange: unknown, logicalOperator?: string | undefined, fromMetadata?: boolean | undefined}; export type DocumentDownloadRequest = {parentJobInstanceId?: string | undefined, jobInstanceId?: string | undefined, docInstanceId?: string | undefined, subJobTypeName?: string | undefined, reportsJobTypeName?: string | undefined, filters?: Array | undefined, pageNumber?: number | undefined, pageSize?: number | undefined, jobTypeName?: string | undefined, downloadReportType?: ('MULTIPLE_INSTANCES_DOWNLOAD' | 'SINGLE_INSTANCE_DOWNLOAD') | undefined}; export type CreateApiApiV1DownloadDocumentDownloadPdfArgs = {body: DocumentDownloadRequest}; export type CreateApiApiV1DownloadDocumentDownloadPdfOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /api/v1/download-document/download-pdf */ export const createApiApiV1DownloadDocumentDownloadPdf = async (args: CreateApiApiV1DownloadDocumentDownloadPdfArgs, options?: CreateApiApiV1DownloadDocumentDownloadPdfOptions) => { const {baseUrl = "https://api-docs.gosure.ai", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/download-document/download-pdf${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };