/* 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'; import type { ApiProxyServerConfigurationDTO, } from '../models/index'; import { ApiProxyServerConfigurationDTOFromJSON, ApiProxyServerConfigurationDTOToJSON, } from '../models/index'; export interface ConfigProxyServerApiSetConfiguration4Request { apiProxyServerConfigurationDTO?: ApiProxyServerConfigurationDTO; } /** * ConfigProxyServerApi - interface * * @export * @interface ConfigProxyServerApiInterface */ export interface ConfigProxyServerApiInterface { /** * Use this method to remove an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigProxyServerApiInterface */ deleteConfiguration4Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to remove an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users */ deleteConfiguration4(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to inspect an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigProxyServerApiInterface */ getConfiguration4Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to inspect an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users */ getConfiguration4(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to create or update an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users * @param {ApiProxyServerConfigurationDTO} [apiProxyServerConfigurationDTO] The request JSON could include: <ul><li>`hostname` is host name or IP address of the HTTP proxy server to use for outgoing HTTP connections.</li><li>`port` is the port number for the HTTP proxy server.</li><li>`username` is the username used to authenticate with the HTTP proxy server.</li><li>`password` is the password used for authentication with the HTTP proxy server.</li><li>`passwordIsIncluded` should be `true` if password is included in the request.<ul><li>If `true` but the password is not included the password will be considered as `null`.</li><li>Can be `false` for update operations that do not a require password change. Note that updating the hostname and port requires a password to be provided.</li> </ul><li>`excludeHosts` is a list of host names that are to be excluded from using the HTTP proxy server.</li></ul> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigProxyServerApiInterface */ setConfiguration4Raw(requestParameters: ConfigProxyServerApiSetConfiguration4Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to create or update an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users */ setConfiguration4(requestParameters: ConfigProxyServerApiSetConfiguration4Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class ConfigProxyServerApi extends runtime.BaseAPI implements ConfigProxyServerApiInterface { /** * Use this method to remove an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users */ async deleteConfiguration4Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { 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/config/httpProxyServer`; const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to remove an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users */ async deleteConfiguration4(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.deleteConfiguration4Raw(initOverrides); } /** * Use this method to inspect an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users */ async getConfiguration4Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { 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/config/httpProxyServer`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiProxyServerConfigurationDTOFromJSON(jsonValue)); } /** * Use this method to inspect an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users */ async getConfiguration4(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getConfiguration4Raw(initOverrides); return await response.value(); } /** * Use this method to create or update an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users */ async setConfiguration4Raw(requestParameters: ConfigProxyServerApiSetConfiguration4Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; 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/config/httpProxyServer`; const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: ApiProxyServerConfigurationDTOToJSON(requestParameters['apiProxyServerConfigurationDTO']), }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to create or update an existing HTTP proxy server configuration. Permissions required: Edit System Configuration and Users */ async setConfiguration4(requestParameters: ConfigProxyServerApiSetConfiguration4Request = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.setConfiguration4Raw(requestParameters, initOverrides); } }