"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.CreateDatasourceResponseBody$inboundSchema = exports.CreateDatasourceStatus$inboundSchema = exports.CreateDatasourceRequest$outboundSchema = exports.CreateDatasourceRequestBody$outboundSchema = exports.ChunkingOptions$outboundSchema = exports.ChunkingCleanupOptions$outboundSchema = exports.ChunkingConfiguration$outboundSchema = exports.ChunkingConfiguration1$outboundSchema = exports.ChunkingConfiguration2$outboundSchema = exports.CreateDatasourceStatus = void 0;
exports.chunkingConfiguration2ToJSON = chunkingConfiguration2ToJSON;
exports.chunkingConfiguration1ToJSON = chunkingConfiguration1ToJSON;
exports.chunkingConfigurationToJSON = chunkingConfigurationToJSON;
exports.chunkingCleanupOptionsToJSON = chunkingCleanupOptionsToJSON;
exports.chunkingOptionsToJSON = chunkingOptionsToJSON;
exports.createDatasourceRequestBodyToJSON = createDatasourceRequestBodyToJSON;
exports.createDatasourceRequestToJSON = createDatasourceRequestToJSON;
exports.createDatasourceResponseBodyFromJSON = createDatasourceResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.CreateDatasourceStatus = {
    Pending: "pending",
    Processing: "processing",
    Completed: "completed",
    Failed: "failed",
    Queued: "queued",
};
/** @internal */
exports.ChunkingConfiguration2$outboundSchema = z.object({
    type: z.literal("advanced"),
    chunkMaxCharacters: z.number().default(500),
    chunkOverlap: z.number().default(0),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        chunkMaxCharacters: "chunk_max_characters",
        chunkOverlap: "chunk_overlap",
    });
});
function chunkingConfiguration2ToJSON(chunkingConfiguration2) {
    return JSON.stringify(exports.ChunkingConfiguration2$outboundSchema.parse(chunkingConfiguration2));
}
/** @internal */
exports.ChunkingConfiguration1$outboundSchema = z.object({
    type: z.literal("default"),
});
function chunkingConfiguration1ToJSON(chunkingConfiguration1) {
    return JSON.stringify(exports.ChunkingConfiguration1$outboundSchema.parse(chunkingConfiguration1));
}
/** @internal */
exports.ChunkingConfiguration$outboundSchema = z.union([
    z.lazy(() => exports.ChunkingConfiguration1$outboundSchema),
    z.lazy(() => exports.ChunkingConfiguration2$outboundSchema),
]);
function chunkingConfigurationToJSON(chunkingConfiguration) {
    return JSON.stringify(exports.ChunkingConfiguration$outboundSchema.parse(chunkingConfiguration));
}
/** @internal */
exports.ChunkingCleanupOptions$outboundSchema = z.object({
    deleteEmails: z.boolean().optional(),
    deleteCreditCards: z.boolean().optional(),
    deletePhoneNumbers: z.boolean().optional(),
    cleanBulletPoints: z.boolean().optional(),
    cleanNumberedList: z.boolean().optional(),
    cleanUnicode: z.boolean().optional(),
    cleanDashes: z.boolean().optional(),
    cleanWhitespaces: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        deleteEmails: "delete_emails",
        deleteCreditCards: "delete_credit_cards",
        deletePhoneNumbers: "delete_phone_numbers",
        cleanBulletPoints: "clean_bullet_points",
        cleanNumberedList: "clean_numbered_list",
        cleanUnicode: "clean_unicode",
        cleanDashes: "clean_dashes",
        cleanWhitespaces: "clean_whitespaces",
    });
});
function chunkingCleanupOptionsToJSON(chunkingCleanupOptions) {
    return JSON.stringify(exports.ChunkingCleanupOptions$outboundSchema.parse(chunkingCleanupOptions));
}
/** @internal */
exports.ChunkingOptions$outboundSchema = z.object({
    chunkingConfiguration: z.union([
        z.lazy(() => exports.ChunkingConfiguration1$outboundSchema),
        z.lazy(() => exports.ChunkingConfiguration2$outboundSchema),
    ]).optional(),
    chunkingCleanupOptions: z.lazy(() => exports.ChunkingCleanupOptions$outboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        chunkingConfiguration: "chunking_configuration",
        chunkingCleanupOptions: "chunking_cleanup_options",
    });
});
function chunkingOptionsToJSON(chunkingOptions) {
    return JSON.stringify(exports.ChunkingOptions$outboundSchema.parse(chunkingOptions));
}
/** @internal */
exports.CreateDatasourceRequestBody$outboundSchema = z.object({
    displayName: z.string().optional(),
    fileId: z.string().optional(),
    chunkingOptions: z.lazy(() => exports.ChunkingOptions$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        displayName: "display_name",
        fileId: "file_id",
        chunkingOptions: "chunking_options",
    });
});
function createDatasourceRequestBodyToJSON(createDatasourceRequestBody) {
    return JSON.stringify(exports.CreateDatasourceRequestBody$outboundSchema.parse(createDatasourceRequestBody));
}
/** @internal */
exports.CreateDatasourceRequest$outboundSchema = z.object({
    knowledgeId: z.string(),
    requestBody: z.lazy(() => exports.CreateDatasourceRequestBody$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        knowledgeId: "knowledge_id",
        requestBody: "RequestBody",
    });
});
function createDatasourceRequestToJSON(createDatasourceRequest) {
    return JSON.stringify(exports.CreateDatasourceRequest$outboundSchema.parse(createDatasourceRequest));
}
/** @internal */
exports.CreateDatasourceStatus$inboundSchema = z.nativeEnum(exports.CreateDatasourceStatus);
/** @internal */
exports.CreateDatasourceResponseBody$inboundSchema = z.object({
    _id: z.string().default("01KSK55ZK9TT56CSC3Y00N3MMD"),
    display_name: z.string(),
    description: z.string().optional(),
    status: exports.CreateDatasourceStatus$inboundSchema,
    file_id: z.nullable(z.string()).optional(),
    created: z.string(),
    updated: z.string(),
    created_by_id: z.nullable(z.string()).optional(),
    update_by_id: z.nullable(z.string()).optional(),
    knowledge_id: z.string(),
    chunks_count: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "_id": "id",
        "display_name": "displayName",
        "file_id": "fileId",
        "created_by_id": "createdById",
        "update_by_id": "updateById",
        "knowledge_id": "knowledgeId",
        "chunks_count": "chunksCount",
    });
});
function createDatasourceResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateDatasourceResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateDatasourceResponseBody' from JSON`);
}
//# sourceMappingURL=createdatasource.js.map