"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.TicketingTicketResult$inboundSchema = exports.TicketingTicketResultData$inboundSchema = exports.TicketingTicketResultType$inboundSchema = exports.TicketingTicketResultStatus$inboundSchema = exports.TicketingTicketResultSchemasType$inboundSchema = exports.TicketingTicketResultSchemasValue$inboundSchema = exports.TicketingTicketResultSchemasSourceValue$inboundSchema = exports.TicketingTicketResultSchemas4$inboundSchema = exports.TicketingTicketResultPriority$inboundSchema = exports.TicketingTicketResultValue$inboundSchema = exports.TicketingTicketResultSourceValue$inboundSchema = exports.TicketingTicketResult4$inboundSchema = exports.TicketingTicketResultOrganization$inboundSchema = exports.TicketingTicketResultSchemasValue = exports.TicketingTicketResultValue = void 0;
exports.ticketingTicketResultOrganizationFromJSON = ticketingTicketResultOrganizationFromJSON;
exports.ticketingTicketResult4FromJSON = ticketingTicketResult4FromJSON;
exports.ticketingTicketResultSourceValueFromJSON = ticketingTicketResultSourceValueFromJSON;
exports.ticketingTicketResultPriorityFromJSON = ticketingTicketResultPriorityFromJSON;
exports.ticketingTicketResultSchemas4FromJSON = ticketingTicketResultSchemas4FromJSON;
exports.ticketingTicketResultSchemasSourceValueFromJSON = ticketingTicketResultSchemasSourceValueFromJSON;
exports.ticketingTicketResultSchemasTypeFromJSON = ticketingTicketResultSchemasTypeFromJSON;
exports.ticketingTicketResultStatusFromJSON = ticketingTicketResultStatusFromJSON;
exports.ticketingTicketResultTypeFromJSON = ticketingTicketResultTypeFromJSON;
exports.ticketingTicketResultDataFromJSON = ticketingTicketResultDataFromJSON;
exports.ticketingTicketResultFromJSON = ticketingTicketResultFromJSON;
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 rawresponse_js_1 = require("./rawresponse.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 TicketingTicketResultValue;
(function (TicketingTicketResultValue) {
    TicketingTicketResultValue["Lowest"] = "lowest";
    TicketingTicketResultValue["Low"] = "low";
    TicketingTicketResultValue["Medium"] = "medium";
    TicketingTicketResultValue["High"] = "high";
    TicketingTicketResultValue["Highest"] = "highest";
    TicketingTicketResultValue["UnmappedValue"] = "unmapped_value";
})(TicketingTicketResultValue || (exports.TicketingTicketResultValue = TicketingTicketResultValue = {}));
/**
 * The type of this status
 */
var TicketingTicketResultSchemasValue;
(function (TicketingTicketResultSchemasValue) {
    TicketingTicketResultSchemasValue["ToDo"] = "to-do";
    TicketingTicketResultSchemasValue["InProgress"] = "in-progress";
    TicketingTicketResultSchemasValue["Closed"] = "closed";
    TicketingTicketResultSchemasValue["UnmappedValue"] = "unmapped_value";
})(TicketingTicketResultSchemasValue || (exports.TicketingTicketResultSchemasValue = TicketingTicketResultSchemasValue = {}));
/** @internal */
exports.TicketingTicketResultOrganization$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 ticketingTicketResultOrganizationFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResultOrganization$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResultOrganization' from JSON`);
}
/** @internal */
exports.TicketingTicketResult4$inboundSchema = z.object({});
function ticketingTicketResult4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResult4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResult4' from JSON`);
}
/** @internal */
exports.TicketingTicketResultSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TicketingTicketResult4$inboundSchema),
    z.array(z.any()),
]);
function ticketingTicketResultSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResultSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResultSourceValue' from JSON`);
}
/** @internal */
exports.TicketingTicketResultValue$inboundSchema = openEnums.inboundSchema(TicketingTicketResultValue);
/** @internal */
exports.TicketingTicketResultPriority$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TicketingTicketResult4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TicketingTicketResultValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function ticketingTicketResultPriorityFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResultPriority$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResultPriority' from JSON`);
}
/** @internal */
exports.TicketingTicketResultSchemas4$inboundSchema = z.object({});
function ticketingTicketResultSchemas4FromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResultSchemas4$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResultSchemas4' from JSON`);
}
/** @internal */
exports.TicketingTicketResultSchemasSourceValue$inboundSchema = z.union([
    z.string(),
    z.number(),
    z.boolean(),
    z.lazy(() => exports.TicketingTicketResultSchemas4$inboundSchema),
    z.array(z.any()),
]);
function ticketingTicketResultSchemasSourceValueFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResultSchemasSourceValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResultSchemasSourceValue' from JSON`);
}
/** @internal */
exports.TicketingTicketResultSchemasValue$inboundSchema = openEnums.inboundSchema(TicketingTicketResultSchemasValue);
/** @internal */
exports.TicketingTicketResultSchemasType$inboundSchema = z.object({
    source_value: z.nullable(z.union([
        z.string(),
        z.number(),
        z.boolean(),
        z.lazy(() => exports.TicketingTicketResultSchemas4$inboundSchema),
        z.array(z.any()),
    ])).optional(),
    value: z.nullable(exports.TicketingTicketResultSchemasValue$inboundSchema).optional(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "source_value": "sourceValue",
    });
});
function ticketingTicketResultSchemasTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResultSchemasType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResultSchemasType' from JSON`);
}
/** @internal */
exports.TicketingTicketResultStatus$inboundSchema = z.object({
    id: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    type: z.nullable(z.lazy(() => exports.TicketingTicketResultSchemasType$inboundSchema))
        .optional(),
});
function ticketingTicketResultStatusFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResultStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResultStatus' from JSON`);
}
/** @internal */
exports.TicketingTicketResultType$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 ticketingTicketResultTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResultType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResultType' from JSON`);
}
/** @internal */
exports.TicketingTicketResultData$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.TicketingTicketResultOrganization$inboundSchema)).optional(),
    parent_id: z.nullable(z.string()).optional(),
    priority: z.nullable(z.lazy(() => exports.TicketingTicketResultPriority$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.TicketingTicketResultStatus$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.TicketingTicketResultType$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 ticketingTicketResultDataFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResultData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResultData' from JSON`);
}
/** @internal */
exports.TicketingTicketResult$inboundSchema = z.object({
    data: z.nullable(z.lazy(() => exports.TicketingTicketResultData$inboundSchema))
        .optional(),
    raw: z.nullable(z.array(rawresponse_js_1.RawResponse$inboundSchema)).optional(),
});
function ticketingTicketResultFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.TicketingTicketResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TicketingTicketResult' from JSON`);
}
//# sourceMappingURL=ticketingticketresult.js.map