"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.CreateSupportTicketConversation$outboundSchema = exports.CreateSupportTicketConversation$inboundSchema = exports.CreateSupportTicketConversationMessages$outboundSchema = exports.CreateSupportTicketConversationMessages$inboundSchema = exports.CreateSupportTicketConversationMessagesUserProperties$outboundSchema = exports.CreateSupportTicketConversationMessagesUserProperties$inboundSchema = exports.CreateSupportTicketConversationMessagesUserId$outboundSchema = exports.CreateSupportTicketConversationMessagesUserId$inboundSchema = exports.CreateSupportTicketConversationMessagesId$outboundSchema = exports.CreateSupportTicketConversationMessagesId$inboundSchema = exports.CreateSupportTicketConversationLinks$outboundSchema = exports.CreateSupportTicketConversationLinks$inboundSchema = exports.CreateSupportTicketConversationMessagesType$outboundSchema = exports.CreateSupportTicketConversationMessagesType$inboundSchema = exports.CreateSupportTicketConversationType1$outboundSchema = exports.CreateSupportTicketConversationType1$inboundSchema = exports.CreateSupportTicketConversationVisibility$outboundSchema = exports.CreateSupportTicketConversationVisibility$inboundSchema = exports.CreateSupportTicketConversationUserProperties$outboundSchema = exports.CreateSupportTicketConversationUserProperties$inboundSchema = exports.CreateSupportTicketConversationUserId$outboundSchema = exports.CreateSupportTicketConversationUserId$inboundSchema = exports.CreateSupportTicketConversationId$outboundSchema = exports.CreateSupportTicketConversationId$inboundSchema = exports.CreateSupportTicketConversationType1 = exports.CreateSupportTicketConversationVisibility = void 0;
exports.createSupportTicketConversationIdToJSON = createSupportTicketConversationIdToJSON;
exports.createSupportTicketConversationIdFromJSON = createSupportTicketConversationIdFromJSON;
exports.createSupportTicketConversationUserIdToJSON = createSupportTicketConversationUserIdToJSON;
exports.createSupportTicketConversationUserIdFromJSON = createSupportTicketConversationUserIdFromJSON;
exports.createSupportTicketConversationUserPropertiesToJSON = createSupportTicketConversationUserPropertiesToJSON;
exports.createSupportTicketConversationUserPropertiesFromJSON = createSupportTicketConversationUserPropertiesFromJSON;
exports.createSupportTicketConversationMessagesTypeToJSON = createSupportTicketConversationMessagesTypeToJSON;
exports.createSupportTicketConversationMessagesTypeFromJSON = createSupportTicketConversationMessagesTypeFromJSON;
exports.createSupportTicketConversationLinksToJSON = createSupportTicketConversationLinksToJSON;
exports.createSupportTicketConversationLinksFromJSON = createSupportTicketConversationLinksFromJSON;
exports.createSupportTicketConversationMessagesIdToJSON = createSupportTicketConversationMessagesIdToJSON;
exports.createSupportTicketConversationMessagesIdFromJSON = createSupportTicketConversationMessagesIdFromJSON;
exports.createSupportTicketConversationMessagesUserIdToJSON = createSupportTicketConversationMessagesUserIdToJSON;
exports.createSupportTicketConversationMessagesUserIdFromJSON = createSupportTicketConversationMessagesUserIdFromJSON;
exports.createSupportTicketConversationMessagesUserPropertiesToJSON = createSupportTicketConversationMessagesUserPropertiesToJSON;
exports.createSupportTicketConversationMessagesUserPropertiesFromJSON = createSupportTicketConversationMessagesUserPropertiesFromJSON;
exports.createSupportTicketConversationMessagesToJSON = createSupportTicketConversationMessagesToJSON;
exports.createSupportTicketConversationMessagesFromJSON = createSupportTicketConversationMessagesFromJSON;
exports.createSupportTicketConversationToJSON = createSupportTicketConversationToJSON;
exports.createSupportTicketConversationFromJSON = createSupportTicketConversationFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.CreateSupportTicketConversationVisibility = {
    Private: "private",
    Public: "public",
};
exports.CreateSupportTicketConversationType1 = {
    Documentation: "documentation",
    Site: "site",
    DiscoursePost: "discourse_post",
    GithubIssue: "github_issue",
    GithubDiscussion: "github_discussion",
    StackoverflowQuestion: "stackoverflow_question",
    DiscordForumPost: "discord_forum_post",
    DiscordMessage: "discord_message",
    CustomQuestionAnswer: "custom_question_answer",
};
/** @internal */
exports.CreateSupportTicketConversationId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.CreateSupportTicketConversationId$outboundSchema = z.union([z.string(), z.number()]);
function createSupportTicketConversationIdToJSON(createSupportTicketConversationId) {
    return JSON.stringify(exports.CreateSupportTicketConversationId$outboundSchema.parse(createSupportTicketConversationId));
}
function createSupportTicketConversationIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportTicketConversationId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationId' from JSON`);
}
/** @internal */
exports.CreateSupportTicketConversationUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.CreateSupportTicketConversationUserId$outboundSchema = z.union([z.string(), z.number()]);
function createSupportTicketConversationUserIdToJSON(createSupportTicketConversationUserId) {
    return JSON.stringify(exports.CreateSupportTicketConversationUserId$outboundSchema.parse(createSupportTicketConversationUserId));
}
function createSupportTicketConversationUserIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportTicketConversationUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationUserId' from JSON`);
}
/** @internal */
exports.CreateSupportTicketConversationUserProperties$inboundSchema = (0, schemas_js_1.collectExtraKeys)(z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
    userType: z.nullable(z.string()).optional(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
exports.CreateSupportTicketConversationUserProperties$outboundSchema = z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
    userType: z.nullable(z.string()).optional(),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...(0, primitives_js_1.remap)(v, {
            additionalProperties: null,
        }),
    };
});
function createSupportTicketConversationUserPropertiesToJSON(createSupportTicketConversationUserProperties) {
    return JSON.stringify(exports.CreateSupportTicketConversationUserProperties$outboundSchema.parse(createSupportTicketConversationUserProperties));
}
function createSupportTicketConversationUserPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportTicketConversationUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationUserProperties' from JSON`);
}
/** @internal */
exports.CreateSupportTicketConversationVisibility$inboundSchema = z
    .nativeEnum(exports.CreateSupportTicketConversationVisibility);
/** @internal */
exports.CreateSupportTicketConversationVisibility$outboundSchema = exports.CreateSupportTicketConversationVisibility$inboundSchema;
/** @internal */
exports.CreateSupportTicketConversationType1$inboundSchema = z.nativeEnum(exports.CreateSupportTicketConversationType1);
/** @internal */
exports.CreateSupportTicketConversationType1$outboundSchema = exports.CreateSupportTicketConversationType1$inboundSchema;
/** @internal */
exports.CreateSupportTicketConversationMessagesType$inboundSchema = z.union([exports.CreateSupportTicketConversationType1$inboundSchema, z.string()]);
/** @internal */
exports.CreateSupportTicketConversationMessagesType$outboundSchema = z.union([
    exports.CreateSupportTicketConversationType1$outboundSchema,
    z.string(),
]);
function createSupportTicketConversationMessagesTypeToJSON(createSupportTicketConversationMessagesType) {
    return JSON.stringify(exports.CreateSupportTicketConversationMessagesType$outboundSchema.parse(createSupportTicketConversationMessagesType));
}
function createSupportTicketConversationMessagesTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportTicketConversationMessagesType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationMessagesType' from JSON`);
}
/** @internal */
exports.CreateSupportTicketConversationLinks$inboundSchema = z.object({
    label: z.nullable(z.string()).optional(),
    url: z.string(),
    title: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    type: z.nullable(z.union([exports.CreateSupportTicketConversationType1$inboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
/** @internal */
exports.CreateSupportTicketConversationLinks$outboundSchema = z.object({
    label: z.nullable(z.string()).optional(),
    url: z.string(),
    title: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
    type: z.nullable(z.union([exports.CreateSupportTicketConversationType1$outboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
function createSupportTicketConversationLinksToJSON(createSupportTicketConversationLinks) {
    return JSON.stringify(exports.CreateSupportTicketConversationLinks$outboundSchema.parse(createSupportTicketConversationLinks));
}
function createSupportTicketConversationLinksFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportTicketConversationLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationLinks' from JSON`);
}
/** @internal */
exports.CreateSupportTicketConversationMessagesId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.CreateSupportTicketConversationMessagesId$outboundSchema = z.union([z.string(), z.number()]);
function createSupportTicketConversationMessagesIdToJSON(createSupportTicketConversationMessagesId) {
    return JSON.stringify(exports.CreateSupportTicketConversationMessagesId$outboundSchema.parse(createSupportTicketConversationMessagesId));
}
function createSupportTicketConversationMessagesIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportTicketConversationMessagesId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationMessagesId' from JSON`);
}
/** @internal */
exports.CreateSupportTicketConversationMessagesUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.CreateSupportTicketConversationMessagesUserId$outboundSchema = z.union([z.string(), z.number()]);
function createSupportTicketConversationMessagesUserIdToJSON(createSupportTicketConversationMessagesUserId) {
    return JSON.stringify(exports.CreateSupportTicketConversationMessagesUserId$outboundSchema.parse(createSupportTicketConversationMessagesUserId));
}
function createSupportTicketConversationMessagesUserIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportTicketConversationMessagesUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationMessagesUserId' from JSON`);
}
/** @internal */
exports.CreateSupportTicketConversationMessagesUserProperties$inboundSchema = (0, schemas_js_1.collectExtraKeys)(z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
    userType: z.nullable(z.string()).optional(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
exports.CreateSupportTicketConversationMessagesUserProperties$outboundSchema = z.object({
    id: z.nullable(z.union([z.string(), z.number()])).optional(),
    identificationType: z.nullable(z.string()).optional(),
    userId: z.nullable(z.union([z.string(), z.number()])).optional(),
    supportAgentName: z.nullable(z.string()).optional(),
    userType: z.nullable(z.string()).optional(),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...(0, primitives_js_1.remap)(v, {
            additionalProperties: null,
        }),
    };
});
function createSupportTicketConversationMessagesUserPropertiesToJSON(createSupportTicketConversationMessagesUserProperties) {
    return JSON.stringify(exports.CreateSupportTicketConversationMessagesUserProperties$outboundSchema.parse(createSupportTicketConversationMessagesUserProperties));
}
function createSupportTicketConversationMessagesUserPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportTicketConversationMessagesUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationMessagesUserProperties' from JSON`);
}
/** @internal */
exports.CreateSupportTicketConversationMessages$inboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    updatedAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    role: z.string(),
    content: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    links: z.nullable(z.array(z.lazy(() => exports.CreateSupportTicketConversationLinks$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.CreateSupportTicketConversationMessagesUserProperties$inboundSchema)).optional(),
});
/** @internal */
exports.CreateSupportTicketConversationMessages$outboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    role: z.string(),
    content: z.nullable(z.string()).optional(),
    name: z.nullable(z.string()).optional(),
    links: z.nullable(z.array(z.lazy(() => exports.CreateSupportTicketConversationLinks$outboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.CreateSupportTicketConversationMessagesUserProperties$outboundSchema)).optional(),
});
function createSupportTicketConversationMessagesToJSON(createSupportTicketConversationMessages) {
    return JSON.stringify(exports.CreateSupportTicketConversationMessages$outboundSchema.parse(createSupportTicketConversationMessages));
}
function createSupportTicketConversationMessagesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportTicketConversationMessages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationMessages' from JSON`);
}
/** @internal */
exports.CreateSupportTicketConversation$inboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    type: z.literal("support_ticket"),
    supportTicketConversationId: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    updatedAt: z.nullable(z.string().datetime({ offset: true }).transform(v => new Date(v))).optional(),
    projectId: z.nullable(z.string()).optional(),
    integrationId: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.CreateSupportTicketConversationUserProperties$inboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(exports.CreateSupportTicketConversationVisibility$inboundSchema).optional(),
    messages: z.array(z.lazy(() => exports.CreateSupportTicketConversationMessages$inboundSchema)),
});
/** @internal */
exports.CreateSupportTicketConversation$outboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    type: z.literal("support_ticket"),
    supportTicketConversationId: z.nullable(z.string()).optional(),
    createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
    projectId: z.nullable(z.string()).optional(),
    integrationId: z.nullable(z.string()).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.CreateSupportTicketConversationUserProperties$outboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(exports.CreateSupportTicketConversationVisibility$outboundSchema).optional(),
    messages: z.array(z.lazy(() => exports.CreateSupportTicketConversationMessages$outboundSchema)),
});
function createSupportTicketConversationToJSON(createSupportTicketConversation) {
    return JSON.stringify(exports.CreateSupportTicketConversation$outboundSchema.parse(createSupportTicketConversation));
}
function createSupportTicketConversationFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CreateSupportTicketConversation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversation' from JSON`);
}
//# sourceMappingURL=createsupportticketconversation.js.map