"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BatchJobOut$ = exports.BatchJobOut$outboundSchema = exports.BatchJobOut$inboundSchema = exports.BatchJobOutObject$ = exports.BatchJobOutObject$outboundSchema = exports.BatchJobOutObject$inboundSchema = exports.BatchJobOutObject = void 0;
exports.batchJobOutToJSON = batchJobOutToJSON;
exports.batchJobOutFromJSON = batchJobOutFromJSON;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const batcherror_js_1 = require("./batcherror.js");
const batchjobstatus_js_1 = require("./batchjobstatus.js");
exports.BatchJobOutObject = {
    Batch: "batch",
};
/** @internal */
exports.BatchJobOutObject$inboundSchema = z.nativeEnum(exports.BatchJobOutObject);
/** @internal */
exports.BatchJobOutObject$outboundSchema = exports.BatchJobOutObject$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var BatchJobOutObject$;
(function (BatchJobOutObject$) {
    /** @deprecated use `BatchJobOutObject$inboundSchema` instead. */
    BatchJobOutObject$.inboundSchema = exports.BatchJobOutObject$inboundSchema;
    /** @deprecated use `BatchJobOutObject$outboundSchema` instead. */
    BatchJobOutObject$.outboundSchema = exports.BatchJobOutObject$outboundSchema;
})(BatchJobOutObject$ || (exports.BatchJobOutObject$ = BatchJobOutObject$ = {}));
/** @internal */
exports.BatchJobOut$inboundSchema = z.object({
    id: z.string(),
    object: exports.BatchJobOutObject$inboundSchema.default("batch"),
    input_files: z.array(z.string()),
    metadata: z.nullable(z.record(z.any())).optional(),
    endpoint: z.string(),
    model: z.string(),
    output_file: z.nullable(z.string()).optional(),
    error_file: z.nullable(z.string()).optional(),
    errors: z.array(batcherror_js_1.BatchError$inboundSchema),
    status: batchjobstatus_js_1.BatchJobStatus$inboundSchema,
    created_at: z.number().int(),
    total_requests: z.number().int(),
    completed_requests: z.number().int(),
    succeeded_requests: z.number().int(),
    failed_requests: z.number().int(),
    started_at: z.nullable(z.number().int()).optional(),
    completed_at: z.nullable(z.number().int()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "input_files": "inputFiles",
        "output_file": "outputFile",
        "error_file": "errorFile",
        "created_at": "createdAt",
        "total_requests": "totalRequests",
        "completed_requests": "completedRequests",
        "succeeded_requests": "succeededRequests",
        "failed_requests": "failedRequests",
        "started_at": "startedAt",
        "completed_at": "completedAt",
    });
});
/** @internal */
exports.BatchJobOut$outboundSchema = z.object({
    id: z.string(),
    object: exports.BatchJobOutObject$outboundSchema.default("batch"),
    inputFiles: z.array(z.string()),
    metadata: z.nullable(z.record(z.any())).optional(),
    endpoint: z.string(),
    model: z.string(),
    outputFile: z.nullable(z.string()).optional(),
    errorFile: z.nullable(z.string()).optional(),
    errors: z.array(batcherror_js_1.BatchError$outboundSchema),
    status: batchjobstatus_js_1.BatchJobStatus$outboundSchema,
    createdAt: z.number().int(),
    totalRequests: z.number().int(),
    completedRequests: z.number().int(),
    succeededRequests: z.number().int(),
    failedRequests: z.number().int(),
    startedAt: z.nullable(z.number().int()).optional(),
    completedAt: z.nullable(z.number().int()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        inputFiles: "input_files",
        outputFile: "output_file",
        errorFile: "error_file",
        createdAt: "created_at",
        totalRequests: "total_requests",
        completedRequests: "completed_requests",
        succeededRequests: "succeeded_requests",
        failedRequests: "failed_requests",
        startedAt: "started_at",
        completedAt: "completed_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var BatchJobOut$;
(function (BatchJobOut$) {
    /** @deprecated use `BatchJobOut$inboundSchema` instead. */
    BatchJobOut$.inboundSchema = exports.BatchJobOut$inboundSchema;
    /** @deprecated use `BatchJobOut$outboundSchema` instead. */
    BatchJobOut$.outboundSchema = exports.BatchJobOut$outboundSchema;
})(BatchJobOut$ || (exports.BatchJobOut$ = BatchJobOut$ = {}));
function batchJobOutToJSON(batchJobOut) {
    return JSON.stringify(exports.BatchJobOut$outboundSchema.parse(batchJobOut));
}
function batchJobOutFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.BatchJobOut$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchJobOut' from JSON`);
}
//# sourceMappingURL=batchjobout.js.map