/* * 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 accountingSuppliersList$module: | Promise | undefined; const accountingSuppliersList = (( ...args: Parameters< typeof import("../funcs/accountingSuppliersList.js").accountingSuppliersList > ) => new APIPromise( (accountingSuppliersList$module ??= import( "../funcs/accountingSuppliersList.js" ).catch((error: unknown) => { accountingSuppliersList$module = undefined; throw error; })).then((module) => module.accountingSuppliersList(...args).$inspect()), )) as typeof import("../funcs/accountingSuppliersList.js").accountingSuppliersList; let accountingSuppliersCreate$module: | Promise | undefined; const accountingSuppliersCreate = (( ...args: Parameters< typeof import("../funcs/accountingSuppliersCreate.js").accountingSuppliersCreate > ) => new APIPromise( (accountingSuppliersCreate$module ??= import( "../funcs/accountingSuppliersCreate.js" ).catch((error: unknown) => { accountingSuppliersCreate$module = undefined; throw error; })).then((module) => module.accountingSuppliersCreate(...args).$inspect() ), )) as typeof import("../funcs/accountingSuppliersCreate.js").accountingSuppliersCreate; let accountingSuppliersGet$module: | Promise | undefined; const accountingSuppliersGet = (( ...args: Parameters< typeof import("../funcs/accountingSuppliersGet.js").accountingSuppliersGet > ) => new APIPromise( (accountingSuppliersGet$module ??= import( "../funcs/accountingSuppliersGet.js" ).catch((error: unknown) => { accountingSuppliersGet$module = undefined; throw error; })).then((module) => module.accountingSuppliersGet(...args).$inspect()), )) as typeof import("../funcs/accountingSuppliersGet.js").accountingSuppliersGet; let accountingSuppliersUpdate$module: | Promise | undefined; const accountingSuppliersUpdate = (( ...args: Parameters< typeof import("../funcs/accountingSuppliersUpdate.js").accountingSuppliersUpdate > ) => new APIPromise( (accountingSuppliersUpdate$module ??= import( "../funcs/accountingSuppliersUpdate.js" ).catch((error: unknown) => { accountingSuppliersUpdate$module = undefined; throw error; })).then((module) => module.accountingSuppliersUpdate(...args).$inspect() ), )) as typeof import("../funcs/accountingSuppliersUpdate.js").accountingSuppliersUpdate; let accountingSuppliersDelete$module: | Promise | undefined; const accountingSuppliersDelete = (( ...args: Parameters< typeof import("../funcs/accountingSuppliersDelete.js").accountingSuppliersDelete > ) => new APIPromise( (accountingSuppliersDelete$module ??= import( "../funcs/accountingSuppliersDelete.js" ).catch((error: unknown) => { accountingSuppliersDelete$module = undefined; throw error; })).then((module) => module.accountingSuppliersDelete(...args).$inspect() ), )) as typeof import("../funcs/accountingSuppliersDelete.js").accountingSuppliersDelete; let accountingSuppliersCreateBatch$module: | Promise | undefined; const accountingSuppliersCreateBatch = (( ...args: Parameters< typeof import("../funcs/accountingSuppliersCreateBatch.js").accountingSuppliersCreateBatch > ) => new APIPromise( (accountingSuppliersCreateBatch$module ??= import( "../funcs/accountingSuppliersCreateBatch.js" ).catch((error: unknown) => { accountingSuppliersCreateBatch$module = undefined; throw error; })).then((module) => module.accountingSuppliersCreateBatch(...args).$inspect() ), )) as typeof import("../funcs/accountingSuppliersCreateBatch.js").accountingSuppliersCreateBatch; export class Suppliers extends ClientSDK { /** * List Suppliers * * @remarks * List Suppliers */ async list( request: operations.AccountingSuppliersAllRequest, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(accountingSuppliersList( this, request, options, )); } /** * Create Supplier * * @remarks * Create Supplier */ async create( request: operations.AccountingSuppliersAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingSuppliersCreate( this, request, options, )); } /** * Get Supplier * * @remarks * Get Supplier */ async get( request: operations.AccountingSuppliersOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingSuppliersGet( this, request, options, )); } /** * Update Supplier * * @remarks * Update Supplier */ async update( request: operations.AccountingSuppliersUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingSuppliersUpdate( this, request, options, )); } /** * Delete Supplier * * @remarks * Delete Supplier */ async delete( request: operations.AccountingSuppliersDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingSuppliersDelete( this, request, options, )); } /** * Create Suppliers in batch * * @remarks * Create multiple suppliers 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.AccountingSuppliersBatchAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingSuppliersCreateBatch( this, request, options, )); } }