/* 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 { ApiJiraConfigurationDTO, } from '../models/index'; import { ApiJiraConfigurationDTOFromJSON, ApiJiraConfigurationDTOToJSON, } from '../models/index'; export interface ConfigJiraApiSetConfiguration2Request { apiJiraConfigurationDTO?: ApiJiraConfigurationDTO; } /** * ConfigJiraApi - interface * * @export * @interface ConfigJiraApiInterface */ export interface ConfigJiraApiInterface { /** * Use this method to delete a Jira configuration. Permissions required: Edit System Configuration and Users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigJiraApiInterface */ deleteConfiguration2Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to delete a Jira configuration. Permissions required: Edit System Configuration and Users */ deleteConfiguration2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve an existing configuration for Jira. Permissions required: Edit System Configuration and Users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigJiraApiInterface */ getConfiguration2Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve an existing configuration for Jira. Permissions required: Edit System Configuration and Users */ getConfiguration2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to set a Jira configuration. If a Jira configuration already exists, the values will be updated with the ones provided here. If the server URL is being changed, then the password (if any) will be required. Permissions required: Edit System Configuration and Users * @param {ApiJiraConfigurationDTO} [apiJiraConfigurationDTO] Enter the Jira configuration details here. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigJiraApiInterface */ setConfiguration2Raw(requestParameters: ConfigJiraApiSetConfiguration2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to set a Jira configuration. If a Jira configuration already exists, the values will be updated with the ones provided here. If the server URL is being changed, then the password (if any) will be required. Permissions required: Edit System Configuration and Users */ setConfiguration2(requestParameters: ConfigJiraApiSetConfiguration2Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class ConfigJiraApi extends runtime.BaseAPI implements ConfigJiraApiInterface { /** * Use this method to delete a Jira configuration. Permissions required: Edit System Configuration and Users */ async deleteConfiguration2Raw(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/jira`; const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to delete a Jira configuration. Permissions required: Edit System Configuration and Users */ async deleteConfiguration2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.deleteConfiguration2Raw(initOverrides); } /** * Use this method to retrieve an existing configuration for Jira. Permissions required: Edit System Configuration and Users */ async getConfiguration2Raw(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/jira`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiJiraConfigurationDTOFromJSON(jsonValue)); } /** * Use this method to retrieve an existing configuration for Jira. Permissions required: Edit System Configuration and Users */ async getConfiguration2(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getConfiguration2Raw(initOverrides); return await response.value(); } /** * Use this method to set a Jira configuration. If a Jira configuration already exists, the values will be updated with the ones provided here. If the server URL is being changed, then the password (if any) will be required. Permissions required: Edit System Configuration and Users */ async setConfiguration2Raw(requestParameters: ConfigJiraApiSetConfiguration2Request, 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/jira`; const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: ApiJiraConfigurationDTOToJSON(requestParameters['apiJiraConfigurationDTO']), }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to set a Jira configuration. If a Jira configuration already exists, the values will be updated with the ones provided here. If the server URL is being changed, then the password (if any) will be required. Permissions required: Edit System Configuration and Users */ async setConfiguration2(requestParameters: ConfigJiraApiSetConfiguration2Request = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.setConfiguration2Raw(requestParameters, initOverrides); } }