/* * 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 accountingBillPaymentsList$module: | Promise | undefined; const accountingBillPaymentsList = (( ...args: Parameters< typeof import("../funcs/accountingBillPaymentsList.js").accountingBillPaymentsList > ) => new APIPromise( (accountingBillPaymentsList$module ??= import( "../funcs/accountingBillPaymentsList.js" ).catch((error: unknown) => { accountingBillPaymentsList$module = undefined; throw error; })).then((module) => module.accountingBillPaymentsList(...args).$inspect() ), )) as typeof import("../funcs/accountingBillPaymentsList.js").accountingBillPaymentsList; let accountingBillPaymentsCreate$module: | Promise | undefined; const accountingBillPaymentsCreate = (( ...args: Parameters< typeof import("../funcs/accountingBillPaymentsCreate.js").accountingBillPaymentsCreate > ) => new APIPromise( (accountingBillPaymentsCreate$module ??= import( "../funcs/accountingBillPaymentsCreate.js" ).catch((error: unknown) => { accountingBillPaymentsCreate$module = undefined; throw error; })).then((module) => module.accountingBillPaymentsCreate(...args).$inspect() ), )) as typeof import("../funcs/accountingBillPaymentsCreate.js").accountingBillPaymentsCreate; let accountingBillPaymentsGet$module: | Promise | undefined; const accountingBillPaymentsGet = (( ...args: Parameters< typeof import("../funcs/accountingBillPaymentsGet.js").accountingBillPaymentsGet > ) => new APIPromise( (accountingBillPaymentsGet$module ??= import( "../funcs/accountingBillPaymentsGet.js" ).catch((error: unknown) => { accountingBillPaymentsGet$module = undefined; throw error; })).then((module) => module.accountingBillPaymentsGet(...args).$inspect() ), )) as typeof import("../funcs/accountingBillPaymentsGet.js").accountingBillPaymentsGet; let accountingBillPaymentsUpdate$module: | Promise | undefined; const accountingBillPaymentsUpdate = (( ...args: Parameters< typeof import("../funcs/accountingBillPaymentsUpdate.js").accountingBillPaymentsUpdate > ) => new APIPromise( (accountingBillPaymentsUpdate$module ??= import( "../funcs/accountingBillPaymentsUpdate.js" ).catch((error: unknown) => { accountingBillPaymentsUpdate$module = undefined; throw error; })).then((module) => module.accountingBillPaymentsUpdate(...args).$inspect() ), )) as typeof import("../funcs/accountingBillPaymentsUpdate.js").accountingBillPaymentsUpdate; let accountingBillPaymentsDelete$module: | Promise | undefined; const accountingBillPaymentsDelete = (( ...args: Parameters< typeof import("../funcs/accountingBillPaymentsDelete.js").accountingBillPaymentsDelete > ) => new APIPromise( (accountingBillPaymentsDelete$module ??= import( "../funcs/accountingBillPaymentsDelete.js" ).catch((error: unknown) => { accountingBillPaymentsDelete$module = undefined; throw error; })).then((module) => module.accountingBillPaymentsDelete(...args).$inspect() ), )) as typeof import("../funcs/accountingBillPaymentsDelete.js").accountingBillPaymentsDelete; let accountingBillPaymentsCreateBatch$module: | Promise | undefined; const accountingBillPaymentsCreateBatch = (( ...args: Parameters< typeof import("../funcs/accountingBillPaymentsCreateBatch.js").accountingBillPaymentsCreateBatch > ) => new APIPromise( (accountingBillPaymentsCreateBatch$module ??= import( "../funcs/accountingBillPaymentsCreateBatch.js" ).catch((error: unknown) => { accountingBillPaymentsCreateBatch$module = undefined; throw error; })).then((module) => module.accountingBillPaymentsCreateBatch(...args).$inspect() ), )) as typeof import("../funcs/accountingBillPaymentsCreateBatch.js").accountingBillPaymentsCreateBatch; export class BillPayments extends ClientSDK { /** * List Bill Payments * * @remarks * List Bill Payments */ async list( request: operations.AccountingBillPaymentsAllRequest, options?: RequestOptions, ): Promise< PageIterator< operations.AccountingBillPaymentsAllResponse, { cursor: string } > > { return unwrapResultIterator(accountingBillPaymentsList( this, request, options, )); } /** * Create Bill Payment * * @remarks * Create Bill Payment */ async create( request: operations.AccountingBillPaymentsAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillPaymentsCreate( this, request, options, )); } /** * Get Bill Payment * * @remarks * Get Bill Payment */ async get( request: operations.AccountingBillPaymentsOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillPaymentsGet( this, request, options, )); } /** * Update Bill Payment * * @remarks * Update Bill Payment */ async update( request: operations.AccountingBillPaymentsUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillPaymentsUpdate( this, request, options, )); } /** * Delete Bill Payment * * @remarks * Delete Bill Payment */ async delete( request: operations.AccountingBillPaymentsDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillPaymentsDelete( this, request, options, )); } /** * Create Bill Payments in batch * * @remarks * Create multiple bill payments 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.AccountingBillPaymentsBatchAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillPaymentsCreateBatch( this, request, options, )); } }