UNPKG

@openzeppelin/relayer-sdk

Version:
122 lines (121 loc) 5.75 kB
/* tslint:disable */ /* eslint-disable */ /** * OpenZeppelin Relayer API * OpenZeppelin Relayer API * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, setSearchParams, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, BaseAPI, operationServerMap } from '../base'; /** * HealthApi - axios parameter creator * @export */ export const HealthApiAxiosParamCreator = function (configuration) { return { /** * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. * @summary Health routes implementation * @param {*} [options] Override http request option. * @throws {RequiredError} */ health: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) { const localVarPath = `/v1/health`; // 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 = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * HealthApi - functional programming interface * @export */ export const HealthApiFp = function (configuration) { const localVarAxiosParamCreator = HealthApiAxiosParamCreator(configuration); return { /** * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. * @summary Health routes implementation * @param {*} [options] Override http request option. * @throws {RequiredError} */ health(options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b, _c; const localVarAxiosArgs = yield localVarAxiosParamCreator.health(options); const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0; const localVarOperationServerBasePath = (_c = (_b = operationServerMap['HealthApi.health']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }); }, }; }; /** * HealthApi - factory interface * @export */ export const HealthApiFactory = function (configuration, basePath, axios) { const localVarFp = HealthApiFp(configuration); return { /** * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. * @summary Health routes implementation * @param {*} [options] Override http request option. * @throws {RequiredError} */ health(options) { return localVarFp.health(options).then((request) => request(axios, basePath)); }, }; }; /** * HealthApi - object-oriented interface * @export * @class HealthApi * @extends {BaseAPI} */ export class HealthApi extends BaseAPI { /** * Note: OpenAPI documentation for these endpoints can be found in the `openapi.rs` file Handles the `/health` endpoint. Returns an `HttpResponse` with a status of `200 OK` and a body of `\"OK\"`. * @summary Health routes implementation * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof HealthApi */ health(options) { return HealthApiFp(this.configuration).health(options).then((request) => request(this.axios, this.basePath)); } }