"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.ticketingCollectionFromJSON = exports.ticketingCollectionToJSON = exports.TicketingCollection$ = exports.TicketingCollection$outboundSchema = exports.TicketingCollection$inboundSchema = exports.TicketingCollectionType$ = exports.TicketingCollectionType$outboundSchema = exports.TicketingCollectionType$inboundSchema = exports.TicketingCollectionType = void 0;
const z = __importStar(require("zod"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const enums_js_1 = require("../../types/enums.js");
/**
 * The type of the collection.
 */
var TicketingCollectionType;
(function (TicketingCollectionType) {
    TicketingCollectionType["Project"] = "project";
    TicketingCollectionType["Component"] = "component";
    TicketingCollectionType["UnmappedValue"] = "unmapped_value";
})(TicketingCollectionType || (exports.TicketingCollectionType = TicketingCollectionType = {}));
/** @internal */
exports.TicketingCollectionType$inboundSchema = z
    .union([
    z.nativeEnum(TicketingCollectionType),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TicketingCollectionType$outboundSchema = z.union([
    z.nativeEnum(TicketingCollectionType),
    z.string().and(z.custom()),
]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
var TicketingCollectionType$;
(function (TicketingCollectionType$) {
    /** @deprecated use `TicketingCollectionType$inboundSchema` instead. */
    TicketingCollectionType$.inboundSchema = exports.TicketingCollectionType$inboundSchema;
    /** @deprecated use `TicketingCollectionType$outboundSchema` instead. */
    TicketingCollectionType$.outboundSchema = exports.TicketingCollectionType$outboundSchema;
})(TicketingCollectionType$ || (exports.TicketingCollectionType$ = TicketingCollectionType$ = {}));
/** @internal */
exports.TicketingCollection$inboundSchema = z.object({
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    description: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    key: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    organization_id: z.nullable(z.string()).optional(),
    parent_id: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
    type: z.nullable(exports.TicketingCollectionType$inboundSchema).optional(),
    updated_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "created_at": "createdAt",
        "organization_id": "organizationId",
        "parent_id": "parentId",
        "remote_id": "remoteId",
        "updated_at": "updatedAt",
    });
});
/** @internal */
exports.TicketingCollection$outboundSchema = z.object({
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    description: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    key: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    organizationId: z.nullable(z.string()).optional(),
    parentId: z.nullable(z.string()).optional(),
    remoteId: z.nullable(z.string()).optional(),
    type: z.nullable(exports.TicketingCollectionType$outboundSchema).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        createdAt: "created_at",
        organizationId: "organization_id",
        parentId: "parent_id",
        remoteId: "remote_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 TicketingCollection$;
(function (TicketingCollection$) {
    /** @deprecated use `TicketingCollection$inboundSchema` instead. */
    TicketingCollection$.inboundSchema = exports.TicketingCollection$inboundSchema;
    /** @deprecated use `TicketingCollection$outboundSchema` instead. */
    TicketingCollection$.outboundSchema = exports.TicketingCollection$outboundSchema;
})(TicketingCollection$ || (exports.TicketingCollection$ = TicketingCollection$ = {}));
function ticketingCollectionToJSON(ticketingCollection) {
    return JSON.stringify(exports.TicketingCollection$outboundSchema.parse(ticketingCollection));
}
exports.ticketingCollectionToJSON = ticketingCollectionToJSON;
function ticketingCollectionFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingCollection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingCollection' from JSON`);
}
exports.ticketingCollectionFromJSON = ticketingCollectionFromJSON;
//# sourceMappingURL=ticketingcollection.js.map