"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.ticketingAttachmentResultFromJSON = exports.ticketingAttachmentResultToJSON = exports.TicketingAttachmentResult$ = exports.TicketingAttachmentResult$outboundSchema = exports.TicketingAttachmentResult$inboundSchema = exports.dataFromJSON = exports.dataToJSON = exports.Data$ = exports.Data$outboundSchema = exports.Data$inboundSchema = void 0;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const rawresponse_js_1 = require("./rawresponse.js");
/** @internal */
exports.Data$inboundSchema = z
    .object({
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    file_name: z.nullable(z.string()).optional(),
    file_type: z.nullable(z.string()).optional(),
    file_url: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    size: z.nullable(z.number()).optional(),
    ticket_id: z.nullable(z.string()).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    user_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "created_at": "createdAt",
        "file_name": "fileName",
        "file_type": "fileType",
        "file_url": "fileUrl",
        "remote_id": "remoteId",
        "ticket_id": "ticketId",
        "updated_at": "updatedAt",
        "user_id": "userId",
    });
});
/** @internal */
exports.Data$outboundSchema = z.object({
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    fileName: z.nullable(z.string()).optional(),
    fileType: z.nullable(z.string()).optional(),
    fileUrl: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    size: z.nullable(z.number()).optional(),
    ticketId: z.nullable(z.string()).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    userId: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        createdAt: "created_at",
        fileName: "file_name",
        fileType: "file_type",
        fileUrl: "file_url",
        remoteId: "remote_id",
        ticketId: "ticket_id",
        updatedAt: "updated_at",
        userId: "user_id",
    });
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var Data$;
(function (Data$) {
    /** @deprecated use `Data$inboundSchema` instead. */
    Data$.inboundSchema = exports.Data$inboundSchema;
    /** @deprecated use `Data$outboundSchema` instead. */
    Data$.outboundSchema = exports.Data$outboundSchema;
})(Data$ || (exports.Data$ = Data$ = {}));
function dataToJSON(data) {
    return JSON.stringify(exports.Data$outboundSchema.parse(data));
}
exports.dataToJSON = dataToJSON;
function dataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Data$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Data' from JSON`);
}
exports.dataFromJSON = dataFromJSON;
/** @internal */
exports.TicketingAttachmentResult$inboundSchema = z.object({
    data: z.nullable(z.lazy(() => exports.Data$inboundSchema)).optional(),
    raw: z.nullable(z.array(rawresponse_js_1.RawResponse$inboundSchema)).optional(),
});
/** @internal */
exports.TicketingAttachmentResult$outboundSchema = z.object({
    data: z.nullable(z.lazy(() => exports.Data$outboundSchema)).optional(),
    raw: z.nullable(z.array(rawresponse_js_1.RawResponse$outboundSchema)).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TicketingAttachmentResult$;
(function (TicketingAttachmentResult$) {
    /** @deprecated use `TicketingAttachmentResult$inboundSchema` instead. */
    TicketingAttachmentResult$.inboundSchema = exports.TicketingAttachmentResult$inboundSchema;
    /** @deprecated use `TicketingAttachmentResult$outboundSchema` instead. */
    TicketingAttachmentResult$.outboundSchema = exports.TicketingAttachmentResult$outboundSchema;
})(TicketingAttachmentResult$ || (exports.TicketingAttachmentResult$ = TicketingAttachmentResult$ = {}));
function ticketingAttachmentResultToJSON(ticketingAttachmentResult) {
    return JSON.stringify(exports.TicketingAttachmentResult$outboundSchema.parse(ticketingAttachmentResult));
}
exports.ticketingAttachmentResultToJSON = ticketingAttachmentResultToJSON;
function ticketingAttachmentResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingAttachmentResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingAttachmentResult' from JSON`);
}
exports.ticketingAttachmentResultFromJSON = ticketingAttachmentResultFromJSON;
//# sourceMappingURL=ticketingattachmentresult.js.map