"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.TicketInput$outboundSchema = exports.Ticket$inboundSchema = exports.TicketPriority$outboundSchema = exports.TicketPriority$inboundSchema = exports.TicketPriority = void 0;
exports.ticketFromJSON = ticketFromJSON;
exports.ticketInputToJSON = ticketInputToJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
const assignee_js_1 = require("./assignee.js");
const assigneeinput_js_1 = require("./assigneeinput.js");
const collectiontag_js_1 = require("./collectiontag.js");
const collectiontaginput_js_1 = require("./collectiontaginput.js");
const passthroughbody_js_1 = require("./passthroughbody.js");
/**
 * Priority of the ticket
 */
exports.TicketPriority = {
    Low: "low",
    Normal: "normal",
    High: "high",
    Urgent: "urgent",
};
/** @internal */
exports.TicketPriority$inboundSchema = z.nativeEnum(exports.TicketPriority);
/** @internal */
exports.TicketPriority$outboundSchema = exports.TicketPriority$inboundSchema;
/** @internal */
exports.Ticket$inboundSchema = z
    .object({
    id: z.string(),
    parent_id: z.nullable(z.string()).optional(),
    collection_id: z.nullable(z.string()).optional(),
    type: z.nullable(z.string()).optional(),
    subject: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    status: z.nullable(z.string()).optional(),
    priority: z.nullable(exports.TicketPriority$inboundSchema).optional(),
    assignees: z.array(assignee_js_1.Assignee$inboundSchema).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    created_by: z.nullable(z.string()).optional(),
    due_date: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    completed_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    tags: z.array(collectiontag_js_1.CollectionTag$inboundSchema).optional(),
    custom_mappings: z.nullable(z.record(z.any())).optional(),
    pass_through: z.array(passthroughbody_js_1.PassThroughBody$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "parent_id": "parentId",
        "collection_id": "collectionId",
        "updated_at": "updatedAt",
        "created_at": "createdAt",
        "created_by": "createdBy",
        "due_date": "dueDate",
        "completed_at": "completedAt",
        "custom_mappings": "customMappings",
        "pass_through": "passThrough",
    });
});
function ticketFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Ticket$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Ticket' from JSON`);
}
/** @internal */
exports.TicketInput$outboundSchema = z.object({
    parentId: z.nullable(z.string()).optional(),
    type: z.nullable(z.string()).optional(),
    subject: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    status: z.nullable(z.string()).optional(),
    priority: z.nullable(exports.TicketPriority$outboundSchema).optional(),
    assignees: z.array(assigneeinput_js_1.AssigneeInput$outboundSchema).optional(),
    dueDate: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    tags: z.array(collectiontaginput_js_1.CollectionTagInput$outboundSchema).optional(),
    passThrough: z.array(passthroughbody_js_1.PassThroughBody$outboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        parentId: "parent_id",
        dueDate: "due_date",
        passThrough: "pass_through",
    });
});
function ticketInputToJSON(ticketInput) {
    return JSON.stringify(exports.TicketInput$outboundSchema.parse(ticketInput));
}
//# sourceMappingURL=ticket.js.map