|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | + * Hyperledger Cactus API |
| 5 | + * Interact with a Cactus deployment through HTTP. |
| 6 | + * |
| 7 | + * The version of the OpenAPI document: 0.0.1 |
| 8 | + * |
| 9 | + * |
| 10 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 11 | + * https://openapi-generator.tech |
| 12 | + * Do not edit the class manually. |
| 13 | + */ |
| 14 | + |
| 15 | + |
| 16 | +import { Configuration } from './configuration'; |
| 17 | +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; |
| 18 | +// Some imports not used depending on template conditions |
| 19 | +// @ts-ignore |
| 20 | +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; |
| 21 | + |
| 22 | +/** |
| 23 | + * |
| 24 | + * @export |
| 25 | + * @interface HealthCheckResponse |
| 26 | + */ |
| 27 | +export interface HealthCheckResponse { |
| 28 | + /** |
| 29 | + * |
| 30 | + * @type {boolean} |
| 31 | + * @memberof HealthCheckResponse |
| 32 | + */ |
| 33 | + success?: boolean; |
| 34 | + /** |
| 35 | + * |
| 36 | + * @type {string} |
| 37 | + * @memberof HealthCheckResponse |
| 38 | + */ |
| 39 | + createdAt: string; |
| 40 | + /** |
| 41 | + * |
| 42 | + * @type {MemoryUsage} |
| 43 | + * @memberof HealthCheckResponse |
| 44 | + */ |
| 45 | + memoryUsage: MemoryUsage; |
| 46 | +} |
| 47 | +/** |
| 48 | + * |
| 49 | + * @export |
| 50 | + * @interface MemoryUsage |
| 51 | + */ |
| 52 | +export interface MemoryUsage { |
| 53 | + /** |
| 54 | + * |
| 55 | + * @type {number} |
| 56 | + * @memberof MemoryUsage |
| 57 | + */ |
| 58 | + rss?: number; |
| 59 | + /** |
| 60 | + * |
| 61 | + * @type {number} |
| 62 | + * @memberof MemoryUsage |
| 63 | + */ |
| 64 | + heapTotal?: number; |
| 65 | + /** |
| 66 | + * |
| 67 | + * @type {number} |
| 68 | + * @memberof MemoryUsage |
| 69 | + */ |
| 70 | + heapUsed?: number; |
| 71 | + /** |
| 72 | + * |
| 73 | + * @type {number} |
| 74 | + * @memberof MemoryUsage |
| 75 | + */ |
| 76 | + external?: number; |
| 77 | + /** |
| 78 | + * |
| 79 | + * @type {number} |
| 80 | + * @memberof MemoryUsage |
| 81 | + */ |
| 82 | + arrayBuffers?: number; |
| 83 | +} |
| 84 | + |
| 85 | +/** |
| 86 | + * DefaultApi - axios parameter creator |
| 87 | + * @export |
| 88 | + */ |
| 89 | +export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { |
| 90 | + return { |
| 91 | + /** |
| 92 | + * Returns the current timestamp of the API server as proof of health/liveness |
| 93 | + * @summary Can be used to verify liveness of an API server instance |
| 94 | + * @param {*} [options] Override http request option. |
| 95 | + * @throws {RequiredError} |
| 96 | + */ |
| 97 | + getHealthCheck: async (options: any = {}): Promise<RequestArgs> => { |
| 98 | + const localVarPath = `/api/v1/api-server/healthcheck`; |
| 99 | + // use dummy base URL string because the URL constructor only accepts absolute URLs. |
| 100 | + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); |
| 101 | + let baseOptions; |
| 102 | + if (configuration) { |
| 103 | + baseOptions = configuration.baseOptions; |
| 104 | + } |
| 105 | + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; |
| 106 | + const localVarHeaderParameter = {} as any; |
| 107 | + const localVarQueryParameter = {} as any; |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + const query = new URLSearchParams(localVarUrlObj.search); |
| 112 | + for (const key in localVarQueryParameter) { |
| 113 | + query.set(key, localVarQueryParameter[key]); |
| 114 | + } |
| 115 | + for (const key in options.query) { |
| 116 | + query.set(key, options.query[key]); |
| 117 | + } |
| 118 | + localVarUrlObj.search = (new URLSearchParams(query)).toString(); |
| 119 | + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; |
| 120 | + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; |
| 121 | + |
| 122 | + return { |
| 123 | + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, |
| 124 | + options: localVarRequestOptions, |
| 125 | + }; |
| 126 | + }, |
| 127 | + } |
| 128 | +}; |
| 129 | + |
| 130 | +/** |
| 131 | + * DefaultApi - functional programming interface |
| 132 | + * @export |
| 133 | + */ |
| 134 | +export const DefaultApiFp = function(configuration?: Configuration) { |
| 135 | + return { |
| 136 | + /** |
| 137 | + * Returns the current timestamp of the API server as proof of health/liveness |
| 138 | + * @summary Can be used to verify liveness of an API server instance |
| 139 | + * @param {*} [options] Override http request option. |
| 140 | + * @throws {RequiredError} |
| 141 | + */ |
| 142 | + async getHealthCheck(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<HealthCheckResponse>> { |
| 143 | + const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).getHealthCheck(options); |
| 144 | + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { |
| 145 | + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; |
| 146 | + return axios.request(axiosRequestArgs); |
| 147 | + }; |
| 148 | + }, |
| 149 | + } |
| 150 | +}; |
| 151 | + |
| 152 | +/** |
| 153 | + * DefaultApi - factory interface |
| 154 | + * @export |
| 155 | + */ |
| 156 | +export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { |
| 157 | + return { |
| 158 | + /** |
| 159 | + * Returns the current timestamp of the API server as proof of health/liveness |
| 160 | + * @summary Can be used to verify liveness of an API server instance |
| 161 | + * @param {*} [options] Override http request option. |
| 162 | + * @throws {RequiredError} |
| 163 | + */ |
| 164 | + getHealthCheck(options?: any): AxiosPromise<HealthCheckResponse> { |
| 165 | + return DefaultApiFp(configuration).getHealthCheck(options).then((request) => request(axios, basePath)); |
| 166 | + }, |
| 167 | + }; |
| 168 | +}; |
| 169 | + |
| 170 | +/** |
| 171 | + * DefaultApi - object-oriented interface |
| 172 | + * @export |
| 173 | + * @class DefaultApi |
| 174 | + * @extends {BaseAPI} |
| 175 | + */ |
| 176 | +export class DefaultApi extends BaseAPI { |
| 177 | + /** |
| 178 | + * Returns the current timestamp of the API server as proof of health/liveness |
| 179 | + * @summary Can be used to verify liveness of an API server instance |
| 180 | + * @param {*} [options] Override http request option. |
| 181 | + * @throws {RequiredError} |
| 182 | + * @memberof DefaultApi |
| 183 | + */ |
| 184 | + public getHealthCheck(options?: any) { |
| 185 | + return DefaultApiFp(this.configuration).getHealthCheck(options).then((request) => request(this.axios, this.basePath)); |
| 186 | + } |
| 187 | +} |
| 188 | + |
| 189 | + |
0 commit comments