/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { APIPromise } from "../types/async.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; let accountingInvoicesList$module: | Promise | undefined; const accountingInvoicesList = (( ...args: Parameters< typeof import("../funcs/accountingInvoicesList.js").accountingInvoicesList > ) => new APIPromise( (accountingInvoicesList$module ??= import( "../funcs/accountingInvoicesList.js" ).catch((error: unknown) => { accountingInvoicesList$module = undefined; throw error; })).then((module) => module.accountingInvoicesList(...args).$inspect()), )) as typeof import("../funcs/accountingInvoicesList.js").accountingInvoicesList; let accountingInvoicesCreate$module: | Promise | undefined; const accountingInvoicesCreate = (( ...args: Parameters< typeof import("../funcs/accountingInvoicesCreate.js").accountingInvoicesCreate > ) => new APIPromise( (accountingInvoicesCreate$module ??= import( "../funcs/accountingInvoicesCreate.js" ).catch((error: unknown) => { accountingInvoicesCreate$module = undefined; throw error; })).then((module) => module.accountingInvoicesCreate(...args).$inspect()), )) as typeof import("../funcs/accountingInvoicesCreate.js").accountingInvoicesCreate; let accountingInvoicesGet$module: | Promise | undefined; const accountingInvoicesGet = (( ...args: Parameters< typeof import("../funcs/accountingInvoicesGet.js").accountingInvoicesGet > ) => new APIPromise( (accountingInvoicesGet$module ??= import( "../funcs/accountingInvoicesGet.js" ).catch((error: unknown) => { accountingInvoicesGet$module = undefined; throw error; })).then((module) => module.accountingInvoicesGet(...args).$inspect()), )) as typeof import("../funcs/accountingInvoicesGet.js").accountingInvoicesGet; let accountingInvoicesUpdate$module: | Promise | undefined; const accountingInvoicesUpdate = (( ...args: Parameters< typeof import("../funcs/accountingInvoicesUpdate.js").accountingInvoicesUpdate > ) => new APIPromise( (accountingInvoicesUpdate$module ??= import( "../funcs/accountingInvoicesUpdate.js" ).catch((error: unknown) => { accountingInvoicesUpdate$module = undefined; throw error; })).then((module) => module.accountingInvoicesUpdate(...args).$inspect()), )) as typeof import("../funcs/accountingInvoicesUpdate.js").accountingInvoicesUpdate; let accountingInvoicesDelete$module: | Promise | undefined; const accountingInvoicesDelete = (( ...args: Parameters< typeof import("../funcs/accountingInvoicesDelete.js").accountingInvoicesDelete > ) => new APIPromise( (accountingInvoicesDelete$module ??= import( "../funcs/accountingInvoicesDelete.js" ).catch((error: unknown) => { accountingInvoicesDelete$module = undefined; throw error; })).then((module) => module.accountingInvoicesDelete(...args).$inspect()), )) as typeof import("../funcs/accountingInvoicesDelete.js").accountingInvoicesDelete; let accountingInvoicesCreateBatch$module: | Promise | undefined; const accountingInvoicesCreateBatch = (( ...args: Parameters< typeof import("../funcs/accountingInvoicesCreateBatch.js").accountingInvoicesCreateBatch > ) => new APIPromise( (accountingInvoicesCreateBatch$module ??= import( "../funcs/accountingInvoicesCreateBatch.js" ).catch((error: unknown) => { accountingInvoicesCreateBatch$module = undefined; throw error; })).then((module) => module.accountingInvoicesCreateBatch(...args).$inspect() ), )) as typeof import("../funcs/accountingInvoicesCreateBatch.js").accountingInvoicesCreateBatch; export class Invoices extends ClientSDK { /** * List Invoices * * @remarks * List Invoices */ async list( request: operations.AccountingInvoicesAllRequest, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(accountingInvoicesList( this, request, options, )); } /** * Create Invoice * * @remarks * Create Invoice */ async create( request: operations.AccountingInvoicesAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingInvoicesCreate( this, request, options, )); } /** * Get Invoice * * @remarks * Get Invoice */ async get( request: operations.AccountingInvoicesOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingInvoicesGet( this, request, options, )); } /** * Update Invoice * * @remarks * Update Invoice */ async update( request: operations.AccountingInvoicesUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingInvoicesUpdate( this, request, options, )); } /** * Delete Invoice * * @remarks * Delete Invoice */ async delete( request: operations.AccountingInvoicesDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingInvoicesDelete( this, request, options, )); } /** * Create Invoices in batch * * @remarks * Create multiple invoices in a single request. Each item is processed independently, so some may be created while others fail; the response returns `200` with one result per item, in the order the items were sent. The maximum number of items accepted per request depends on the connector. */ async createBatch( request: operations.AccountingInvoicesBatchAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingInvoicesCreateBatch( this, request, options, )); } }