/* tslint:disable */ /* eslint-disable */ /** * Sonatype Lifecycle Public REST API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.207.0-01 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; export interface EndpointsApiGetOpenAPIRequest { apiType: GetOpenAPIApiTypeEnum; } /** * EndpointsApi - interface * * @export * @interface EndpointsApiInterface */ export interface EndpointsApiInterface { /** * Use this method to retrieve the OpenAPI documentation for the specified type of IQ Server REST API. * @param {'public' | 'experimental'} apiType Select the type of the API.<ul><li> `public` APIs are Generally Available and fully supported by Sonatype.</li><li> `experimental` APIs are not production ready, may change, and are not intended to be used in critical workloads.</li></ul> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof EndpointsApiInterface */ getOpenAPIRaw(requestParameters: EndpointsApiGetOpenAPIRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve the OpenAPI documentation for the specified type of IQ Server REST API. */ getOpenAPI(requestParameters: EndpointsApiGetOpenAPIRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class EndpointsApi extends runtime.BaseAPI implements EndpointsApiInterface { /** * Use this method to retrieve the OpenAPI documentation for the specified type of IQ Server REST API. */ async getOpenAPIRaw(requestParameters: EndpointsApiGetOpenAPIRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['apiType'] == null) { throw new runtime.RequiredError( 'apiType', 'Required parameter "apiType" was null or undefined when calling getOpenAPI().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); } if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = await token("BearerAuth", []); if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } let urlPath = `/api/v2/endpoints/{apiType}`; urlPath = urlPath.replace(`{${"apiType"}}`, encodeURIComponent(String(requestParameters['apiType']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response) as any; } } /** * Use this method to retrieve the OpenAPI documentation for the specified type of IQ Server REST API. */ async getOpenAPI(requestParameters: EndpointsApiGetOpenAPIRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getOpenAPIRaw(requestParameters, initOverrides); return await response.value(); } } /** * @export */ export const GetOpenAPIApiTypeEnum = { Public: 'public', Experimental: 'experimental' } as const; export type GetOpenAPIApiTypeEnum = typeof GetOpenAPIApiTypeEnum[keyof typeof GetOpenAPIApiTypeEnum];