/*
 * 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";
export const InsertConversationEventEntityType = {
    Conversation: "conversation",
};
/** @internal */
export const InsertConversationEventId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const InsertConversationEventId$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 InsertConversationEventId$;
(function (InsertConversationEventId$) {
    /** @deprecated use `InsertConversationEventId$inboundSchema` instead. */
    InsertConversationEventId$.inboundSchema = InsertConversationEventId$inboundSchema;
    /** @deprecated use `InsertConversationEventId$outboundSchema` instead. */
    InsertConversationEventId$.outboundSchema = InsertConversationEventId$outboundSchema;
})(InsertConversationEventId$ || (InsertConversationEventId$ = {}));
export function insertConversationEventIdToJSON(insertConversationEventId) {
    return JSON.stringify(InsertConversationEventId$outboundSchema.parse(insertConversationEventId));
}
export function insertConversationEventIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => InsertConversationEventId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InsertConversationEventId' from JSON`);
}
/** @internal */
export const InsertConversationEventUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const InsertConversationEventUserId$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 InsertConversationEventUserId$;
(function (InsertConversationEventUserId$) {
    /** @deprecated use `InsertConversationEventUserId$inboundSchema` instead. */
    InsertConversationEventUserId$.inboundSchema = InsertConversationEventUserId$inboundSchema;
    /** @deprecated use `InsertConversationEventUserId$outboundSchema` instead. */
    InsertConversationEventUserId$.outboundSchema = InsertConversationEventUserId$outboundSchema;
})(InsertConversationEventUserId$ || (InsertConversationEventUserId$ = {}));
export function insertConversationEventUserIdToJSON(insertConversationEventUserId) {
    return JSON.stringify(InsertConversationEventUserId$outboundSchema.parse(insertConversationEventUserId));
}
export function insertConversationEventUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => InsertConversationEventUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InsertConversationEventUserId' from JSON`);
}
/** @internal */
export const InsertConversationEventUserProperties$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 InsertConversationEventUserProperties$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 InsertConversationEventUserProperties$;
(function (InsertConversationEventUserProperties$) {
    /** @deprecated use `InsertConversationEventUserProperties$inboundSchema` instead. */
    InsertConversationEventUserProperties$.inboundSchema = InsertConversationEventUserProperties$inboundSchema;
    /** @deprecated use `InsertConversationEventUserProperties$outboundSchema` instead. */
    InsertConversationEventUserProperties$.outboundSchema = InsertConversationEventUserProperties$outboundSchema;
})(InsertConversationEventUserProperties$ || (InsertConversationEventUserProperties$ = {}));
export function insertConversationEventUserPropertiesToJSON(insertConversationEventUserProperties) {
    return JSON.stringify(InsertConversationEventUserProperties$outboundSchema.parse(insertConversationEventUserProperties));
}
export function insertConversationEventUserPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => InsertConversationEventUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InsertConversationEventUserProperties' from JSON`);
}
/** @internal */
export const InsertConversationEventEntityType$inboundSchema = z.nativeEnum(InsertConversationEventEntityType);
/** @internal */
export const InsertConversationEventEntityType$outboundSchema = InsertConversationEventEntityType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var InsertConversationEventEntityType$;
(function (InsertConversationEventEntityType$) {
    /** @deprecated use `InsertConversationEventEntityType$inboundSchema` instead. */
    InsertConversationEventEntityType$.inboundSchema = InsertConversationEventEntityType$inboundSchema;
    /** @deprecated use `InsertConversationEventEntityType$outboundSchema` instead. */
    InsertConversationEventEntityType$.outboundSchema = InsertConversationEventEntityType$outboundSchema;
})(InsertConversationEventEntityType$ || (InsertConversationEventEntityType$ = {}));
/** @internal */
export const InsertConversationEvent$inboundSchema = z.object({
    id: z.string().optional(),
    type: z.string(),
    conversationId: z.string(),
    createdAt: 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.lazy(() => InsertConversationEventUserProperties$inboundSchema)).optional(),
    entityType: InsertConversationEventEntityType$inboundSchema,
});
/** @internal */
export const InsertConversationEvent$outboundSchema = z.object({
    id: z.string().optional(),
    type: z.string(),
    conversationId: z.string(),
    createdAt: 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.lazy(() => InsertConversationEventUserProperties$outboundSchema)).optional(),
    entityType: InsertConversationEventEntityType$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var InsertConversationEvent$;
(function (InsertConversationEvent$) {
    /** @deprecated use `InsertConversationEvent$inboundSchema` instead. */
    InsertConversationEvent$.inboundSchema = InsertConversationEvent$inboundSchema;
    /** @deprecated use `InsertConversationEvent$outboundSchema` instead. */
    InsertConversationEvent$.outboundSchema = InsertConversationEvent$outboundSchema;
})(InsertConversationEvent$ || (InsertConversationEvent$ = {}));
export function insertConversationEventToJSON(insertConversationEvent) {
    return JSON.stringify(InsertConversationEvent$outboundSchema.parse(insertConversationEvent));
}
export function insertConversationEventFromJSON(jsonString) {
    return safeParse(jsonString, (x) => InsertConversationEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InsertConversationEvent' from JSON`);
}
//# sourceMappingURL=insertconversationevent.js.map