fineract_sdk
Version:
Wrapper around fineract api.
655 lines (592 loc) • 36.5 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Apache Fineract
* Apache Fineract is a secure, multi-tenanted microfinance platform The goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform<br>The [reference app](https://cui.fineract.dev) (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation - The API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) - Find out more about Apache Fineract [here](/fineract-provider/api-docs/apiLive.htm#top) - You can [Try The API From Your Browser](/fineract-provider/api-docs/apiLive.htm#interact) - The Generic Options are available [here](/fineract-provider/api-docs/apiLive.htm#genopts) - Find out more about [Updating Dates and Numbers](/fineract-provider/api-docs/apiLive.htm#dates_and_numbers) - For the Authentication and the Basic of HTTP and HTTPS refer [here](/fineract-provider/api-docs/apiLive.htm#authentication_overview) - Check about ERROR codes [here](/fineract-provider/api-docs/apiLive.htm#errors) Please refer to the [old documentation](/fineract-provider/api-docs/apiLive.htm) for any documentation queries
*
* The version of the OpenAPI document: 1.5.0-66-gffae7d4-dirty
* Contact: dev@fineract.apache.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
// @ts-ignore
import { DeleteEntityTypeEntityIdDocumentsResponse } from '../models';
// @ts-ignore
import { FormDataBodyPart } from '../models';
// @ts-ignore
import { GetEntityTypeEntityIdDocumentsResponse } from '../models';
// @ts-ignore
import { PostEntityTypeEntityIdDocumentsResponse } from '../models';
// @ts-ignore
import { PutEntityTypeEntityIdDocumentsResponse } from '../models';
/**
* DocumentsApi - axios parameter creator
* @export
*/
export const DocumentsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Note: A document is created using a Multi-part form upload Body Parts name : Name or summary of the document description : Description of the document file : The file to be uploaded Mandatory Fields : file and description
* @summary Create a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} [contentLength] Content-Length
* @param {FormDataBodyPart} [file]
* @param {string} [name] name
* @param {string} [description] description
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createDocument: async (entityType: string, entityId: number, contentLength?: number, file?: FormDataBodyPart, name?: string, description?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'entityType' is not null or undefined
assertParamExists('createDocument', 'entityType', entityType)
// verify required parameter 'entityId' is not null or undefined
assertParamExists('createDocument', 'entityId', entityId)
const localVarPath = `/{entityType}/{entityId}/documents`
.replace(`{${"entityType"}}`, encodeURIComponent(String(entityType)))
.replace(`{${"entityId"}}`, encodeURIComponent(String(entityId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
if (contentLength !== undefined && contentLength !== null) {
localVarHeaderParameter['Content-Length'] = String(JSON.stringify(contentLength));
}
if (file !== undefined) {
localVarFormParams.append('file', new Blob([JSON.stringify(file)], { type: "application/json", }));
}
if (name !== undefined) {
localVarFormParams.append('name', name as any);
}
if (description !== undefined) {
localVarFormParams.append('description', description as any);
}
localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = localVarFormParams;
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Remove a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteDocument: async (entityType: string, entityId: number, documentId: number, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'entityType' is not null or undefined
assertParamExists('deleteDocument', 'entityType', entityType)
// verify required parameter 'entityId' is not null or undefined
assertParamExists('deleteDocument', 'entityId', entityId)
// verify required parameter 'documentId' is not null or undefined
assertParamExists('deleteDocument', 'documentId', documentId)
const localVarPath = `/{entityType}/{entityId}/documents/{documentId}`
.replace(`{${"entityType"}}`, encodeURIComponent(String(entityType)))
.replace(`{${"entityId"}}`, encodeURIComponent(String(entityId)))
.replace(`{${"documentId"}}`, encodeURIComponent(String(documentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Request used to download the file associated with the document Example Requests: clients/1/documents/1/attachment loans/1/documents/1/attachment
* @summary Retrieve Binary File associated with Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
downloadFile: async (entityType: string, entityId: number, documentId: number, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'entityType' is not null or undefined
assertParamExists('downloadFile', 'entityType', entityType)
// verify required parameter 'entityId' is not null or undefined
assertParamExists('downloadFile', 'entityId', entityId)
// verify required parameter 'documentId' is not null or undefined
assertParamExists('downloadFile', 'documentId', documentId)
const localVarPath = `/{entityType}/{entityId}/documents/{documentId}/attachment`
.replace(`{${"entityType"}}`, encodeURIComponent(String(entityType)))
.replace(`{${"entityId"}}`, encodeURIComponent(String(entityId)))
.replace(`{${"documentId"}}`, encodeURIComponent(String(documentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Example Requests: clients/1/documents/1 loans/1/documents/1 client_identifiers/1/documents/1?fields=name,description
* @summary Retrieve a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getDocument: async (entityType: string, entityId: number, documentId: number, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'entityType' is not null or undefined
assertParamExists('getDocument', 'entityType', entityType)
// verify required parameter 'entityId' is not null or undefined
assertParamExists('getDocument', 'entityId', entityId)
// verify required parameter 'documentId' is not null or undefined
assertParamExists('getDocument', 'documentId', documentId)
const localVarPath = `/{entityType}/{entityId}/documents/{documentId}`
.replace(`{${"entityType"}}`, encodeURIComponent(String(entityType)))
.replace(`{${"entityId"}}`, encodeURIComponent(String(entityId)))
.replace(`{${"documentId"}}`, encodeURIComponent(String(documentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Example Requests: clients/1/documents client_identifiers/1/documents loans/1/documents?fields=name,description
* @summary List documents
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveAllDocuments: async (entityType: string, entityId: number, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'entityType' is not null or undefined
assertParamExists('retrieveAllDocuments', 'entityType', entityType)
// verify required parameter 'entityId' is not null or undefined
assertParamExists('retrieveAllDocuments', 'entityId', entityId)
const localVarPath = `/{entityType}/{entityId}/documents`
.replace(`{${"entityType"}}`, encodeURIComponent(String(entityType)))
.replace(`{${"entityId"}}`, encodeURIComponent(String(entityId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Note: A document is updated using a Multi-part form upload Body Parts name Name or summary of the document description Description of the document file The file to be uploaded
* @summary Update a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {number} [contentLength] Content-Length
* @param {FormDataBodyPart} [file]
* @param {string} [name] name
* @param {string} [description] description
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDocument: async (entityType: string, entityId: number, documentId: number, contentLength?: number, file?: FormDataBodyPart, name?: string, description?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'entityType' is not null or undefined
assertParamExists('updateDocument', 'entityType', entityType)
// verify required parameter 'entityId' is not null or undefined
assertParamExists('updateDocument', 'entityId', entityId)
// verify required parameter 'documentId' is not null or undefined
assertParamExists('updateDocument', 'documentId', documentId)
const localVarPath = `/{entityType}/{entityId}/documents/{documentId}`
.replace(`{${"entityType"}}`, encodeURIComponent(String(entityType)))
.replace(`{${"entityId"}}`, encodeURIComponent(String(entityId)))
.replace(`{${"documentId"}}`, encodeURIComponent(String(documentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
// authentication basicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration)
// authentication tenantid required
await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration)
if (contentLength !== undefined && contentLength !== null) {
localVarHeaderParameter['Content-Length'] = String(JSON.stringify(contentLength));
}
if (file !== undefined) {
localVarFormParams.append('file', new Blob([JSON.stringify(file)], { type: "application/json", }));
}
if (name !== undefined) {
localVarFormParams.append('name', name as any);
}
if (description !== undefined) {
localVarFormParams.append('description', description as any);
}
localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = localVarFormParams;
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* DocumentsApi - functional programming interface
* @export
*/
export const DocumentsApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = DocumentsApiAxiosParamCreator(configuration)
return {
/**
* Note: A document is created using a Multi-part form upload Body Parts name : Name or summary of the document description : Description of the document file : The file to be uploaded Mandatory Fields : file and description
* @summary Create a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} [contentLength] Content-Length
* @param {FormDataBodyPart} [file]
* @param {string} [name] name
* @param {string} [description] description
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createDocument(entityType: string, entityId: number, contentLength?: number, file?: FormDataBodyPart, name?: string, description?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostEntityTypeEntityIdDocumentsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createDocument(entityType, entityId, contentLength, file, name, description, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @summary Remove a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteDocument(entityType: string, entityId: number, documentId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteEntityTypeEntityIdDocumentsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDocument(entityType, entityId, documentId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Request used to download the file associated with the document Example Requests: clients/1/documents/1/attachment loans/1/documents/1/attachment
* @summary Retrieve Binary File associated with Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async downloadFile(entityType: string, entityId: number, documentId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.downloadFile(entityType, entityId, documentId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Example Requests: clients/1/documents/1 loans/1/documents/1 client_identifiers/1/documents/1?fields=name,description
* @summary Retrieve a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getDocument(entityType: string, entityId: number, documentId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetEntityTypeEntityIdDocumentsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getDocument(entityType, entityId, documentId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Example Requests: clients/1/documents client_identifiers/1/documents loans/1/documents?fields=name,description
* @summary List documents
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async retrieveAllDocuments(entityType: string, entityId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<GetEntityTypeEntityIdDocumentsResponse>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveAllDocuments(entityType, entityId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Note: A document is updated using a Multi-part form upload Body Parts name Name or summary of the document description Description of the document file The file to be uploaded
* @summary Update a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {number} [contentLength] Content-Length
* @param {FormDataBodyPart} [file]
* @param {string} [name] name
* @param {string} [description] description
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async updateDocument(entityType: string, entityId: number, documentId: number, contentLength?: number, file?: FormDataBodyPart, name?: string, description?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PutEntityTypeEntityIdDocumentsResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.updateDocument(entityType, entityId, documentId, contentLength, file, name, description, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* DocumentsApi - factory interface
* @export
*/
export const DocumentsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = DocumentsApiFp(configuration)
return {
/**
* Note: A document is created using a Multi-part form upload Body Parts name : Name or summary of the document description : Description of the document file : The file to be uploaded Mandatory Fields : file and description
* @summary Create a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} [contentLength] Content-Length
* @param {FormDataBodyPart} [file]
* @param {string} [name] name
* @param {string} [description] description
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createDocument(entityType: string, entityId: number, contentLength?: number, file?: FormDataBodyPart, name?: string, description?: string, options?: any): AxiosPromise<PostEntityTypeEntityIdDocumentsResponse> {
return localVarFp.createDocument(entityType, entityId, contentLength, file, name, description, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Remove a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteDocument(entityType: string, entityId: number, documentId: number, options?: any): AxiosPromise<DeleteEntityTypeEntityIdDocumentsResponse> {
return localVarFp.deleteDocument(entityType, entityId, documentId, options).then((request) => request(axios, basePath));
},
/**
* Request used to download the file associated with the document Example Requests: clients/1/documents/1/attachment loans/1/documents/1/attachment
* @summary Retrieve Binary File associated with Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
downloadFile(entityType: string, entityId: number, documentId: number, options?: any): AxiosPromise<void> {
return localVarFp.downloadFile(entityType, entityId, documentId, options).then((request) => request(axios, basePath));
},
/**
* Example Requests: clients/1/documents/1 loans/1/documents/1 client_identifiers/1/documents/1?fields=name,description
* @summary Retrieve a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getDocument(entityType: string, entityId: number, documentId: number, options?: any): AxiosPromise<GetEntityTypeEntityIdDocumentsResponse> {
return localVarFp.getDocument(entityType, entityId, documentId, options).then((request) => request(axios, basePath));
},
/**
* Example Requests: clients/1/documents client_identifiers/1/documents loans/1/documents?fields=name,description
* @summary List documents
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
retrieveAllDocuments(entityType: string, entityId: number, options?: any): AxiosPromise<Array<GetEntityTypeEntityIdDocumentsResponse>> {
return localVarFp.retrieveAllDocuments(entityType, entityId, options).then((request) => request(axios, basePath));
},
/**
* Note: A document is updated using a Multi-part form upload Body Parts name Name or summary of the document description Description of the document file The file to be uploaded
* @summary Update a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {number} [contentLength] Content-Length
* @param {FormDataBodyPart} [file]
* @param {string} [name] name
* @param {string} [description] description
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDocument(entityType: string, entityId: number, documentId: number, contentLength?: number, file?: FormDataBodyPart, name?: string, description?: string, options?: any): AxiosPromise<PutEntityTypeEntityIdDocumentsResponse> {
return localVarFp.updateDocument(entityType, entityId, documentId, contentLength, file, name, description, options).then((request) => request(axios, basePath));
},
};
};
/**
* DocumentsApi - object-oriented interface
* @export
* @class DocumentsApi
* @extends {BaseAPI}
*/
export class DocumentsApi extends BaseAPI {
/**
* Note: A document is created using a Multi-part form upload Body Parts name : Name or summary of the document description : Description of the document file : The file to be uploaded Mandatory Fields : file and description
* @summary Create a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} [contentLength] Content-Length
* @param {FormDataBodyPart} [file]
* @param {string} [name] name
* @param {string} [description] description
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DocumentsApi
*/
public createDocument(entityType: string, entityId: number, contentLength?: number, file?: FormDataBodyPart, name?: string, description?: string, options?: any) {
return DocumentsApiFp(this.configuration).createDocument(entityType, entityId, contentLength, file, name, description, options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Remove a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DocumentsApi
*/
public deleteDocument(entityType: string, entityId: number, documentId: number, options?: any) {
return DocumentsApiFp(this.configuration).deleteDocument(entityType, entityId, documentId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Request used to download the file associated with the document Example Requests: clients/1/documents/1/attachment loans/1/documents/1/attachment
* @summary Retrieve Binary File associated with Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DocumentsApi
*/
public downloadFile(entityType: string, entityId: number, documentId: number, options?: any) {
return DocumentsApiFp(this.configuration).downloadFile(entityType, entityId, documentId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Example Requests: clients/1/documents/1 loans/1/documents/1 client_identifiers/1/documents/1?fields=name,description
* @summary Retrieve a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DocumentsApi
*/
public getDocument(entityType: string, entityId: number, documentId: number, options?: any) {
return DocumentsApiFp(this.configuration).getDocument(entityType, entityId, documentId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Example Requests: clients/1/documents client_identifiers/1/documents loans/1/documents?fields=name,description
* @summary List documents
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DocumentsApi
*/
public retrieveAllDocuments(entityType: string, entityId: number, options?: any) {
return DocumentsApiFp(this.configuration).retrieveAllDocuments(entityType, entityId, options).then((request) => request(this.axios, this.basePath));
}
/**
* Note: A document is updated using a Multi-part form upload Body Parts name Name or summary of the document description Description of the document file The file to be uploaded
* @summary Update a Document
* @param {string} entityType entityType
* @param {number} entityId entityId
* @param {number} documentId documentId
* @param {number} [contentLength] Content-Length
* @param {FormDataBodyPart} [file]
* @param {string} [name] name
* @param {string} [description] description
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DocumentsApi
*/
public updateDocument(entityType: string, entityId: number, documentId: number, contentLength?: number, file?: FormDataBodyPart, name?: string, description?: string, options?: any) {
return DocumentsApiFp(this.configuration).updateDocument(entityType, entityId, documentId, contentLength, file, name, description, options).then((request) => request(this.axios, this.basePath));
}
}