/* * 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 accountingJournalEntriesList$module: | Promise | undefined; const accountingJournalEntriesList = (( ...args: Parameters< typeof import("../funcs/accountingJournalEntriesList.js").accountingJournalEntriesList > ) => new APIPromise( (accountingJournalEntriesList$module ??= import( "../funcs/accountingJournalEntriesList.js" ).catch((error: unknown) => { accountingJournalEntriesList$module = undefined; throw error; })).then((module) => module.accountingJournalEntriesList(...args).$inspect() ), )) as typeof import("../funcs/accountingJournalEntriesList.js").accountingJournalEntriesList; let accountingJournalEntriesCreate$module: | Promise | undefined; const accountingJournalEntriesCreate = (( ...args: Parameters< typeof import("../funcs/accountingJournalEntriesCreate.js").accountingJournalEntriesCreate > ) => new APIPromise( (accountingJournalEntriesCreate$module ??= import( "../funcs/accountingJournalEntriesCreate.js" ).catch((error: unknown) => { accountingJournalEntriesCreate$module = undefined; throw error; })).then((module) => module.accountingJournalEntriesCreate(...args).$inspect() ), )) as typeof import("../funcs/accountingJournalEntriesCreate.js").accountingJournalEntriesCreate; let accountingJournalEntriesGet$module: | Promise | undefined; const accountingJournalEntriesGet = (( ...args: Parameters< typeof import("../funcs/accountingJournalEntriesGet.js").accountingJournalEntriesGet > ) => new APIPromise( (accountingJournalEntriesGet$module ??= import( "../funcs/accountingJournalEntriesGet.js" ).catch((error: unknown) => { accountingJournalEntriesGet$module = undefined; throw error; })).then((module) => module.accountingJournalEntriesGet(...args).$inspect() ), )) as typeof import("../funcs/accountingJournalEntriesGet.js").accountingJournalEntriesGet; let accountingJournalEntriesUpdate$module: | Promise | undefined; const accountingJournalEntriesUpdate = (( ...args: Parameters< typeof import("../funcs/accountingJournalEntriesUpdate.js").accountingJournalEntriesUpdate > ) => new APIPromise( (accountingJournalEntriesUpdate$module ??= import( "../funcs/accountingJournalEntriesUpdate.js" ).catch((error: unknown) => { accountingJournalEntriesUpdate$module = undefined; throw error; })).then((module) => module.accountingJournalEntriesUpdate(...args).$inspect() ), )) as typeof import("../funcs/accountingJournalEntriesUpdate.js").accountingJournalEntriesUpdate; let accountingJournalEntriesDelete$module: | Promise | undefined; const accountingJournalEntriesDelete = (( ...args: Parameters< typeof import("../funcs/accountingJournalEntriesDelete.js").accountingJournalEntriesDelete > ) => new APIPromise( (accountingJournalEntriesDelete$module ??= import( "../funcs/accountingJournalEntriesDelete.js" ).catch((error: unknown) => { accountingJournalEntriesDelete$module = undefined; throw error; })).then((module) => module.accountingJournalEntriesDelete(...args).$inspect() ), )) as typeof import("../funcs/accountingJournalEntriesDelete.js").accountingJournalEntriesDelete; let accountingJournalEntriesCreateBatch$module: | Promise | undefined; const accountingJournalEntriesCreateBatch = (( ...args: Parameters< typeof import("../funcs/accountingJournalEntriesCreateBatch.js").accountingJournalEntriesCreateBatch > ) => new APIPromise( (accountingJournalEntriesCreateBatch$module ??= import( "../funcs/accountingJournalEntriesCreateBatch.js" ).catch((error: unknown) => { accountingJournalEntriesCreateBatch$module = undefined; throw error; })).then((module) => module.accountingJournalEntriesCreateBatch(...args).$inspect() ), )) as typeof import("../funcs/accountingJournalEntriesCreateBatch.js").accountingJournalEntriesCreateBatch; export class JournalEntries extends ClientSDK { /** * List Journal Entries * * @remarks * List Journal Entries */ async list( request: operations.AccountingJournalEntriesAllRequest, options?: RequestOptions, ): Promise< PageIterator< operations.AccountingJournalEntriesAllResponse, { cursor: string } > > { return unwrapResultIterator(accountingJournalEntriesList( this, request, options, )); } /** * Create Journal Entry * * @remarks * Create Journal Entry */ async create( request: operations.AccountingJournalEntriesAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingJournalEntriesCreate( this, request, options, )); } /** * Get Journal Entry * * @remarks * Get Journal Entry */ async get( request: operations.AccountingJournalEntriesOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingJournalEntriesGet( this, request, options, )); } /** * Update Journal Entry * * @remarks * Update Journal Entry */ async update( request: operations.AccountingJournalEntriesUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingJournalEntriesUpdate( this, request, options, )); } /** * Delete Journal Entry * * @remarks * Delete Journal Entry */ async delete( request: operations.AccountingJournalEntriesDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingJournalEntriesDelete( this, request, options, )); } /** * Create Journal Entries in batch * * @remarks * Create multiple journal entries 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.AccountingJournalEntriesBatchAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingJournalEntriesCreateBatch( this, request, options, )); } }