/* * 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 accountingLedgerAccountsList$module: | Promise | undefined; const accountingLedgerAccountsList = (( ...args: Parameters< typeof import("../funcs/accountingLedgerAccountsList.js").accountingLedgerAccountsList > ) => new APIPromise( (accountingLedgerAccountsList$module ??= import( "../funcs/accountingLedgerAccountsList.js" ).catch((error: unknown) => { accountingLedgerAccountsList$module = undefined; throw error; })).then((module) => module.accountingLedgerAccountsList(...args).$inspect() ), )) as typeof import("../funcs/accountingLedgerAccountsList.js").accountingLedgerAccountsList; let accountingLedgerAccountsCreate$module: | Promise | undefined; const accountingLedgerAccountsCreate = (( ...args: Parameters< typeof import("../funcs/accountingLedgerAccountsCreate.js").accountingLedgerAccountsCreate > ) => new APIPromise( (accountingLedgerAccountsCreate$module ??= import( "../funcs/accountingLedgerAccountsCreate.js" ).catch((error: unknown) => { accountingLedgerAccountsCreate$module = undefined; throw error; })).then((module) => module.accountingLedgerAccountsCreate(...args).$inspect() ), )) as typeof import("../funcs/accountingLedgerAccountsCreate.js").accountingLedgerAccountsCreate; let accountingLedgerAccountsGet$module: | Promise | undefined; const accountingLedgerAccountsGet = (( ...args: Parameters< typeof import("../funcs/accountingLedgerAccountsGet.js").accountingLedgerAccountsGet > ) => new APIPromise( (accountingLedgerAccountsGet$module ??= import( "../funcs/accountingLedgerAccountsGet.js" ).catch((error: unknown) => { accountingLedgerAccountsGet$module = undefined; throw error; })).then((module) => module.accountingLedgerAccountsGet(...args).$inspect() ), )) as typeof import("../funcs/accountingLedgerAccountsGet.js").accountingLedgerAccountsGet; let accountingLedgerAccountsUpdate$module: | Promise | undefined; const accountingLedgerAccountsUpdate = (( ...args: Parameters< typeof import("../funcs/accountingLedgerAccountsUpdate.js").accountingLedgerAccountsUpdate > ) => new APIPromise( (accountingLedgerAccountsUpdate$module ??= import( "../funcs/accountingLedgerAccountsUpdate.js" ).catch((error: unknown) => { accountingLedgerAccountsUpdate$module = undefined; throw error; })).then((module) => module.accountingLedgerAccountsUpdate(...args).$inspect() ), )) as typeof import("../funcs/accountingLedgerAccountsUpdate.js").accountingLedgerAccountsUpdate; let accountingLedgerAccountsDelete$module: | Promise | undefined; const accountingLedgerAccountsDelete = (( ...args: Parameters< typeof import("../funcs/accountingLedgerAccountsDelete.js").accountingLedgerAccountsDelete > ) => new APIPromise( (accountingLedgerAccountsDelete$module ??= import( "../funcs/accountingLedgerAccountsDelete.js" ).catch((error: unknown) => { accountingLedgerAccountsDelete$module = undefined; throw error; })).then((module) => module.accountingLedgerAccountsDelete(...args).$inspect() ), )) as typeof import("../funcs/accountingLedgerAccountsDelete.js").accountingLedgerAccountsDelete; let accountingLedgerAccountsCreateBatch$module: | Promise | undefined; const accountingLedgerAccountsCreateBatch = (( ...args: Parameters< typeof import("../funcs/accountingLedgerAccountsCreateBatch.js").accountingLedgerAccountsCreateBatch > ) => new APIPromise( (accountingLedgerAccountsCreateBatch$module ??= import( "../funcs/accountingLedgerAccountsCreateBatch.js" ).catch((error: unknown) => { accountingLedgerAccountsCreateBatch$module = undefined; throw error; })).then((module) => module.accountingLedgerAccountsCreateBatch(...args).$inspect() ), )) as typeof import("../funcs/accountingLedgerAccountsCreateBatch.js").accountingLedgerAccountsCreateBatch; export class LedgerAccounts extends ClientSDK { /** * List Ledger Accounts * * @remarks * List Ledger Accounts */ async list( request: operations.AccountingLedgerAccountsAllRequest, options?: RequestOptions, ): Promise< PageIterator< operations.AccountingLedgerAccountsAllResponse, { cursor: string } > > { return unwrapResultIterator(accountingLedgerAccountsList( this, request, options, )); } /** * Create Ledger Account * * @remarks * Create Ledger Account */ async create( request: operations.AccountingLedgerAccountsAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingLedgerAccountsCreate( this, request, options, )); } /** * Get Ledger Account * * @remarks * Get Ledger Account */ async get( request: operations.AccountingLedgerAccountsOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingLedgerAccountsGet( this, request, options, )); } /** * Update Ledger Account * * @remarks * Update Ledger Account */ async update( request: operations.AccountingLedgerAccountsUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingLedgerAccountsUpdate( this, request, options, )); } /** * Delete Ledger Account * * @remarks * Delete Ledger Account */ async delete( request: operations.AccountingLedgerAccountsDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingLedgerAccountsDelete( this, request, options, )); } /** * Create Ledger Accounts in batch * * @remarks * Create multiple ledger accounts 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.AccountingLedgerAccountsBatchAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingLedgerAccountsCreateBatch( this, request, options, )); } }