/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; 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.ZodMiniType, unknown> { const options = Object.values(enumObj); return z.union([ ...options.map(x => z.literal(x)), z.pipe(z.string(), z.transform(x => unrecognized(x))), ] as any); } export function inboundSchemaInt>( enumObj: T, ): z.ZodMiniType, 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.pipe(z.int(), z.transform(x => unrecognized(x))), ] as any); } export function outboundSchema>( _: T, ): z.ZodMiniType> { return z.string() as any; } export function outboundSchemaInt>( _: T, ): z.ZodMiniType> { return z.int() as any; }