/* tslint:disable */ /* eslint-disable */ /** * Service Registry Management API * Service Registry Management API is a REST API for managing Service Registry instances. Service Registry is a datastore for event schemas and API designs, which is based on the open source Apicurio Registry project. * * The version of the OpenAPI document: 1.0.0 * Contact: rhosak-eval-support@redhat.com * * 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, AxiosRequestConfig } 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 { Empty } from '../model'; // @ts-ignore import { ErrorList } from '../model'; /** * ErrorsApi - axios parameter creator * @export */ export const ErrorsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Get information about a specific error type * @param {string} id The id of the object you wish to interact with. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getError: async (id: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined assertParamExists('getError', 'id', id) const localVarPath = `/api/serviceregistry_mgmt/v1/errors/{id}` .replace(`{${"id"}}`, encodeURIComponent(String(id))); // 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; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get the list of all errors * @param {number} [page] Page index. * @param {number} [size] Number of items in each page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getErrors: async (page?: number, size?: number, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/serviceregistry_mgmt/v1/errors`; // 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; if (page !== undefined) { localVarQueryParameter['page'] = page; } if (size !== undefined) { localVarQueryParameter['size'] = size; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * ErrorsApi - functional programming interface * @export */ export const ErrorsApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ErrorsApiAxiosParamCreator(configuration) return { /** * Get information about a specific error type * @param {string} id The id of the object you wish to interact with. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getError(id: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getError(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * Get the list of all errors * @param {number} [page] Page index. * @param {number} [size] Number of items in each page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getErrors(page?: number, size?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getErrors(page, size, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } }; /** * ErrorsApi - factory interface * @export */ export const ErrorsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ErrorsApiFp(configuration) return { /** * Get information about a specific error type * @param {string} id The id of the object you wish to interact with. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getError(id: string, options?: any): AxiosPromise { return localVarFp.getError(id, options).then((request) => request(axios, basePath)); }, /** * Get the list of all errors * @param {number} [page] Page index. * @param {number} [size] Number of items in each page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getErrors(page?: number, size?: number, options?: any): AxiosPromise { return localVarFp.getErrors(page, size, options).then((request) => request(axios, basePath)); }, }; }; /** * ErrorsApi - interface * @export * @interface ErrorsApi */ export interface ErrorsApiInterface { /** * Get information about a specific error type * @param {string} id The id of the object you wish to interact with. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ErrorsApiInterface */ getError(id: string, options?: AxiosRequestConfig): AxiosPromise; /** * Get the list of all errors * @param {number} [page] Page index. * @param {number} [size] Number of items in each page. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ErrorsApiInterface */ getErrors(page?: number, size?: number, options?: AxiosRequestConfig): AxiosPromise; } /** * ErrorsApi - object-oriented interface * @export * @class ErrorsApi * @extends {BaseAPI} */ export class ErrorsApi extends BaseAPI implements ErrorsApiInterface { /** * Get information about a specific error type * @param {string} id The id of the object you wish to interact with. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ErrorsApi */ public getError(id: string, options?: AxiosRequestConfig) { return ErrorsApiFp(this.configuration).getError(id, options).then((request) => request(this.axios, this.basePath)); } /** * Get the list of all errors * @param {number} [page] Page index. * @param {number} [size] Number of items in each page. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ErrorsApi */ public getErrors(page?: number, size?: number, options?: AxiosRequestConfig) { return ErrorsApiFp(this.configuration).getErrors(page, size, options).then((request) => request(this.axios, this.basePath)); } }