/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { contractorPaymentGroupsCreate } from "../funcs/contractorPaymentGroupsCreate.js"; import { contractorPaymentGroupsDelete } from "../funcs/contractorPaymentGroupsDelete.js"; import { contractorPaymentGroupsFund } from "../funcs/contractorPaymentGroupsFund.js"; import { contractorPaymentGroupsGet } from "../funcs/contractorPaymentGroupsGet.js"; import { contractorPaymentGroupsGetList } from "../funcs/contractorPaymentGroupsGetList.js"; import { contractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursements } from "../funcs/contractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursements.js"; import { contractorPaymentGroupsPatchV1ContractorPaymentGroupsIdPartnerDisbursements } from "../funcs/contractorPaymentGroupsPatchV1ContractorPaymentGroupsIdPartnerDisbursements.js"; import { contractorPaymentGroupsPreview } from "../funcs/contractorPaymentGroupsPreview.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { DeleteV1ContractorPaymentGroupsContractorPaymentGroupIdRequest, DeleteV1ContractorPaymentGroupsContractorPaymentGroupIdResponse, } from "../models/operations/deletev1contractorpaymentgroupscontractorpaymentgroupid.js"; import { GetV1CompaniesCompanyIdContractorPaymentGroupsRequest, GetV1CompaniesCompanyIdContractorPaymentGroupsResponse, } from "../models/operations/getv1companiescompanyidcontractorpaymentgroups.js"; import { GetV1ContractorPaymentGroupsContractorPaymentGroupIdRequest, GetV1ContractorPaymentGroupsContractorPaymentGroupIdResponse, } from "../models/operations/getv1contractorpaymentgroupscontractorpaymentgroupid.js"; import { GetV1ContractorPaymentGroupsIdPartnerDisbursementsRequest, GetV1ContractorPaymentGroupsIdPartnerDisbursementsResponse, } from "../models/operations/getv1contractorpaymentgroupsidpartnerdisbursements.js"; import { PatchV1ContractorPaymentGroupsIdPartnerDisbursementsRequest, PatchV1ContractorPaymentGroupsIdPartnerDisbursementsResponse, } from "../models/operations/patchv1contractorpaymentgroupsidpartnerdisbursements.js"; import { PostV1CompaniesCompanyIdContractorPaymentGroupsRequest, PostV1CompaniesCompanyIdContractorPaymentGroupsResponse, } from "../models/operations/postv1companiescompanyidcontractorpaymentgroups.js"; import { PostV1CompaniesCompanyIdContractorPaymentGroupsPreviewRequest, PostV1CompaniesCompanyIdContractorPaymentGroupsPreviewResponse, } from "../models/operations/postv1companiescompanyidcontractorpaymentgroupspreview.js"; import { PutV1ContractorPaymentGroupsContractorPaymentGroupIdFundRequest, PutV1ContractorPaymentGroupsContractorPaymentGroupIdFundResponse, } from "../models/operations/putv1contractorpaymentgroupscontractorpaymentgroupidfund.js"; import { unwrapAsync } from "../types/fp.js"; export class ContractorPaymentGroups extends ClientSDK { /** * Get contractor payment groups for a company * * @remarks * Returns a list of minimal contractor payment groups within a given time period, including totals but not associated contractor payments. * * scope: `payrolls:read` */ async getList( request: GetV1CompaniesCompanyIdContractorPaymentGroupsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(contractorPaymentGroupsGetList( this, request, options, )); } /** * Create a contractor payment group * * @remarks * Pay a group of contractors. Information needed depends on the contractor's wage type (hourly vs fixed) * * scope: `payrolls:run` */ async create( request: PostV1CompaniesCompanyIdContractorPaymentGroupsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(contractorPaymentGroupsCreate( this, request, options, )); } /** * Preview a contractor payment group * * @remarks * Preview a group of contractor payments. Request will validate inputs and return preview of the contractor payment group including the expected `debit_date`. The `uuid` field will be null in the response. * * The returned `creation_token` is a required parameter in order to create the contractor payment group. * * scope: `payrolls:read` */ async preview( request: PostV1CompaniesCompanyIdContractorPaymentGroupsPreviewRequest, options?: RequestOptions, ): Promise { return unwrapAsync(contractorPaymentGroupsPreview( this, request, options, )); } /** * Get a contractor payment group * * @remarks * Returns a contractor payment group with all associated contractor payments. * * scope: `payrolls:read` */ async get( request: GetV1ContractorPaymentGroupsContractorPaymentGroupIdRequest, options?: RequestOptions, ): Promise { return unwrapAsync(contractorPaymentGroupsGet( this, request, options, )); } /** * Cancel a contractor payment group * * @remarks * Cancels a contractor payment group and all associated contractor payments. All contractor payments must be cancellable, unfunded. * * scope: `payrolls:run` */ async delete( request: DeleteV1ContractorPaymentGroupsContractorPaymentGroupIdRequest, options?: RequestOptions, ): Promise { return unwrapAsync(contractorPaymentGroupsDelete( this, request, options, )); } /** * Fund a contractor payment group [DEMO] * * @remarks * > 🚧 Demo action * > This action is only available in the Demo environment * * Simulate funding a contractor payment group. Funding only occurs automatically in the production environment when bank transactions are generated. Use this action in the demo environment to transition a contractor payment group's `status` from `Unfunded` to `Funded`. A `Funded` status is required for generating a contractor payment receipt. * * scope: `payrolls:run` */ async fund( request: PutV1ContractorPaymentGroupsContractorPaymentGroupIdFundRequest, options?: RequestOptions, ): Promise { return unwrapAsync(contractorPaymentGroupsFund( this, request, options, )); } /** * Get partner disbursements for a contractor payment group * * @remarks * Get partner disbursements for a specific contractor payment group. * * scope: `partner_disbursements:read` */ async getV1ContractorPaymentGroupsIdPartnerDisbursements( request: GetV1ContractorPaymentGroupsIdPartnerDisbursementsRequest, options?: RequestOptions, ): Promise { return unwrapAsync( contractorPaymentGroupsGetV1ContractorPaymentGroupsIdPartnerDisbursements( this, request, options, ), ); } /** * Update partner disbursements for a contractor payment group * * @remarks * Update partner disbursements for a specific contractor payment group. * * scope: `partner_disbursements:write` */ async patchV1ContractorPaymentGroupsIdPartnerDisbursements( request: PatchV1ContractorPaymentGroupsIdPartnerDisbursementsRequest, options?: RequestOptions, ): Promise { return unwrapAsync( contractorPaymentGroupsPatchV1ContractorPaymentGroupsIdPartnerDisbursements( this, request, options, ), ); } }