fineract_sdk
Version:
Wrapper around fineract api.
220 lines (196 loc) • 10.9 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 { GetAccountTransferTemplateResponse } from '../models';
// @ts-ignore
import { PostNewTransferResponse } from '../models';
/**
* SelfAccountTransferApi - axios parameter creator
* @export
*/
export const SelfAccountTransferApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Ability to create new transfer of monetary funds from one account to another. Example Requests: self/accounttransfers/
* @summary Create new Transfer
* @param {string} [type]
* @param {string} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
create14: async (type?: string, body?: string, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/self/accounttransfers`;
// 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)
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
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,
};
},
/**
* Returns list of loan/savings accounts that can be used for account transfer Example Requests: self/accounttransfers/template
* @summary Retrieve Account Transfer Template
* @param {string} [type]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
template15: async (type?: string, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/self/accounttransfers/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)
if (type !== undefined) {
localVarQueryParameter['type'] = type;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* SelfAccountTransferApi - functional programming interface
* @export
*/
export const SelfAccountTransferApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = SelfAccountTransferApiAxiosParamCreator(configuration)
return {
/**
* Ability to create new transfer of monetary funds from one account to another. Example Requests: self/accounttransfers/
* @summary Create new Transfer
* @param {string} [type]
* @param {string} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async create14(type?: string, body?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<PostNewTransferResponse>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.create14(type, body, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Returns list of loan/savings accounts that can be used for account transfer Example Requests: self/accounttransfers/template
* @summary Retrieve Account Transfer Template
* @param {string} [type]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async template15(type?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<GetAccountTransferTemplateResponse>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.template15(type, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};
/**
* SelfAccountTransferApi - factory interface
* @export
*/
export const SelfAccountTransferApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = SelfAccountTransferApiFp(configuration)
return {
/**
* Ability to create new transfer of monetary funds from one account to another. Example Requests: self/accounttransfers/
* @summary Create new Transfer
* @param {string} [type]
* @param {string} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
create14(type?: string, body?: string, options?: any): AxiosPromise<Array<PostNewTransferResponse>> {
return localVarFp.create14(type, body, options).then((request) => request(axios, basePath));
},
/**
* Returns list of loan/savings accounts that can be used for account transfer Example Requests: self/accounttransfers/template
* @summary Retrieve Account Transfer Template
* @param {string} [type]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
template15(type?: string, options?: any): AxiosPromise<Array<GetAccountTransferTemplateResponse>> {
return localVarFp.template15(type, options).then((request) => request(axios, basePath));
},
};
};
/**
* SelfAccountTransferApi - object-oriented interface
* @export
* @class SelfAccountTransferApi
* @extends {BaseAPI}
*/
export class SelfAccountTransferApi extends BaseAPI {
/**
* Ability to create new transfer of monetary funds from one account to another. Example Requests: self/accounttransfers/
* @summary Create new Transfer
* @param {string} [type]
* @param {string} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SelfAccountTransferApi
*/
public create14(type?: string, body?: string, options?: any) {
return SelfAccountTransferApiFp(this.configuration).create14(type, body, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns list of loan/savings accounts that can be used for account transfer Example Requests: self/accounttransfers/template
* @summary Retrieve Account Transfer Template
* @param {string} [type]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof SelfAccountTransferApi
*/
public template15(type?: string, options?: any) {
return SelfAccountTransferApiFp(this.configuration).template15(type, options).then((request) => request(this.axios, this.basePath));
}
}