"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$outboundSchema = exports.CreateDatasourceResponseBody$inboundSchema = exports.CreateDatasourceStatus$outboundSchema = exports.CreateDatasourceStatus$inboundSchema = exports.CreateDatasourceRequest$outboundSchema = exports.CreateDatasourceRequest$inboundSchema = exports.CreateDatasourceRequestBody$outboundSchema = exports.CreateDatasourceRequestBody$inboundSchema = exports.ChunkingOptions$outboundSchema = exports.ChunkingOptions$inboundSchema = exports.ChunkingCleanupOptions$outboundSchema = exports.ChunkingCleanupOptions$inboundSchema = exports.ChunkingConfiguration$outboundSchema = exports.ChunkingConfiguration$inboundSchema = exports.ChunkingConfiguration1$outboundSchema = exports.ChunkingConfiguration1$inboundSchema = exports.ChunkingConfigurationType$outboundSchema = exports.ChunkingConfigurationType$inboundSchema = exports.ChunkingConfiguration2$outboundSchema = exports.ChunkingConfiguration2$inboundSchema = exports.CreateDatasourceChunkingConfigurationType$outboundSchema = exports.CreateDatasourceChunkingConfigurationType$inboundSchema = exports.CreateDatasourceStatus = exports.ChunkingConfigurationType = exports.CreateDatasourceChunkingConfigurationType = void 0;
exports.chunkingConfiguration2ToJSON = chunkingConfiguration2ToJSON;
exports.chunkingConfiguration2FromJSON = chunkingConfiguration2FromJSON;
exports.chunkingConfiguration1ToJSON = chunkingConfiguration1ToJSON;
exports.chunkingConfiguration1FromJSON = chunkingConfiguration1FromJSON;
exports.chunkingConfigurationToJSON = chunkingConfigurationToJSON;
exports.chunkingConfigurationFromJSON = chunkingConfigurationFromJSON;
exports.chunkingCleanupOptionsToJSON = chunkingCleanupOptionsToJSON;
exports.chunkingCleanupOptionsFromJSON = chunkingCleanupOptionsFromJSON;
exports.chunkingOptionsToJSON = chunkingOptionsToJSON;
exports.chunkingOptionsFromJSON = chunkingOptionsFromJSON;
exports.createDatasourceRequestBodyToJSON = createDatasourceRequestBodyToJSON;
exports.createDatasourceRequestBodyFromJSON = createDatasourceRequestBodyFromJSON;
exports.createDatasourceRequestToJSON = createDatasourceRequestToJSON;
exports.createDatasourceRequestFromJSON = createDatasourceRequestFromJSON;
exports.createDatasourceResponseBodyToJSON = createDatasourceResponseBodyToJSON;
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.CreateDatasourceChunkingConfigurationType = {
    Advanced: "advanced",
};
exports.ChunkingConfigurationType = {
    Default: "default",
};
exports.CreateDatasourceStatus = {
    Pending: "pending",
    Processing: "processing",
    Completed: "completed",
    Failed: "failed",
    Queued: "queued",
};
/** @internal */
exports.CreateDatasourceChunkingConfigurationType$inboundSchema = z
    .nativeEnum(exports.CreateDatasourceChunkingConfigurationType);
/** @internal */
exports.CreateDatasourceChunkingConfigurationType$outboundSchema = exports.CreateDatasourceChunkingConfigurationType$inboundSchema;
/** @internal */
exports.ChunkingConfiguration2$inboundSchema = z.object({
    type: exports.CreateDatasourceChunkingConfigurationType$inboundSchema,
    chunk_max_characters: z.number().default(500),
    chunk_overlap: z.number().default(0),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "chunk_max_characters": "chunkMaxCharacters",
        "chunk_overlap": "chunkOverlap",
    });
});
/** @internal */
exports.ChunkingConfiguration2$outboundSchema = z.object({
    type: exports.CreateDatasourceChunkingConfigurationType$outboundSchema,
    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));
}
function chunkingConfiguration2FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ChunkingConfiguration2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChunkingConfiguration2' from JSON`);
}
/** @internal */
exports.ChunkingConfigurationType$inboundSchema = z.nativeEnum(exports.ChunkingConfigurationType);
/** @internal */
exports.ChunkingConfigurationType$outboundSchema = exports.ChunkingConfigurationType$inboundSchema;
/** @internal */
exports.ChunkingConfiguration1$inboundSchema = z.object({
    type: exports.ChunkingConfigurationType$inboundSchema,
});
/** @internal */
exports.ChunkingConfiguration1$outboundSchema = z.object({
    type: exports.ChunkingConfigurationType$outboundSchema,
});
function chunkingConfiguration1ToJSON(chunkingConfiguration1) {
    return JSON.stringify(exports.ChunkingConfiguration1$outboundSchema.parse(chunkingConfiguration1));
}
function chunkingConfiguration1FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ChunkingConfiguration1$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChunkingConfiguration1' from JSON`);
}
/** @internal */
exports.ChunkingConfiguration$inboundSchema = z.union([
    z.lazy(() => exports.ChunkingConfiguration1$inboundSchema),
    z.lazy(() => exports.ChunkingConfiguration2$inboundSchema),
]);
/** @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));
}
function chunkingConfigurationFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ChunkingConfiguration$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChunkingConfiguration' from JSON`);
}
/** @internal */
exports.ChunkingCleanupOptions$inboundSchema = z.object({
    delete_emails: z.boolean().optional(),
    delete_credit_cards: z.boolean().optional(),
    delete_phone_numbers: z.boolean().optional(),
    clean_bullet_points: z.boolean().optional(),
    clean_numbered_list: z.boolean().optional(),
    clean_unicode: z.boolean().optional(),
    clean_dashes: z.boolean().optional(),
    clean_whitespaces: z.boolean().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "delete_emails": "deleteEmails",
        "delete_credit_cards": "deleteCreditCards",
        "delete_phone_numbers": "deletePhoneNumbers",
        "clean_bullet_points": "cleanBulletPoints",
        "clean_numbered_list": "cleanNumberedList",
        "clean_unicode": "cleanUnicode",
        "clean_dashes": "cleanDashes",
        "clean_whitespaces": "cleanWhitespaces",
    });
});
/** @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));
}
function chunkingCleanupOptionsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ChunkingCleanupOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChunkingCleanupOptions' from JSON`);
}
/** @internal */
exports.ChunkingOptions$inboundSchema = z.object({
    chunking_configuration: z.union([
        z.lazy(() => exports.ChunkingConfiguration1$inboundSchema),
        z.lazy(() => exports.ChunkingConfiguration2$inboundSchema),
    ]).optional(),
    chunking_cleanup_options: z.lazy(() => exports.ChunkingCleanupOptions$inboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "chunking_configuration": "chunkingConfiguration",
        "chunking_cleanup_options": "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));
}
function chunkingOptionsFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ChunkingOptions$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChunkingOptions' from JSON`);
}
/** @internal */
exports.CreateDatasourceRequestBody$inboundSchema = z.object({
    display_name: z.string().optional(),
    file_id: z.string().optional(),
    chunking_options: z.lazy(() => exports.ChunkingOptions$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "display_name": "displayName",
        "file_id": "fileId",
        "chunking_options": "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));
}
function createDatasourceRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateDatasourceRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateDatasourceRequestBody' from JSON`);
}
/** @internal */
exports.CreateDatasourceRequest$inboundSchema = z.object({
    knowledge_id: z.string(),
    RequestBody: z.lazy(() => exports.CreateDatasourceRequestBody$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "knowledge_id": "knowledgeId",
        "RequestBody": "requestBody",
    });
});
/** @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));
}
function createDatasourceRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateDatasourceRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateDatasourceRequest' from JSON`);
}
/** @internal */
exports.CreateDatasourceStatus$inboundSchema = z.nativeEnum(exports.CreateDatasourceStatus);
/** @internal */
exports.CreateDatasourceStatus$outboundSchema = exports.CreateDatasourceStatus$inboundSchema;
/** @internal */
exports.CreateDatasourceResponseBody$inboundSchema = z.object({
    _id: z.string().default("01KAXX9JC4S05QABK90KAWZTJV"),
    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",
    });
});
/** @internal */
exports.CreateDatasourceResponseBody$outboundSchema = z.object({
    id: z.string().default("01KAXX9JC4S05QABK90KAWZTJV"),
    displayName: z.string(),
    description: z.string().optional(),
    status: exports.CreateDatasourceStatus$outboundSchema,
    fileId: z.nullable(z.string()).optional(),
    created: z.string(),
    updated: z.string(),
    createdById: z.nullable(z.string()).optional(),
    updateById: z.nullable(z.string()).optional(),
    knowledgeId: z.string(),
    chunksCount: z.number(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        displayName: "display_name",
        fileId: "file_id",
        createdById: "created_by_id",
        updateById: "update_by_id",
        knowledgeId: "knowledge_id",
        chunksCount: "chunks_count",
    });
});
function createDatasourceResponseBodyToJSON(createDatasourceResponseBody) {
    return JSON.stringify(exports.CreateDatasourceResponseBody$outboundSchema.parse(createDatasourceResponseBody));
}
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