"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.SupportTicketMessage$outboundSchema = exports.SupportTicketMessage$inboundSchema = exports.SupportTicketMessageUserProperties$outboundSchema = exports.SupportTicketMessageUserProperties$inboundSchema = exports.SupportTicketMessageUserId$outboundSchema = exports.SupportTicketMessageUserId$inboundSchema = exports.SupportTicketMessageId$outboundSchema = exports.SupportTicketMessageId$inboundSchema = exports.SupportTicketMessageLinks$outboundSchema = exports.SupportTicketMessageLinks$inboundSchema = exports.SupportTicketMessageLinksType$outboundSchema = exports.SupportTicketMessageLinksType$inboundSchema = exports.Type1$outboundSchema = exports.Type1$inboundSchema = exports.SupportTicketMessageType$outboundSchema = exports.SupportTicketMessageType$inboundSchema = exports.Type1 = exports.SupportTicketMessageType = void 0;
exports.supportTicketMessageLinksTypeToJSON = supportTicketMessageLinksTypeToJSON;
exports.supportTicketMessageLinksTypeFromJSON = supportTicketMessageLinksTypeFromJSON;
exports.supportTicketMessageLinksToJSON = supportTicketMessageLinksToJSON;
exports.supportTicketMessageLinksFromJSON = supportTicketMessageLinksFromJSON;
exports.supportTicketMessageIdToJSON = supportTicketMessageIdToJSON;
exports.supportTicketMessageIdFromJSON = supportTicketMessageIdFromJSON;
exports.supportTicketMessageUserIdToJSON = supportTicketMessageUserIdToJSON;
exports.supportTicketMessageUserIdFromJSON = supportTicketMessageUserIdFromJSON;
exports.supportTicketMessageUserPropertiesToJSON = supportTicketMessageUserPropertiesToJSON;
exports.supportTicketMessageUserPropertiesFromJSON = supportTicketMessageUserPropertiesFromJSON;
exports.supportTicketMessageToJSON = supportTicketMessageToJSON;
exports.supportTicketMessageFromJSON = supportTicketMessageFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
exports.SupportTicketMessageType = {
    SupportTicket: "support_ticket",
};
exports.Type1 = {
    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.SupportTicketMessageType$inboundSchema = z.nativeEnum(exports.SupportTicketMessageType);
/** @internal */
exports.SupportTicketMessageType$outboundSchema = exports.SupportTicketMessageType$inboundSchema;
/** @internal */
exports.Type1$inboundSchema = z.nativeEnum(exports.Type1);
/** @internal */
exports.Type1$outboundSchema = exports.Type1$inboundSchema;
/** @internal */
exports.SupportTicketMessageLinksType$inboundSchema = z.union([exports.Type1$inboundSchema, z.string()]);
/** @internal */
exports.SupportTicketMessageLinksType$outboundSchema = z.union([exports.Type1$outboundSchema, z.string()]);
function supportTicketMessageLinksTypeToJSON(supportTicketMessageLinksType) {
    return JSON.stringify(exports.SupportTicketMessageLinksType$outboundSchema.parse(supportTicketMessageLinksType));
}
function supportTicketMessageLinksTypeFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportTicketMessageLinksType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketMessageLinksType' from JSON`);
}
/** @internal */
exports.SupportTicketMessageLinks$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.Type1$inboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
/** @internal */
exports.SupportTicketMessageLinks$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.Type1$outboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
function supportTicketMessageLinksToJSON(supportTicketMessageLinks) {
    return JSON.stringify(exports.SupportTicketMessageLinks$outboundSchema.parse(supportTicketMessageLinks));
}
function supportTicketMessageLinksFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportTicketMessageLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketMessageLinks' from JSON`);
}
/** @internal */
exports.SupportTicketMessageId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.SupportTicketMessageId$outboundSchema = z.union([z.string(), z.number()]);
function supportTicketMessageIdToJSON(supportTicketMessageId) {
    return JSON.stringify(exports.SupportTicketMessageId$outboundSchema.parse(supportTicketMessageId));
}
function supportTicketMessageIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportTicketMessageId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketMessageId' from JSON`);
}
/** @internal */
exports.SupportTicketMessageUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
exports.SupportTicketMessageUserId$outboundSchema = z.union([z.string(), z.number()]);
function supportTicketMessageUserIdToJSON(supportTicketMessageUserId) {
    return JSON.stringify(exports.SupportTicketMessageUserId$outboundSchema.parse(supportTicketMessageUserId));
}
function supportTicketMessageUserIdFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportTicketMessageUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketMessageUserId' from JSON`);
}
/** @internal */
exports.SupportTicketMessageUserProperties$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.SupportTicketMessageUserProperties$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 supportTicketMessageUserPropertiesToJSON(supportTicketMessageUserProperties) {
    return JSON.stringify(exports.SupportTicketMessageUserProperties$outboundSchema.parse(supportTicketMessageUserProperties));
}
function supportTicketMessageUserPropertiesFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportTicketMessageUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketMessageUserProperties' from JSON`);
}
/** @internal */
exports.SupportTicketMessage$inboundSchema = z.object({
    id: z.string(),
    type: exports.SupportTicketMessageType$inboundSchema,
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    conversationId: z.string(),
    createdAt: z.string(),
    updatedAt: z.string(),
    role: z.string(),
    content: z.nullable(z.string()),
    name: z.nullable(z.string()).optional(),
    links: z.nullable(z.array(z.lazy(() => exports.SupportTicketMessageLinks$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.SupportTicketMessageUserProperties$inboundSchema)).optional(),
});
/** @internal */
exports.SupportTicketMessage$outboundSchema = z.object({
    id: z.string(),
    type: exports.SupportTicketMessageType$outboundSchema,
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    conversationId: z.string(),
    createdAt: z.string(),
    updatedAt: z.string(),
    role: z.string(),
    content: z.nullable(z.string()),
    name: z.nullable(z.string()).optional(),
    links: z.nullable(z.array(z.lazy(() => exports.SupportTicketMessageLinks$outboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => exports.SupportTicketMessageUserProperties$outboundSchema)).optional(),
});
function supportTicketMessageToJSON(supportTicketMessage) {
    return JSON.stringify(exports.SupportTicketMessage$outboundSchema.parse(supportTicketMessage));
}
function supportTicketMessageFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.SupportTicketMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketMessage' from JSON`);
}
//# sourceMappingURL=supportticketmessage.js.map