/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { remap as remap$ } from "../../lib/primitives.js";
import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../../lib/schemas.js";
import { SupportTicketMessage$inboundSchema, SupportTicketMessage$outboundSchema, } from "./supportticketmessage.js";
export const SupportTicketConversationType = {
    SupportTicket: "support_ticket",
};
export const SupportTicketConversationVisibility = {
    Private: "private",
    Public: "public",
};
/** @internal */
export const SupportTicketConversationType$inboundSchema = z.nativeEnum(SupportTicketConversationType);
/** @internal */
export const SupportTicketConversationType$outboundSchema = SupportTicketConversationType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportTicketConversationType$;
(function (SupportTicketConversationType$) {
    /** @deprecated use `SupportTicketConversationType$inboundSchema` instead. */
    SupportTicketConversationType$.inboundSchema = SupportTicketConversationType$inboundSchema;
    /** @deprecated use `SupportTicketConversationType$outboundSchema` instead. */
    SupportTicketConversationType$.outboundSchema = SupportTicketConversationType$outboundSchema;
})(SupportTicketConversationType$ || (SupportTicketConversationType$ = {}));
/** @internal */
export const SupportTicketConversationId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SupportTicketConversationId$outboundSchema = z.union([z.string(), z.number()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportTicketConversationId$;
(function (SupportTicketConversationId$) {
    /** @deprecated use `SupportTicketConversationId$inboundSchema` instead. */
    SupportTicketConversationId$.inboundSchema = SupportTicketConversationId$inboundSchema;
    /** @deprecated use `SupportTicketConversationId$outboundSchema` instead. */
    SupportTicketConversationId$.outboundSchema = SupportTicketConversationId$outboundSchema;
})(SupportTicketConversationId$ || (SupportTicketConversationId$ = {}));
export function supportTicketConversationIdToJSON(supportTicketConversationId) {
    return JSON.stringify(SupportTicketConversationId$outboundSchema.parse(supportTicketConversationId));
}
export function supportTicketConversationIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportTicketConversationId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketConversationId' from JSON`);
}
/** @internal */
export const SupportTicketConversationUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SupportTicketConversationUserId$outboundSchema = z.union([z.string(), z.number()]);
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportTicketConversationUserId$;
(function (SupportTicketConversationUserId$) {
    /** @deprecated use `SupportTicketConversationUserId$inboundSchema` instead. */
    SupportTicketConversationUserId$.inboundSchema = SupportTicketConversationUserId$inboundSchema;
    /** @deprecated use `SupportTicketConversationUserId$outboundSchema` instead. */
    SupportTicketConversationUserId$.outboundSchema = SupportTicketConversationUserId$outboundSchema;
})(SupportTicketConversationUserId$ || (SupportTicketConversationUserId$ = {}));
export function supportTicketConversationUserIdToJSON(supportTicketConversationUserId) {
    return JSON.stringify(SupportTicketConversationUserId$outboundSchema.parse(supportTicketConversationUserId));
}
export function supportTicketConversationUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportTicketConversationUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketConversationUserId' from JSON`);
}
/** @internal */
export const SupportTicketConversationUserProperties$inboundSchema = 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(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
export const SupportTicketConversationUserProperties$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(),
    additionalProperties: z.record(z.any()),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...remap$(v, {
            additionalProperties: null,
        }),
    };
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportTicketConversationUserProperties$;
(function (SupportTicketConversationUserProperties$) {
    /** @deprecated use `SupportTicketConversationUserProperties$inboundSchema` instead. */
    SupportTicketConversationUserProperties$.inboundSchema = SupportTicketConversationUserProperties$inboundSchema;
    /** @deprecated use `SupportTicketConversationUserProperties$outboundSchema` instead. */
    SupportTicketConversationUserProperties$.outboundSchema = SupportTicketConversationUserProperties$outboundSchema;
})(SupportTicketConversationUserProperties$ || (SupportTicketConversationUserProperties$ = {}));
export function supportTicketConversationUserPropertiesToJSON(supportTicketConversationUserProperties) {
    return JSON.stringify(SupportTicketConversationUserProperties$outboundSchema.parse(supportTicketConversationUserProperties));
}
export function supportTicketConversationUserPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportTicketConversationUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketConversationUserProperties' from JSON`);
}
/** @internal */
export const SupportTicketConversationVisibility$inboundSchema = z.nativeEnum(SupportTicketConversationVisibility);
/** @internal */
export const SupportTicketConversationVisibility$outboundSchema = SupportTicketConversationVisibility$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportTicketConversationVisibility$;
(function (SupportTicketConversationVisibility$) {
    /** @deprecated use `SupportTicketConversationVisibility$inboundSchema` instead. */
    SupportTicketConversationVisibility$.inboundSchema = SupportTicketConversationVisibility$inboundSchema;
    /** @deprecated use `SupportTicketConversationVisibility$outboundSchema` instead. */
    SupportTicketConversationVisibility$.outboundSchema = SupportTicketConversationVisibility$outboundSchema;
})(SupportTicketConversationVisibility$ || (SupportTicketConversationVisibility$ = {}));
/** @internal */
export const SupportTicketConversation$inboundSchema = z.object({
    id: z.string(),
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    type: SupportTicketConversationType$inboundSchema,
    supportTicketConversationId: z.nullable(z.string()),
    createdAt: z.string(),
    updatedAt: z.string(),
    projectId: z.nullable(z.string()),
    integrationId: z.nullable(z.string()),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => SupportTicketConversationUserProperties$inboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(SupportTicketConversationVisibility$inboundSchema),
    messages: z.array(SupportTicketMessage$inboundSchema),
});
/** @internal */
export const SupportTicketConversation$outboundSchema = z.object({
    id: z.string(),
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    type: SupportTicketConversationType$outboundSchema,
    supportTicketConversationId: z.nullable(z.string()),
    createdAt: z.string(),
    updatedAt: z.string(),
    projectId: z.nullable(z.string()),
    integrationId: z.nullable(z.string()),
    properties: z.nullable(z.record(z.any())).optional(),
    userProperties: z.nullable(z.lazy(() => SupportTicketConversationUserProperties$outboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(SupportTicketConversationVisibility$outboundSchema),
    messages: z.array(SupportTicketMessage$outboundSchema),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportTicketConversation$;
(function (SupportTicketConversation$) {
    /** @deprecated use `SupportTicketConversation$inboundSchema` instead. */
    SupportTicketConversation$.inboundSchema = SupportTicketConversation$inboundSchema;
    /** @deprecated use `SupportTicketConversation$outboundSchema` instead. */
    SupportTicketConversation$.outboundSchema = SupportTicketConversation$outboundSchema;
})(SupportTicketConversation$ || (SupportTicketConversation$ = {}));
export function supportTicketConversationToJSON(supportTicketConversation) {
    return JSON.stringify(SupportTicketConversation$outboundSchema.parse(supportTicketConversation));
}
export function supportTicketConversationFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportTicketConversation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportTicketConversation' from JSON`);
}
//# sourceMappingURL=supportticketconversation.js.map