/* * 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"; export type Five = string | number | boolean | { [k: string]: any }; export type Four = {}; /** * Value that failed validation */ export type Value = | string | number | boolean | Four | Array; export type ConstraintValidation = { /** * List of validation error messages */ messages: Array; /** * Value that failed validation */ value?: | string | number | boolean | Four | Array | null | undefined; }; /** @internal */ export const Five$inboundSchema: z.ZodType = z .union([z.string(), z.number(), z.boolean(), z.record(z.any())]); export function fiveFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Five$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Five' from JSON`, ); } /** @internal */ export const Four$inboundSchema: z.ZodType = z .object({}); export function fourFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Four$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Four' from JSON`, ); } /** @internal */ export const Value$inboundSchema: z.ZodType = z .union([ z.string(), z.number(), z.boolean(), z.lazy(() => Four$inboundSchema), z.array( z.nullable( z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]), ), ), ]); export function valueFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Value$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Value' from JSON`, ); } /** @internal */ export const ConstraintValidation$inboundSchema: z.ZodType< ConstraintValidation, z.ZodTypeDef, unknown > = z.object({ messages: z.array(z.string()), value: z.nullable( z.union([ z.string(), z.number(), z.boolean(), z.lazy(() => Four$inboundSchema), z.array( z.nullable( z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]), ), ), ]), ).optional(), }); export function constraintValidationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConstraintValidation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConstraintValidation' from JSON`, ); }