/* * 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"; export enum DownloadAcceptEnum { applicationJson = "application/json", wildcardRootWildcard = "*/*", } let accountingAttachmentsList$module: | Promise | undefined; const accountingAttachmentsList = (( ...args: Parameters< typeof import("../funcs/accountingAttachmentsList.js").accountingAttachmentsList > ) => new APIPromise( (accountingAttachmentsList$module ??= import( "../funcs/accountingAttachmentsList.js" ).catch((error: unknown) => { accountingAttachmentsList$module = undefined; throw error; })).then((module) => module.accountingAttachmentsList(...args).$inspect() ), )) as typeof import("../funcs/accountingAttachmentsList.js").accountingAttachmentsList; let accountingAttachmentsUpload$module: | Promise | undefined; const accountingAttachmentsUpload = (( ...args: Parameters< typeof import("../funcs/accountingAttachmentsUpload.js").accountingAttachmentsUpload > ) => new APIPromise( (accountingAttachmentsUpload$module ??= import( "../funcs/accountingAttachmentsUpload.js" ).catch((error: unknown) => { accountingAttachmentsUpload$module = undefined; throw error; })).then((module) => module.accountingAttachmentsUpload(...args).$inspect() ), )) as typeof import("../funcs/accountingAttachmentsUpload.js").accountingAttachmentsUpload; let accountingAttachmentsGet$module: | Promise | undefined; const accountingAttachmentsGet = (( ...args: Parameters< typeof import("../funcs/accountingAttachmentsGet.js").accountingAttachmentsGet > ) => new APIPromise( (accountingAttachmentsGet$module ??= import( "../funcs/accountingAttachmentsGet.js" ).catch((error: unknown) => { accountingAttachmentsGet$module = undefined; throw error; })).then((module) => module.accountingAttachmentsGet(...args).$inspect()), )) as typeof import("../funcs/accountingAttachmentsGet.js").accountingAttachmentsGet; let accountingAttachmentsDelete$module: | Promise | undefined; const accountingAttachmentsDelete = (( ...args: Parameters< typeof import("../funcs/accountingAttachmentsDelete.js").accountingAttachmentsDelete > ) => new APIPromise( (accountingAttachmentsDelete$module ??= import( "../funcs/accountingAttachmentsDelete.js" ).catch((error: unknown) => { accountingAttachmentsDelete$module = undefined; throw error; })).then((module) => module.accountingAttachmentsDelete(...args).$inspect() ), )) as typeof import("../funcs/accountingAttachmentsDelete.js").accountingAttachmentsDelete; let accountingAttachmentsDownload$module: | Promise | undefined; const accountingAttachmentsDownload = (( ...args: Parameters< typeof import("../funcs/accountingAttachmentsDownload.js").accountingAttachmentsDownload > ) => new APIPromise( (accountingAttachmentsDownload$module ??= import( "../funcs/accountingAttachmentsDownload.js" ).catch((error: unknown) => { accountingAttachmentsDownload$module = undefined; throw error; })).then((module) => module.accountingAttachmentsDownload(...args).$inspect() ), )) as typeof import("../funcs/accountingAttachmentsDownload.js").accountingAttachmentsDownload; export class Attachments extends ClientSDK { /** * List Attachments * * @remarks * List Attachments */ async list( request: operations.AccountingAttachmentsAllRequest, options?: RequestOptions, ): Promise< PageIterator< operations.AccountingAttachmentsAllResponse, { cursor: string } > > { return unwrapResultIterator(accountingAttachmentsList( this, request, options, )); } /** * Upload attachment * * @remarks * Upload attachment */ async upload( request: operations.AccountingAttachmentsUploadRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingAttachmentsUpload( this, request, options, )); } /** * Get Attachment * * @remarks * Get Attachment */ async get( request: operations.AccountingAttachmentsOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingAttachmentsGet( this, request, options, )); } /** * Delete Attachment * * @remarks * Delete Attachment */ async delete( request: operations.AccountingAttachmentsDeleteRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingAttachmentsDelete( this, request, options, )); } /** * Download Attachment * * @remarks * Download Attachment */ async download( request: operations.AccountingAttachmentsDownloadRequest, options?: RequestOptions & { acceptHeaderOverride?: DownloadAcceptEnum }, ): Promise { return unwrapAsync(accountingAttachmentsDownload( this, request, options, )); } }