/* * 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 Value = string | Array; export type CustomField = { label: string; value: string | Array; }; /** @internal */ export const Value$inboundSchema: z.ZodType = z .union([z.string(), z.array(z.string())]); 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 CustomField$inboundSchema: z.ZodType< CustomField, z.ZodTypeDef, unknown > = z.object({ label: z.string(), value: z.union([z.string(), z.array(z.string())]), }); export function customFieldFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomField$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomField' from JSON`, ); }