/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { taxAssociationsCreateTaxAssociation } from "../funcs/tax-associations-create-tax-association.js"; import { taxAssociationsDeleteTaxAssociation } from "../funcs/tax-associations-delete-tax-association.js"; import { taxAssociationsGetTaxAssociation } from "../funcs/tax-associations-get-tax-association.js"; import { taxAssociationsListTaxAssociations } from "../funcs/tax-associations-list-tax-associations.js"; import { taxAssociationsUpdateTaxAssociation } from "../funcs/tax-associations-update-tax-association.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { unwrapAsync } from "../types/fp.js"; import * as models from "./models/index.js"; export class TaxAssociations extends ClientSDK { /** * List tax associations * * @remarks * Use when listing tax associations (e.g. tax config or audit). Returns list with optional filtering. */ async listTaxAssociations( entityType?: string | undefined, entityId?: string | undefined, externalCustomerId?: string | undefined, taxRateId?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(taxAssociationsListTaxAssociations( this, entityType, entityId, externalCustomerId, taxRateId, options, )); } /** * Create Tax Association * * @remarks * Use when linking a tax rate to an entity (e.g. customer, product, or region) so that rate applies on invoices. */ async createTaxAssociation( request: models.CreateTaxAssociationRequest, options?: RequestOptions, ): Promise { return unwrapAsync(taxAssociationsCreateTaxAssociation( this, request, options, )); } /** * Get Tax Association * * @remarks * Use when you need to load a single tax association (e.g. for display or editing). */ async getTaxAssociation( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(taxAssociationsGetTaxAssociation( this, id, options, )); } /** * Update tax association * * @remarks * Use when changing a tax association (e.g. switch rate or entity). Request body contains the fields to update. */ async updateTaxAssociation( id: string, body: models.TaxAssociationUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(taxAssociationsUpdateTaxAssociation( this, id, body, options, )); } /** * Delete tax association * * @remarks * Use when removing a tax association (e.g. entity no longer subject to that rate). */ async deleteTaxAssociation( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(taxAssociationsDeleteTaxAssociation( this, id, options, )); } }