/* * 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"; /** * Federal tax information for employees using the pre-2020 W4 form. */ export type EmployeeFederalTaxPre2020 = { /** * The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. */ version: string; /** * The UUID of the employee. */ employeeUuid?: string | undefined; /** * The internal ID of the employee. */ employeeId?: number | undefined; /** * The internal ID of the company. */ companyId?: number | undefined; /** * The version of w4 form. */ w4DataType: "pre_2020_w4"; /** * It determines which tax return form an individual will use and is an important factor in computing taxable income. One of: * * @remarks * - Single * - Married * - Head of Household * - Exempt from withholding * - Married, but withhold as Single */ filingStatus?: string | null | undefined; /** * An exemption from paying a certain amount of income tax. May be null when filing_status is "Exempt from withholding". */ federalWithholdingAllowance?: number | null | undefined; /** * An additional withholding dollar amount. */ additionalWithholding: string; }; /** @internal */ export const EmployeeFederalTaxPre2020$inboundSchema: z.ZodType< EmployeeFederalTaxPre2020, z.ZodTypeDef, unknown > = z.object({ version: z.string(), employee_uuid: z.string().optional(), employee_id: z.number().int().optional(), company_id: z.number().int().optional(), w4_data_type: z.literal("pre_2020_w4"), filing_status: z.nullable(z.string()).optional(), federal_withholding_allowance: z.nullable(z.number()).optional(), additional_withholding: z.string(), }).transform((v) => { return remap$(v, { "employee_uuid": "employeeUuid", "employee_id": "employeeId", "company_id": "companyId", "w4_data_type": "w4DataType", "filing_status": "filingStatus", "federal_withholding_allowance": "federalWithholdingAllowance", "additional_withholding": "additionalWithholding", }); }); export function employeeFederalTaxPre2020FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeFederalTaxPre2020$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeFederalTaxPre2020' from JSON`, ); }