@hubbleprotocol/carpool-typescript-client
Version:
OpenAPI TypeScript client for Carpool
348 lines (324 loc) • 21.4 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';
/**
* LogsApi - axios parameter creator
* @export
*/
export const LogsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Query transaction logs with full text search and receive matching instructions. Note that logs are scoped to each instruction invocation and CPI logs are not included.
* @summary Search instructions for matching logs.
* @param {string} xApiKey
* @param {string} programId
* @param {string} q Elasticsearch querystring. See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax\" target=\"_blank\">the Elasticsearch docs</a> for more.
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
logsControllerSearchProgramLogs: async (xApiKey: string, programId: string, q: string, instructionName?: string, size?: number, from?: number, start?: number, end?: 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 logsControllerSearchProgramLogs.');
}
// 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 logsControllerSearchProgramLogs.');
}
// verify required parameter 'q' is not null or undefined
if (q === null || q === undefined) {
throw new RequiredError('q','Required parameter q was null or undefined when calling logsControllerSearchProgramLogs.');
}
const localVarPath = `/devnet/logs/{programId}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)));
// 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 (q !== undefined) {
localVarQueryParameter['q'] = q;
}
if (instructionName !== undefined) {
localVarQueryParameter['instructionName'] = instructionName;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (start !== undefined) {
localVarQueryParameter['start'] = start;
}
if (end !== undefined) {
localVarQueryParameter['end'] = end;
}
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,
};
},
/**
* Query transaction logs with full text search and receive matching instructions. Note that logs are scoped to each instruction invocation and CPI logs are not included.
* @summary Search instructions for matching logs.
* @param {string} xApiKey
* @param {string} programId
* @param {string} q Elasticsearch querystring. See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax\" target=\"_blank\">the Elasticsearch docs</a> for more.
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
logsControllerSearchProgramLogs_1: async (xApiKey: string, programId: string, q: string, instructionName?: string, size?: number, from?: number, start?: number, end?: 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 logsControllerSearchProgramLogs_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 logsControllerSearchProgramLogs_1.');
}
// verify required parameter 'q' is not null or undefined
if (q === null || q === undefined) {
throw new RequiredError('q','Required parameter q was null or undefined when calling logsControllerSearchProgramLogs_1.');
}
const localVarPath = `/mainnet/logs/{programId}`
.replace(`{${"programId"}}`, encodeURIComponent(String(programId)));
// 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 (q !== undefined) {
localVarQueryParameter['q'] = q;
}
if (instructionName !== undefined) {
localVarQueryParameter['instructionName'] = instructionName;
}
if (size !== undefined) {
localVarQueryParameter['size'] = size;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (start !== undefined) {
localVarQueryParameter['start'] = start;
}
if (end !== undefined) {
localVarQueryParameter['end'] = end;
}
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,
};
},
}
};
/**
* LogsApi - functional programming interface
* @export
*/
export const LogsApiFp = function(configuration?: Configuration) {
return {
/**
* Query transaction logs with full text search and receive matching instructions. Note that logs are scoped to each instruction invocation and CPI logs are not included.
* @summary Search instructions for matching logs.
* @param {string} xApiKey
* @param {string} programId
* @param {string} q Elasticsearch querystring. See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax\" target=\"_blank\">the Elasticsearch docs</a> for more.
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async logsControllerSearchProgramLogs(xApiKey: string, programId: string, q: string, instructionName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await LogsApiAxiosParamCreator(configuration).logsControllerSearchProgramLogs(xApiKey, programId, q, instructionName, size, from, start, end, sort, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Query transaction logs with full text search and receive matching instructions. Note that logs are scoped to each instruction invocation and CPI logs are not included.
* @summary Search instructions for matching logs.
* @param {string} xApiKey
* @param {string} programId
* @param {string} q Elasticsearch querystring. See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax\" target=\"_blank\">the Elasticsearch docs</a> for more.
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async logsControllerSearchProgramLogs_1(xApiKey: string, programId: string, q: string, instructionName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await LogsApiAxiosParamCreator(configuration).logsControllerSearchProgramLogs_1(xApiKey, programId, q, instructionName, size, from, start, end, sort, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* LogsApi - factory interface
* @export
*/
export const LogsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
* Query transaction logs with full text search and receive matching instructions. Note that logs are scoped to each instruction invocation and CPI logs are not included.
* @summary Search instructions for matching logs.
* @param {string} xApiKey
* @param {string} programId
* @param {string} q Elasticsearch querystring. See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax\" target=\"_blank\">the Elasticsearch docs</a> for more.
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async logsControllerSearchProgramLogs(xApiKey: string, programId: string, q: string, instructionName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return LogsApiFp(configuration).logsControllerSearchProgramLogs(xApiKey, programId, q, instructionName, size, from, start, end, sort, options).then((request) => request(axios, basePath));
},
/**
* Query transaction logs with full text search and receive matching instructions. Note that logs are scoped to each instruction invocation and CPI logs are not included.
* @summary Search instructions for matching logs.
* @param {string} xApiKey
* @param {string} programId
* @param {string} q Elasticsearch querystring. See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax\" target=\"_blank\">the Elasticsearch docs</a> for more.
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async logsControllerSearchProgramLogs_1(xApiKey: string, programId: string, q: string, instructionName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return LogsApiFp(configuration).logsControllerSearchProgramLogs_1(xApiKey, programId, q, instructionName, size, from, start, end, sort, options).then((request) => request(axios, basePath));
},
};
};
/**
* LogsApi - object-oriented interface
* @export
* @class LogsApi
* @extends {BaseAPI}
*/
export class LogsApi extends BaseAPI {
/**
* Query transaction logs with full text search and receive matching instructions. Note that logs are scoped to each instruction invocation and CPI logs are not included.
* @summary Search instructions for matching logs.
* @param {string} xApiKey
* @param {string} programId
* @param {string} q Elasticsearch querystring. See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax\" target=\"_blank\">the Elasticsearch docs</a> for more.
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LogsApi
*/
public async logsControllerSearchProgramLogsDevnet(xApiKey: string, programId: string, q: string, instructionName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return LogsApiFp(this.configuration).logsControllerSearchProgramLogs(xApiKey, programId, q, instructionName, size, from, start, end, sort, options).then((request) => request(this.axios, this.basePath));
}
/**
* Query transaction logs with full text search and receive matching instructions. Note that logs are scoped to each instruction invocation and CPI logs are not included.
* @summary Search instructions for matching logs.
* @param {string} xApiKey
* @param {string} programId
* @param {string} q Elasticsearch querystring. See <a href=\"https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax\" target=\"_blank\">the Elasticsearch docs</a> for more.
* @param {string} [instructionName] A specific instruction name to search though.
* @param {number} [size] Number of entries to return. Default is 10.
* @param {number} [from] Pagination starting point.
* @param {number} [start] A starting slot for the search (inclusive)
* @param {number} [end] An ending slot for the search (exclusive)
* @param {string} [sort] Slot sort order for results. Defaults to \"desc\".
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof LogsApi
*/
public async logsControllerSearchProgramLogsMainnet(xApiKey: string, programId: string, q: string, instructionName?: string, size?: number, from?: number, start?: number, end?: number, sort?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return LogsApiFp(this.configuration).logsControllerSearchProgramLogs_1(xApiKey, programId, q, instructionName, size, from, start, end, sort, options).then((request) => request(this.axios, this.basePath));
}
}