@hubbleprotocol/carpool-typescript-client
Version:
OpenAPI TypeScript client for Carpool
807 lines (770 loc) • 58.1 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Carpool Query
* The Carpool Query API
*
* OpenAPI spec version: 1.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { AccountSearchRequest } from '../models';
import { AccountsAggregateRequest } from '../models';
/**
* AccountsApi - axios parameter creator
* @export
*/
export const AccountsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html\" target=\"_blank\">the Elasticsearch docs</a> for a list of aggregations. <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">Queries</a> and slots can be used to narrow aggregation range.
* @summary Perform aggregations of accounts of a program.
* @param {AccountsAggregateRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
accountsControllerAggregateAccounts: async (body: AccountsAggregateRequest, xApiKey: string, programId: string, accountName: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError('body','Required parameter body was null or undefined when calling accountsControllerAggregateAccounts.');
}
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling accountsControllerAggregateAccounts.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling accountsControllerAggregateAccounts.');
}
// verify required parameter 'accountName' is not null or undefined
if (accountName === null || accountName === undefined) {
throw new RequiredError('accountName','Required parameter accountName was null or undefined when calling accountsControllerAggregateAccounts.');
}
const localVarPath = `/devnet/accounts/{programId}/{accountName}/aggregate`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html\" target=\"_blank\">the Elasticsearch docs</a> for a list of aggregations. <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">Queries</a> and slots can be used to narrow aggregation range.
* @summary Perform aggregations of accounts of a program.
* @param {AccountsAggregateRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
accountsControllerAggregateAccounts_1: async (body: AccountsAggregateRequest, xApiKey: string, programId: string, accountName: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError('body','Required parameter body was null or undefined when calling accountsControllerAggregateAccounts_1.');
}
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling accountsControllerAggregateAccounts_1.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling accountsControllerAggregateAccounts_1.');
}
// verify required parameter 'accountName' is not null or undefined
if (accountName === null || accountName === undefined) {
throw new RequiredError('accountName','Required parameter accountName was null or undefined when calling accountsControllerAggregateAccounts_1.');
}
const localVarPath = `/mainnet/accounts/{programId}/{accountName}/aggregate`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary Fetch a specific account
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {string} accountId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
accountsControllerGetAccount: async (xApiKey: string, programId: string, accountName: string, accountId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling accountsControllerGetAccount.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling accountsControllerGetAccount.');
}
// verify required parameter 'accountName' is not null or undefined
if (accountName === null || accountName === undefined) {
throw new RequiredError('accountName','Required parameter accountName was null or undefined when calling accountsControllerGetAccount.');
}
// verify required parameter 'accountId' is not null or undefined
if (accountId === null || accountId === undefined) {
throw new RequiredError('accountId','Required parameter accountId was null or undefined when calling accountsControllerGetAccount.');
}
const localVarPath = `/devnet/accounts/{programId}/{accountName}/account/{accountId}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)))
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary Fetch a specific account
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {string} accountId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
accountsControllerGetAccount_2: async (xApiKey: string, programId: string, accountName: string, accountId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling accountsControllerGetAccount_2.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling accountsControllerGetAccount_2.');
}
// verify required parameter 'accountName' is not null or undefined
if (accountName === null || accountName === undefined) {
throw new RequiredError('accountName','Required parameter accountName was null or undefined when calling accountsControllerGetAccount_2.');
}
// verify required parameter 'accountId' is not null or undefined
if (accountId === null || accountId === undefined) {
throw new RequiredError('accountId','Required parameter accountId was null or undefined when calling accountsControllerGetAccount_2.');
}
const localVarPath = `/mainnet/accounts/{programId}/{accountName}/account/{accountId}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)))
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary List accounts.
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\". For accounts, \"slot\" refers to the last slot it was updated at.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
accountsControllerListAccounts: async (xApiKey: string, programId: string, accountName: string, size?: number, from?: number, sort?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling accountsControllerListAccounts.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling accountsControllerListAccounts.');
}
// verify required parameter 'accountName' is not null or undefined
if (accountName === null || accountName === undefined) {
throw new RequiredError('accountName','Required parameter accountName was null or undefined when calling accountsControllerListAccounts.');
}
const localVarPath = `/devnet/accounts/{programId}/{accountName}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (sort !== undefined) {
localVarQueryParameter['sort'] = sort;
}
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
*
* @summary List accounts.
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\". For accounts, \"slot\" refers to the last slot it was updated at.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
accountsControllerListAccounts_3: async (xApiKey: string, programId: string, accountName: string, size?: number, from?: number, sort?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling accountsControllerListAccounts_3.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling accountsControllerListAccounts_3.');
}
// verify required parameter 'accountName' is not null or undefined
if (accountName === null || accountName === undefined) {
throw new RequiredError('accountName','Required parameter accountName was null or undefined when calling accountsControllerListAccounts_3.');
}
const localVarPath = `/mainnet/accounts/{programId}/{accountName}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (sort !== undefined) {
localVarQueryParameter['sort'] = sort;
}
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">the Elasticsearch docs</a> for a list of query types.
* @summary Search accounts of a program using Elasticsearch DSL.
* @param {AccountSearchRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
accountsControllerSearchAccounts: async (body: AccountSearchRequest, xApiKey: string, programId: string, accountName: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError('body','Required parameter body was null or undefined when calling accountsControllerSearchAccounts.');
}
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling accountsControllerSearchAccounts.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling accountsControllerSearchAccounts.');
}
// verify required parameter 'accountName' is not null or undefined
if (accountName === null || accountName === undefined) {
throw new RequiredError('accountName','Required parameter accountName was null or undefined when calling accountsControllerSearchAccounts.');
}
const localVarPath = `/devnet/accounts/{programId}/{accountName}/search`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">the Elasticsearch docs</a> for a list of query types.
* @summary Search accounts of a program using Elasticsearch DSL.
* @param {AccountSearchRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
accountsControllerSearchAccounts_4: async (body: AccountSearchRequest, xApiKey: string, programId: string, accountName: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError('body','Required parameter body was null or undefined when calling accountsControllerSearchAccounts_4.');
}
// verify required parameter 'xApiKey' is not null or undefined
if (xApiKey === null || xApiKey === undefined) {
throw new RequiredError('xApiKey','Required parameter xApiKey was null or undefined when calling accountsControllerSearchAccounts_4.');
}
// verify required parameter 'programId' is not null or undefined
if (programId === null || programId === undefined) {
throw new RequiredError('programId','Required parameter programId was null or undefined when calling accountsControllerSearchAccounts_4.');
}
// verify required parameter 'accountName' is not null or undefined
if (accountName === null || accountName === undefined) {
throw new RequiredError('accountName','Required parameter accountName was null or undefined when calling accountsControllerSearchAccounts_4.');
}
const localVarPath = `/mainnet/accounts/{programId}/{accountName}/search`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)))
.replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (xApiKey !== undefined && xApiKey !== null) {
localVarHeaderParameter['x-api-key'] = String(xApiKey);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
}
};
/**
* AccountsApi - functional programming interface
* @export
*/
export const AccountsApiFp = function(configuration?: Configuration) {
return {
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html\" target=\"_blank\">the Elasticsearch docs</a> for a list of aggregations. <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">Queries</a> and slots can be used to narrow aggregation range.
* @summary Perform aggregations of accounts of a program.
* @param {AccountsAggregateRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerAggregateAccounts(body: AccountsAggregateRequest, xApiKey: string, programId: string, accountName: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await AccountsApiAxiosParamCreator(configuration).accountsControllerAggregateAccounts(body, xApiKey, programId, accountName, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html\" target=\"_blank\">the Elasticsearch docs</a> for a list of aggregations. <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">Queries</a> and slots can be used to narrow aggregation range.
* @summary Perform aggregations of accounts of a program.
* @param {AccountsAggregateRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerAggregateAccounts_1(body: AccountsAggregateRequest, xApiKey: string, programId: string, accountName: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await AccountsApiAxiosParamCreator(configuration).accountsControllerAggregateAccounts_1(body, xApiKey, programId, accountName, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary Fetch a specific account
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {string} accountId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerGetAccount(xApiKey: string, programId: string, accountName: string, accountId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await AccountsApiAxiosParamCreator(configuration).accountsControllerGetAccount(xApiKey, programId, accountName, accountId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary Fetch a specific account
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {string} accountId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerGetAccount_2(xApiKey: string, programId: string, accountName: string, accountId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await AccountsApiAxiosParamCreator(configuration).accountsControllerGetAccount_2(xApiKey, programId, accountName, accountId, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary List accounts.
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\". For accounts, \"slot\" refers to the last slot it was updated at.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerListAccounts(xApiKey: string, programId: string, accountName: string, size?: number, from?: number, sort?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await AccountsApiAxiosParamCreator(configuration).accountsControllerListAccounts(xApiKey, programId, accountName, size, from, sort, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
*
* @summary List accounts.
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\". For accounts, \"slot\" refers to the last slot it was updated at.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerListAccounts_3(xApiKey: string, programId: string, accountName: string, size?: number, from?: number, sort?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await AccountsApiAxiosParamCreator(configuration).accountsControllerListAccounts_3(xApiKey, programId, accountName, size, from, sort, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">the Elasticsearch docs</a> for a list of query types.
* @summary Search accounts of a program using Elasticsearch DSL.
* @param {AccountSearchRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerSearchAccounts(body: AccountSearchRequest, xApiKey: string, programId: string, accountName: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await AccountsApiAxiosParamCreator(configuration).accountsControllerSearchAccounts(body, xApiKey, programId, accountName, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">the Elasticsearch docs</a> for a list of query types.
* @summary Search accounts of a program using Elasticsearch DSL.
* @param {AccountSearchRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerSearchAccounts_4(body: AccountSearchRequest, xApiKey: string, programId: string, accountName: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await AccountsApiAxiosParamCreator(configuration).accountsControllerSearchAccounts_4(body, xApiKey, programId, accountName, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* AccountsApi - factory interface
* @export
*/
export const AccountsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html\" target=\"_blank\">the Elasticsearch docs</a> for a list of aggregations. <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">Queries</a> and slots can be used to narrow aggregation range.
* @summary Perform aggregations of accounts of a program.
* @param {AccountsAggregateRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerAggregateAccounts(body: AccountsAggregateRequest, xApiKey: string, programId: string, accountName: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return AccountsApiFp(configuration).accountsControllerAggregateAccounts(body, xApiKey, programId, accountName, options).then((request) => request(axios, basePath));
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html\" target=\"_blank\">the Elasticsearch docs</a> for a list of aggregations. <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">Queries</a> and slots can be used to narrow aggregation range.
* @summary Perform aggregations of accounts of a program.
* @param {AccountsAggregateRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerAggregateAccounts_1(body: AccountsAggregateRequest, xApiKey: string, programId: string, accountName: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return AccountsApiFp(configuration).accountsControllerAggregateAccounts_1(body, xApiKey, programId, accountName, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Fetch a specific account
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {string} accountId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerGetAccount(xApiKey: string, programId: string, accountName: string, accountId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return AccountsApiFp(configuration).accountsControllerGetAccount(xApiKey, programId, accountName, accountId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary Fetch a specific account
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {string} accountId
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerGetAccount_2(xApiKey: string, programId: string, accountName: string, accountId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return AccountsApiFp(configuration).accountsControllerGetAccount_2(xApiKey, programId, accountName, accountId, options).then((request) => request(axios, basePath));
},
/**
*
* @summary List accounts.
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\". For accounts, \"slot\" refers to the last slot it was updated at.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerListAccounts(xApiKey: string, programId: string, accountName: string, size?: number, from?: number, sort?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return AccountsApiFp(configuration).accountsControllerListAccounts(xApiKey, programId, accountName, size, from, sort, options).then((request) => request(axios, basePath));
},
/**
*
* @summary List accounts.
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\". For accounts, \"slot\" refers to the last slot it was updated at.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerListAccounts_3(xApiKey: string, programId: string, accountName: string, size?: number, from?: number, sort?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return AccountsApiFp(configuration).accountsControllerListAccounts_3(xApiKey, programId, accountName, size, from, sort, options).then((request) => request(axios, basePath));
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">the Elasticsearch docs</a> for a list of query types.
* @summary Search accounts of a program using Elasticsearch DSL.
* @param {AccountSearchRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async accountsControllerSearchAccounts(body: AccountSearchRequest, xApiKey: string, programId: string, accountName: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return AccountsApiFp(configuration).accountsControllerSearchAccounts(body, xApiKey, programId, accountName, options).then((request) => request(axios, basePath));
},
/**
* See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-context\" target=\"_blank\">the Elasticsearch docs</a> for a list of query types.
* @summary Search accounts of a program using Elasticsearch DSL.
* @param {AccountSearchRequest} body
* @param {string} xApiKey
* @param {string} programId
* @param {string} accountName
* @param {*} [options] Override http request option.
* @throws {RequiredError}