/* * 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 accountingPaymentsList$module: | Promise | undefined; const accountingPaymentsList = (( ...args: Parameters< typeof import("../funcs/accountingPaymentsList.js").accountingPaymentsList > ) => new APIPromise( (accountingPaymentsList$module ??= import( "../funcs/accountingPaymentsList.js" ).catch((error: unknown) => { accountingPaymentsList$module = undefined; throw error; })).then((module) => module.accountingPaymentsList(...args).$inspect()), )) as typeof import("../funcs/accountingPaymentsList.js").accountingPaymentsList; let accountingPaymentsCreate$module: | Promise | undefined; const accountingPaymentsCreate = (( ...args: Parameters< typeof import("../funcs/accountingPaymentsCreate.js").accountingPaymentsCreate > ) => new APIPromise( (accountingPaymentsCreate$module ??= import( "../funcs/accountingPaymentsCreate.js" ).catch((error: unknown) => { accountingPaymentsCreate$module = undefined; throw error; })).then((module) => module.accountingPaymentsCreate(...args).$inspect()), )) as typeof import("../funcs/accountingPaymentsCreate.js").accountingPaymentsCreate; let accountingPaymentsGet$module: | Promise | undefined; const accountingPaymentsGet = (( ...args: Parameters< typeof import("../funcs/accountingPaymentsGet.js").accountingPaymentsGet > ) => new APIPromise( (accountingPaymentsGet$module ??= import( "../funcs/accountingPaymentsGet.js" ).catch((error: unknown) => { accountingPaymentsGet$module = undefined; throw error; })).then((module) => module.accountingPaymentsGet(...args).$inspect()), )) as typeof import("../funcs/accountingPaymentsGet.js").accountingPaymentsGet; let accountingPaymentsUpdate$module: | Promise | undefined; const accountingPaymentsUpdate = (( ...args: Parameters< typeof import("../funcs/accountingPaymentsUpdate.js").accountingPaymentsUpdate > ) => new APIPromise( (accountingPaymentsUpdate$module ??= import( "../funcs/accountingPaymentsUpdate.js" ).catch((error: unknown) => { accountingPaymentsUpdate$module = undefined; throw error; })).then((module) => module.accountingPaymentsUpdate(...args).$inspect()), )) as typeof import("../funcs/accountingPaymentsUpdate.js").accountingPaymentsUpdate; let accountingPaymentsDelete$module: | Promise | undefined; const accountingPaymentsDelete = (( ...args: Parameters< typeof import("../funcs/accountingPaymentsDelete.js").accountingPaymentsDelete > ) => new APIPromise( (accountingPaymentsDelete$module ??= import( "../funcs/accountingPaymentsDelete.js" ).catch((error: unknown) => { accountingPaymentsDelete$module = undefined; throw error; })).then((module) => module.accountingPaymentsDelete(...args).$inspect()), )) as typeof import("../funcs/accountingPaymentsDelete.js").accountingPaymentsDelete; let accountingPaymentsCreateBatch$module: | Promise | undefined; const accountingPaymentsCreateBatch = (( ...args: Parameters< typeof import("../funcs/accountingPaymentsCreateBatch.js").accountingPaymentsCreateBatch > ) => new APIPromise( (accountingPaymentsCreateBatch$module ??= import( "../funcs/accountingPaymentsCreateBatch.js" ).catch((error: unknown) => { accountingPaymentsCreateBatch$module = undefined; throw error; })).then((module) => module.accountingPaymentsCreateBatch(...args).$inspect() ), )) as typeof import("../funcs/accountingPaymentsCreateBatch.js").accountingPaymentsCreateBatch; export class Payments extends ClientSDK { /** * List Payments * * @remarks * List Payments */ async list( request: operations.AccountingPaymentsAllRequest, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(accountingPaymentsList( this, request, options, )); } /** * Create Payment * * @remarks * Create Payment */ async create( request: operations.AccountingPaymentsAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingPaymentsCreate( this, request, options, )); } /** * Get Payment * * @remarks * Get Payment */ async get( request: operations.AccountingPaymentsOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingPaymentsGet( this, request, options, )); } /** * Update Payment * * @remarks * Update Payment */ async update( request: operations.AccountingPaymentsUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingPaymentsUpdate( this, request, options, )); } /** * Delete Payment * * @remarks * Delete Payment */ async delete( request: operations.AccountingPaymentsDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingPaymentsDelete( this, request, options, )); } /** * Create Payments in batch * * @remarks * Create multiple 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.AccountingPaymentsBatchAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingPaymentsCreateBatch( this, request, options, )); } }