"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 (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.foldersFromJSON = exports.foldersToJSON = exports.Folders$ = exports.Folders$outboundSchema = exports.Folders$inboundSchema = void 0;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
/** @internal */
exports.Folders$inboundSchema = z.object({
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    description: z.nullable(z.string()).optional(),
    drive_id: z.nullable(z.string()).optional(),
    has_children: z.nullable(z.boolean()).optional(),
    has_content: z.nullable(z.boolean()).optional(),
    id: z.nullable(z.string()).optional(),
    is_root: z.nullable(z.boolean()).optional(),
    name: z.nullable(z.string()).optional(),
    owner_id: z.nullable(z.string()).optional(),
    parent_folder_id: z.nullable(z.string()).optional(),
    path: z.nullable(z.string()).optional(),
    remote_drive_id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    remote_owner_id: z.nullable(z.string()).optional(),
    remote_parent_folder_id: z.nullable(z.string()).optional(),
    size: z.nullable(z.number()).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    url: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "created_at": "createdAt",
        "drive_id": "driveId",
        "has_children": "hasChildren",
        "has_content": "hasContent",
        "is_root": "isRoot",
        "owner_id": "ownerId",
        "parent_folder_id": "parentFolderId",
        "remote_drive_id": "remoteDriveId",
        "remote_id": "remoteId",
        "remote_owner_id": "remoteOwnerId",
        "remote_parent_folder_id": "remoteParentFolderId",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.Folders$outboundSchema = z.object({
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    description: z.nullable(z.string()).optional(),
    driveId: z.nullable(z.string()).optional(),
    hasChildren: z.nullable(z.boolean()).optional(),
    hasContent: z.nullable(z.boolean()).optional(),
    id: z.nullable(z.string()).optional(),
    isRoot: z.nullable(z.boolean()).optional(),
    name: z.nullable(z.string()).optional(),
    ownerId: z.nullable(z.string()).optional(),
    parentFolderId: z.nullable(z.string()).optional(),
    path: z.nullable(z.string()).optional(),
    remoteDriveId: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    remoteOwnerId: z.nullable(z.string()).optional(),
    remoteParentFolderId: z.nullable(z.string()).optional(),
    size: z.nullable(z.number()).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    url: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        createdAt: "created_at",
        driveId: "drive_id",
        hasChildren: "has_children",
        hasContent: "has_content",
        isRoot: "is_root",
        ownerId: "owner_id",
        parentFolderId: "parent_folder_id",
        remoteDriveId: "remote_drive_id",
        remoteId: "remote_id",
        remoteOwnerId: "remote_owner_id",
        remoteParentFolderId: "remote_parent_folder_id",
        updatedAt: "updated_at",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Folders$;
(function (Folders$) {
    /** @deprecated use `Folders$inboundSchema` instead. */
    Folders$.inboundSchema = exports.Folders$inboundSchema;
    /** @deprecated use `Folders$outboundSchema` instead. */
    Folders$.outboundSchema = exports.Folders$outboundSchema;
})(Folders$ || (exports.Folders$ = Folders$ = {}));
function foldersToJSON(folders) {
    return JSON.stringify(exports.Folders$outboundSchema.parse(folders));
}
exports.foldersToJSON = foldersToJSON;
function foldersFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Folders$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Folders' from JSON`);
}
exports.foldersFromJSON = foldersFromJSON;
//# sourceMappingURL=folders.js.map