/* * 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 accountingBillsList$module: | Promise | undefined; const accountingBillsList = (( ...args: Parameters< typeof import("../funcs/accountingBillsList.js").accountingBillsList > ) => new APIPromise( (accountingBillsList$module ??= import("../funcs/accountingBillsList.js") .catch((error: unknown) => { accountingBillsList$module = undefined; throw error; })).then((module) => module.accountingBillsList(...args).$inspect()), )) as typeof import("../funcs/accountingBillsList.js").accountingBillsList; let accountingBillsCreate$module: | Promise | undefined; const accountingBillsCreate = (( ...args: Parameters< typeof import("../funcs/accountingBillsCreate.js").accountingBillsCreate > ) => new APIPromise( (accountingBillsCreate$module ??= import( "../funcs/accountingBillsCreate.js" ).catch((error: unknown) => { accountingBillsCreate$module = undefined; throw error; })).then((module) => module.accountingBillsCreate(...args).$inspect()), )) as typeof import("../funcs/accountingBillsCreate.js").accountingBillsCreate; let accountingBillsGet$module: | Promise | undefined; const accountingBillsGet = (( ...args: Parameters< typeof import("../funcs/accountingBillsGet.js").accountingBillsGet > ) => new APIPromise( (accountingBillsGet$module ??= import("../funcs/accountingBillsGet.js") .catch((error: unknown) => { accountingBillsGet$module = undefined; throw error; })).then((module) => module.accountingBillsGet(...args).$inspect()), )) as typeof import("../funcs/accountingBillsGet.js").accountingBillsGet; let accountingBillsUpdate$module: | Promise | undefined; const accountingBillsUpdate = (( ...args: Parameters< typeof import("../funcs/accountingBillsUpdate.js").accountingBillsUpdate > ) => new APIPromise( (accountingBillsUpdate$module ??= import( "../funcs/accountingBillsUpdate.js" ).catch((error: unknown) => { accountingBillsUpdate$module = undefined; throw error; })).then((module) => module.accountingBillsUpdate(...args).$inspect()), )) as typeof import("../funcs/accountingBillsUpdate.js").accountingBillsUpdate; let accountingBillsDelete$module: | Promise | undefined; const accountingBillsDelete = (( ...args: Parameters< typeof import("../funcs/accountingBillsDelete.js").accountingBillsDelete > ) => new APIPromise( (accountingBillsDelete$module ??= import( "../funcs/accountingBillsDelete.js" ).catch((error: unknown) => { accountingBillsDelete$module = undefined; throw error; })).then((module) => module.accountingBillsDelete(...args).$inspect()), )) as typeof import("../funcs/accountingBillsDelete.js").accountingBillsDelete; let accountingBillsCreateBatch$module: | Promise | undefined; const accountingBillsCreateBatch = (( ...args: Parameters< typeof import("../funcs/accountingBillsCreateBatch.js").accountingBillsCreateBatch > ) => new APIPromise( (accountingBillsCreateBatch$module ??= import( "../funcs/accountingBillsCreateBatch.js" ).catch((error: unknown) => { accountingBillsCreateBatch$module = undefined; throw error; })).then((module) => module.accountingBillsCreateBatch(...args).$inspect() ), )) as typeof import("../funcs/accountingBillsCreateBatch.js").accountingBillsCreateBatch; export class Bills extends ClientSDK { /** * List Bills * * @remarks * List Bills */ async list( request: operations.AccountingBillsAllRequest, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(accountingBillsList( this, request, options, )); } /** * Create Bill * * @remarks * Create Bill */ async create( request: operations.AccountingBillsAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillsCreate( this, request, options, )); } /** * Get Bill * * @remarks * Get Bill */ async get( request: operations.AccountingBillsOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillsGet( this, request, options, )); } /** * Update Bill * * @remarks * Update Bill */ async update( request: operations.AccountingBillsUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillsUpdate( this, request, options, )); } /** * Delete Bill * * @remarks * Delete Bill */ async delete( request: operations.AccountingBillsDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillsDelete( this, request, options, )); } /** * Create Bills in batch * * @remarks * Create multiple bills 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.AccountingBillsBatchAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillsCreateBatch( this, request, options, )); } }