/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { earningTypesCreate } from "../funcs/earningTypesCreate.js"; import { earningTypesDelete } from "../funcs/earningTypesDelete.js"; import { earningTypesList } from "../funcs/earningTypesList.js"; import { earningTypesUpdate } from "../funcs/earningTypesUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { DeleteV1CompaniesCompanyIdEarningTypesEarningTypeUuidRequest, DeleteV1CompaniesCompanyIdEarningTypesEarningTypeUuidResponse, } from "../models/operations/deletev1companiescompanyidearningtypesearningtypeuuid.js"; import { GetV1CompaniesCompanyIdEarningTypesRequest, GetV1CompaniesCompanyIdEarningTypesResponse, } from "../models/operations/getv1companiescompanyidearningtypes.js"; import { PostV1CompaniesCompanyIdEarningTypesRequest, PostV1CompaniesCompanyIdEarningTypesResponse, } from "../models/operations/postv1companiescompanyidearningtypes.js"; import { PutV1CompaniesCompanyIdEarningTypesEarningTypeUuidRequest, PutV1CompaniesCompanyIdEarningTypesEarningTypeUuidResponse, } from "../models/operations/putv1companiescompanyidearningtypesearningtypeuuid.js"; import { unwrapAsync } from "../types/fp.js"; export class EarningTypes extends ClientSDK { /** * Get all earning types for a company * * @remarks * A payroll item in Gusto is associated to an earning type to name the type of earning described by the payroll item. * * #### Default Earning Type * Certain earning types are special because they have tax considerations. Those earning types are mostly the same for every company depending on its legal structure (LLC, Corporation, etc.) * * #### Custom Earning Type * Custom earning types are all the other earning types added specifically for a company. * * scope: `payrolls:read` */ async list( request: GetV1CompaniesCompanyIdEarningTypesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(earningTypesList( this, request, options, )); } /** * Create a custom earning type * * @remarks * Create a custom earning type. * * If an inactive earning type exists with the same name, this will reactivate it instead of creating a new one. * * scope: `payrolls:write` */ async create( request: PostV1CompaniesCompanyIdEarningTypesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(earningTypesCreate( this, request, options, )); } /** * Update an earning type * * @remarks * Update an earning type. * * scope: `payrolls:write` */ async update( request: PutV1CompaniesCompanyIdEarningTypesEarningTypeUuidRequest, options?: RequestOptions, ): Promise { return unwrapAsync(earningTypesUpdate( this, request, options, )); } /** * Deactivate an earning type * * @remarks * Deactivate an earning type. * * scope: `payrolls:write` */ async delete( request: DeleteV1CompaniesCompanyIdEarningTypesEarningTypeUuidRequest, options?: RequestOptions, ): Promise { return unwrapAsync(earningTypesDelete( this, request, options, )); } }