/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Describes an available event type that can be subscribed to. */ export type EventType = { /** * Unique identifier for the event type. */ eventTypeID: string; /** * The type identifier string. */ type: string; /** * A human-readable description of the event type. */ description: string; }; /** @internal */ export const EventType$inboundSchema: z.ZodType< EventType, z.ZodTypeDef, unknown > = z.object({ eventTypeID: z.string(), type: z.string(), description: z.string(), }); /** @internal */ export type EventType$Outbound = { eventTypeID: string; type: string; description: string; }; /** @internal */ export const EventType$outboundSchema: z.ZodType< EventType$Outbound, z.ZodTypeDef, EventType > = z.object({ eventTypeID: z.string(), type: z.string(), description: z.string(), }); export function eventTypeToJSON(eventType: EventType): string { return JSON.stringify(EventType$outboundSchema.parse(eventType)); } export function eventTypeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EventType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventType' from JSON`, ); }