/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.js";
import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../../lib/schemas.js";
/** @internal */
export const SelectConversationEventId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SelectConversationEventId$outboundSchema = z.union([z.string(), z.number()]);
export function selectConversationEventIdToJSON(selectConversationEventId) {
    return JSON.stringify(SelectConversationEventId$outboundSchema.parse(selectConversationEventId));
}
export function selectConversationEventIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectConversationEventId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectConversationEventId' from JSON`);
}
/** @internal */
export const SelectConversationEventUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SelectConversationEventUserId$outboundSchema = z.union([z.string(), z.number()]);
export function selectConversationEventUserIdToJSON(selectConversationEventUserId) {
    return JSON.stringify(SelectConversationEventUserId$outboundSchema.parse(selectConversationEventUserId));
}
export function selectConversationEventUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectConversationEventUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectConversationEventUserId' from JSON`);
}
/** @internal */
export const SelectConversationEventUserProperties$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(),
    userType: z.nullable(z.string()).optional(),
}).catchall(z.any()), "additionalProperties", true);
/** @internal */
export const SelectConversationEventUserProperties$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(),
    userType: z.nullable(z.string()).optional(),
    additionalProperties: z.record(z.any()).optional(),
}).transform((v) => {
    return {
        ...v.additionalProperties,
        ...remap$(v, {
            additionalProperties: null,
        }),
    };
});
export function selectConversationEventUserPropertiesToJSON(selectConversationEventUserProperties) {
    return JSON.stringify(SelectConversationEventUserProperties$outboundSchema.parse(selectConversationEventUserProperties));
}
export function selectConversationEventUserPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectConversationEventUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectConversationEventUserProperties' from JSON`);
}
/** @internal */
export const SelectConversationEvent$inboundSchema = z.object({
    id: z.string(),
    type: z.string(),
    conversationId: z.string(),
    createdAt: 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(() => SelectConversationEventUserProperties$inboundSchema)).optional(),
    entityType: z.literal("conversation"),
});
/** @internal */
export const SelectConversationEvent$outboundSchema = z.object({
    id: z.string(),
    type: z.string(),
    conversationId: z.string(),
    createdAt: 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(() => SelectConversationEventUserProperties$outboundSchema)).optional(),
    entityType: z.literal("conversation"),
});
export function selectConversationEventToJSON(selectConversationEvent) {
    return JSON.stringify(SelectConversationEvent$outboundSchema.parse(selectConversationEvent));
}
export function selectConversationEventFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectConversationEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectConversationEvent' from JSON`);
}
//# sourceMappingURL=selectconversationevent.js.map