fineract_sdk
Version:
Wrapper around fineract api.
832 lines (722 loc) • 79.1 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 { DeleteDataTablesDatatableAppTableIdDatatableIdResponse } from '../models';
// @ts-ignore
import { DeleteDataTablesDatatableAppTableIdResponse } from '../models';
// @ts-ignore
import { DeleteDataTablesResponse } from '../models';
// @ts-ignore
import { GetDataTablesAppTableIdResponse } from '../models';
// @ts-ignore
import { GetDataTablesResponse } from '../models';
// @ts-ignore
import { PostDataTablesAppTableIdRequest } from '../models';
// @ts-ignore
import { PostDataTablesAppTableIdResponse } from '../models';
// @ts-ignore
import { PostDataTablesRequest } from '../models';
// @ts-ignore
import { PostDataTablesResponse } from '../models';
// @ts-ignore
import { PutDataTablesAppTableIdDatatableIdRequest } from '../models';
// @ts-ignore
import { PutDataTablesAppTableIdDatatableIdResponse } from '../models';
// @ts-ignore
import { PutDataTablesAppTableIdRequest } from '../models';
// @ts-ignore
import { PutDataTablesAppTableIdResponse } from '../models';
// @ts-ignore
import { PutDataTablesRequest } from '../models';
// @ts-ignore
import { PutDataTablesResponse } from '../models';
/**
* DataTablesApi - axios parameter creator
* @export
*/
export const DataTablesApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Create a new data table and registers it with the Apache Fineract Core application table. Field Descriptions Mandatory - datatableName : The name of the Data Table. Mandatory - apptableName Application table name. Must be one of the following: m_client m_group m_loan m_office m_saving_account m_product_loan m_savings_product Mandatory - columns An array of columns in the new Data Table. Optional - multiRow Allows to create multiple entries in the Data Table. Optional, defaults to false. If this property is not provided Data Table will allow only one entry. Field Descriptions - columns Mandatory - name Name of the created column. Can contain only alphanumeric characters, underscores and spaces, but cannot start with a number. Cannot start or end with an underscore or space. Mandatory - type Column type. Must be one of the following: Boolean Date DateTime Decimal Dropdown Number String Text Mandatory [type = Dropdown] - code Used in Code description fields. Column name becomes: code_cd_name. Mandatory if using type Dropdown, otherwise an error is returned. Optional - mandatory Determines whether this column must have a value in every entry. Optional, defaults to false. Mandatory [type = String] - length Length of the text field. Mandatory if type String is used, otherwise an error is returned.
* @summary Create Data Table
* @param {PostDataTablesRequest} postDataTablesRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createDatatable: async (postDataTablesRequest: PostDataTablesRequest, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'postDataTablesRequest' is not null or undefined
assertParamExists('createDatatable', 'postDataTablesRequest', postDataTablesRequest)
const localVarPath = `/datatables`;
// 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(postDataTablesRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Adds a row to the data table. Note that the default datatable UI functionality converts any field name containing spaces to underscores when using the API. This means the field name \"Business Description\" is considered the same as \"Business_Description\". So you shouldn\'t have both \"versions\" in any data table.
* @summary Create Entry in Data Table
* @param {string} datatable datatable
* @param {number} apptableId apptableId
* @param {PostDataTablesAppTableIdRequest} postDataTablesAppTableIdRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createDatatableEntry: async (datatable: string, apptableId: number, postDataTablesAppTableIdRequest: PostDataTablesAppTableIdRequest, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatable' is not null or undefined
assertParamExists('createDatatableEntry', 'datatable', datatable)
// verify required parameter 'apptableId' is not null or undefined
assertParamExists('createDatatableEntry', 'apptableId', apptableId)
// verify required parameter 'postDataTablesAppTableIdRequest' is not null or undefined
assertParamExists('createDatatableEntry', 'postDataTablesAppTableIdRequest', postDataTablesAppTableIdRequest)
const localVarPath = `/datatables/{datatable}/{apptableId}`
.replace(`{${"datatable"}}`, encodeURIComponent(String(datatable)))
.replace(`{${"apptableId"}}`, encodeURIComponent(String(apptableId)));
// 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(postDataTablesAppTableIdRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Deletes a data table and deregisters it from the Apache Fineract Core application table.
* @summary Delete Data Table
* @param {string} datatableName datatableName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteDatatable: async (datatableName: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatableName' is not null or undefined
assertParamExists('deleteDatatable', 'datatableName', datatableName)
const localVarPath = `/datatables/{datatableName}`
.replace(`{${"datatableName"}}`, encodeURIComponent(String(datatableName)));
// 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,
};
},
/**
* Deletes the entry (if it exists) for data tables that are one-to-one with the application table. Deletes the entries (if they exist) for data tables that are one-to-many with the application table.
* @summary Delete Entry(s) in Data Table
* @param {string} datatable datatable
* @param {number} apptableId apptableId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteDatatableEntries: async (datatable: string, apptableId: number, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatable' is not null or undefined
assertParamExists('deleteDatatableEntries', 'datatable', datatable)
// verify required parameter 'apptableId' is not null or undefined
assertParamExists('deleteDatatableEntries', 'apptableId', apptableId)
const localVarPath = `/datatables/{datatable}/{apptableId}`
.replace(`{${"datatable"}}`, encodeURIComponent(String(datatable)))
.replace(`{${"apptableId"}}`, encodeURIComponent(String(apptableId)));
// 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,
};
},
/**
* Deletes the entry (if it exists) for data tables that are one to many with the application table.
* @summary Delete Entry in Datatable (One to Many)
* @param {string} datatable datatable
* @param {number} apptableId apptableId
* @param {number} datatableId datatableId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteDatatableEntries1: async (datatable: string, apptableId: number, datatableId: number, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatable' is not null or undefined
assertParamExists('deleteDatatableEntries1', 'datatable', datatable)
// verify required parameter 'apptableId' is not null or undefined
assertParamExists('deleteDatatableEntries1', 'apptableId', apptableId)
// verify required parameter 'datatableId' is not null or undefined
assertParamExists('deleteDatatableEntries1', 'datatableId', datatableId)
const localVarPath = `/datatables/{datatable}/{apptableId}/{datatableId}`
.replace(`{${"datatable"}}`, encodeURIComponent(String(datatable)))
.replace(`{${"apptableId"}}`, encodeURIComponent(String(apptableId)))
.replace(`{${"datatableId"}}`, encodeURIComponent(String(datatableId)));
// 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,
};
},
/**
* Deregisters a data table. It will no longer be available through the API.
* @summary Deregister Data Table
* @param {string} datatable datatable
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deregisterDatatable: async (datatable: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatable' is not null or undefined
assertParamExists('deregisterDatatable', 'datatable', datatable)
const localVarPath = `/datatables/deregister/{datatable}`
.replace(`{${"datatable"}}`, encodeURIComponent(String(datatable)));
// 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)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Lists a registered data table details and the Apache Fineract Core application table they are registered to.
* @summary Retrieve Data Table Details
* @param {string} datatable datatable
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getDatatable: async (datatable: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatable' is not null or undefined
assertParamExists('getDatatable', 'datatable', datatable)
const localVarPath = `/datatables/{datatable}`
.replace(`{${"datatable"}}`, encodeURIComponent(String(datatable)));
// 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,
};
},
/**
* Gets the entry (if it exists) for data tables that are one to one with the application table. Gets the entries (if they exist) for data tables that are one to many with the application table. Note: The \'fields\' parameter is not available for datatables. ARGUMENTS orderoptional Specifies the order in which data is returned.genericResultSetoptional, defaults to false If \'true\' an optimised JSON format is returned suitable for tabular display of data. This format is used by the default data tables UI functionality. Example Requests: datatables/extra_client_details/1 datatables/extra_family_details/1?order=`Date of Birth` desc datatables/extra_client_details/1?genericResultSet=true
* @summary Retrieve Entry(s) from Data Table
* @param {string} datatable datatable
* @param {number} apptableId apptableId
* @param {string} [order] order
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getDatatable1: async (datatable: string, apptableId: number, order?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatable' is not null or undefined
assertParamExists('getDatatable1', 'datatable', datatable)
// verify required parameter 'apptableId' is not null or undefined
assertParamExists('getDatatable1', 'apptableId', apptableId)
const localVarPath = `/datatables/{datatable}/{apptableId}`
.replace(`{${"datatable"}}`, encodeURIComponent(String(datatable)))
.replace(`{${"apptableId"}}`, encodeURIComponent(String(apptableId)));
// 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 (order !== undefined) {
localVarQueryParameter['order'] = order;
}
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} datatable
* @param {number} apptableId
* @param {number} datatableId
* @param {string} [order]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getDatatableManyEntry: async (datatable: string, apptableId: number, datatableId: number, order?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatable' is not null or undefined
assertParamExists('getDatatableManyEntry', 'datatable', datatable)
// verify required parameter 'apptableId' is not null or undefined
assertParamExists('getDatatableManyEntry', 'apptableId', apptableId)
// verify required parameter 'datatableId' is not null or undefined
assertParamExists('getDatatableManyEntry', 'datatableId', datatableId)
const localVarPath = `/datatables/{datatable}/{apptableId}/{datatableId}`
.replace(`{${"datatable"}}`, encodeURIComponent(String(datatable)))
.replace(`{${"apptableId"}}`, encodeURIComponent(String(apptableId)))
.replace(`{${"datatableId"}}`, encodeURIComponent(String(datatableId)));
// 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 (order !== undefined) {
localVarQueryParameter['order'] = order;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Lists registered data tables and the Apache Fineract Core application table they are registered to. ARGUMENTS apptable - optional The Apache Fineract core application table. Example Requests: datatables?apptable=m_client datatables
* @summary List Data Tables
* @param {string} [apptable] apptable
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getDatatables: async (apptable?: string, options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/datatables`;
// 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 (apptable !== undefined) {
localVarQueryParameter['apptable'] = apptable;
}
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Registers a data table with the Apache Fineract Core application table. This allows the data table to be maintained through the API. In case the datatable is a PPI (survey table), a parameter category should be pass along with the request. The API currently support one category (200)
* @summary Register Data Table
* @param {string} datatable datatable
* @param {string} apptable apptable
* @param {object} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
registerDatatable: async (datatable: string, apptable: string, body?: object, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatable' is not null or undefined
assertParamExists('registerDatatable', 'datatable', datatable)
// verify required parameter 'apptable' is not null or undefined
assertParamExists('registerDatatable', 'apptable', apptable)
const localVarPath = `/datatables/register/{datatable}/{apptable}`
.replace(`{${"datatable"}}`, encodeURIComponent(String(datatable)))
.replace(`{${"apptable"}}`, encodeURIComponent(String(apptable)));
// 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,
};
},
/**
* Modifies fields of a data table. If the apptableName parameter is passed, data table is deregistered and registered with the new application table.
* @summary Update Data Table
* @param {string} datatableName datatableName
* @param {PutDataTablesRequest} putDataTablesRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDatatable: async (datatableName: string, putDataTablesRequest: PutDataTablesRequest, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatableName' is not null or undefined
assertParamExists('updateDatatable', 'datatableName', datatableName)
// verify required parameter 'putDataTablesRequest' is not null or undefined
assertParamExists('updateDatatable', 'putDataTablesRequest', putDataTablesRequest)
const localVarPath = `/datatables/{datatableName}`
.replace(`{${"datatableName"}}`, encodeURIComponent(String(datatableName)));
// 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(putDataTablesRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Updates the row (if it exists) of the data table.
* @summary Update Entry in Data Table (One to Many)
* @param {string} datatable datatable
* @param {number} apptableId apptableId
* @param {number} datatableId datatableId
* @param {PutDataTablesAppTableIdDatatableIdRequest} putDataTablesAppTableIdDatatableIdRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDatatableEntryOneToMany: async (datatable: string, apptableId: number, datatableId: number, putDataTablesAppTableIdDatatableIdRequest: PutDataTablesAppTableIdDatatableIdRequest, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatable' is not null or undefined
assertParamExists('updateDatatableEntryOneToMany', 'datatable', datatable)
// verify required parameter 'apptableId' is not null or undefined
assertParamExists('updateDatatableEntryOneToMany', 'apptableId', apptableId)
// verify required parameter 'datatableId' is not null or undefined
assertParamExists('updateDatatableEntryOneToMany', 'datatableId', datatableId)
// verify required parameter 'putDataTablesAppTableIdDatatableIdRequest' is not null or undefined
assertParamExists('updateDatatableEntryOneToMany', 'putDataTablesAppTableIdDatatableIdRequest', putDataTablesAppTableIdDatatableIdRequest)
const localVarPath = `/datatables/{datatable}/{apptableId}/{datatableId}`
.replace(`{${"datatable"}}`, encodeURIComponent(String(datatable)))
.replace(`{${"apptableId"}}`, encodeURIComponent(String(apptableId)))
.replace(`{${"datatableId"}}`, encodeURIComponent(String(datatableId)));
// 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(putDataTablesAppTableIdDatatableIdRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Updates the row (if it exists) of the data table.
* @summary Update Entry in Data Table (One to One)
* @param {string} datatable datatable
* @param {number} apptableId apptableId
* @param {PutDataTablesAppTableIdRequest} putDataTablesAppTableIdRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
updateDatatableEntryOnetoOne: async (datatable: string, apptableId: number, putDataTablesAppTableIdRequest: PutDataTablesAppTableIdRequest, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'datatable' is not null or undefined
assertParamExists('updateDatatableEntryOnetoOne', 'datatable', datatable)
// verify required parameter 'apptableId' is not null or undefined
assertParamExists('updateDatatableEntryOnetoOne', 'apptableId', apptableId)
// verify required parameter 'putDataTablesAppTableIdRequest' is not null or undefined
assertParamExists('updateDatatableEntryOnetoOne', 'putDataTablesAppTableIdRequest', putDataTablesAppTableIdRequest)
const localVarPath = `/datatables/{datatable}/{apptableId}`
.replace(`{${"datatable"}}`, encodeURIComponent(String(datatable)))
.replace(`{${"apptableId"}}`, encodeURIComponent(String(apptableId)));
// 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(putDataTablesAppTableIdRequest, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};
/**
* DataTablesApi - functional programming interface
* @export
*/
export const DataTablesApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = DataTablesApiAxiosParamCreator(configuration)
return {
/**
* Create a new data table and registers it with the Apache Fineract Core application table. Field Descriptions Mandatory - datatableName : The name of the Data Table. Mandatory - apptableName Application table name. Must be one of the following: m_client m_group m_loan m_office m_saving_account m_product_loan m_savings_product Mandatory - columns An array of columns in the new Data Table. Optional - multiRow Allows to create multiple entries in the Data Table. Optional, defaults to false. If this property is not provided Data Table will allow only one entry. Field Descriptions - columns Mandatory - name Name of the created column. Can contain only alphanumeric characters, underscores and spaces, but cannot start with a number. Cannot start or end with an underscore or space. Mandatory - type Column type. Must be one of the following: Boolean Date DateTime Decimal Dropdown Number String Text Mandatory [type = Dropdown] - code Used in Code description fields. Column name becomes: code_cd_name. Mandatory if using type Dropdown, otherwise an error is returned. Optional - mandatory Determines whether this column must have a value in every entry. Optional, defaults to false. Mandatory [type = String] - length Length of the text field. Mandatory if type String is used, otherwise an error is returned.
* @summary Create Data Table
* @param {PostDataTablesRequest} postDataTablesRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createDatatable(postDataTablesRequest: PostDataTablesRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostDataTablesResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createDatatable(postDataTablesRequest, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Adds a row to the data table. Note that the default datatable UI functionality converts any field name containing spaces to underscores when using the API. This means the field name \"Business Description\" is considered the same as \"Business_Description\". So you shouldn\'t have both \"versions\" in any data table.
* @summary Create Entry in Data Table
* @param {string} datatable datatable
* @param {number} apptableId apptableId
* @param {PostDataTablesAppTableIdRequest} postDataTablesAppTableIdRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createDatatableEntry(datatable: string, apptableId: number, postDataTablesAppTableIdRequest: PostDataTablesAppTableIdRequest, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PostDataTablesAppTableIdResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.createDatatableEntry(datatable, apptableId, postDataTablesAppTableIdRequest, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Deletes a data table and deregisters it from the Apache Fineract Core application table.
* @summary Delete Data Table
* @param {string} datatableName datatableName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteDatatable(datatableName: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteDataTablesResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDatatable(datatableName, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Deletes the entry (if it exists) for data tables that are one-to-one with the application table. Deletes the entries (if they exist) for data tables that are one-to-many with the application table.
* @summary Delete Entry(s) in Data Table
* @param {string} datatable datatable
* @param {number} apptableId apptableId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteDatatableEntries(datatable: string, apptableId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteDataTablesDatatableAppTableIdResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDatatableEntries(datatable, apptableId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Deletes the entry (if it exists) for data tables that are one to many with the application table.
* @summary Delete Entry in Datatable (One to Many)
* @param {string} datatable datatable
* @param {number} apptableId apptableId
* @param {number} datatableId datatableId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteDatatableEntries1(datatable: string, apptableId: number, datatableId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteDataTablesDatatableAppTableIdDatatableIdResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDatatableEntries1(datatable, apptableId, datatableId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Deregisters a data table. It will no longer be available through the API.
* @summary Deregister Data Table
* @param {string} datatable datatable
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deregisterDatatable(datatable: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PutDataTablesResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.deregisterDatatable(datatable, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Lists a registered data table details and the Apache Fineract Core application table they are registered to.
* @summary Retrieve Data Table Details
* @param {string} datatable datatable
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getDatatable(datatable: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetDataTablesResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getDatatable(datatable, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Gets the entry (if it exists) for data tables that are one to one with the application table. Gets the entries (if they exist) for data tables that are one to many with the application table. Note: The \'fields\' parameter is not available for datatables. ARGUMENTS orderoptional Specifies the order in which data is returned.genericResultSetoptional, defaults to false If \'true\' an optimised JSON format is returned suitable for tabular display of data. This format is used by the default data tables UI functionality. Example Requests: datatables/extra_client_details/1 datatables/extra_family_details/1?order=`Date of Birth` desc datatables/extra_client_details/1?genericResultSet=true
* @summary Retrieve Entry(s) from Data Table
* @param {string} datatable datatable
* @param {number} apptableId apptableId
* @param {string} [order] order
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getDatatable1(datatable: string, apptableId: number, order?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetDataTablesAppTableIdResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getDatatable1(datatable, apptableId, order, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {string} datatable
* @param {number} apptableId
* @param {number} datatableId
* @param {string} [order]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getDatatableManyEntry(datatable: string, apptableId: number, datatableId: number, order?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getDatatableManyEntry(datatable, apptableId, datatableI