export type CreateApiApiV1JobInstancesBulkCreateArgs = {statusFieldName?: string | undefined, resolveRefs?: boolean | undefined, body: {jobInstances: string, file?: string | undefined}}; export type CreateApiApiV1JobInstancesBulkCreateOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /api/v1/job-instances/bulk-create */ export const createApiApiV1JobInstancesBulkCreate = async (args: CreateApiApiV1JobInstancesBulkCreateArgs, options?: CreateApiApiV1JobInstancesBulkCreateOptions) => { 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 (args.statusFieldName != null) query.append("statusFieldName", String(args.statusFieldName)) if (args.resolveRefs != null) query.append("resolveRefs", String(args.resolveRefs)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/job-instances/bulk-create${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 };