/* * 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 accountingCustomersList$module: | Promise | undefined; const accountingCustomersList = (( ...args: Parameters< typeof import("../funcs/accountingCustomersList.js").accountingCustomersList > ) => new APIPromise( (accountingCustomersList$module ??= import( "../funcs/accountingCustomersList.js" ).catch((error: unknown) => { accountingCustomersList$module = undefined; throw error; })).then((module) => module.accountingCustomersList(...args).$inspect()), )) as typeof import("../funcs/accountingCustomersList.js").accountingCustomersList; let accountingCustomersCreate$module: | Promise | undefined; const accountingCustomersCreate = (( ...args: Parameters< typeof import("../funcs/accountingCustomersCreate.js").accountingCustomersCreate > ) => new APIPromise( (accountingCustomersCreate$module ??= import( "../funcs/accountingCustomersCreate.js" ).catch((error: unknown) => { accountingCustomersCreate$module = undefined; throw error; })).then((module) => module.accountingCustomersCreate(...args).$inspect() ), )) as typeof import("../funcs/accountingCustomersCreate.js").accountingCustomersCreate; let accountingCustomersGet$module: | Promise | undefined; const accountingCustomersGet = (( ...args: Parameters< typeof import("../funcs/accountingCustomersGet.js").accountingCustomersGet > ) => new APIPromise( (accountingCustomersGet$module ??= import( "../funcs/accountingCustomersGet.js" ).catch((error: unknown) => { accountingCustomersGet$module = undefined; throw error; })).then((module) => module.accountingCustomersGet(...args).$inspect()), )) as typeof import("../funcs/accountingCustomersGet.js").accountingCustomersGet; let accountingCustomersUpdate$module: | Promise | undefined; const accountingCustomersUpdate = (( ...args: Parameters< typeof import("../funcs/accountingCustomersUpdate.js").accountingCustomersUpdate > ) => new APIPromise( (accountingCustomersUpdate$module ??= import( "../funcs/accountingCustomersUpdate.js" ).catch((error: unknown) => { accountingCustomersUpdate$module = undefined; throw error; })).then((module) => module.accountingCustomersUpdate(...args).$inspect() ), )) as typeof import("../funcs/accountingCustomersUpdate.js").accountingCustomersUpdate; let accountingCustomersDelete$module: | Promise | undefined; const accountingCustomersDelete = (( ...args: Parameters< typeof import("../funcs/accountingCustomersDelete.js").accountingCustomersDelete > ) => new APIPromise( (accountingCustomersDelete$module ??= import( "../funcs/accountingCustomersDelete.js" ).catch((error: unknown) => { accountingCustomersDelete$module = undefined; throw error; })).then((module) => module.accountingCustomersDelete(...args).$inspect() ), )) as typeof import("../funcs/accountingCustomersDelete.js").accountingCustomersDelete; let accountingCustomersCreateBatch$module: | Promise | undefined; const accountingCustomersCreateBatch = (( ...args: Parameters< typeof import("../funcs/accountingCustomersCreateBatch.js").accountingCustomersCreateBatch > ) => new APIPromise( (accountingCustomersCreateBatch$module ??= import( "../funcs/accountingCustomersCreateBatch.js" ).catch((error: unknown) => { accountingCustomersCreateBatch$module = undefined; throw error; })).then((module) => module.accountingCustomersCreateBatch(...args).$inspect() ), )) as typeof import("../funcs/accountingCustomersCreateBatch.js").accountingCustomersCreateBatch; export class Customers extends ClientSDK { /** * List Customers * * @remarks * List Customers */ async list( request: operations.AccountingCustomersAllRequest, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(accountingCustomersList( this, request, options, )); } /** * Create Customer * * @remarks * Create Customer */ async create( request: operations.AccountingCustomersAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingCustomersCreate( this, request, options, )); } /** * Get Customer * * @remarks * Get Customer */ async get( request: operations.AccountingCustomersOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingCustomersGet( this, request, options, )); } /** * Update Customer * * @remarks * Update Customer */ async update( request: operations.AccountingCustomersUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingCustomersUpdate( this, request, options, )); } /** * Delete Customer * * @remarks * Delete Customer */ async delete( request: operations.AccountingCustomersDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingCustomersDelete( this, request, options, )); } /** * Create Customers in batch * * @remarks * Create multiple customers 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.AccountingCustomersBatchAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingCustomersCreateBatch( this, request, options, )); } }