UNPKG

fineract_sdk

Version:

Wrapper around fineract api.

514 lines (459 loc) 26 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'; // @ts-ignore import { DeleteChargesChargeIdResponse } from '../models'; // @ts-ignore import { GetChargesResponse } from '../models'; // @ts-ignore import { GetChargesTemplateResponse } from '../models'; // @ts-ignore import { PostChargesRequest } from '../models'; // @ts-ignore import { PostChargesResponse } from '../models'; // @ts-ignore import { PutChargesChargeIdRequest } from '../models'; // @ts-ignore import { PutChargesChargeIdResponse } from '../models'; /** * ChargesApi - axios parameter creator * @export */ export const ChargesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Define a new charge that can later be associated with loans and savings through their respective product definitions or directly on each account instance. * @summary Create/Define a Charge * @param {PostChargesRequest} postChargesRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createCharge: async (postChargesRequest: PostChargesRequest, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'postChargesRequest' is not null or undefined assertParamExists('createCharge', 'postChargesRequest', postChargesRequest) const localVarPath = `/charges`; // 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(postChargesRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Deletes a Charge. * @summary Delete a Charge * @param {number} chargeId chargeId * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteCharge: async (chargeId: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'chargeId' is not null or undefined assertParamExists('deleteCharge', 'chargeId', chargeId) const localVarPath = `/charges/{chargeId}` .replace(`{${"chargeId"}}`, encodeURIComponent(String(chargeId))); // 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, }; }, /** * Returns the list of defined charges. Example Requests: charges * @summary Retrieve Charges * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveAllCharges: async (options: any = {}): Promise<RequestArgs> => { const localVarPath = `/charges`; // 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, }; }, /** * Returns the details of a defined Charge. Example Requests: charges/1 * @summary Retrieve a Charge * @param {number} chargeId chargeId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveCharge: async (chargeId: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'chargeId' is not null or undefined assertParamExists('retrieveCharge', 'chargeId', chargeId) const localVarPath = `/charges/{chargeId}` .replace(`{${"chargeId"}}`, encodeURIComponent(String(chargeId))); // 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, }; }, /** * This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: Field Defaults Allowed description Lists Example Request: charges/template * @summary Retrieve Charge Template * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveNewChargeDetails: async (options: any = {}): Promise<RequestArgs> => { const localVarPath = `/charges/template`; // 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, }; }, /** * Updates the details of a Charge. * @summary Update a Charge * @param {number} chargeId chargeId * @param {PutChargesChargeIdRequest} putChargesChargeIdRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateCharge: async (chargeId: number, putChargesChargeIdRequest: PutChargesChargeIdRequest, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'chargeId' is not null or undefined assertParamExists('updateCharge', 'chargeId', chargeId) // verify required parameter 'putChargesChargeIdRequest' is not null or undefined assertParamExists('updateCharge', 'putChargesChargeIdRequest', putChargesChargeIdRequest) const localVarPath = `/charges/{chargeId}` .replace(`{${"chargeId"}}`, encodeURIComponent(String(chargeId))); // 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(putChargesChargeIdRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ChargesApi - functional programming interface * @export */ export const ChargesApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ChargesApiAxiosParamCreator(configuration) return { /** * Define a new charge that can later be associated with loans and savings through their respective product definitions or directly on each account instance. * @summary Create/Define a Charge * @param {PostChargesRequest} postChargesRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createCharge(postChargesRequest: PostChargesRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostChargesResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.createCharge(postChargesRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Deletes a Charge. * @summary Delete a Charge * @param {number} chargeId chargeId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteCharge(chargeId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteChargesChargeIdResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCharge(chargeId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns the list of defined charges. Example Requests: charges * @summary Retrieve Charges * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveAllCharges(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<GetChargesResponse>>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveAllCharges(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns the details of a defined Charge. Example Requests: charges/1 * @summary Retrieve a Charge * @param {number} chargeId chargeId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveCharge(chargeId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetChargesResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveCharge(chargeId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: Field Defaults Allowed description Lists Example Request: charges/template * @summary Retrieve Charge Template * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveNewChargeDetails(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetChargesTemplateResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveNewChargeDetails(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Updates the details of a Charge. * @summary Update a Charge * @param {number} chargeId chargeId * @param {PutChargesChargeIdRequest} putChargesChargeIdRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateCharge(chargeId: number, putChargesChargeIdRequest: PutChargesChargeIdRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PutChargesChargeIdResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateCharge(chargeId, putChargesChargeIdRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * ChargesApi - factory interface * @export */ export const ChargesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ChargesApiFp(configuration) return { /** * Define a new charge that can later be associated with loans and savings through their respective product definitions or directly on each account instance. * @summary Create/Define a Charge * @param {PostChargesRequest} postChargesRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createCharge(postChargesRequest: PostChargesRequest, options?: any): AxiosPromise<PostChargesResponse> { return localVarFp.createCharge(postChargesRequest, options).then((request) => request(axios, basePath)); }, /** * Deletes a Charge. * @summary Delete a Charge * @param {number} chargeId chargeId * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteCharge(chargeId: number, options?: any): AxiosPromise<DeleteChargesChargeIdResponse> { return localVarFp.deleteCharge(chargeId, options).then((request) => request(axios, basePath)); }, /** * Returns the list of defined charges. Example Requests: charges * @summary Retrieve Charges * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveAllCharges(options?: any): AxiosPromise<Array<GetChargesResponse>> { return localVarFp.retrieveAllCharges(options).then((request) => request(axios, basePath)); }, /** * Returns the details of a defined Charge. Example Requests: charges/1 * @summary Retrieve a Charge * @param {number} chargeId chargeId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveCharge(chargeId: number, options?: any): AxiosPromise<GetChargesResponse> { return localVarFp.retrieveCharge(chargeId, options).then((request) => request(axios, basePath)); }, /** * This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: Field Defaults Allowed description Lists Example Request: charges/template * @summary Retrieve Charge Template * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveNewChargeDetails(options?: any): AxiosPromise<GetChargesTemplateResponse> { return localVarFp.retrieveNewChargeDetails(options).then((request) => request(axios, basePath)); }, /** * Updates the details of a Charge. * @summary Update a Charge * @param {number} chargeId chargeId * @param {PutChargesChargeIdRequest} putChargesChargeIdRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateCharge(chargeId: number, putChargesChargeIdRequest: PutChargesChargeIdRequest, options?: any): AxiosPromise<PutChargesChargeIdResponse> { return localVarFp.updateCharge(chargeId, putChargesChargeIdRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * ChargesApi - object-oriented interface * @export * @class ChargesApi * @extends {BaseAPI} */ export class ChargesApi extends BaseAPI { /** * Define a new charge that can later be associated with loans and savings through their respective product definitions or directly on each account instance. * @summary Create/Define a Charge * @param {PostChargesRequest} postChargesRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ChargesApi */ public createCharge(postChargesRequest: PostChargesRequest, options?: any) { return ChargesApiFp(this.configuration).createCharge(postChargesRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Deletes a Charge. * @summary Delete a Charge * @param {number} chargeId chargeId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ChargesApi */ public deleteCharge(chargeId: number, options?: any) { return ChargesApiFp(this.configuration).deleteCharge(chargeId, options).then((request) => request(this.axios, this.basePath)); } /** * Returns the list of defined charges. Example Requests: charges * @summary Retrieve Charges * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ChargesApi */ public retrieveAllCharges(options?: any) { return ChargesApiFp(this.configuration).retrieveAllCharges(options).then((request) => request(this.axios, this.basePath)); } /** * Returns the details of a defined Charge. Example Requests: charges/1 * @summary Retrieve a Charge * @param {number} chargeId chargeId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ChargesApi */ public retrieveCharge(chargeId: number, options?: any) { return ChargesApiFp(this.configuration).retrieveCharge(chargeId, options).then((request) => request(this.axios, this.basePath)); } /** * This is a convenience resource. It can be useful when building maintenance user interface screens for client applications. The template data returned consists of any or all of: Field Defaults Allowed description Lists Example Request: charges/template * @summary Retrieve Charge Template * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ChargesApi */ public retrieveNewChargeDetails(options?: any) { return ChargesApiFp(this.configuration).retrieveNewChargeDetails(options).then((request) => request(this.axios, this.basePath)); } /** * Updates the details of a Charge. * @summary Update a Charge * @param {number} chargeId chargeId * @param {PutChargesChargeIdRequest} putChargesChargeIdRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ChargesApi */ public updateCharge(chargeId: number, putChargesChargeIdRequest: PutChargesChargeIdRequest, options?: any) { return ChargesApiFp(this.configuration).updateCharge(chargeId, putChargesChargeIdRequest, options).then((request) => request(this.axios, this.basePath)); } }