"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.ticketingCollectionResultFromJSON = exports.ticketingCollectionResultToJSON = exports.TicketingCollectionResult$ = exports.TicketingCollectionResult$outboundSchema = exports.TicketingCollectionResult$inboundSchema = exports.ticketingCollectionResultDataFromJSON = exports.ticketingCollectionResultDataToJSON = exports.TicketingCollectionResultData$ = exports.TicketingCollectionResultData$outboundSchema = exports.TicketingCollectionResultData$inboundSchema = exports.TicketingCollectionResultType$ = exports.TicketingCollectionResultType$outboundSchema = exports.TicketingCollectionResultType$inboundSchema = exports.TicketingCollectionResultType = 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");
const rawresponse_js_1 = require("./rawresponse.js");
/**
 * The type of the collection.
 */
var TicketingCollectionResultType;
(function (TicketingCollectionResultType) {
    TicketingCollectionResultType["Project"] = "project";
    TicketingCollectionResultType["Component"] = "component";
    TicketingCollectionResultType["UnmappedValue"] = "unmapped_value";
})(TicketingCollectionResultType || (exports.TicketingCollectionResultType = TicketingCollectionResultType = {}));
/** @internal */
exports.TicketingCollectionResultType$inboundSchema = z
    .union([
    z.nativeEnum(TicketingCollectionResultType),
    z.string().transform(enums_js_1.catchUnrecognizedEnum),
]);
/** @internal */
exports.TicketingCollectionResultType$outboundSchema = z.union([
    z.nativeEnum(TicketingCollectionResultType),
    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 TicketingCollectionResultType$;
(function (TicketingCollectionResultType$) {
    /** @deprecated use `TicketingCollectionResultType$inboundSchema` instead. */
    TicketingCollectionResultType$.inboundSchema = exports.TicketingCollectionResultType$inboundSchema;
    /** @deprecated use `TicketingCollectionResultType$outboundSchema` instead. */
    TicketingCollectionResultType$.outboundSchema = exports.TicketingCollectionResultType$outboundSchema;
})(TicketingCollectionResultType$ || (exports.TicketingCollectionResultType$ = TicketingCollectionResultType$ = {}));
/** @internal */
exports.TicketingCollectionResultData$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.TicketingCollectionResultType$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.TicketingCollectionResultData$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.TicketingCollectionResultType$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 TicketingCollectionResultData$;
(function (TicketingCollectionResultData$) {
    /** @deprecated use `TicketingCollectionResultData$inboundSchema` instead. */
    TicketingCollectionResultData$.inboundSchema = exports.TicketingCollectionResultData$inboundSchema;
    /** @deprecated use `TicketingCollectionResultData$outboundSchema` instead. */
    TicketingCollectionResultData$.outboundSchema = exports.TicketingCollectionResultData$outboundSchema;
})(TicketingCollectionResultData$ || (exports.TicketingCollectionResultData$ = TicketingCollectionResultData$ = {}));
function ticketingCollectionResultDataToJSON(ticketingCollectionResultData) {
    return JSON.stringify(exports.TicketingCollectionResultData$outboundSchema.parse(ticketingCollectionResultData));
}
exports.ticketingCollectionResultDataToJSON = ticketingCollectionResultDataToJSON;
function ticketingCollectionResultDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingCollectionResultData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingCollectionResultData' from JSON`);
}
exports.ticketingCollectionResultDataFromJSON = ticketingCollectionResultDataFromJSON;
/** @internal */
exports.TicketingCollectionResult$inboundSchema = z.object({
    data: z.nullable(z.lazy(() => exports.TicketingCollectionResultData$inboundSchema))
        .optional(),
    raw: z.nullable(z.array(rawresponse_js_1.RawResponse$inboundSchema)).optional(),
});
/** @internal */
exports.TicketingCollectionResult$outboundSchema = z.object({
    data: z.nullable(z.lazy(() => exports.TicketingCollectionResultData$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 TicketingCollectionResult$;
(function (TicketingCollectionResult$) {
    /** @deprecated use `TicketingCollectionResult$inboundSchema` instead. */
    TicketingCollectionResult$.inboundSchema = exports.TicketingCollectionResult$inboundSchema;
    /** @deprecated use `TicketingCollectionResult$outboundSchema` instead. */
    TicketingCollectionResult$.outboundSchema = exports.TicketingCollectionResult$outboundSchema;
})(TicketingCollectionResult$ || (exports.TicketingCollectionResult$ = TicketingCollectionResult$ = {}));
function ticketingCollectionResultToJSON(ticketingCollectionResult) {
    return JSON.stringify(exports.TicketingCollectionResult$outboundSchema.parse(ticketingCollectionResult));
}
exports.ticketingCollectionResultToJSON = ticketingCollectionResultToJSON;
function ticketingCollectionResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingCollectionResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingCollectionResult' from JSON`);
}
exports.ticketingCollectionResultFromJSON = ticketingCollectionResultFromJSON;
//# sourceMappingURL=ticketingcollectionresult.js.map