/* 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 { ApiSourceControlConfigurationDTO, } from '../models/index'; import { ApiSourceControlConfigurationDTOFromJSON, ApiSourceControlConfigurationDTOToJSON, } from '../models/index'; export interface ConfigSourceControlApiSetConfiguration6Request { apiSourceControlConfigurationDTO?: ApiSourceControlConfigurationDTO; } /** * ConfigSourceControlApi - interface * * @export * @interface ConfigSourceControlApiInterface */ export interface ConfigSourceControlApiInterface { /** * Use this method to delete an existing SCM configuration. Permissions required: Edit System Configuration and Users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigSourceControlApiInterface */ deleteConfiguration7Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to delete an existing SCM configuration. Permissions required: Edit System Configuration and Users */ deleteConfiguration7(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve an existing SCM configuration. Permissions required: Edit System Configuration and Users * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigSourceControlApiInterface */ getConfiguration7Raw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve an existing SCM configuration. Permissions required: Edit System Configuration and Users */ getConfiguration7(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to set an SCM Configuration with the IQ Server. Permissions required: Edit System Configuration and Users * @param {ApiSourceControlConfigurationDTO} [apiSourceControlConfigurationDTO] Provide the settings for the SCM configuration as below: <ul><li>`cloneDirectory` is the location of the cloned repository that will be used by the IQ server. If a relative path is provided, then that path will be created inside the `sonatype-work` directory and your repository will be created within this. A return value `source-control` indicates that this setting is not configured.</li><li>`gitImplementation` will have the value `java` for JGit or `native` for a native git client.</li><li>`prCommentPurgeWindow` is the number of days until the comments of a Pull Request (PR) are allowed to be purged.</li><li>`prEventPurgeWindow` is the number of days until PR events are allowed to be purged.</li><li>`gitExecutable` is the absolute path to a native client. No value indicates the native git client is on the system path.</li>`gitTimeoutSeconds` is the number of seconds a git command can execute before timing out.</li>`commitUsername` is the username that will be used for the SCM features. The value `NexusIQ` indicates the default value.</li>`commitEmail` is the commit email that will be used for the SCM features.`useUsernameInRepositoryCloneUrl` indicates if the username will be added to the URL for the clonedrepository. This can be used in conjunction with `commitEmail` to support the \'Verified Committer\' feature of Bitbucket.</li>`defaultBranchMonitoringStartTime` has a default value between 00:00 and 00:10. It is the time at which the default branch monitoring will start for the first time.</li>`defaultBranchMonitoringIntervalHours` is the number of hours elapsed between the executions of default branch monitoring by the IQ Server. The default value is 24 hours.</li><li>`pullRequestMonitoringIntervalSeconds` is the time in seconds between consecutive execution of PR monitoring. The default value is 60 seconds.</li></ul> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigSourceControlApiInterface */ setConfiguration6Raw(requestParameters: ConfigSourceControlApiSetConfiguration6Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to set an SCM Configuration with the IQ Server. Permissions required: Edit System Configuration and Users */ setConfiguration6(requestParameters: ConfigSourceControlApiSetConfiguration6Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class ConfigSourceControlApi extends runtime.BaseAPI implements ConfigSourceControlApiInterface { /** * Use this method to delete an existing SCM configuration. Permissions required: Edit System Configuration and Users */ async deleteConfiguration7Raw(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/sourceControl`; const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to delete an existing SCM configuration. Permissions required: Edit System Configuration and Users */ async deleteConfiguration7(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.deleteConfiguration7Raw(initOverrides); } /** * Use this method to retrieve an existing SCM configuration. Permissions required: Edit System Configuration and Users */ async getConfiguration7Raw(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/sourceControl`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiSourceControlConfigurationDTOFromJSON(jsonValue)); } /** * Use this method to retrieve an existing SCM configuration. Permissions required: Edit System Configuration and Users */ async getConfiguration7(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getConfiguration7Raw(initOverrides); return await response.value(); } /** * Use this method to set an SCM Configuration with the IQ Server. Permissions required: Edit System Configuration and Users */ async setConfiguration6Raw(requestParameters: ConfigSourceControlApiSetConfiguration6Request, 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/sourceControl`; const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: ApiSourceControlConfigurationDTOToJSON(requestParameters['apiSourceControlConfigurationDTO']), }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to set an SCM Configuration with the IQ Server. Permissions required: Edit System Configuration and Users */ async setConfiguration6(requestParameters: ConfigSourceControlApiSetConfiguration6Request = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.setConfiguration6Raw(requestParameters, initOverrides); } }