/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { Unrecognized, unrecognized } from "./unrecognized.js"; export type ClosedEnum>> = T[keyof T]; export type OpenEnum>> = | T[keyof T] | Unrecognized; export function inboundSchema>( enumObj: T, ): z.ZodType, z.ZodTypeDef, unknown> { const options = Object.values(enumObj); return z.union([ ...options.map(x => z.literal(x)), z.string().transform(x => unrecognized(x)), ] as any); } export function inboundSchemaInt>( enumObj: T, ): z.ZodType, z.ZodTypeDef, unknown> { // For numeric enums, Object.values returns both numbers and string keys const options = Object.values(enumObj).filter(v => typeof v === "number"); return z.union([ ...options.map(x => z.literal(x)), z.number().int().transform(x => unrecognized(x)), ] as any); } export function outboundSchema>( _: T, ): z.ZodType> { return z.string() as any; } export function outboundSchemaInt>( _: T, ): z.ZodType> { return z.number().int() as any; }