/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { employeeEmploymentsCreateRehire } from "../funcs/employeeEmploymentsCreateRehire.js"; import { employeeEmploymentsCreateTermination } from "../funcs/employeeEmploymentsCreateTermination.js"; import { employeeEmploymentsDeleteRehire } from "../funcs/employeeEmploymentsDeleteRehire.js"; import { employeeEmploymentsDeleteTermination } from "../funcs/employeeEmploymentsDeleteTermination.js"; import { employeeEmploymentsGetHistory } from "../funcs/employeeEmploymentsGetHistory.js"; import { employeeEmploymentsGetRehire } from "../funcs/employeeEmploymentsGetRehire.js"; import { employeeEmploymentsGetTerminations } from "../funcs/employeeEmploymentsGetTerminations.js"; import { employeeEmploymentsGetV1TerminationsEmployeeId } from "../funcs/employeeEmploymentsGetV1TerminationsEmployeeId.js"; import { employeeEmploymentsRehire } from "../funcs/employeeEmploymentsRehire.js"; import { employeeEmploymentsUpdateTermination } from "../funcs/employeeEmploymentsUpdateTermination.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { DeleteV1EmployeesEmployeeIdRehireRequest, DeleteV1EmployeesEmployeeIdRehireResponse, } from "../models/operations/deletev1employeesemployeeidrehire.js"; import { DeleteV1EmployeesEmployeeIdTerminationsRequest, DeleteV1EmployeesEmployeeIdTerminationsResponse, } from "../models/operations/deletev1employeesemployeeidterminations.js"; import { GetV1EmployeesEmployeeIdEmploymentHistoryRequest, GetV1EmployeesEmployeeIdEmploymentHistoryResponse, } from "../models/operations/getv1employeesemployeeidemploymenthistory.js"; import { GetV1EmployeesEmployeeIdRehireRequest, GetV1EmployeesEmployeeIdRehireResponse, } from "../models/operations/getv1employeesemployeeidrehire.js"; import { GetV1EmployeesEmployeeIdTerminationsRequest, GetV1EmployeesEmployeeIdTerminationsResponse, } from "../models/operations/getv1employeesemployeeidterminations.js"; import { GetV1TerminationsEmployeeIdRequest, GetV1TerminationsEmployeeIdResponse, } from "../models/operations/getv1terminationsemployeeid.js"; import { PostV1EmployeesEmployeeIdRehireRequest, PostV1EmployeesEmployeeIdRehireResponse, } from "../models/operations/postv1employeesemployeeidrehire.js"; import { PostV1EmployeesEmployeeIdTerminationsRequest, PostV1EmployeesEmployeeIdTerminationsResponse, } from "../models/operations/postv1employeesemployeeidterminations.js"; import { PutV1EmployeesEmployeeIdRehireRequest, PutV1EmployeesEmployeeIdRehireResponse, } from "../models/operations/putv1employeesemployeeidrehire.js"; import { PutV1TerminationsEmployeeIdRequest, PutV1TerminationsEmployeeIdResponse, } from "../models/operations/putv1terminationsemployeeid.js"; import { unwrapAsync } from "../types/fp.js"; export class EmployeeEmployments extends ClientSDK { /** * Get terminations for an employee * * @remarks * Terminations are created whenever an employee is scheduled to leave the company. The only things required are an effective date (their last day of work) and whether they should receive their wages in a one-off termination payroll or with the rest of the company. * * Note that some states require employees to receive their final wages within 24 hours (unless they consent otherwise,) in which case running a one-off payroll may be the only option. * * scope: `employments:read` */ async getTerminations( request: GetV1EmployeesEmployeeIdTerminationsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeEmploymentsGetTerminations( this, request, options, )); } /** * Create an employee termination * * @remarks * Create a termination for an employee. The only things required are an effective date (their last day of work) and whether they should receive their wages in a one-off termination payroll or with the rest of the company. * * Note that some states require employees to receive their final wages within 24 hours (unless they consent otherwise,) in which case running a one-off payroll may be the only option. * * scope: `employments:write` */ async createTermination( request: PostV1EmployeesEmployeeIdTerminationsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeEmploymentsCreateTermination( this, request, options, )); } /** * Delete an employee termination * * @remarks * Delete an employee termination. * * scope: `employments:write` */ async deleteTermination( request: DeleteV1EmployeesEmployeeIdTerminationsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeEmploymentsDeleteTermination( this, request, options, )); } /** * Update an employee termination * * @remarks * Terminations are created whenever an employee is scheduled to leave the company. The only things required are an effective date (their last day of work) and whether they should receive their wages in a one-off termination payroll or with the rest of the company. * * Note that some states require employees to receive their final wages within 24 hours (unless they consent otherwise,) in which case running a one-off payroll may be the only option. * * scope: `employments:write` */ async updateTermination( request: PutV1TerminationsEmployeeIdRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeEmploymentsUpdateTermination( this, request, options, )); } /** * Get an employee rehire * * @remarks * Retrieve an employee's rehire, which contains information on when the employee returns to work. * * scope: `employments:read` */ async getRehire( request: GetV1EmployeesEmployeeIdRehireRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeEmploymentsGetRehire( this, request, options, )); } /** * Create an employee rehire * * @remarks * Rehire is created whenever an employee is scheduled to return to the company. * * scope: `employments:write` */ async createRehire( request: PostV1EmployeesEmployeeIdRehireRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeEmploymentsCreateRehire( this, request, options, )); } /** * Update an employee rehire * * @remarks * Update an employee's rehire. * * scope: `employments:write` */ async rehire( request: PutV1EmployeesEmployeeIdRehireRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeEmploymentsRehire( this, request, options, )); } /** * Delete an employee rehire * * @remarks * Delete an employee rehire. An employee rehire cannot be deleted if it's active (past effective date). * * scope: `employments:write` */ async deleteRehire( request: DeleteV1EmployeesEmployeeIdRehireRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeEmploymentsDeleteRehire( this, request, options, )); } /** * Get employment history for an employee * * @remarks * Retrieve the employment history for a given employee, which includes termination and rehire. * * scope: `employments:read` */ async getHistory( request: GetV1EmployeesEmployeeIdEmploymentHistoryRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeEmploymentsGetHistory( this, request, options, )); } /** * Get an employee termination * * @remarks * Terminations are created whenever an employee is scheduled to leave the company. The only things required are an effective date (their last day of work) and whether they should receive their wages in a one-off termination payroll or with the rest of the company. * * Note that some states require employees to receive their final wages within 24 hours (unless they consent otherwise,) in which case running a one-off payroll may be the only option. * * scope: `employments:read` */ async getV1TerminationsEmployeeId( request: GetV1TerminationsEmployeeIdRequest, options?: RequestOptions, ): Promise { return unwrapAsync(employeeEmploymentsGetV1TerminationsEmployeeId( this, request, options, )); } }