/* * 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"; import { EmployeeStateTaxAnswer, EmployeeStateTaxAnswer$inboundSchema, } from "./employeestatetaxanswer.js"; import { EmployeeStateTaxInputQuestionFormat, EmployeeStateTaxInputQuestionFormat$inboundSchema, } from "./employeestatetaxinputquestionformat.js"; export type EmployeeStateTaxQuestion = { /** * A short title for the question */ label: string; /** * An explaination of the question - this may contain inline html formatted links. */ description: string | null; /** * A unique identifier of the question (for the given state) - used for updating the answer. */ key: string; isQuestionForAdminOnly: boolean; inputQuestionFormat: EmployeeStateTaxInputQuestionFormat; answers: Array; }; /** @internal */ export const EmployeeStateTaxQuestion$inboundSchema: z.ZodType< EmployeeStateTaxQuestion, z.ZodTypeDef, unknown > = z.object({ label: z.string(), description: z.nullable(z.string()), key: z.string(), is_question_for_admin_only: z.boolean(), input_question_format: EmployeeStateTaxInputQuestionFormat$inboundSchema, answers: z.array(EmployeeStateTaxAnswer$inboundSchema), }).transform((v) => { return remap$(v, { "is_question_for_admin_only": "isQuestionForAdminOnly", "input_question_format": "inputQuestionFormat", }); }); export function employeeStateTaxQuestionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeStateTaxQuestion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeStateTaxQuestion' from JSON`, ); }