/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const SupportCopilotMessageType = {
    SupportCopilot: "support_copilot",
};
export const SupportCopilotMessageType1 = {
    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 SupportCopilotMessageType$inboundSchema = z.nativeEnum(SupportCopilotMessageType);
/** @internal */
export const SupportCopilotMessageType$outboundSchema = SupportCopilotMessageType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportCopilotMessageType$;
(function (SupportCopilotMessageType$) {
    /** @deprecated use `SupportCopilotMessageType$inboundSchema` instead. */
    SupportCopilotMessageType$.inboundSchema = SupportCopilotMessageType$inboundSchema;
    /** @deprecated use `SupportCopilotMessageType$outboundSchema` instead. */
    SupportCopilotMessageType$.outboundSchema = SupportCopilotMessageType$outboundSchema;
})(SupportCopilotMessageType$ || (SupportCopilotMessageType$ = {}));
/** @internal */
export const SupportCopilotMessageType1$inboundSchema = z.nativeEnum(SupportCopilotMessageType1);
/** @internal */
export const SupportCopilotMessageType1$outboundSchema = SupportCopilotMessageType1$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportCopilotMessageType1$;
(function (SupportCopilotMessageType1$) {
    /** @deprecated use `SupportCopilotMessageType1$inboundSchema` instead. */
    SupportCopilotMessageType1$.inboundSchema = SupportCopilotMessageType1$inboundSchema;
    /** @deprecated use `SupportCopilotMessageType1$outboundSchema` instead. */
    SupportCopilotMessageType1$.outboundSchema = SupportCopilotMessageType1$outboundSchema;
})(SupportCopilotMessageType1$ || (SupportCopilotMessageType1$ = {}));
/** @internal */
export const SupportCopilotMessageLinksType$inboundSchema = z.union([SupportCopilotMessageType1$inboundSchema, z.string()]);
/** @internal */
export const SupportCopilotMessageLinksType$outboundSchema = z.union([SupportCopilotMessageType1$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 SupportCopilotMessageLinksType$;
(function (SupportCopilotMessageLinksType$) {
    /** @deprecated use `SupportCopilotMessageLinksType$inboundSchema` instead. */
    SupportCopilotMessageLinksType$.inboundSchema = SupportCopilotMessageLinksType$inboundSchema;
    /** @deprecated use `SupportCopilotMessageLinksType$outboundSchema` instead. */
    SupportCopilotMessageLinksType$.outboundSchema = SupportCopilotMessageLinksType$outboundSchema;
})(SupportCopilotMessageLinksType$ || (SupportCopilotMessageLinksType$ = {}));
export function supportCopilotMessageLinksTypeToJSON(supportCopilotMessageLinksType) {
    return JSON.stringify(SupportCopilotMessageLinksType$outboundSchema.parse(supportCopilotMessageLinksType));
}
export function supportCopilotMessageLinksTypeFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportCopilotMessageLinksType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotMessageLinksType' from JSON`);
}
/** @internal */
export const SupportCopilotMessageLinks$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([SupportCopilotMessageType1$inboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
/** @internal */
export const SupportCopilotMessageLinks$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([SupportCopilotMessageType1$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 SupportCopilotMessageLinks$;
(function (SupportCopilotMessageLinks$) {
    /** @deprecated use `SupportCopilotMessageLinks$inboundSchema` instead. */
    SupportCopilotMessageLinks$.inboundSchema = SupportCopilotMessageLinks$inboundSchema;
    /** @deprecated use `SupportCopilotMessageLinks$outboundSchema` instead. */
    SupportCopilotMessageLinks$.outboundSchema = SupportCopilotMessageLinks$outboundSchema;
})(SupportCopilotMessageLinks$ || (SupportCopilotMessageLinks$ = {}));
export function supportCopilotMessageLinksToJSON(supportCopilotMessageLinks) {
    return JSON.stringify(SupportCopilotMessageLinks$outboundSchema.parse(supportCopilotMessageLinks));
}
export function supportCopilotMessageLinksFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportCopilotMessageLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotMessageLinks' from JSON`);
}
/** @internal */
export const SupportCopilotMessage$inboundSchema = z.object({
    id: z.string(),
    type: SupportCopilotMessageType$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(() => SupportCopilotMessageLinks$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
});
/** @internal */
export const SupportCopilotMessage$outboundSchema = z.object({
    id: z.string(),
    type: SupportCopilotMessageType$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(() => SupportCopilotMessageLinks$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 SupportCopilotMessage$;
(function (SupportCopilotMessage$) {
    /** @deprecated use `SupportCopilotMessage$inboundSchema` instead. */
    SupportCopilotMessage$.inboundSchema = SupportCopilotMessage$inboundSchema;
    /** @deprecated use `SupportCopilotMessage$outboundSchema` instead. */
    SupportCopilotMessage$.outboundSchema = SupportCopilotMessage$outboundSchema;
})(SupportCopilotMessage$ || (SupportCopilotMessage$ = {}));
export function supportCopilotMessageToJSON(supportCopilotMessage) {
    return JSON.stringify(SupportCopilotMessage$outboundSchema.parse(supportCopilotMessage));
}
export function supportCopilotMessageFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportCopilotMessage$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotMessage' from JSON`);
}
//# sourceMappingURL=supportcopilotmessage.js.map