UNPKG

fineract_sdk

Version:

Wrapper around fineract api.

297 lines (266 loc) 14.6 kB
/* 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'; /** * LoanDisbursementDetailsApi - axios parameter creator * @export */ export const LoanDisbursementDetailsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @param {number} loanId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ addAndDeleteDisbursementDetail: async (loanId: number, body?: string, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'loanId' is not null or undefined assertParamExists('addAndDeleteDisbursementDetail', 'loanId', loanId) const localVarPath = `/loans/{loanId}/disbursements/editDisbursements` .replace(`{${"loanId"}}`, encodeURIComponent(String(loanId))); // 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; // authentication basicAuth required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication tenantid required await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @param {number} loanId * @param {number} disbursementId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retriveDetail: async (loanId: number, disbursementId: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'loanId' is not null or undefined assertParamExists('retriveDetail', 'loanId', loanId) // verify required parameter 'disbursementId' is not null or undefined assertParamExists('retriveDetail', 'disbursementId', disbursementId) const localVarPath = `/loans/{loanId}/disbursements/{disbursementId}` .replace(`{${"loanId"}}`, encodeURIComponent(String(loanId))) .replace(`{${"disbursementId"}}`, encodeURIComponent(String(disbursementId))); // 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, }; }, /** * * @param {number} loanId * @param {number} disbursementId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateDisbursementDate: async (loanId: number, disbursementId: number, body?: string, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'loanId' is not null or undefined assertParamExists('updateDisbursementDate', 'loanId', loanId) // verify required parameter 'disbursementId' is not null or undefined assertParamExists('updateDisbursementDate', 'disbursementId', disbursementId) const localVarPath = `/loans/{loanId}/disbursements/{disbursementId}` .replace(`{${"loanId"}}`, encodeURIComponent(String(loanId))) .replace(`{${"disbursementId"}}`, encodeURIComponent(String(disbursementId))); // 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; // authentication basicAuth required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) // authentication tenantid required await setApiKeyToObject(localVarHeaderParameter, "fineract-platform-tenantid", configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * LoanDisbursementDetailsApi - functional programming interface * @export */ export const LoanDisbursementDetailsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = LoanDisbursementDetailsApiAxiosParamCreator(configuration) return { /** * * @param {number} loanId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async addAndDeleteDisbursementDetail(loanId: number, body?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.addAndDeleteDisbursementDetail(loanId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @param {number} loanId * @param {number} disbursementId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retriveDetail(loanId: number, disbursementId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retriveDetail(loanId, disbursementId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @param {number} loanId * @param {number} disbursementId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateDisbursementDate(loanId: number, disbursementId: number, body?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateDisbursementDate(loanId, disbursementId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * LoanDisbursementDetailsApi - factory interface * @export */ export const LoanDisbursementDetailsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = LoanDisbursementDetailsApiFp(configuration) return { /** * * @param {number} loanId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ addAndDeleteDisbursementDetail(loanId: number, body?: string, options?: any): AxiosPromise<string> { return localVarFp.addAndDeleteDisbursementDetail(loanId, body, options).then((request) => request(axios, basePath)); }, /** * * @param {number} loanId * @param {number} disbursementId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retriveDetail(loanId: number, disbursementId: number, options?: any): AxiosPromise<string> { return localVarFp.retriveDetail(loanId, disbursementId, options).then((request) => request(axios, basePath)); }, /** * * @param {number} loanId * @param {number} disbursementId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateDisbursementDate(loanId: number, disbursementId: number, body?: string, options?: any): AxiosPromise<string> { return localVarFp.updateDisbursementDate(loanId, disbursementId, body, options).then((request) => request(axios, basePath)); }, }; }; /** * LoanDisbursementDetailsApi - object-oriented interface * @export * @class LoanDisbursementDetailsApi * @extends {BaseAPI} */ export class LoanDisbursementDetailsApi extends BaseAPI { /** * * @param {number} loanId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LoanDisbursementDetailsApi */ public addAndDeleteDisbursementDetail(loanId: number, body?: string, options?: any) { return LoanDisbursementDetailsApiFp(this.configuration).addAndDeleteDisbursementDetail(loanId, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {number} loanId * @param {number} disbursementId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LoanDisbursementDetailsApi */ public retriveDetail(loanId: number, disbursementId: number, options?: any) { return LoanDisbursementDetailsApiFp(this.configuration).retriveDetail(loanId, disbursementId, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {number} loanId * @param {number} disbursementId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof LoanDisbursementDetailsApi */ public updateDisbursementDate(loanId: number, disbursementId: number, body?: string, options?: any) { return LoanDisbursementDetailsApiFp(this.configuration).updateDisbursementDate(loanId, disbursementId, body, options).then((request) => request(this.axios, this.basePath)); } }