"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.TicketingReadTicket$inboundSchema = exports.TicketingReadTicketType$inboundSchema = exports.TicketingReadTicketStatus$inboundSchema = exports.TicketingReadTicketSchemasType$inboundSchema = exports.TicketingReadTicketSchemasValue$inboundSchema = exports.TicketingReadTicketSchemasSourceValue$inboundSchema = exports.TicketingReadTicketSchemas4$inboundSchema = exports.Priority$inboundSchema = exports.TicketingReadTicketValue$inboundSchema = exports.TicketingReadTicketSourceValue$inboundSchema = exports.TicketingReadTicket4$inboundSchema = exports.Organization$inboundSchema = exports.TicketingReadTicketSchemasValue = exports.TicketingReadTicketValue = void 0;
exports.organizationFromJSON = organizationFromJSON;
exports.ticketingReadTicket4FromJSON = ticketingReadTicket4FromJSON;
exports.ticketingReadTicketSourceValueFromJSON = ticketingReadTicketSourceValueFromJSON;
exports.priorityFromJSON = priorityFromJSON;
exports.ticketingReadTicketSchemas4FromJSON = ticketingReadTicketSchemas4FromJSON;
exports.ticketingReadTicketSchemasSourceValueFromJSON = ticketingReadTicketSchemasSourceValueFromJSON;
exports.ticketingReadTicketSchemasTypeFromJSON = ticketingReadTicketSchemasTypeFromJSON;
exports.ticketingReadTicketStatusFromJSON = ticketingReadTicketStatusFromJSON;
exports.ticketingReadTicketTypeFromJSON = ticketingReadTicketTypeFromJSON;
exports.ticketingReadTicketFromJSON = ticketingReadTicketFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../../lib/primitives.js");
const schemas_js_1 = require("../../../lib/schemas.js");
const openEnums = __importStar(require("../../types/enums.js"));
const ticketingcomponent_js_1 = require("./ticketingcomponent.js");
const ticketingcontent_js_1 = require("./ticketingcontent.js");
const ticketingproject_js_1 = require("./ticketingproject.js");
/**
 * The priority of the ticket.
 */
var TicketingReadTicketValue;
(function (TicketingReadTicketValue) {
    TicketingReadTicketValue["Lowest"] = "lowest";
    TicketingReadTicketValue["Low"] = "low";
    TicketingReadTicketValue["Medium"] = "medium";
    TicketingReadTicketValue["High"] = "high";
    TicketingReadTicketValue["Highest"] = "highest";
    TicketingReadTicketValue["UnmappedValue"] = "unmapped_value";
})(TicketingReadTicketValue || (exports.TicketingReadTicketValue = TicketingReadTicketValue = {}));
/**
 * The type of this status
 */
var TicketingReadTicketSchemasValue;
(function (TicketingReadTicketSchemasValue) {
    TicketingReadTicketSchemasValue["ToDo"] = "to-do";
    TicketingReadTicketSchemasValue["InProgress"] = "in-progress";
    TicketingReadTicketSchemasValue["Closed"] = "closed";
    TicketingReadTicketSchemasValue["UnmappedValue"] = "unmapped_value";
})(TicketingReadTicketSchemasValue || (exports.TicketingReadTicketSchemasValue = TicketingReadTicketSchemasValue = {}));
/** @internal */
exports.Organization$inboundSchema = z.object({
    domain: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    remote_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "remote_id": "remoteId",
    });
});
function organizationFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Organization$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Organization' from JSON`);
}
/** @internal */
exports.TicketingReadTicket4$inboundSchema = z.object({});
function ticketingReadTicket4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingReadTicket4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingReadTicket4' from JSON`);
}
/** @internal */
exports.TicketingReadTicketSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TicketingReadTicket4$inboundSchema),
    z.array(z.any()),
]);
function ticketingReadTicketSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingReadTicketSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingReadTicketSourceValue' from JSON`);
}
/** @internal */
exports.TicketingReadTicketValue$inboundSchema = openEnums.inboundSchema(TicketingReadTicketValue);
/** @internal */
exports.Priority$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TicketingReadTicket4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TicketingReadTicketValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function priorityFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Priority$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Priority' from JSON`);
}
/** @internal */
exports.TicketingReadTicketSchemas4$inboundSchema = z.object({});
function ticketingReadTicketSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingReadTicketSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingReadTicketSchemas4' from JSON`);
}
/** @internal */
exports.TicketingReadTicketSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TicketingReadTicketSchemas4$inboundSchema),
    z.array(z.any()),
]);
function ticketingReadTicketSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingReadTicketSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingReadTicketSchemasSourceValue' from JSON`);
}
/** @internal */
exports.TicketingReadTicketSchemasValue$inboundSchema = openEnums.inboundSchema(TicketingReadTicketSchemasValue);
/** @internal */
exports.TicketingReadTicketSchemasType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TicketingReadTicketSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TicketingReadTicketSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function ticketingReadTicketSchemasTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingReadTicketSchemasType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingReadTicketSchemasType' from JSON`);
}
/** @internal */
exports.TicketingReadTicketStatus$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.TicketingReadTicketSchemasType$inboundSchema))
        .optional(),
});
function ticketingReadTicketStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingReadTicketStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingReadTicketStatus' from JSON`);
}
/** @internal */
exports.TicketingReadTicketType$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    project_id: z.nullable(z.string()).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "project_id": "projectId",
    });
});
function ticketingReadTicketTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingReadTicketType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingReadTicketType' from JSON`);
}
/** @internal */
exports.TicketingReadTicket$inboundSchema = z.object({
    assignees: z.nullable(z.array(z.string())).optional(),
    closed_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    components: z.nullable(z.array(ticketingcomponent_js_1.TicketingComponent$inboundSchema)).optional(),
    content: z.nullable(z.array(ticketingcontent_js_1.TicketingContent$inboundSchema)).optional(),
    created_at: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    creator_id: z.nullable(z.string()).optional(),
    id: z.nullable(z.string()).optional(),
    organization: z.nullable(z.lazy(() => exports.Organization$inboundSchema)).optional(),
    parent_id: z.nullable(z.string()).optional(),
    priority: z.nullable(z.lazy(() => exports.Priority$inboundSchema)).optional(),
    projects: z.nullable(z.array(ticketingproject_js_1.TicketingProject$inboundSchema)).optional(),
    remote_id: z.nullable(z.string()).optional(),
    reporters: z.nullable(z.array(z.string())).optional(),
    status: z.nullable(z.lazy(() => exports.TicketingReadTicketStatus$inboundSchema))
        .optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    ticket_number: z.nullable(z.string()).optional(),
    ticket_url: z.nullable(z.string()).optional(),
    title: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.TicketingReadTicketType$inboundSchema))
        .optional(),
    unified_custom_fields: z.nullable(z.record(z.any())).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, {
        "closed_at": "closedAt",
        "created_at": "createdAt",
        "creator_id": "creatorId",
        "parent_id": "parentId",
        "remote_id": "remoteId",
        "ticket_number": "ticketNumber",
        "ticket_url": "ticketUrl",
        "unified_custom_fields": "unifiedCustomFields",
        "updated_at": "updatedAt",
    });
});
function ticketingReadTicketFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingReadTicket$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingReadTicket' from JSON`);
}
//# sourceMappingURL=ticketingreadticket.js.map