/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type Event = { customerId?: string | undefined; environmentId?: string | undefined; eventName?: string | undefined; externalCustomerId?: string | undefined; id?: string | undefined; properties?: { [k: string]: any } | undefined; source?: string | undefined; timestamp?: string | undefined; }; /** @internal */ export const Event$inboundSchema: z.ZodMiniType = z.pipe( z.object({ customer_id: types.optional(types.string()), environment_id: types.optional(types.string()), event_name: types.optional(types.string()), external_customer_id: types.optional(types.string()), id: types.optional(types.string()), properties: types.optional(z.record(z.string(), z.any())), source: types.optional(types.string()), timestamp: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "customer_id": "customerId", "environment_id": "environmentId", "event_name": "eventName", "external_customer_id": "externalCustomerId", }); }), ); export function eventFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Event$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Event' from JSON`, ); }