/* * 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"; /** * An allowed value to answer the question */ export type EmployeeStateTaxInputQuestionFormatValue = | string | boolean | number; export type Options = { /** * An allowed value to answer the question */ value?: string | boolean | number | undefined; /** * A display label that corresponds to the answer value */ label: string; }; export type EmployeeStateTaxInputQuestionFormat = { /** * Describes the type of question - Text, Number, Select, Currency, Date */ type: string; /** * For "Select" type questions, the allowed values and display labels. */ options?: Array | undefined; }; /** @internal */ export const EmployeeStateTaxInputQuestionFormatValue$inboundSchema: z.ZodType< EmployeeStateTaxInputQuestionFormatValue, z.ZodTypeDef, unknown > = z.union([z.string(), z.boolean(), z.number()]); export function employeeStateTaxInputQuestionFormatValueFromJSON( jsonString: string, ): SafeParseResult< EmployeeStateTaxInputQuestionFormatValue, SDKValidationError > { return safeParse( jsonString, (x) => EmployeeStateTaxInputQuestionFormatValue$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'EmployeeStateTaxInputQuestionFormatValue' from JSON`, ); } /** @internal */ export const Options$inboundSchema: z.ZodType = z.object({ value: z.union([z.string(), z.boolean(), z.number()]).optional(), label: z.string(), }); export function optionsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Options$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Options' from JSON`, ); } /** @internal */ export const EmployeeStateTaxInputQuestionFormat$inboundSchema: z.ZodType< EmployeeStateTaxInputQuestionFormat, z.ZodTypeDef, unknown > = z.object({ type: z.string(), options: z.array(z.lazy(() => Options$inboundSchema)).optional(), }); export function employeeStateTaxInputQuestionFormatFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeStateTaxInputQuestionFormat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeStateTaxInputQuestionFormat' from JSON`, ); }