"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.UpdateChunkResponseBody$outboundSchema = exports.UpdateChunkResponseBody$inboundSchema = exports.UpdateChunkStatus$outboundSchema = exports.UpdateChunkStatus$inboundSchema = exports.UpdateChunkKnowledgeMetadata$outboundSchema = exports.UpdateChunkKnowledgeMetadata$inboundSchema = exports.UpdateChunkRequest$outboundSchema = exports.UpdateChunkRequest$inboundSchema = exports.UpdateChunkRequestBody$outboundSchema = exports.UpdateChunkRequestBody$inboundSchema = exports.UpdateChunkMetadata$outboundSchema = exports.UpdateChunkMetadata$inboundSchema = exports.UpdateChunkStatus = void 0;
exports.updateChunkMetadataToJSON = updateChunkMetadataToJSON;
exports.updateChunkMetadataFromJSON = updateChunkMetadataFromJSON;
exports.updateChunkRequestBodyToJSON = updateChunkRequestBodyToJSON;
exports.updateChunkRequestBodyFromJSON = updateChunkRequestBodyFromJSON;
exports.updateChunkRequestToJSON = updateChunkRequestToJSON;
exports.updateChunkRequestFromJSON = updateChunkRequestFromJSON;
exports.updateChunkKnowledgeMetadataToJSON = updateChunkKnowledgeMetadataToJSON;
exports.updateChunkKnowledgeMetadataFromJSON = updateChunkKnowledgeMetadataFromJSON;
exports.updateChunkResponseBodyToJSON = updateChunkResponseBodyToJSON;
exports.updateChunkResponseBodyFromJSON = updateChunkResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * The status of the chunk
 */
exports.UpdateChunkStatus = {
    Pending: "pending",
    Processing: "processing",
    Completed: "completed",
    Failed: "failed",
    Queued: "queued",
};
/** @internal */
exports.UpdateChunkMetadata$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
/** @internal */
exports.UpdateChunkMetadata$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function updateChunkMetadataToJSON(updateChunkMetadata) {
    return JSON.stringify(exports.UpdateChunkMetadata$outboundSchema.parse(updateChunkMetadata));
}
function updateChunkMetadataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateChunkMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateChunkMetadata' from JSON`);
}
/** @internal */
exports.UpdateChunkRequestBody$inboundSchema = z.object({
    text: z.string().optional(),
    embedding: z.array(z.number()).optional(),
    metadata: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
});
/** @internal */
exports.UpdateChunkRequestBody$outboundSchema = z.object({
    text: z.string().optional(),
    embedding: z.array(z.number()).optional(),
    metadata: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
});
function updateChunkRequestBodyToJSON(updateChunkRequestBody) {
    return JSON.stringify(exports.UpdateChunkRequestBody$outboundSchema.parse(updateChunkRequestBody));
}
function updateChunkRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateChunkRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateChunkRequestBody' from JSON`);
}
/** @internal */
exports.UpdateChunkRequest$inboundSchema = z.object({
    chunk_id: z.string(),
    datasource_id: z.string(),
    knowledge_id: z.string(),
    RequestBody: z.lazy(() => exports.UpdateChunkRequestBody$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "chunk_id": "chunkId",
        "datasource_id": "datasourceId",
        "knowledge_id": "knowledgeId",
        "RequestBody": "requestBody",
    });
});
/** @internal */
exports.UpdateChunkRequest$outboundSchema = z.object({
    chunkId: z.string(),
    datasourceId: z.string(),
    knowledgeId: z.string(),
    requestBody: z.lazy(() => exports.UpdateChunkRequestBody$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        chunkId: "chunk_id",
        datasourceId: "datasource_id",
        knowledgeId: "knowledge_id",
        requestBody: "RequestBody",
    });
});
function updateChunkRequestToJSON(updateChunkRequest) {
    return JSON.stringify(exports.UpdateChunkRequest$outboundSchema.parse(updateChunkRequest));
}
function updateChunkRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateChunkRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateChunkRequest' from JSON`);
}
/** @internal */
exports.UpdateChunkKnowledgeMetadata$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
/** @internal */
exports.UpdateChunkKnowledgeMetadata$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function updateChunkKnowledgeMetadataToJSON(updateChunkKnowledgeMetadata) {
    return JSON.stringify(exports.UpdateChunkKnowledgeMetadata$outboundSchema.parse(updateChunkKnowledgeMetadata));
}
function updateChunkKnowledgeMetadataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateChunkKnowledgeMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateChunkKnowledgeMetadata' from JSON`);
}
/** @internal */
exports.UpdateChunkStatus$inboundSchema = z.nativeEnum(exports.UpdateChunkStatus);
/** @internal */
exports.UpdateChunkStatus$outboundSchema = exports.UpdateChunkStatus$inboundSchema;
/** @internal */
exports.UpdateChunkResponseBody$inboundSchema = z.object({
    _id: z.string(),
    text: z.string(),
    metadata: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
    enabled: z.boolean(),
    status: exports.UpdateChunkStatus$inboundSchema,
    created: z.string(),
    updated: z.string(),
    created_by_id: z.nullable(z.string()).optional(),
    update_by_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "_id": "id",
        "created_by_id": "createdById",
        "update_by_id": "updateById",
    });
});
/** @internal */
exports.UpdateChunkResponseBody$outboundSchema = z.object({
    id: z.string(),
    text: z.string(),
    metadata: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
    enabled: z.boolean(),
    status: exports.UpdateChunkStatus$outboundSchema,
    created: z.string(),
    updated: z.string(),
    createdById: z.nullable(z.string()).optional(),
    updateById: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        createdById: "created_by_id",
        updateById: "update_by_id",
    });
});
function updateChunkResponseBodyToJSON(updateChunkResponseBody) {
    return JSON.stringify(exports.UpdateChunkResponseBody$outboundSchema.parse(updateChunkResponseBody));
}
function updateChunkResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.UpdateChunkResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateChunkResponseBody' from JSON`);
}
//# sourceMappingURL=updatechunk.js.map