"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$inboundSchema = exports.ListChunksPaginatedData$inboundSchema = exports.ListChunksPaginatedStatus$inboundSchema = exports.ListChunksPaginatedMetadata$inboundSchema = exports.ListChunksPaginatedObject$inboundSchema = exports.ListChunksPaginatedRequest$outboundSchema = exports.ListChunksPaginatedRequestBody$outboundSchema = exports.Status$outboundSchema = exports.ListChunksPaginatedStatus = exports.ListChunksPaginatedObject = exports.Status = void 0;
exports.listChunksPaginatedRequestBodyToJSON = listChunksPaginatedRequestBodyToJSON;
exports.listChunksPaginatedRequestToJSON = listChunksPaginatedRequestToJSON;
exports.listChunksPaginatedMetadataFromJSON = listChunksPaginatedMetadataFromJSON;
exports.listChunksPaginatedDataFromJSON = listChunksPaginatedDataFromJSON;
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");
/**
 * Filter chunks by processing status
 */
exports.Status = {
    Pending: "pending",
    Processing: "processing",
    Completed: "completed",
    Failed: "failed",
    Queued: "queued",
};
exports.ListChunksPaginatedObject = {
    List: "list",
};
/**
 * The status of the chunk
 */
exports.ListChunksPaginatedStatus = {
    Pending: "pending",
    Processing: "processing",
    Completed: "completed",
    Failed: "failed",
    Queued: "queued",
};
/** @internal */
exports.Status$outboundSchema = z
    .nativeEnum(exports.Status);
/** @internal */
exports.ListChunksPaginatedRequestBody$outboundSchema = z.object({
    q: z.string().default(""),
    enabled: z.boolean().optional(),
    status: exports.Status$outboundSchema.optional(),
    limit: z.number().int().default(100),
    page: z.number().int().default(1),
});
function listChunksPaginatedRequestBodyToJSON(listChunksPaginatedRequestBody) {
    return JSON.stringify(exports.ListChunksPaginatedRequestBody$outboundSchema.parse(listChunksPaginatedRequestBody));
}
/** @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));
}
/** @internal */
exports.ListChunksPaginatedObject$inboundSchema = z.nativeEnum(exports.ListChunksPaginatedObject);
/** @internal */
exports.ListChunksPaginatedMetadata$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
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.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",
    });
});
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",
    });
});
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