/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const CreateSupportTicketConversationType = {
    SupportTicket: "support_ticket",
};
export const CreateSupportTicketConversationVisibility = {
    Private: "private",
    Public: "public",
};
export const 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 */
export const CreateSupportTicketConversationType$inboundSchema = z.nativeEnum(CreateSupportTicketConversationType);
/** @internal */
export const CreateSupportTicketConversationType$outboundSchema = CreateSupportTicketConversationType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateSupportTicketConversationType$;
(function (CreateSupportTicketConversationType$) {
    /** @deprecated use `CreateSupportTicketConversationType$inboundSchema` instead. */
    CreateSupportTicketConversationType$.inboundSchema = CreateSupportTicketConversationType$inboundSchema;
    /** @deprecated use `CreateSupportTicketConversationType$outboundSchema` instead. */
    CreateSupportTicketConversationType$.outboundSchema = CreateSupportTicketConversationType$outboundSchema;
})(CreateSupportTicketConversationType$ || (CreateSupportTicketConversationType$ = {}));
/** @internal */
export const CreateSupportTicketConversationVisibility$inboundSchema = z
    .nativeEnum(CreateSupportTicketConversationVisibility);
/** @internal */
export const CreateSupportTicketConversationVisibility$outboundSchema = CreateSupportTicketConversationVisibility$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateSupportTicketConversationVisibility$;
(function (CreateSupportTicketConversationVisibility$) {
    /** @deprecated use `CreateSupportTicketConversationVisibility$inboundSchema` instead. */
    CreateSupportTicketConversationVisibility$.inboundSchema = CreateSupportTicketConversationVisibility$inboundSchema;
    /** @deprecated use `CreateSupportTicketConversationVisibility$outboundSchema` instead. */
    CreateSupportTicketConversationVisibility$.outboundSchema = CreateSupportTicketConversationVisibility$outboundSchema;
})(CreateSupportTicketConversationVisibility$ || (CreateSupportTicketConversationVisibility$ = {}));
/** @internal */
export const CreateSupportTicketConversationType1$inboundSchema = z.nativeEnum(CreateSupportTicketConversationType1);
/** @internal */
export const CreateSupportTicketConversationType1$outboundSchema = CreateSupportTicketConversationType1$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateSupportTicketConversationType1$;
(function (CreateSupportTicketConversationType1$) {
    /** @deprecated use `CreateSupportTicketConversationType1$inboundSchema` instead. */
    CreateSupportTicketConversationType1$.inboundSchema = CreateSupportTicketConversationType1$inboundSchema;
    /** @deprecated use `CreateSupportTicketConversationType1$outboundSchema` instead. */
    CreateSupportTicketConversationType1$.outboundSchema = CreateSupportTicketConversationType1$outboundSchema;
})(CreateSupportTicketConversationType1$ || (CreateSupportTicketConversationType1$ = {}));
/** @internal */
export const CreateSupportTicketConversationMessagesType$inboundSchema = z.union([CreateSupportTicketConversationType1$inboundSchema, z.string()]);
/** @internal */
export const CreateSupportTicketConversationMessagesType$outboundSchema = z.union([
    CreateSupportTicketConversationType1$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 CreateSupportTicketConversationMessagesType$;
(function (CreateSupportTicketConversationMessagesType$) {
    /** @deprecated use `CreateSupportTicketConversationMessagesType$inboundSchema` instead. */
    CreateSupportTicketConversationMessagesType$.inboundSchema = CreateSupportTicketConversationMessagesType$inboundSchema;
    /** @deprecated use `CreateSupportTicketConversationMessagesType$outboundSchema` instead. */
    CreateSupportTicketConversationMessagesType$.outboundSchema = CreateSupportTicketConversationMessagesType$outboundSchema;
})(CreateSupportTicketConversationMessagesType$ || (CreateSupportTicketConversationMessagesType$ = {}));
export function createSupportTicketConversationMessagesTypeToJSON(createSupportTicketConversationMessagesType) {
    return JSON.stringify(CreateSupportTicketConversationMessagesType$outboundSchema.parse(createSupportTicketConversationMessagesType));
}
export function createSupportTicketConversationMessagesTypeFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateSupportTicketConversationMessagesType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationMessagesType' from JSON`);
}
/** @internal */
export const 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([CreateSupportTicketConversationType1$inboundSchema, z.string()])).optional(),
    breadcrumbs: z.nullable(z.array(z.string())).optional(),
});
/** @internal */
export const 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([CreateSupportTicketConversationType1$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 CreateSupportTicketConversationLinks$;
(function (CreateSupportTicketConversationLinks$) {
    /** @deprecated use `CreateSupportTicketConversationLinks$inboundSchema` instead. */
    CreateSupportTicketConversationLinks$.inboundSchema = CreateSupportTicketConversationLinks$inboundSchema;
    /** @deprecated use `CreateSupportTicketConversationLinks$outboundSchema` instead. */
    CreateSupportTicketConversationLinks$.outboundSchema = CreateSupportTicketConversationLinks$outboundSchema;
})(CreateSupportTicketConversationLinks$ || (CreateSupportTicketConversationLinks$ = {}));
export function createSupportTicketConversationLinksToJSON(createSupportTicketConversationLinks) {
    return JSON.stringify(CreateSupportTicketConversationLinks$outboundSchema.parse(createSupportTicketConversationLinks));
}
export function createSupportTicketConversationLinksFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateSupportTicketConversationLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationLinks' from JSON`);
}
/** @internal */
export const 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(() => CreateSupportTicketConversationLinks$inboundSchema))).optional(),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.record(z.any())).optional(),
});
/** @internal */
export const 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(() => CreateSupportTicketConversationLinks$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 CreateSupportTicketConversationMessages$;
(function (CreateSupportTicketConversationMessages$) {
    /** @deprecated use `CreateSupportTicketConversationMessages$inboundSchema` instead. */
    CreateSupportTicketConversationMessages$.inboundSchema = CreateSupportTicketConversationMessages$inboundSchema;
    /** @deprecated use `CreateSupportTicketConversationMessages$outboundSchema` instead. */
    CreateSupportTicketConversationMessages$.outboundSchema = CreateSupportTicketConversationMessages$outboundSchema;
})(CreateSupportTicketConversationMessages$ || (CreateSupportTicketConversationMessages$ = {}));
export function createSupportTicketConversationMessagesToJSON(createSupportTicketConversationMessages) {
    return JSON.stringify(CreateSupportTicketConversationMessages$outboundSchema.parse(createSupportTicketConversationMessages));
}
export function createSupportTicketConversationMessagesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateSupportTicketConversationMessages$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversationMessages' from JSON`);
}
/** @internal */
export const CreateSupportTicketConversation$inboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    type: CreateSupportTicketConversationType$inboundSchema,
    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.record(z.any())).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(CreateSupportTicketConversationVisibility$inboundSchema).optional(),
    messages: z.array(z.lazy(() => CreateSupportTicketConversationMessages$inboundSchema)),
});
/** @internal */
export const CreateSupportTicketConversation$outboundSchema = z.object({
    id: z.string().optional(),
    externalId: z.nullable(z.string()).optional(),
    externalUrl: z.nullable(z.string()).optional(),
    type: CreateSupportTicketConversationType$outboundSchema,
    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.record(z.any())).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(CreateSupportTicketConversationVisibility$outboundSchema).optional(),
    messages: z.array(z.lazy(() => CreateSupportTicketConversationMessages$outboundSchema)),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var CreateSupportTicketConversation$;
(function (CreateSupportTicketConversation$) {
    /** @deprecated use `CreateSupportTicketConversation$inboundSchema` instead. */
    CreateSupportTicketConversation$.inboundSchema = CreateSupportTicketConversation$inboundSchema;
    /** @deprecated use `CreateSupportTicketConversation$outboundSchema` instead. */
    CreateSupportTicketConversation$.outboundSchema = CreateSupportTicketConversation$outboundSchema;
})(CreateSupportTicketConversation$ || (CreateSupportTicketConversation$ = {}));
export function createSupportTicketConversationToJSON(createSupportTicketConversation) {
    return JSON.stringify(CreateSupportTicketConversation$outboundSchema.parse(createSupportTicketConversation));
}
export function createSupportTicketConversationFromJSON(jsonString) {
    return safeParse(jsonString, (x) => CreateSupportTicketConversation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSupportTicketConversation' from JSON`);
}
//# sourceMappingURL=createsupportticketconversation.js.map