/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type EventType = { /** * Creation timestamp of the object. */ createdAt: Date; /** * Last modification timestamp of the object. */ modifiedAt: Date | null; /** * The ID of the object. */ id: string; /** * The name of the event type. */ name: string; /** * The label for the event type. */ label: string; /** * Property path to extract dynamic label from event metadata. */ labelPropertySelector?: string | null | undefined; /** * The ID of the organization owning the event type. */ organizationId: string; }; /** @internal */ export const EventType$inboundSchema: z.ZodMiniType = z .pipe( z.object({ created_at: z.pipe( z.iso.datetime({ offset: true }), z.transform(v => new Date(v)), ), modified_at: z.nullable( z.pipe(z.iso.datetime({ offset: true }), z.transform(v => new Date(v))), ), id: z.string(), name: z.string(), label: z.string(), label_property_selector: z.optional(z.nullable(z.string())), organization_id: z.string(), }), z.transform((v) => { return remap$(v, { "created_at": "createdAt", "modified_at": "modifiedAt", "label_property_selector": "labelPropertySelector", "organization_id": "organizationId", }); }), ); export function eventTypeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventType' from JSON`, ); }