/*
 * 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 SelectMessageEventEntityType = {
    Message: "message",
};
/** @internal */
export const SelectMessageEventId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SelectMessageEventId$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 SelectMessageEventId$;
(function (SelectMessageEventId$) {
    /** @deprecated use `SelectMessageEventId$inboundSchema` instead. */
    SelectMessageEventId$.inboundSchema = SelectMessageEventId$inboundSchema;
    /** @deprecated use `SelectMessageEventId$outboundSchema` instead. */
    SelectMessageEventId$.outboundSchema = SelectMessageEventId$outboundSchema;
})(SelectMessageEventId$ || (SelectMessageEventId$ = {}));
export function selectMessageEventIdToJSON(selectMessageEventId) {
    return JSON.stringify(SelectMessageEventId$outboundSchema.parse(selectMessageEventId));
}
export function selectMessageEventIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectMessageEventId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectMessageEventId' from JSON`);
}
/** @internal */
export const SelectMessageEventUserId$inboundSchema = z.union([z.string(), z.number()]);
/** @internal */
export const SelectMessageEventUserId$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 SelectMessageEventUserId$;
(function (SelectMessageEventUserId$) {
    /** @deprecated use `SelectMessageEventUserId$inboundSchema` instead. */
    SelectMessageEventUserId$.inboundSchema = SelectMessageEventUserId$inboundSchema;
    /** @deprecated use `SelectMessageEventUserId$outboundSchema` instead. */
    SelectMessageEventUserId$.outboundSchema = SelectMessageEventUserId$outboundSchema;
})(SelectMessageEventUserId$ || (SelectMessageEventUserId$ = {}));
export function selectMessageEventUserIdToJSON(selectMessageEventUserId) {
    return JSON.stringify(SelectMessageEventUserId$outboundSchema.parse(selectMessageEventUserId));
}
export function selectMessageEventUserIdFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectMessageEventUserId$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectMessageEventUserId' from JSON`);
}
/** @internal */
export const SelectMessageEventUserProperties$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 SelectMessageEventUserProperties$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 SelectMessageEventUserProperties$;
(function (SelectMessageEventUserProperties$) {
    /** @deprecated use `SelectMessageEventUserProperties$inboundSchema` instead. */
    SelectMessageEventUserProperties$.inboundSchema = SelectMessageEventUserProperties$inboundSchema;
    /** @deprecated use `SelectMessageEventUserProperties$outboundSchema` instead. */
    SelectMessageEventUserProperties$.outboundSchema = SelectMessageEventUserProperties$outboundSchema;
})(SelectMessageEventUserProperties$ || (SelectMessageEventUserProperties$ = {}));
export function selectMessageEventUserPropertiesToJSON(selectMessageEventUserProperties) {
    return JSON.stringify(SelectMessageEventUserProperties$outboundSchema.parse(selectMessageEventUserProperties));
}
export function selectMessageEventUserPropertiesFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectMessageEventUserProperties$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectMessageEventUserProperties' from JSON`);
}
/** @internal */
export const SelectMessageEventEntityType$inboundSchema = z.nativeEnum(SelectMessageEventEntityType);
/** @internal */
export const SelectMessageEventEntityType$outboundSchema = SelectMessageEventEntityType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SelectMessageEventEntityType$;
(function (SelectMessageEventEntityType$) {
    /** @deprecated use `SelectMessageEventEntityType$inboundSchema` instead. */
    SelectMessageEventEntityType$.inboundSchema = SelectMessageEventEntityType$inboundSchema;
    /** @deprecated use `SelectMessageEventEntityType$outboundSchema` instead. */
    SelectMessageEventEntityType$.outboundSchema = SelectMessageEventEntityType$outboundSchema;
})(SelectMessageEventEntityType$ || (SelectMessageEventEntityType$ = {}));
/** @internal */
export const SelectMessageEvent$inboundSchema = z.object({
    id: z.string(),
    type: z.string(),
    messageId: 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(() => SelectMessageEventUserProperties$inboundSchema)).optional(),
    entityType: SelectMessageEventEntityType$inboundSchema,
});
/** @internal */
export const SelectMessageEvent$outboundSchema = z.object({
    id: z.string(),
    type: z.string(),
    messageId: 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(() => SelectMessageEventUserProperties$outboundSchema)).optional(),
    entityType: SelectMessageEventEntityType$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var SelectMessageEvent$;
(function (SelectMessageEvent$) {
    /** @deprecated use `SelectMessageEvent$inboundSchema` instead. */
    SelectMessageEvent$.inboundSchema = SelectMessageEvent$inboundSchema;
    /** @deprecated use `SelectMessageEvent$outboundSchema` instead. */
    SelectMessageEvent$.outboundSchema = SelectMessageEvent$outboundSchema;
})(SelectMessageEvent$ || (SelectMessageEvent$ = {}));
export function selectMessageEventToJSON(selectMessageEvent) {
    return JSON.stringify(SelectMessageEvent$outboundSchema.parse(selectMessageEvent));
}
export function selectMessageEventFromJSON(jsonString) {
    return safeParse(jsonString, (x) => SelectMessageEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SelectMessageEvent' from JSON`);
}
//# sourceMappingURL=selectmessageevent.js.map