"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.FileListResponseBody$outboundSchema = exports.FileListResponseBody$inboundSchema = exports.FileListData$outboundSchema = exports.FileListData$inboundSchema = exports.FileListPurpose$outboundSchema = exports.FileListPurpose$inboundSchema = exports.FileListObject$outboundSchema = exports.FileListObject$inboundSchema = exports.FileListRequest$outboundSchema = exports.FileListRequest$inboundSchema = exports.FileListPurpose = exports.FileListObject = void 0;
exports.fileListRequestToJSON = fileListRequestToJSON;
exports.fileListRequestFromJSON = fileListRequestFromJSON;
exports.fileListDataToJSON = fileListDataToJSON;
exports.fileListDataFromJSON = fileListDataFromJSON;
exports.fileListResponseBodyToJSON = fileListResponseBodyToJSON;
exports.fileListResponseBodyFromJSON = fileListResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.FileListObject = {
    List: "list",
};
/**
 * The intended purpose of the uploaded file.
 */
exports.FileListPurpose = {
    Retrieval: "retrieval",
    KnowledgeDatasource: "knowledge_datasource",
    Batch: "batch",
};
/** @internal */
exports.FileListRequest$inboundSchema = z.object({
    limit: z.number().default(10),
    starting_after: z.string().optional(),
    ending_before: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "starting_after": "startingAfter",
        "ending_before": "endingBefore",
    });
});
/** @internal */
exports.FileListRequest$outboundSchema = z.object({
    limit: z.number().default(10),
    startingAfter: z.string().optional(),
    endingBefore: z.string().optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        startingAfter: "starting_after",
        endingBefore: "ending_before",
    });
});
function fileListRequestToJSON(fileListRequest) {
    return JSON.stringify(exports.FileListRequest$outboundSchema.parse(fileListRequest));
}
function fileListRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.FileListRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileListRequest' from JSON`);
}
/** @internal */
exports.FileListObject$inboundSchema = z.nativeEnum(exports.FileListObject);
/** @internal */
exports.FileListObject$outboundSchema = exports.FileListObject$inboundSchema;
/** @internal */
exports.FileListPurpose$inboundSchema = z.nativeEnum(exports.FileListPurpose);
/** @internal */
exports.FileListPurpose$outboundSchema = exports.FileListPurpose$inboundSchema;
/** @internal */
exports.FileListData$inboundSchema = z.object({
    _id: z.string(),
    object_name: z.string(),
    purpose: exports.FileListPurpose$inboundSchema,
    bytes: z.number(),
    file_name: z.string(),
    workspace_id: z.string(),
    created: z.string().datetime({ offset: true }).default("2025-11-25T16:24:26.415Z").transform(v => new Date(v)),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "_id": "id",
        "object_name": "objectName",
        "file_name": "fileName",
        "workspace_id": "workspaceId",
    });
});
/** @internal */
exports.FileListData$outboundSchema = z.object({
    id: z.string(),
    objectName: z.string(),
    purpose: exports.FileListPurpose$outboundSchema,
    bytes: z.number(),
    fileName: z.string(),
    workspaceId: z.string(),
    created: z.date().default(() => new Date("2025-11-25T16:24:26.415Z"))
        .transform(v => v.toISOString()),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        objectName: "object_name",
        fileName: "file_name",
        workspaceId: "workspace_id",
    });
});
function fileListDataToJSON(fileListData) {
    return JSON.stringify(exports.FileListData$outboundSchema.parse(fileListData));
}
function fileListDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.FileListData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileListData' from JSON`);
}
/** @internal */
exports.FileListResponseBody$inboundSchema = z.object({
    object: exports.FileListObject$inboundSchema,
    data: z.array(z.lazy(() => exports.FileListData$inboundSchema)),
    has_more: z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "has_more": "hasMore",
    });
});
/** @internal */
exports.FileListResponseBody$outboundSchema = z.object({
    object: exports.FileListObject$outboundSchema,
    data: z.array(z.lazy(() => exports.FileListData$outboundSchema)),
    hasMore: z.boolean(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        hasMore: "has_more",
    });
});
function fileListResponseBodyToJSON(fileListResponseBody) {
    return JSON.stringify(exports.FileListResponseBody$outboundSchema.parse(fileListResponseBody));
}
function fileListResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.FileListResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileListResponseBody' from JSON`);
}
//# sourceMappingURL=filelist.js.map