"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.ListChunksResponseBody$inboundSchema = exports.ListChunksData$inboundSchema = exports.ListChunksStatus$inboundSchema = exports.ListChunksMetadata$inboundSchema = exports.ListChunksObject$inboundSchema = exports.ListChunksRequest$outboundSchema = exports.QueryParamStatus$outboundSchema = exports.QueryParam1$outboundSchema = exports.QueryParam2$outboundSchema = exports.ListChunksStatus = exports.ListChunksObject = exports.QueryParam1 = exports.QueryParam2 = void 0;
exports.queryParamStatusToJSON = queryParamStatusToJSON;
exports.listChunksRequestToJSON = listChunksRequestToJSON;
exports.listChunksMetadataFromJSON = listChunksMetadataFromJSON;
exports.listChunksDataFromJSON = listChunksDataFromJSON;
exports.listChunksResponseBodyFromJSON = listChunksResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.QueryParam2 = {
    Pending: "pending",
    Processing: "processing",
    Completed: "completed",
    Failed: "failed",
    Queued: "queued",
};
exports.QueryParam1 = {
    Pending: "pending",
    Processing: "processing",
    Completed: "completed",
    Failed: "failed",
    Queued: "queued",
};
exports.ListChunksObject = {
    List: "list",
};
/**
 * The status of the chunk
 */
exports.ListChunksStatus = {
    Pending: "pending",
    Processing: "processing",
    Completed: "completed",
    Failed: "failed",
    Queued: "queued",
};
/** @internal */
exports.QueryParam2$outboundSchema = z
    .nativeEnum(exports.QueryParam2);
/** @internal */
exports.QueryParam1$outboundSchema = z
    .nativeEnum(exports.QueryParam1);
/** @internal */
exports.QueryParamStatus$outboundSchema = z.union([z.array(exports.QueryParam1$outboundSchema), exports.QueryParam2$outboundSchema]);
function queryParamStatusToJSON(queryParamStatus) {
    return JSON.stringify(exports.QueryParamStatus$outboundSchema.parse(queryParamStatus));
}
/** @internal */
exports.ListChunksRequest$outboundSchema = z.object({
    knowledgeId: z.string(),
    datasourceId: z.string(),
    limit: z.number().int().default(10),
    startingAfter: z.string().optional(),
    endingBefore: z.string().optional(),
    q: z.string().optional(),
    status: z.union([
        z.array(exports.QueryParam1$outboundSchema),
        exports.QueryParam2$outboundSchema,
    ]).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        knowledgeId: "knowledge_id",
        datasourceId: "datasource_id",
        startingAfter: "starting_after",
        endingBefore: "ending_before",
    });
});
function listChunksRequestToJSON(listChunksRequest) {
    return JSON.stringify(exports.ListChunksRequest$outboundSchema.parse(listChunksRequest));
}
/** @internal */
exports.ListChunksObject$inboundSchema = z.nativeEnum(exports.ListChunksObject);
/** @internal */
exports.ListChunksMetadata$inboundSchema = z.union([z.string(), z.number(), z.boolean()]);
function listChunksMetadataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListChunksMetadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListChunksMetadata' from JSON`);
}
/** @internal */
exports.ListChunksStatus$inboundSchema = z.nativeEnum(exports.ListChunksStatus);
/** @internal */
exports.ListChunksData$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.ListChunksStatus$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 listChunksDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListChunksData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListChunksData' from JSON`);
}
/** @internal */
exports.ListChunksResponseBody$inboundSchema = z.object({
    object: exports.ListChunksObject$inboundSchema,
    data: z.array(z.lazy(() => exports.ListChunksData$inboundSchema)),
    has_more: z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "has_more": "hasMore",
    });
});
function listChunksResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.ListChunksResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListChunksResponseBody' from JSON`);
}
//# sourceMappingURL=listchunks.js.map