/* * 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 revised 2020 W4 form. */ export type EmployeeFederalTaxRev2020 = { /** * 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: "rev_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 */ filingStatus: string | null; /** * An employee can request an additional amount to be withheld from each paycheck. */ extraWithholding: string | null; /** * If there are only two jobs (i.e., you and your spouse each have a job, or you have two), you can set it to true. */ twoJobs: boolean | null; /** * A dependent is a person other than the taxpayer or spouse who entitles the taxpayer to claim a dependency exemption. */ dependentsAmount: string | null; /** * Other income amount. */ otherIncome: string | null; /** * Deductions other than the standard deduction to reduce withholding. */ deductions: string | null; }; /** @internal */ export const EmployeeFederalTaxRev2020$inboundSchema: z.ZodType< EmployeeFederalTaxRev2020, 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("rev_2020_w4"), filing_status: z.nullable(z.string()), extra_withholding: z.nullable(z.string()), two_jobs: z.nullable(z.boolean()), dependents_amount: z.nullable(z.string()), other_income: z.nullable(z.string()), deductions: z.nullable(z.string()), }).transform((v) => { return remap$(v, { "employee_uuid": "employeeUuid", "employee_id": "employeeId", "company_id": "companyId", "w4_data_type": "w4DataType", "filing_status": "filingStatus", "extra_withholding": "extraWithholding", "two_jobs": "twoJobs", "dependents_amount": "dependentsAmount", "other_income": "otherIncome", }); }); export function employeeFederalTaxRev2020FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EmployeeFederalTaxRev2020$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EmployeeFederalTaxRev2020' from JSON`, ); }