/* * 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"; import { UiComponentEnum, UiComponentEnum$inboundSchema, } from "./uicomponentenum.js"; export type Placeholder5 = string | number | boolean | { [k: string]: any }; /** * Placeholder for the UI Schema Property */ export type Placeholder = | string | number | boolean | { [k: string]: any } | Array; export type UiSchemaProperty = { /** * Placeholder for the UI Schema Property */ placeholder?: | string | number | boolean | { [k: string]: any } | Array | null | undefined; /** * Component type for the UI Schema Property */ component: UiComponentEnum; /** * Properties of the UI Schema */ properties?: { [k: string]: UiSchemaProperty } | undefined; }; /** @internal */ export const Placeholder5$inboundSchema: z.ZodType< Placeholder5, z.ZodTypeDef, unknown > = z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]); export function placeholder5FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Placeholder5$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Placeholder5' from JSON`, ); } /** @internal */ export const Placeholder$inboundSchema: z.ZodType< Placeholder, z.ZodTypeDef, unknown > = z.union([ z.string(), z.number(), z.boolean(), z.record(z.any()), z.array(z.union([z.string(), z.number(), z.boolean(), z.record(z.any())])), ]); export function placeholderFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Placeholder$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Placeholder' from JSON`, ); } /** @internal */ export const UiSchemaProperty$inboundSchema: z.ZodType< UiSchemaProperty, z.ZodTypeDef, unknown > = z.object({ placeholder: z.nullable( z.union([ z.string(), z.number(), z.boolean(), z.record(z.any()), z.array( z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]), ), ]), ).optional(), component: UiComponentEnum$inboundSchema, properties: z.record(z.lazy(() => UiSchemaProperty$inboundSchema)).optional(), }); export function uiSchemaPropertyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UiSchemaProperty$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UiSchemaProperty' from JSON`, ); }