/*
 * 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 { SupportCopilotMessage$inboundSchema, SupportCopilotMessage$outboundSchema, } from "./supportcopilotmessage.js";
export const SupportCopilotConversationType = {
    SupportCopilot: "support_copilot",
};
export const SupportCopilotConversationVisibility = {
    Private: "private",
    Public: "public",
};
/** @internal */
export const SupportCopilotConversationType$inboundSchema = z.nativeEnum(SupportCopilotConversationType);
/** @internal */
export const SupportCopilotConversationType$outboundSchema = SupportCopilotConversationType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportCopilotConversationType$;
(function (SupportCopilotConversationType$) {
    /** @deprecated use `SupportCopilotConversationType$inboundSchema` instead. */
    SupportCopilotConversationType$.inboundSchema = SupportCopilotConversationType$inboundSchema;
    /** @deprecated use `SupportCopilotConversationType$outboundSchema` instead. */
    SupportCopilotConversationType$.outboundSchema = SupportCopilotConversationType$outboundSchema;
})(SupportCopilotConversationType$ || (SupportCopilotConversationType$ = {}));
/** @internal */
export const SupportCopilotConversationId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SupportCopilotConversationId$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 SupportCopilotConversationId$;
(function (SupportCopilotConversationId$) {
    /** @deprecated use `SupportCopilotConversationId$inboundSchema` instead. */
    SupportCopilotConversationId$.inboundSchema = SupportCopilotConversationId$inboundSchema;
    /** @deprecated use `SupportCopilotConversationId$outboundSchema` instead. */
    SupportCopilotConversationId$.outboundSchema = SupportCopilotConversationId$outboundSchema;
})(SupportCopilotConversationId$ || (SupportCopilotConversationId$ = {}));
export function supportCopilotConversationIdToJSON(supportCopilotConversationId) {
    return JSON.stringify(SupportCopilotConversationId$outboundSchema.parse(supportCopilotConversationId));
}
export function supportCopilotConversationIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportCopilotConversationId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotConversationId' from JSON`);
}
/** @internal */
export const SupportCopilotConversationUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SupportCopilotConversationUserId$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 SupportCopilotConversationUserId$;
(function (SupportCopilotConversationUserId$) {
    /** @deprecated use `SupportCopilotConversationUserId$inboundSchema` instead. */
    SupportCopilotConversationUserId$.inboundSchema = SupportCopilotConversationUserId$inboundSchema;
    /** @deprecated use `SupportCopilotConversationUserId$outboundSchema` instead. */
    SupportCopilotConversationUserId$.outboundSchema = SupportCopilotConversationUserId$outboundSchema;
})(SupportCopilotConversationUserId$ || (SupportCopilotConversationUserId$ = {}));
export function supportCopilotConversationUserIdToJSON(supportCopilotConversationUserId) {
    return JSON.stringify(SupportCopilotConversationUserId$outboundSchema.parse(supportCopilotConversationUserId));
}
export function supportCopilotConversationUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportCopilotConversationUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotConversationUserId' from JSON`);
}
/** @internal */
export const SupportCopilotConversationUserProperties$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 SupportCopilotConversationUserProperties$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 SupportCopilotConversationUserProperties$;
(function (SupportCopilotConversationUserProperties$) {
    /** @deprecated use `SupportCopilotConversationUserProperties$inboundSchema` instead. */
    SupportCopilotConversationUserProperties$.inboundSchema = SupportCopilotConversationUserProperties$inboundSchema;
    /** @deprecated use `SupportCopilotConversationUserProperties$outboundSchema` instead. */
    SupportCopilotConversationUserProperties$.outboundSchema = SupportCopilotConversationUserProperties$outboundSchema;
})(SupportCopilotConversationUserProperties$ || (SupportCopilotConversationUserProperties$ = {}));
export function supportCopilotConversationUserPropertiesToJSON(supportCopilotConversationUserProperties) {
    return JSON.stringify(SupportCopilotConversationUserProperties$outboundSchema.parse(supportCopilotConversationUserProperties));
}
export function supportCopilotConversationUserPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportCopilotConversationUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotConversationUserProperties' from JSON`);
}
/** @internal */
export const SupportCopilotConversationVisibility$inboundSchema = z.nativeEnum(SupportCopilotConversationVisibility);
/** @internal */
export const SupportCopilotConversationVisibility$outboundSchema = SupportCopilotConversationVisibility$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportCopilotConversationVisibility$;
(function (SupportCopilotConversationVisibility$) {
    /** @deprecated use `SupportCopilotConversationVisibility$inboundSchema` instead. */
    SupportCopilotConversationVisibility$.inboundSchema = SupportCopilotConversationVisibility$inboundSchema;
    /** @deprecated use `SupportCopilotConversationVisibility$outboundSchema` instead. */
    SupportCopilotConversationVisibility$.outboundSchema = SupportCopilotConversationVisibility$outboundSchema;
})(SupportCopilotConversationVisibility$ || (SupportCopilotConversationVisibility$ = {}));
/** @internal */
export const SupportCopilotConversation$inboundSchema = z.object({
    id: z.string(),
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    type: SupportCopilotConversationType$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(() => SupportCopilotConversationUserProperties$inboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(SupportCopilotConversationVisibility$inboundSchema),
    messages: z.array(SupportCopilotMessage$inboundSchema),
});
/** @internal */
export const SupportCopilotConversation$outboundSchema = z.object({
    id: z.string(),
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    type: SupportCopilotConversationType$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(() => SupportCopilotConversationUserProperties$outboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(SupportCopilotConversationVisibility$outboundSchema),
    messages: z.array(SupportCopilotMessage$outboundSchema),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SupportCopilotConversation$;
(function (SupportCopilotConversation$) {
    /** @deprecated use `SupportCopilotConversation$inboundSchema` instead. */
    SupportCopilotConversation$.inboundSchema = SupportCopilotConversation$inboundSchema;
    /** @deprecated use `SupportCopilotConversation$outboundSchema` instead. */
    SupportCopilotConversation$.outboundSchema = SupportCopilotConversation$outboundSchema;
})(SupportCopilotConversation$ || (SupportCopilotConversation$ = {}));
export function supportCopilotConversationToJSON(supportCopilotConversation) {
    return JSON.stringify(SupportCopilotConversation$outboundSchema.parse(supportCopilotConversation));
}
export function supportCopilotConversationFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SupportCopilotConversation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportCopilotConversation' from JSON`);
}
//# sourceMappingURL=supportcopilotconversation.js.map