/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { taxRatesCreateTaxRate } from "../funcs/tax-rates-create-tax-rate.js"; import { taxRatesDeleteTaxRate } from "../funcs/tax-rates-delete-tax-rate.js"; import { taxRatesGetTaxRate } from "../funcs/tax-rates-get-tax-rate.js"; import { taxRatesGetTaxRates } from "../funcs/tax-rates-get-tax-rates.js"; import { taxRatesUpdateTaxRate } from "../funcs/tax-rates-update-tax-rate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { unwrapAsync } from "../types/fp.js"; import * as models from "./models/index.js"; export class TaxRates extends ClientSDK { /** * Get tax rates * * @remarks * Use when listing tax rates (e.g. tax config UI). Returns tax rates with optional filters. */ async getTaxRates( request?: models.GetTaxRatesRequest | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(taxRatesGetTaxRates( this, request, options, )); } /** * Create a tax rate * * @remarks * Use when defining a new tax rate (e.g. VAT or sales tax) for use in invoices. Attach to customers or products via tax associations. */ async createTaxRate( request: models.CreateTaxRateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(taxRatesCreateTaxRate( this, request, options, )); } /** * Get a tax rate * * @remarks * Use when you need to load a single tax rate (e.g. for display or when creating an association). */ async getTaxRate( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(taxRatesGetTaxRate( this, id, options, )); } /** * Update a tax rate * * @remarks * Use when changing a tax rate (e.g. rate value or name). Request body contains the fields to update. */ async updateTaxRate( id: string, body: models.UpdateTaxRateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(taxRatesUpdateTaxRate( this, id, body, options, )); } /** * Delete a tax rate * * @remarks * Use when retiring a tax rate (e.g. no longer applicable). Fails if still referenced by associations. */ async deleteTaxRate( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(taxRatesDeleteTaxRate( this, id, options, )); } }