/* * 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 accountingDepartmentsList$module: | Promise | undefined; const accountingDepartmentsList = (( ...args: Parameters< typeof import("../funcs/accountingDepartmentsList.js").accountingDepartmentsList > ) => new APIPromise( (accountingDepartmentsList$module ??= import( "../funcs/accountingDepartmentsList.js" ).catch((error: unknown) => { accountingDepartmentsList$module = undefined; throw error; })).then((module) => module.accountingDepartmentsList(...args).$inspect() ), )) as typeof import("../funcs/accountingDepartmentsList.js").accountingDepartmentsList; let accountingDepartmentsCreate$module: | Promise | undefined; const accountingDepartmentsCreate = (( ...args: Parameters< typeof import("../funcs/accountingDepartmentsCreate.js").accountingDepartmentsCreate > ) => new APIPromise( (accountingDepartmentsCreate$module ??= import( "../funcs/accountingDepartmentsCreate.js" ).catch((error: unknown) => { accountingDepartmentsCreate$module = undefined; throw error; })).then((module) => module.accountingDepartmentsCreate(...args).$inspect() ), )) as typeof import("../funcs/accountingDepartmentsCreate.js").accountingDepartmentsCreate; let accountingDepartmentsGet$module: | Promise | undefined; const accountingDepartmentsGet = (( ...args: Parameters< typeof import("../funcs/accountingDepartmentsGet.js").accountingDepartmentsGet > ) => new APIPromise( (accountingDepartmentsGet$module ??= import( "../funcs/accountingDepartmentsGet.js" ).catch((error: unknown) => { accountingDepartmentsGet$module = undefined; throw error; })).then((module) => module.accountingDepartmentsGet(...args).$inspect()), )) as typeof import("../funcs/accountingDepartmentsGet.js").accountingDepartmentsGet; let accountingDepartmentsUpdate$module: | Promise | undefined; const accountingDepartmentsUpdate = (( ...args: Parameters< typeof import("../funcs/accountingDepartmentsUpdate.js").accountingDepartmentsUpdate > ) => new APIPromise( (accountingDepartmentsUpdate$module ??= import( "../funcs/accountingDepartmentsUpdate.js" ).catch((error: unknown) => { accountingDepartmentsUpdate$module = undefined; throw error; })).then((module) => module.accountingDepartmentsUpdate(...args).$inspect() ), )) as typeof import("../funcs/accountingDepartmentsUpdate.js").accountingDepartmentsUpdate; let accountingDepartmentsDelete$module: | Promise | undefined; const accountingDepartmentsDelete = (( ...args: Parameters< typeof import("../funcs/accountingDepartmentsDelete.js").accountingDepartmentsDelete > ) => new APIPromise( (accountingDepartmentsDelete$module ??= import( "../funcs/accountingDepartmentsDelete.js" ).catch((error: unknown) => { accountingDepartmentsDelete$module = undefined; throw error; })).then((module) => module.accountingDepartmentsDelete(...args).$inspect() ), )) as typeof import("../funcs/accountingDepartmentsDelete.js").accountingDepartmentsDelete; export class Departments extends ClientSDK { /** * List Departments * * @remarks * List Departments */ async list( request: operations.AccountingDepartmentsAllRequest, options?: RequestOptions, ): Promise< PageIterator< operations.AccountingDepartmentsAllResponse, { cursor: string } > > { return unwrapResultIterator(accountingDepartmentsList( this, request, options, )); } /** * Create Department * * @remarks * Create Department */ async create( request: operations.AccountingDepartmentsAddRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingDepartmentsCreate( this, request, options, )); } /** * Get Department * * @remarks * Get Department */ async get( request: operations.AccountingDepartmentsOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingDepartmentsGet( this, request, options, )); } /** * Update Department * * @remarks * Update Department */ async update( request: operations.AccountingDepartmentsUpdateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingDepartmentsUpdate( this, request, options, )); } /** * Delete Department * * @remarks * Delete Department */ async delete( request: operations.AccountingDepartmentsDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingDepartmentsDelete( this, request, options, )); } }