/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
export const EntityType = {
    Message: "message",
};
/** @internal */
export const EntityType$inboundSchema = z
    .nativeEnum(EntityType);
/** @internal */
export const EntityType$outboundSchema = EntityType$inboundSchema;
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var EntityType$;
(function (EntityType$) {
    /** @deprecated use `EntityType$inboundSchema` instead. */
    EntityType$.inboundSchema = EntityType$inboundSchema;
    /** @deprecated use `EntityType$outboundSchema` instead. */
    EntityType$.outboundSchema = EntityType$outboundSchema;
})(EntityType$ || (EntityType$ = {}));
/** @internal */
export const InsertMessageEvent$inboundSchema = z.object({
    id: z.string().optional(),
    type: z.string(),
    messageId: 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.record(z.any())).optional(),
    entityType: EntityType$inboundSchema,
});
/** @internal */
export const InsertMessageEvent$outboundSchema = z.object({
    id: z.string().optional(),
    type: z.string(),
    messageId: 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.record(z.any())).optional(),
    entityType: EntityType$outboundSchema,
});
/**
 * @internal
 * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
 */
export var InsertMessageEvent$;
(function (InsertMessageEvent$) {
    /** @deprecated use `InsertMessageEvent$inboundSchema` instead. */
    InsertMessageEvent$.inboundSchema = InsertMessageEvent$inboundSchema;
    /** @deprecated use `InsertMessageEvent$outboundSchema` instead. */
    InsertMessageEvent$.outboundSchema = InsertMessageEvent$outboundSchema;
})(InsertMessageEvent$ || (InsertMessageEvent$ = {}));
export function insertMessageEventToJSON(insertMessageEvent) {
    return JSON.stringify(InsertMessageEvent$outboundSchema.parse(insertMessageEvent));
}
export function insertMessageEventFromJSON(jsonString) {
    return safeParse(jsonString, (x) => InsertMessageEvent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InsertMessageEvent' from JSON`);
}
//# sourceMappingURL=insertmessageevent.js.map