/*
 * 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 { OpenAIChatCompletionMessage$inboundSchema, OpenAIChatCompletionMessage$outboundSchema, } from "./openaichatcompletionmessage.js";
import { OpenAIExtendedMessage$inboundSchema, OpenAIExtendedMessage$outboundSchema, } from "./openaiextendedmessage.js";
export const OpenAIConversationType = {
    Openai: "openai",
};
export const OpenAIConversationVisibility = {
    Private: "private",
    Public: "public",
};
/** @internal */
export const OpenAIConversationType$inboundSchema = z.nativeEnum(OpenAIConversationType);
/** @internal */
export const OpenAIConversationType$outboundSchema = OpenAIConversationType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var OpenAIConversationType$;
(function (OpenAIConversationType$) {
    /** @deprecated use `OpenAIConversationType$inboundSchema` instead. */
    OpenAIConversationType$.inboundSchema = OpenAIConversationType$inboundSchema;
    /** @deprecated use `OpenAIConversationType$outboundSchema` instead. */
    OpenAIConversationType$.outboundSchema = OpenAIConversationType$outboundSchema;
})(OpenAIConversationType$ || (OpenAIConversationType$ = {}));
/** @internal */
export const OpenAIConversationId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const OpenAIConversationId$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 OpenAIConversationId$;
(function (OpenAIConversationId$) {
    /** @deprecated use `OpenAIConversationId$inboundSchema` instead. */
    OpenAIConversationId$.inboundSchema = OpenAIConversationId$inboundSchema;
    /** @deprecated use `OpenAIConversationId$outboundSchema` instead. */
    OpenAIConversationId$.outboundSchema = OpenAIConversationId$outboundSchema;
})(OpenAIConversationId$ || (OpenAIConversationId$ = {}));
export function openAIConversationIdToJSON(openAIConversationId) {
    return JSON.stringify(OpenAIConversationId$outboundSchema.parse(openAIConversationId));
}
export function openAIConversationIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => OpenAIConversationId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIConversationId' from JSON`);
}
/** @internal */
export const OpenAIConversationUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const OpenAIConversationUserId$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 OpenAIConversationUserId$;
(function (OpenAIConversationUserId$) {
    /** @deprecated use `OpenAIConversationUserId$inboundSchema` instead. */
    OpenAIConversationUserId$.inboundSchema = OpenAIConversationUserId$inboundSchema;
    /** @deprecated use `OpenAIConversationUserId$outboundSchema` instead. */
    OpenAIConversationUserId$.outboundSchema = OpenAIConversationUserId$outboundSchema;
})(OpenAIConversationUserId$ || (OpenAIConversationUserId$ = {}));
export function openAIConversationUserIdToJSON(openAIConversationUserId) {
    return JSON.stringify(OpenAIConversationUserId$outboundSchema.parse(openAIConversationUserId));
}
export function openAIConversationUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => OpenAIConversationUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIConversationUserId' from JSON`);
}
/** @internal */
export const OpenAIConversationUserProperties$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 OpenAIConversationUserProperties$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 OpenAIConversationUserProperties$;
(function (OpenAIConversationUserProperties$) {
    /** @deprecated use `OpenAIConversationUserProperties$inboundSchema` instead. */
    OpenAIConversationUserProperties$.inboundSchema = OpenAIConversationUserProperties$inboundSchema;
    /** @deprecated use `OpenAIConversationUserProperties$outboundSchema` instead. */
    OpenAIConversationUserProperties$.outboundSchema = OpenAIConversationUserProperties$outboundSchema;
})(OpenAIConversationUserProperties$ || (OpenAIConversationUserProperties$ = {}));
export function openAIConversationUserPropertiesToJSON(openAIConversationUserProperties) {
    return JSON.stringify(OpenAIConversationUserProperties$outboundSchema.parse(openAIConversationUserProperties));
}
export function openAIConversationUserPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => OpenAIConversationUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIConversationUserProperties' from JSON`);
}
/** @internal */
export const OpenAIConversationVisibility$inboundSchema = z.nativeEnum(OpenAIConversationVisibility);
/** @internal */
export const OpenAIConversationVisibility$outboundSchema = OpenAIConversationVisibility$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var OpenAIConversationVisibility$;
(function (OpenAIConversationVisibility$) {
    /** @deprecated use `OpenAIConversationVisibility$inboundSchema` instead. */
    OpenAIConversationVisibility$.inboundSchema = OpenAIConversationVisibility$inboundSchema;
    /** @deprecated use `OpenAIConversationVisibility$outboundSchema` instead. */
    OpenAIConversationVisibility$.outboundSchema = OpenAIConversationVisibility$outboundSchema;
})(OpenAIConversationVisibility$ || (OpenAIConversationVisibility$ = {}));
/** @internal */
export const OpenAIConversation$inboundSchema = z.object({
    id: z.string(),
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    type: OpenAIConversationType$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(() => OpenAIConversationUserProperties$inboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(OpenAIConversationVisibility$inboundSchema),
    messages: z.array(OpenAIExtendedMessage$inboundSchema),
    messagesOpenAIFormat: z.array(OpenAIChatCompletionMessage$inboundSchema),
});
/** @internal */
export const OpenAIConversation$outboundSchema = z.object({
    id: z.string(),
    externalId: z.nullable(z.string()),
    externalUrl: z.nullable(z.string()),
    type: OpenAIConversationType$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(() => OpenAIConversationUserProperties$outboundSchema)).optional(),
    tags: z.nullable(z.array(z.string())).optional(),
    visibility: z.nullable(OpenAIConversationVisibility$outboundSchema),
    messages: z.array(OpenAIExtendedMessage$outboundSchema),
    messagesOpenAIFormat: z.array(OpenAIChatCompletionMessage$outboundSchema),
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var OpenAIConversation$;
(function (OpenAIConversation$) {
    /** @deprecated use `OpenAIConversation$inboundSchema` instead. */
    OpenAIConversation$.inboundSchema = OpenAIConversation$inboundSchema;
    /** @deprecated use `OpenAIConversation$outboundSchema` instead. */
    OpenAIConversation$.outboundSchema = OpenAIConversation$outboundSchema;
})(OpenAIConversation$ || (OpenAIConversation$ = {}));
export function openAIConversationToJSON(openAIConversation) {
    return JSON.stringify(OpenAIConversation$outboundSchema.parse(openAIConversation));
}
export function openAIConversationFromJSON(jsonString) {
    return safeParse(jsonString, (x) => OpenAIConversation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIConversation' from JSON`);
}
//# sourceMappingURL=openaiconversation.js.map