/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { employeeTaxSetupGetFederalTaxes } from "../funcs/employeeTaxSetupGetFederalTaxes.js"; import { employeeTaxSetupGetStateTaxes } from "../funcs/employeeTaxSetupGetStateTaxes.js"; import { employeeTaxSetupUpdateFederalTaxes } from "../funcs/employeeTaxSetupUpdateFederalTaxes.js"; import { employeeTaxSetupUpdateStateTaxes } from "../funcs/employeeTaxSetupUpdateStateTaxes.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { GetV1EmployeesEmployeeIdFederalTaxesRequest, GetV1EmployeesEmployeeIdFederalTaxesResponse, } from "../models/operations/getv1employeesemployeeidfederaltaxes.js"; import { GetV1EmployeesEmployeeIdStateTaxesRequest, GetV1EmployeesEmployeeIdStateTaxesResponse, } from "../models/operations/getv1employeesemployeeidstatetaxes.js"; import { PutV1EmployeesEmployeeIdFederalTaxesRequest, PutV1EmployeesEmployeeIdFederalTaxesResponse, } from "../models/operations/putv1employeesemployeeidfederaltaxes.js"; import { PutV1EmployeesEmployeeIdStateTaxesRequest, PutV1EmployeesEmployeeIdStateTaxesResponse, } from "../models/operations/putv1employeesemployeeidstatetaxes.js"; import { unwrapAsync } from "../types/fp.js"; export class EmployeeTaxSetup extends ClientSDK { /** * Get federal taxes for an employee * * @remarks * Returns federal tax information for an employee. The response structure varies based on the w4_data_type (pre_2020_w4 or rev_2020_w4). * * scope: `employee_federal_taxes:read` */ async getFederalTaxes( request: GetV1EmployeesEmployeeIdFederalTaxesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeTaxSetupGetFederalTaxes( this, request, options, )); } /** * Update federal taxes for an employee * * @remarks * Updates federal tax (W4) information for an employee. Only rev_2020_w4 format is accepted for updates. * * scope: `employee_federal_taxes:write` */ async updateFederalTaxes( request: PutV1EmployeesEmployeeIdFederalTaxesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeTaxSetupUpdateFederalTaxes( this, request, options, )); } /** * Get an employee's state taxes * * @remarks * Get attributes relevant for an employee's state taxes. * * The data required to correctly calculate an employee's state taxes varies by both home and work location. This API returns information about each question that must be answered grouped by state. Mostly commonly, an employee lives and works in the same state and will only have questions for a single state. The response contains metadata about each question, the type of answer expected, and the current answer stored in Gusto for that question. * * Answers are represented by an array. Today, this array can only be empty or contain exactly one element, but is designed to allow for forward compatibility with effective-dated fields. The `valid_from` and `valid_up_to` fields are optional and currently ignored. * * ## About filing new hire reports * Payroll Admins are responsible for filing a new hire report for each Employee. The `file_new_hire_report` question will only be listed if: * - the `employee.onboarding_status` is one of the following: * - `admin_onboarding_incomplete` * - `self_onboarding_awaiting_admin_review` * - that employee's work state requires filing a new hire report * * scope: `employee_state_taxes:read` */ async getStateTaxes( request: GetV1EmployeesEmployeeIdStateTaxesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeTaxSetupGetStateTaxes( this, request, options, )); } /** * Update an employee's state taxes * * @remarks * Update attributes relevant for an employee's state taxes. * * As described for the GET endpoint, the answers must be supplied in the effective-dated format, but currently only a single answer will be accepted. The `valid_from` and `valid_up_to` fields are optional and currently ignored. * * scope: `employee_state_taxes:write` */ async updateStateTaxes( request: PutV1EmployeesEmployeeIdStateTaxesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeTaxSetupUpdateStateTaxes( this, request, options, )); } }