/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The answer to the corresponding question - this may be a string, number, boolean, or null. */ export type Value = string | number | boolean; export type EmployeeStateTaxAnswer = { /** * The answer to the corresponding question - this may be a string, number, boolean, or null. */ value?: string | number | boolean | null | undefined; /** * The effective date of the answer - currently always “2010-01-01”. */ validFrom?: string | undefined; /** * The effective end date of the answer - currently always null. */ validUpTo?: string | null | undefined; }; /** @internal */ export const Value$inboundSchema: z.ZodType = z .union([z.string(), z.number(), z.boolean()]); 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 EmployeeStateTaxAnswer$inboundSchema: z.ZodType< EmployeeStateTaxAnswer, z.ZodTypeDef, unknown > = z.object({ value: z.nullable(z.union([z.string(), z.number(), z.boolean()])).optional(), valid_from: z.string().optional(), valid_up_to: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "valid_from": "validFrom", "valid_up_to": "validUpTo", }); }); export function employeeStateTaxAnswerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeStateTaxAnswer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeStateTaxAnswer' from JSON`, ); }