/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { EmployeeFederalTax, EmployeeFederalTax$inboundSchema, } from "../components/employeefederaltax.js"; import { HTTPMetadata, HTTPMetadata$inboundSchema, } from "../components/httpmetadata.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ export const PutV1EmployeesEmployeeIdFederalTaxesHeaderXGustoAPIVersion = { TwoThousandAndTwentyFiveMinus06Minus15: "2025-06-15", } as const; /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ export type PutV1EmployeesEmployeeIdFederalTaxesHeaderXGustoAPIVersion = ClosedEnum; /** * The version of the W4 form. Only rev_2020_w4 is accepted for updates. */ export const W4DataType = { Rev2020W4: "rev_2020_w4", } as const; /** * The version of the W4 form. Only rev_2020_w4 is accepted for updates. */ export type W4DataType = ClosedEnum; /** * Determines which tax return form an individual will use. One of: Single, Married, Head of Household, Exempt from withholding. */ export const FilingStatus = { Single: "Single", Married: "Married", HeadOfHousehold: "Head of Household", ExemptFromWithholding: "Exempt from withholding", } as const; /** * Determines which tax return form an individual will use. One of: Single, Married, Head of Household, Exempt from withholding. */ export type FilingStatus = ClosedEnum; export type PutV1EmployeesEmployeeIdFederalTaxesRequestBody = { /** * The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/versioning#object-layer) for information on how to use this field. */ version: string; /** * The version of the W4 form. Only rev_2020_w4 is accepted for updates. */ w4DataType: W4DataType; /** * Determines which tax return form an individual will use. One of: Single, Married, Head of Household, Exempt from withholding. */ filingStatus: FilingStatus; /** * If there are only two jobs (e.g., you and your spouse each have a job), set to true. */ twoJobs?: boolean | undefined; /** * Amount for dependents; a dependent entitles the taxpayer to claim a dependency exemption. */ dependentsAmount?: number | undefined; /** * Other income amount. */ otherIncome?: number | undefined; /** * Deductions other than the standard deduction to reduce withholding. */ deductions?: number | undefined; /** * Additional amount to be withheld from each paycheck. */ extraWithholding?: number | undefined; /** * Only applicable when w4_data_type is 'pre_2020_w4' (pre-2020 W4 forms are deprecated for updates). */ federalWithholdingAllowance?: number | undefined; /** * Only applicable when w4_data_type is 'pre_2020_w4' (pre-2020 W4 forms are deprecated for updates). */ additionalWithholding?: number | undefined; }; export type PutV1EmployeesEmployeeIdFederalTaxesRequest = { /** * Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. */ xGustoAPIVersion?: | PutV1EmployeesEmployeeIdFederalTaxesHeaderXGustoAPIVersion | undefined; /** * The UUID of the employee */ employeeUuid: string; requestBody: PutV1EmployeesEmployeeIdFederalTaxesRequestBody; }; export type PutV1EmployeesEmployeeIdFederalTaxesResponse = { httpMeta: HTTPMetadata; /** * Successful */ employeeFederalTax?: EmployeeFederalTax | undefined; }; /** @internal */ export const PutV1EmployeesEmployeeIdFederalTaxesHeaderXGustoAPIVersion$outboundSchema: z.ZodNativeEnum< typeof PutV1EmployeesEmployeeIdFederalTaxesHeaderXGustoAPIVersion > = z.nativeEnum(PutV1EmployeesEmployeeIdFederalTaxesHeaderXGustoAPIVersion); /** @internal */ export const W4DataType$outboundSchema: z.ZodNativeEnum = z .nativeEnum(W4DataType); /** @internal */ export const FilingStatus$outboundSchema: z.ZodNativeEnum = z.nativeEnum(FilingStatus); /** @internal */ export type PutV1EmployeesEmployeeIdFederalTaxesRequestBody$Outbound = { version: string; w4_data_type: string; filing_status: string; two_jobs?: boolean | undefined; dependents_amount?: number | undefined; other_income?: number | undefined; deductions?: number | undefined; extra_withholding?: number | undefined; federal_withholding_allowance?: number | undefined; additional_withholding?: number | undefined; }; /** @internal */ export const PutV1EmployeesEmployeeIdFederalTaxesRequestBody$outboundSchema: z.ZodType< PutV1EmployeesEmployeeIdFederalTaxesRequestBody$Outbound, z.ZodTypeDef, PutV1EmployeesEmployeeIdFederalTaxesRequestBody > = z.object({ version: z.string(), w4DataType: W4DataType$outboundSchema, filingStatus: FilingStatus$outboundSchema, twoJobs: z.boolean().optional(), dependentsAmount: z.number().optional(), otherIncome: z.number().optional(), deductions: z.number().optional(), extraWithholding: z.number().optional(), federalWithholdingAllowance: z.number().int().optional(), additionalWithholding: z.number().optional(), }).transform((v) => { return remap$(v, { w4DataType: "w4_data_type", filingStatus: "filing_status", twoJobs: "two_jobs", dependentsAmount: "dependents_amount", otherIncome: "other_income", extraWithholding: "extra_withholding", federalWithholdingAllowance: "federal_withholding_allowance", additionalWithholding: "additional_withholding", }); }); export function putV1EmployeesEmployeeIdFederalTaxesRequestBodyToJSON( putV1EmployeesEmployeeIdFederalTaxesRequestBody: PutV1EmployeesEmployeeIdFederalTaxesRequestBody, ): string { return JSON.stringify( PutV1EmployeesEmployeeIdFederalTaxesRequestBody$outboundSchema.parse( putV1EmployeesEmployeeIdFederalTaxesRequestBody, ), ); } /** @internal */ export type PutV1EmployeesEmployeeIdFederalTaxesRequest$Outbound = { "X-Gusto-API-Version": string; employee_uuid: string; RequestBody: PutV1EmployeesEmployeeIdFederalTaxesRequestBody$Outbound; }; /** @internal */ export const PutV1EmployeesEmployeeIdFederalTaxesRequest$outboundSchema: z.ZodType< PutV1EmployeesEmployeeIdFederalTaxesRequest$Outbound, z.ZodTypeDef, PutV1EmployeesEmployeeIdFederalTaxesRequest > = z.object({ xGustoAPIVersion: PutV1EmployeesEmployeeIdFederalTaxesHeaderXGustoAPIVersion$outboundSchema .default("2025-06-15"), employeeUuid: z.string(), requestBody: z.lazy(() => PutV1EmployeesEmployeeIdFederalTaxesRequestBody$outboundSchema ), }).transform((v) => { return remap$(v, { xGustoAPIVersion: "X-Gusto-API-Version", employeeUuid: "employee_uuid", requestBody: "RequestBody", }); }); export function putV1EmployeesEmployeeIdFederalTaxesRequestToJSON( putV1EmployeesEmployeeIdFederalTaxesRequest: PutV1EmployeesEmployeeIdFederalTaxesRequest, ): string { return JSON.stringify( PutV1EmployeesEmployeeIdFederalTaxesRequest$outboundSchema.parse( putV1EmployeesEmployeeIdFederalTaxesRequest, ), ); } /** @internal */ export const PutV1EmployeesEmployeeIdFederalTaxesResponse$inboundSchema: z.ZodType< PutV1EmployeesEmployeeIdFederalTaxesResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: HTTPMetadata$inboundSchema, "Employee-Federal-Tax": EmployeeFederalTax$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Employee-Federal-Tax": "employeeFederalTax", }); }); export function putV1EmployeesEmployeeIdFederalTaxesResponseFromJSON( jsonString: string, ): SafeParseResult< PutV1EmployeesEmployeeIdFederalTaxesResponse, SDKValidationError > { return safeParse( jsonString, (x) => PutV1EmployeesEmployeeIdFederalTaxesResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'PutV1EmployeesEmployeeIdFederalTaxesResponse' from JSON`, ); }