UNPKG

fineract_sdk

Version:

Wrapper around fineract api.

564 lines (508 loc) 27.7 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'; /** * CalendarApi - axios parameter creator * @export */ export const CalendarApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @param {string} entityType * @param {number} entityId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createCalendar: async (entityType: string, entityId: number, body?: string, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'entityType' is not null or undefined assertParamExists('createCalendar', 'entityType', entityType) // verify required parameter 'entityId' is not null or undefined assertParamExists('createCalendar', 'entityId', entityId) const localVarPath = `/{entityType}/{entityId}/calendars` .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; // 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 {string} entityType * @param {number} entityId * @param {number} calendarId * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteCalendar: async (entityType: string, entityId: number, calendarId: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'entityType' is not null or undefined assertParamExists('deleteCalendar', 'entityType', entityType) // verify required parameter 'entityId' is not null or undefined assertParamExists('deleteCalendar', 'entityId', entityId) // verify required parameter 'calendarId' is not null or undefined assertParamExists('deleteCalendar', 'calendarId', calendarId) const localVarPath = `/{entityType}/{entityId}/calendars/{calendarId}` .replace(`{${"entityType"}}`, encodeURIComponent(String(entityType))) .replace(`{${"entityId"}}`, encodeURIComponent(String(entityId))) .replace(`{${"calendarId"}}`, encodeURIComponent(String(calendarId))); // 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, }; }, /** * * @param {number} calendarId * @param {string} entityType * @param {number} entityId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveCalendar: async (calendarId: number, entityType: string, entityId: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'calendarId' is not null or undefined assertParamExists('retrieveCalendar', 'calendarId', calendarId) // verify required parameter 'entityType' is not null or undefined assertParamExists('retrieveCalendar', 'entityType', entityType) // verify required parameter 'entityId' is not null or undefined assertParamExists('retrieveCalendar', 'entityId', entityId) const localVarPath = `/{entityType}/{entityId}/calendars/{calendarId}` .replace(`{${"calendarId"}}`, encodeURIComponent(String(calendarId))) .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, }; }, /** * * @param {string} entityType * @param {number} entityId * @param {string} [calendarType] * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveCalendarsByEntity: async (entityType: string, entityId: number, calendarType?: string, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'entityType' is not null or undefined assertParamExists('retrieveCalendarsByEntity', 'entityType', entityType) // verify required parameter 'entityId' is not null or undefined assertParamExists('retrieveCalendarsByEntity', 'entityId', entityId) const localVarPath = `/{entityType}/{entityId}/calendars` .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) if (calendarType !== undefined) { localVarQueryParameter['calendarType'] = calendarType; } 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 {string} entityType * @param {number} entityId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveNewCalendarDetails: async (entityType: string, entityId: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'entityType' is not null or undefined assertParamExists('retrieveNewCalendarDetails', 'entityType', entityType) // verify required parameter 'entityId' is not null or undefined assertParamExists('retrieveNewCalendarDetails', 'entityId', entityId) const localVarPath = `/{entityType}/{entityId}/calendars/template` .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, }; }, /** * * @param {string} entityType * @param {number} entityId * @param {number} calendarId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateCalendar: async (entityType: string, entityId: number, calendarId: number, body?: string, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'entityType' is not null or undefined assertParamExists('updateCalendar', 'entityType', entityType) // verify required parameter 'entityId' is not null or undefined assertParamExists('updateCalendar', 'entityId', entityId) // verify required parameter 'calendarId' is not null or undefined assertParamExists('updateCalendar', 'calendarId', calendarId) const localVarPath = `/{entityType}/{entityId}/calendars/{calendarId}` .replace(`{${"entityType"}}`, encodeURIComponent(String(entityType))) .replace(`{${"entityId"}}`, encodeURIComponent(String(entityId))) .replace(`{${"calendarId"}}`, encodeURIComponent(String(calendarId))); // 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, }; }, } }; /** * CalendarApi - functional programming interface * @export */ export const CalendarApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = CalendarApiAxiosParamCreator(configuration) return { /** * * @param {string} entityType * @param {number} entityId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createCalendar(entityType: string, entityId: number, body?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.createCalendar(entityType, entityId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @param {string} entityType * @param {number} entityId * @param {number} calendarId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteCalendar(entityType: string, entityId: number, calendarId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCalendar(entityType, entityId, calendarId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @param {number} calendarId * @param {string} entityType * @param {number} entityId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveCalendar(calendarId: number, entityType: string, entityId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveCalendar(calendarId, entityType, entityId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @param {string} entityType * @param {number} entityId * @param {string} [calendarType] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveCalendarsByEntity(entityType: string, entityId: number, calendarType?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveCalendarsByEntity(entityType, entityId, calendarType, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @param {string} entityType * @param {number} entityId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveNewCalendarDetails(entityType: string, entityId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveNewCalendarDetails(entityType, entityId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * * @param {string} entityType * @param {number} entityId * @param {number} calendarId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateCalendar(entityType: string, entityId: number, calendarId: number, body?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateCalendar(entityType, entityId, calendarId, body, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * CalendarApi - factory interface * @export */ export const CalendarApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = CalendarApiFp(configuration) return { /** * * @param {string} entityType * @param {number} entityId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createCalendar(entityType: string, entityId: number, body?: string, options?: any): AxiosPromise<string> { return localVarFp.createCalendar(entityType, entityId, body, options).then((request) => request(axios, basePath)); }, /** * * @param {string} entityType * @param {number} entityId * @param {number} calendarId * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteCalendar(entityType: string, entityId: number, calendarId: number, options?: any): AxiosPromise<string> { return localVarFp.deleteCalendar(entityType, entityId, calendarId, options).then((request) => request(axios, basePath)); }, /** * * @param {number} calendarId * @param {string} entityType * @param {number} entityId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveCalendar(calendarId: number, entityType: string, entityId: number, options?: any): AxiosPromise<string> { return localVarFp.retrieveCalendar(calendarId, entityType, entityId, options).then((request) => request(axios, basePath)); }, /** * * @param {string} entityType * @param {number} entityId * @param {string} [calendarType] * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveCalendarsByEntity(entityType: string, entityId: number, calendarType?: string, options?: any): AxiosPromise<string> { return localVarFp.retrieveCalendarsByEntity(entityType, entityId, calendarType, options).then((request) => request(axios, basePath)); }, /** * * @param {string} entityType * @param {number} entityId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveNewCalendarDetails(entityType: string, entityId: number, options?: any): AxiosPromise<string> { return localVarFp.retrieveNewCalendarDetails(entityType, entityId, options).then((request) => request(axios, basePath)); }, /** * * @param {string} entityType * @param {number} entityId * @param {number} calendarId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateCalendar(entityType: string, entityId: number, calendarId: number, body?: string, options?: any): AxiosPromise<string> { return localVarFp.updateCalendar(entityType, entityId, calendarId, body, options).then((request) => request(axios, basePath)); }, }; }; /** * CalendarApi - object-oriented interface * @export * @class CalendarApi * @extends {BaseAPI} */ export class CalendarApi extends BaseAPI { /** * * @param {string} entityType * @param {number} entityId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CalendarApi */ public createCalendar(entityType: string, entityId: number, body?: string, options?: any) { return CalendarApiFp(this.configuration).createCalendar(entityType, entityId, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {string} entityType * @param {number} entityId * @param {number} calendarId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CalendarApi */ public deleteCalendar(entityType: string, entityId: number, calendarId: number, options?: any) { return CalendarApiFp(this.configuration).deleteCalendar(entityType, entityId, calendarId, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {number} calendarId * @param {string} entityType * @param {number} entityId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CalendarApi */ public retrieveCalendar(calendarId: number, entityType: string, entityId: number, options?: any) { return CalendarApiFp(this.configuration).retrieveCalendar(calendarId, entityType, entityId, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {string} entityType * @param {number} entityId * @param {string} [calendarType] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CalendarApi */ public retrieveCalendarsByEntity(entityType: string, entityId: number, calendarType?: string, options?: any) { return CalendarApiFp(this.configuration).retrieveCalendarsByEntity(entityType, entityId, calendarType, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {string} entityType * @param {number} entityId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CalendarApi */ public retrieveNewCalendarDetails(entityType: string, entityId: number, options?: any) { return CalendarApiFp(this.configuration).retrieveNewCalendarDetails(entityType, entityId, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {string} entityType * @param {number} entityId * @param {number} calendarId * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CalendarApi */ public updateCalendar(entityType: string, entityId: number, calendarId: number, body?: string, options?: any) { return CalendarApiFp(this.configuration).updateCalendar(entityType, entityId, calendarId, body, options).then((request) => request(this.axios, this.basePath)); } }