| 44364 | var components = __importStar(require_components()); |
| 44365 | var operations = __importStar(require_operations()); |
| 44366 | async function batchJobsList(client, request3, options) { |
| 44367 | const parsed = (0, schemas_js_1.safeParse)(request3, (value) => operations.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema.optional().parse(value), "Input validation failed"); |
| 44368 | if (!parsed.ok) { |
| 44369 | return parsed; |
| 44370 | } |
| 44371 | const payload = parsed.value; |
| 44372 | const body = null; |
| 44373 | const path5 = (0, url_js_1.pathToFunc)("/v1/batch/jobs")(); |
| 44374 | const query = (0, encodings_js_1.encodeFormQuery)({ |
| 44375 | "created_after": payload === null || payload === void 0 ? void 0 : payload.created_after, |
| 44376 | "created_by_me": payload === null || payload === void 0 ? void 0 : payload.created_by_me, |
| 44377 | "metadata": payload === null || payload === void 0 ? void 0 : payload.metadata, |
| 44378 | "model": payload === null || payload === void 0 ? void 0 : payload.model, |
| 44379 | "page": payload === null || payload === void 0 ? void 0 : payload.page, |
| 44380 | "page_size": payload === null || payload === void 0 ? void 0 : payload.page_size, |
| 44381 | "status": payload === null || payload === void 0 ? void 0 : payload.status |
| 44382 | }); |
| 44383 | const headers = new Headers({ |
| 44384 | Accept: "application/json" |
| 44385 | }); |
| 44386 | const secConfig = await (0, security_js_1.extractSecurity)(client._options.apiKey); |
| 44387 | const securityInput = secConfig == null ? {} : { apiKey: secConfig }; |
| 44388 | const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput); |
| 44389 | const context = { |
| 44390 | operationID: "jobs_api_routes_batch_get_batch_jobs", |
| 44391 | oAuth2Scopes: [], |
| 44392 | resolvedSecurity: requestSecurity, |
| 44393 | securitySource: client._options.apiKey, |
| 44394 | retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || client._options.retryConfig || { strategy: "none" }, |
| 44395 | retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"] |
| 44396 | }; |
| 44397 | const requestRes = client._createRequest(context, { |
| 44398 | security: requestSecurity, |
| 44399 | method: "GET", |
| 44400 | path: path5, |
| 44401 | headers, |
| 44402 | query, |
| 44403 | body, |
| 44404 | timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || -1 |
| 44405 | }, options); |
| 44406 | if (!requestRes.ok) { |
| 44407 | return requestRes; |
| 44408 | } |
| 44409 | const req = requestRes.value; |
| 44410 | const doResult = await client._do(req, { |
| 44411 | context, |
| 44412 | errorCodes: ["4XX", "5XX"], |
| 44413 | retryConfig: context.retryConfig, |
| 44414 | retryCodes: context.retryCodes |
| 44415 | }); |
| 44416 | if (!doResult.ok) { |
| 44417 | return doResult; |
| 44418 | } |
| 44419 | const response = doResult.value; |
| 44420 | const [result] = await M5.match(M5.json(200, components.BatchJobsOut$inboundSchema), M5.fail(["4XX", "5XX"]))(response); |
| 44421 | if (!result.ok) { |
| 44422 | return result; |
| 44423 | } |