"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.ListChunksPaginatedResponseBody$outboundSchema = exports.ListChunksPaginatedResponseBody$inboundSchema = exports.ListChunksPaginatedData$outboundSchema = exports.ListChunksPaginatedData$inboundSchema = exports.ListChunksPaginatedStatus$outboundSchema = exports.ListChunksPaginatedStatus$inboundSchema = exports.ListChunksPaginatedMetadata$outboundSchema = exports.ListChunksPaginatedMetadata$inboundSchema = exports.ListChunksPaginatedObject$outboundSchema = exports.ListChunksPaginatedObject$inboundSchema = exports.ListChunksPaginatedRequest$outboundSchema = exports.ListChunksPaginatedRequest$inboundSchema = exports.ListChunksPaginatedRequestBody$outboundSchema = exports.ListChunksPaginatedRequestBody$inboundSchema = exports.ListChunksPaginatedStatus = exports.ListChunksPaginatedObject = void 0;
exports.listChunksPaginatedRequestBodyToJSON = listChunksPaginatedRequestBodyToJSON;
exports.listChunksPaginatedRequestBodyFromJSON = listChunksPaginatedRequestBodyFromJSON;
exports.listChunksPaginatedRequestToJSON = listChunksPaginatedRequestToJSON;
exports.listChunksPaginatedRequestFromJSON = listChunksPaginatedRequestFromJSON;
exports.listChunksPaginatedMetadataToJSON = listChunksPaginatedMetadataToJSON;
exports.listChunksPaginatedMetadataFromJSON = listChunksPaginatedMetadataFromJSON;
exports.listChunksPaginatedDataToJSON = listChunksPaginatedDataToJSON;
exports.listChunksPaginatedDataFromJSON = listChunksPaginatedDataFromJSON;
exports.listChunksPaginatedResponseBodyToJSON = listChunksPaginatedResponseBodyToJSON;
exports.listChunksPaginatedResponseBodyFromJSON = listChunksPaginatedResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.ListChunksPaginatedObject = {
    List: "list",
};
/**
 * The status of the chunk
 */
exports.ListChunksPaginatedStatus = {
    Pending: "pending",
    Processing: "processing",
    Completed: "completed",
    Failed: "failed",
    Queued: "queued",
};
/** @internal */
exports.ListChunksPaginatedRequestBody$inboundSchema = z.object({
    q: z.string().default(""),
    enabled: z.boolean().optional(),
    status: z.string().optional(),
    limit: z.number().int().default(100),
    page: z.number().int().default(1),
});
/** @internal */
exports.ListChunksPaginatedRequestBody$outboundSchema = z.object({
    q: z.string().default(""),
    enabled: z.boolean().optional(),
    status: z.string().optional(),
    limit: z.number().int().default(100),
    page: z.number().int().default(1),
});
function listChunksPaginatedRequestBodyToJSON(listChunksPaginatedRequestBody) {
    return JSON.stringify(exports.ListChunksPaginatedRequestBody$outboundSchema.parse(listChunksPaginatedRequestBody));
}
function listChunksPaginatedRequestBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListChunksPaginatedRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListChunksPaginatedRequestBody' from JSON`);
}
/** @internal */
exports.ListChunksPaginatedRequest$inboundSchema = z.object({
    knowledge_id: z.string(),
    datasource_id: z.string(),
    RequestBody: z.lazy(() => exports.ListChunksPaginatedRequestBody$inboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "knowledge_id": "knowledgeId",
        "datasource_id": "datasourceId",
        "RequestBody": "requestBody",
    });
});
/** @internal */
exports.ListChunksPaginatedRequest$outboundSchema = z.object({
    knowledgeId: z.string(),
    datasourceId: z.string(),
    requestBody: z.lazy(() => exports.ListChunksPaginatedRequestBody$outboundSchema)
        .optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        knowledgeId: "knowledge_id",
        datasourceId: "datasource_id",
        requestBody: "RequestBody",
    });
});
function listChunksPaginatedRequestToJSON(listChunksPaginatedRequest) {
    return JSON.stringify(exports.ListChunksPaginatedRequest$outboundSchema.parse(listChunksPaginatedRequest));
}
function listChunksPaginatedRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListChunksPaginatedRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListChunksPaginatedRequest' from JSON`);
}
/** @internal */
exports.ListChunksPaginatedObject$inboundSchema = z.nativeEnum(exports.ListChunksPaginatedObject);
/** @internal */
exports.ListChunksPaginatedObject$outboundSchema = exports.ListChunksPaginatedObject$inboundSchema;
/** @internal */
exports.ListChunksPaginatedMetadata$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
/** @internal */
exports.ListChunksPaginatedMetadata$outboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function listChunksPaginatedMetadataToJSON(listChunksPaginatedMetadata) {
    return JSON.stringify(exports.ListChunksPaginatedMetadata$outboundSchema.parse(listChunksPaginatedMetadata));
}
function listChunksPaginatedMetadataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListChunksPaginatedMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListChunksPaginatedMetadata' from JSON`);
}
/** @internal */
exports.ListChunksPaginatedStatus$inboundSchema = z.nativeEnum(exports.ListChunksPaginatedStatus);
/** @internal */
exports.ListChunksPaginatedStatus$outboundSchema = exports.ListChunksPaginatedStatus$inboundSchema;
/** @internal */
exports.ListChunksPaginatedData$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.ListChunksPaginatedStatus$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.ListChunksPaginatedData$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.ListChunksPaginatedStatus$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 listChunksPaginatedDataToJSON(listChunksPaginatedData) {
    return JSON.stringify(exports.ListChunksPaginatedData$outboundSchema.parse(listChunksPaginatedData));
}
function listChunksPaginatedDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListChunksPaginatedData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListChunksPaginatedData' from JSON`);
}
/** @internal */
exports.ListChunksPaginatedResponseBody$inboundSchema = z.object({
    object: exports.ListChunksPaginatedObject$inboundSchema,
    data: z.array(z.lazy(() => exports.ListChunksPaginatedData$inboundSchema)),
    has_more: z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "has_more": "hasMore",
    });
});
/** @internal */
exports.ListChunksPaginatedResponseBody$outboundSchema = z.object({
    object: exports.ListChunksPaginatedObject$outboundSchema,
    data: z.array(z.lazy(() => exports.ListChunksPaginatedData$outboundSchema)),
    hasMore: z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        hasMore: "has_more",
    });
});
function listChunksPaginatedResponseBodyToJSON(listChunksPaginatedResponseBody) {
    return JSON.stringify(exports.ListChunksPaginatedResponseBody$outboundSchema.parse(listChunksPaginatedResponseBody));
}
function listChunksPaginatedResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListChunksPaginatedResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListChunksPaginatedResponseBody' from JSON`);
}
//# sourceMappingURL=listchunkspaginated.js.map