/* 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 { ApiCrowdConfigurationDTO, ApiStatusDTO, } from '../models/index'; import { ApiCrowdConfigurationDTOFromJSON, ApiCrowdConfigurationDTOToJSON, ApiStatusDTOFromJSON, ApiStatusDTOToJSON, } from '../models/index'; export interface ConfigCrowdApiInsertOrUpdateCrowdConfigurationRequest { apiCrowdConfigurationDTO?: ApiCrowdConfigurationDTO; } export interface ConfigCrowdApiTestCrowdConfigurationRequest { apiCrowdConfigurationDTO?: ApiCrowdConfigurationDTO; } /** * ConfigCrowdApi - interface * * @export * @interface ConfigCrowdApiInterface */ export interface ConfigCrowdApiInterface { /** * Use this method to remove an existing Atlassian Crowd Configuration. Permissions required: Edit System Configuration and Users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigCrowdApiInterface */ deleteCrowdConfigurationRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to remove an existing Atlassian Crowd Configuration. Permissions required: Edit System Configuration and Users */ deleteCrowdConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve the configuration details for the Atlassian Crowd Server. Permissions required: Edit System Configuration and Users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigCrowdApiInterface */ getCrowdConfigurationRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve the configuration details for the Atlassian Crowd Server. Permissions required: Edit System Configuration and Users */ getCrowdConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to create a new or update an existing Atlassian Crowd Server configuration. Permissions required: Edit System Configuration and Users * @param {ApiCrowdConfigurationDTO} [apiCrowdConfigurationDTO] The request JSON should include the `serverUrl`, `applicationName`, and the `applicationPassword` which will be used for authentication against the Atlassian Crowd Server. If updating the `serverUrl`, the `applicationPassword` field is required. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigCrowdApiInterface */ insertOrUpdateCrowdConfigurationRaw(requestParameters: ConfigCrowdApiInsertOrUpdateCrowdConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to create a new or update an existing Atlassian Crowd Server configuration. Permissions required: Edit System Configuration and Users */ insertOrUpdateCrowdConfiguration(requestParameters: ConfigCrowdApiInsertOrUpdateCrowdConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to test a new or an existing Atlassian Crowd Server configuration. * @param {ApiCrowdConfigurationDTO} [apiCrowdConfigurationDTO] To test an existing configuration, the request body is not required. To test a new configuration, provide the `serverURl`, `applicationName`, and `applicationPassword` for the configuration. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigCrowdApiInterface */ testCrowdConfigurationRaw(requestParameters: ConfigCrowdApiTestCrowdConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to test a new or an existing Atlassian Crowd Server configuration. */ testCrowdConfiguration(requestParameters: ConfigCrowdApiTestCrowdConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class ConfigCrowdApi extends runtime.BaseAPI implements ConfigCrowdApiInterface { /** * Use this method to remove an existing Atlassian Crowd Configuration. Permissions required: Edit System Configuration and Users */ async deleteCrowdConfigurationRaw(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/crowd`; 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 Atlassian Crowd Configuration. Permissions required: Edit System Configuration and Users */ async deleteCrowdConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.deleteCrowdConfigurationRaw(initOverrides); } /** * Use this method to retrieve the configuration details for the Atlassian Crowd Server. Permissions required: Edit System Configuration and Users */ async getCrowdConfigurationRaw(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/crowd`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiCrowdConfigurationDTOFromJSON(jsonValue)); } /** * Use this method to retrieve the configuration details for the Atlassian Crowd Server. Permissions required: Edit System Configuration and Users */ async getCrowdConfiguration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getCrowdConfigurationRaw(initOverrides); return await response.value(); } /** * Use this method to create a new or update an existing Atlassian Crowd Server configuration. Permissions required: Edit System Configuration and Users */ async insertOrUpdateCrowdConfigurationRaw(requestParameters: ConfigCrowdApiInsertOrUpdateCrowdConfigurationRequest, 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/crowd`; const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: ApiCrowdConfigurationDTOToJSON(requestParameters['apiCrowdConfigurationDTO']), }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to create a new or update an existing Atlassian Crowd Server configuration. Permissions required: Edit System Configuration and Users */ async insertOrUpdateCrowdConfiguration(requestParameters: ConfigCrowdApiInsertOrUpdateCrowdConfigurationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.insertOrUpdateCrowdConfigurationRaw(requestParameters, initOverrides); } /** * Use this method to test a new or an existing Atlassian Crowd Server configuration. */ async testCrowdConfigurationRaw(requestParameters: ConfigCrowdApiTestCrowdConfigurationRequest, 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/crowd/test`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: ApiCrowdConfigurationDTOToJSON(requestParameters['apiCrowdConfigurationDTO']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiStatusDTOFromJSON(jsonValue)); } /** * Use this method to test a new or an existing Atlassian Crowd Server configuration. */ async testCrowdConfiguration(requestParameters: ConfigCrowdApiTestCrowdConfigurationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.testCrowdConfigurationRaw(requestParameters, initOverrides); return await response.value(); } }