/* * 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 accountingBillCreditNotesList$module: | Promise | undefined; const accountingBillCreditNotesList = (( ...args: Parameters< typeof import("../funcs/accountingBillCreditNotesList.js").accountingBillCreditNotesList > ) => new APIPromise( (accountingBillCreditNotesList$module ??= import( "../funcs/accountingBillCreditNotesList.js" ).catch((error: unknown) => { accountingBillCreditNotesList$module = undefined; throw error; })).then((module) => module.accountingBillCreditNotesList(...args).$inspect() ), )) as typeof import("../funcs/accountingBillCreditNotesList.js").accountingBillCreditNotesList; let accountingBillCreditNotesCreate$module: | Promise | undefined; const accountingBillCreditNotesCreate = (( ...args: Parameters< typeof import("../funcs/accountingBillCreditNotesCreate.js").accountingBillCreditNotesCreate > ) => new APIPromise( (accountingBillCreditNotesCreate$module ??= import( "../funcs/accountingBillCreditNotesCreate.js" ).catch((error: unknown) => { accountingBillCreditNotesCreate$module = undefined; throw error; })).then((module) => module.accountingBillCreditNotesCreate(...args).$inspect() ), )) as typeof import("../funcs/accountingBillCreditNotesCreate.js").accountingBillCreditNotesCreate; let accountingBillCreditNotesGet$module: | Promise | undefined; const accountingBillCreditNotesGet = (( ...args: Parameters< typeof import("../funcs/accountingBillCreditNotesGet.js").accountingBillCreditNotesGet > ) => new APIPromise( (accountingBillCreditNotesGet$module ??= import( "../funcs/accountingBillCreditNotesGet.js" ).catch((error: unknown) => { accountingBillCreditNotesGet$module = undefined; throw error; })).then((module) => module.accountingBillCreditNotesGet(...args).$inspect() ), )) as typeof import("../funcs/accountingBillCreditNotesGet.js").accountingBillCreditNotesGet; let accountingBillCreditNotesUpdate$module: | Promise | undefined; const accountingBillCreditNotesUpdate = (( ...args: Parameters< typeof import("../funcs/accountingBillCreditNotesUpdate.js").accountingBillCreditNotesUpdate > ) => new APIPromise( (accountingBillCreditNotesUpdate$module ??= import( "../funcs/accountingBillCreditNotesUpdate.js" ).catch((error: unknown) => { accountingBillCreditNotesUpdate$module = undefined; throw error; })).then((module) => module.accountingBillCreditNotesUpdate(...args).$inspect() ), )) as typeof import("../funcs/accountingBillCreditNotesUpdate.js").accountingBillCreditNotesUpdate; let accountingBillCreditNotesDelete$module: | Promise | undefined; const accountingBillCreditNotesDelete = (( ...args: Parameters< typeof import("../funcs/accountingBillCreditNotesDelete.js").accountingBillCreditNotesDelete > ) => new APIPromise( (accountingBillCreditNotesDelete$module ??= import( "../funcs/accountingBillCreditNotesDelete.js" ).catch((error: unknown) => { accountingBillCreditNotesDelete$module = undefined; throw error; })).then((module) => module.accountingBillCreditNotesDelete(...args).$inspect() ), )) as typeof import("../funcs/accountingBillCreditNotesDelete.js").accountingBillCreditNotesDelete; let accountingBillCreditNotesCreateBatch$module: | Promise | undefined; const accountingBillCreditNotesCreateBatch = (( ...args: Parameters< typeof import("../funcs/accountingBillCreditNotesCreateBatch.js").accountingBillCreditNotesCreateBatch > ) => new APIPromise( (accountingBillCreditNotesCreateBatch$module ??= import( "../funcs/accountingBillCreditNotesCreateBatch.js" ).catch((error: unknown) => { accountingBillCreditNotesCreateBatch$module = undefined; throw error; })).then((module) => module.accountingBillCreditNotesCreateBatch(...args).$inspect() ), )) as typeof import("../funcs/accountingBillCreditNotesCreateBatch.js").accountingBillCreditNotesCreateBatch; export class BillCreditNotes extends ClientSDK { /** * List Bill Credit Notes * * @remarks * List Bill Credit Notes */ async list( request: operations.AccountingBillCreditNotesAllRequest, options?: RequestOptions, ): Promise< PageIterator< operations.AccountingBillCreditNotesAllResponse, { cursor: string } > > { return unwrapResultIterator(accountingBillCreditNotesList( this, request, options, )); } /** * Create Bill Credit Note * * @remarks * Create Bill Credit Note */ async create( request: operations.AccountingBillCreditNotesAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillCreditNotesCreate( this, request, options, )); } /** * Get Bill Credit Note * * @remarks * Get Bill Credit Note */ async get( request: operations.AccountingBillCreditNotesOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillCreditNotesGet( this, request, options, )); } /** * Update Bill Credit Note * * @remarks * Update Bill Credit Note */ async update( request: operations.AccountingBillCreditNotesUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillCreditNotesUpdate( this, request, options, )); } /** * Delete Bill Credit Note * * @remarks * Delete Bill Credit Note */ async delete( request: operations.AccountingBillCreditNotesDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillCreditNotesDelete( this, request, options, )); } /** * Create Bill Credit Notes in batch * * @remarks * Create multiple bill credit notes 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.AccountingBillCreditNotesBatchAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingBillCreditNotesCreateBatch( this, request, options, )); } }