/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const SupportTicketMessageType = {
    SupportTicket: "support_ticket",
};
export const 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 */
export const SupportTicketMessageType$inboundSchema = z.nativeEnum(SupportTicketMessageType);
/** @internal */
export const SupportTicketMessageType$outboundSchema = SupportTicketMessageType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportTicketMessageType$;
(function (SupportTicketMessageType$) {
    /** @deprecated use `SupportTicketMessageType$inboundSchema` instead. */
    SupportTicketMessageType$.inboundSchema = SupportTicketMessageType$inboundSchema;
    /** @deprecated use `SupportTicketMessageType$outboundSchema` instead. */
    SupportTicketMessageType$.outboundSchema = SupportTicketMessageType$outboundSchema;
})(SupportTicketMessageType$ || (SupportTicketMessageType$ = {}));
/** @internal */
export const Type1$inboundSchema = z.nativeEnum(Type1);
/** @internal */
export const Type1$outboundSchema = Type1$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var Type1$;
(function (Type1$) {
    /** @deprecated use `Type1$inboundSchema` instead. */
    Type1$.inboundSchema = Type1$inboundSchema;
    /** @deprecated use `Type1$outboundSchema` instead. */
    Type1$.outboundSchema = Type1$outboundSchema;
})(Type1$ || (Type1$ = {}));
/** @internal */
export const SupportTicketMessageLinksType$inboundSchema = z.union([Type1$inboundSchema, z.string()]);
/** @internal */
export const SupportTicketMessageLinksType$outboundSchema = z.union([Type1$outboundSchema, z.string()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportTicketMessageLinksType$;
(function (SupportTicketMessageLinksType$) {
    /** @deprecated use `SupportTicketMessageLinksType$inboundSchema` instead. */
    SupportTicketMessageLinksType$.inboundSchema = SupportTicketMessageLinksType$inboundSchema;
    /** @deprecated use `SupportTicketMessageLinksType$outboundSchema` instead. */
    SupportTicketMessageLinksType$.outboundSchema = SupportTicketMessageLinksType$outboundSchema;
})(SupportTicketMessageLinksType$ || (SupportTicketMessageLinksType$ = {}));
export function supportTicketMessageLinksTypeToJSON(supportTicketMessageLinksType) {
    return JSON.stringify(SupportTicketMessageLinksType$outboundSchema.parse(supportTicketMessageLinksType));
}
export function supportTicketMessageLinksTypeFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportTicketMessageLinksType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketMessageLinksType' from JSON`);
}
/** @internal */
export const 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([Type1$inboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
/** @internal */
export const 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([Type1$outboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportTicketMessageLinks$;
(function (SupportTicketMessageLinks$) {
    /** @deprecated use `SupportTicketMessageLinks$inboundSchema` instead. */
    SupportTicketMessageLinks$.inboundSchema = SupportTicketMessageLinks$inboundSchema;
    /** @deprecated use `SupportTicketMessageLinks$outboundSchema` instead. */
    SupportTicketMessageLinks$.outboundSchema = SupportTicketMessageLinks$outboundSchema;
})(SupportTicketMessageLinks$ || (SupportTicketMessageLinks$ = {}));
export function supportTicketMessageLinksToJSON(supportTicketMessageLinks) {
    return JSON.stringify(SupportTicketMessageLinks$outboundSchema.parse(supportTicketMessageLinks));
}
export function supportTicketMessageLinksFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportTicketMessageLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketMessageLinks' from JSON`);
}
/** @internal */
export const SupportTicketMessage$inboundSchema = z.object({
    id: z.string(),
    type: 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(() => SupportTicketMessageLinks$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
});
/** @internal */
export const SupportTicketMessage$outboundSchema = z.object({
    id: z.string(),
    type: 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(() => SupportTicketMessageLinks$outboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportTicketMessage$;
(function (SupportTicketMessage$) {
    /** @deprecated use `SupportTicketMessage$inboundSchema` instead. */
    SupportTicketMessage$.inboundSchema = SupportTicketMessage$inboundSchema;
    /** @deprecated use `SupportTicketMessage$outboundSchema` instead. */
    SupportTicketMessage$.outboundSchema = SupportTicketMessage$outboundSchema;
})(SupportTicketMessage$ || (SupportTicketMessage$ = {}));
export function supportTicketMessageToJSON(supportTicketMessage) {
    return JSON.stringify(SupportTicketMessage$outboundSchema.parse(supportTicketMessage));
}
export function supportTicketMessageFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportTicketMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketMessage' from JSON`);
}
//# sourceMappingURL=supportticketmessage.js.map