UNPKG

fineract_sdk

Version:

Wrapper around fineract api.

369 lines (330 loc) 17.4 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 { GetFundsResponse } from '../models'; // @ts-ignore import { PostFundsRequest } from '../models'; // @ts-ignore import { PostFundsResponse } from '../models'; // @ts-ignore import { PutFundsFundIdRequest } from '../models'; // @ts-ignore import { PutFundsFundIdResponse } from '../models'; /** * FundsApi - axios parameter creator * @export */ export const FundsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Creates a Fund * @summary Create a Fund * @param {PostFundsRequest} postFundsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createFund: async (postFundsRequest: PostFundsRequest, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'postFundsRequest' is not null or undefined assertParamExists('createFund', 'postFundsRequest', postFundsRequest) const localVarPath = `/funds`; // 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(postFundsRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns the details of a Fund. Example Requests: funds/1 * @summary Retrieve a Fund * @param {number} fundId fundId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retreiveFund: async (fundId: number, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'fundId' is not null or undefined assertParamExists('retreiveFund', 'fundId', fundId) const localVarPath = `/funds/{fundId}` .replace(`{${"fundId"}}`, encodeURIComponent(String(fundId))); // 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 list of funds. Example Requests: funds * @summary Retrieve Funds * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveFunds: async (options: any = {}): Promise<RequestArgs> => { const localVarPath = `/funds`; // 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 fund. * @summary Update a Fund * @param {number} fundId fundId * @param {PutFundsFundIdRequest} putFundsFundIdRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateFund: async (fundId: number, putFundsFundIdRequest: PutFundsFundIdRequest, options: any = {}): Promise<RequestArgs> => { // verify required parameter 'fundId' is not null or undefined assertParamExists('updateFund', 'fundId', fundId) // verify required parameter 'putFundsFundIdRequest' is not null or undefined assertParamExists('updateFund', 'putFundsFundIdRequest', putFundsFundIdRequest) const localVarPath = `/funds/{fundId}` .replace(`{${"fundId"}}`, encodeURIComponent(String(fundId))); // 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(putFundsFundIdRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * FundsApi - functional programming interface * @export */ export const FundsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = FundsApiAxiosParamCreator(configuration) return { /** * Creates a Fund * @summary Create a Fund * @param {PostFundsRequest} postFundsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createFund(postFundsRequest: PostFundsRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostFundsResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.createFund(postFundsRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns the details of a Fund. Example Requests: funds/1 * @summary Retrieve a Fund * @param {number} fundId fundId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retreiveFund(fundId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetFundsResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retreiveFund(fundId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Returns the list of funds. Example Requests: funds * @summary Retrieve Funds * @param {*} [options] Override http request option. * @throws {RequiredError} */ async retrieveFunds(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<GetFundsResponse>>> { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveFunds(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Updates the details of a fund. * @summary Update a Fund * @param {number} fundId fundId * @param {PutFundsFundIdRequest} putFundsFundIdRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateFund(fundId: number, putFundsFundIdRequest: PutFundsFundIdRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PutFundsFundIdResponse>> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateFund(fundId, putFundsFundIdRequest, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * FundsApi - factory interface * @export */ export const FundsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = FundsApiFp(configuration) return { /** * Creates a Fund * @summary Create a Fund * @param {PostFundsRequest} postFundsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ createFund(postFundsRequest: PostFundsRequest, options?: any): AxiosPromise<PostFundsResponse> { return localVarFp.createFund(postFundsRequest, options).then((request) => request(axios, basePath)); }, /** * Returns the details of a Fund. Example Requests: funds/1 * @summary Retrieve a Fund * @param {number} fundId fundId * @param {*} [options] Override http request option. * @throws {RequiredError} */ retreiveFund(fundId: number, options?: any): AxiosPromise<GetFundsResponse> { return localVarFp.retreiveFund(fundId, options).then((request) => request(axios, basePath)); }, /** * Returns the list of funds. Example Requests: funds * @summary Retrieve Funds * @param {*} [options] Override http request option. * @throws {RequiredError} */ retrieveFunds(options?: any): AxiosPromise<Array<GetFundsResponse>> { return localVarFp.retrieveFunds(options).then((request) => request(axios, basePath)); }, /** * Updates the details of a fund. * @summary Update a Fund * @param {number} fundId fundId * @param {PutFundsFundIdRequest} putFundsFundIdRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateFund(fundId: number, putFundsFundIdRequest: PutFundsFundIdRequest, options?: any): AxiosPromise<PutFundsFundIdResponse> { return localVarFp.updateFund(fundId, putFundsFundIdRequest, options).then((request) => request(axios, basePath)); }, }; }; /** * FundsApi - object-oriented interface * @export * @class FundsApi * @extends {BaseAPI} */ export class FundsApi extends BaseAPI { /** * Creates a Fund * @summary Create a Fund * @param {PostFundsRequest} postFundsRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FundsApi */ public createFund(postFundsRequest: PostFundsRequest, options?: any) { return FundsApiFp(this.configuration).createFund(postFundsRequest, options).then((request) => request(this.axios, this.basePath)); } /** * Returns the details of a Fund. Example Requests: funds/1 * @summary Retrieve a Fund * @param {number} fundId fundId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FundsApi */ public retreiveFund(fundId: number, options?: any) { return FundsApiFp(this.configuration).retreiveFund(fundId, options).then((request) => request(this.axios, this.basePath)); } /** * Returns the list of funds. Example Requests: funds * @summary Retrieve Funds * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FundsApi */ public retrieveFunds(options?: any) { return FundsApiFp(this.configuration).retrieveFunds(options).then((request) => request(this.axios, this.basePath)); } /** * Updates the details of a fund. * @summary Update a Fund * @param {number} fundId fundId * @param {PutFundsFundIdRequest} putFundsFundIdRequest * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FundsApi */ public updateFund(fundId: number, putFundsFundIdRequest: PutFundsFundIdRequest, options?: any) { return FundsApiFp(this.configuration).updateFund(fundId, putFundsFundIdRequest, options).then((request) => request(this.axios, this.basePath)); } }