"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 () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.OCRRequest$outboundSchema = exports.TableFormat$outboundSchema = exports.Document$outboundSchema = exports.TableFormat = void 0;
exports.documentToJSON = documentToJSON;
exports.ocrRequestToJSON = ocrRequestToJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const documenturlchunk_js_1 = require("./documenturlchunk.js");
const filechunk_js_1 = require("./filechunk.js");
const imageurlchunk_js_1 = require("./imageurlchunk.js");
const responseformat_js_1 = require("./responseformat.js");
exports.TableFormat = {
    Markdown: "markdown",
    Html: "html",
};
/** @internal */
exports.Document$outboundSchema = z.union([
    filechunk_js_1.FileChunk$outboundSchema,
    documenturlchunk_js_1.DocumentURLChunk$outboundSchema,
    imageurlchunk_js_1.ImageURLChunk$outboundSchema,
]);
function documentToJSON(document) {
    return JSON.stringify(exports.Document$outboundSchema.parse(document));
}
/** @internal */
exports.TableFormat$outboundSchema = z
    .nativeEnum(exports.TableFormat);
/** @internal */
exports.OCRRequest$outboundSchema = z.object({
    model: z.nullable(z.string()),
    id: z.string().optional(),
    document: z.union([
        filechunk_js_1.FileChunk$outboundSchema,
        documenturlchunk_js_1.DocumentURLChunk$outboundSchema,
        imageurlchunk_js_1.ImageURLChunk$outboundSchema,
    ]),
    pages: z.nullable(z.array(z.number().int())).optional(),
    includeImageBase64: z.nullable(z.boolean()).optional(),
    imageLimit: z.nullable(z.number().int()).optional(),
    imageMinSize: z.nullable(z.number().int()).optional(),
    bboxAnnotationFormat: z.nullable(responseformat_js_1.ResponseFormat$outboundSchema).optional(),
    documentAnnotationFormat: z.nullable(responseformat_js_1.ResponseFormat$outboundSchema)
        .optional(),
    documentAnnotationPrompt: z.nullable(z.string()).optional(),
    tableFormat: z.nullable(exports.TableFormat$outboundSchema).optional(),
    extractHeader: z.boolean().optional(),
    extractFooter: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        includeImageBase64: "include_image_base64",
        imageLimit: "image_limit",
        imageMinSize: "image_min_size",
        bboxAnnotationFormat: "bbox_annotation_format",
        documentAnnotationFormat: "document_annotation_format",
        documentAnnotationPrompt: "document_annotation_prompt",
        tableFormat: "table_format",
        extractHeader: "extract_header",
        extractFooter: "extract_footer",
    });
});
function ocrRequestToJSON(ocrRequest) {
    return JSON.stringify(exports.OCRRequest$outboundSchema.parse(ocrRequest));
}
//# sourceMappingURL=ocrrequest.js.map