/* 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 { ApiArtifactoryConnectionDTO, ApiArtifactoryConnectionStatusRequestDTO, ApiOwnerArtifactoryConnectionDTO, ApiStatusDTO, } from '../models/index'; import { ApiArtifactoryConnectionDTOFromJSON, ApiArtifactoryConnectionDTOToJSON, ApiArtifactoryConnectionStatusRequestDTOFromJSON, ApiArtifactoryConnectionStatusRequestDTOToJSON, ApiOwnerArtifactoryConnectionDTOFromJSON, ApiOwnerArtifactoryConnectionDTOToJSON, ApiStatusDTOFromJSON, ApiStatusDTOToJSON, } from '../models/index'; export interface ConfigureArtifactoryConnectionApiAddArtifactoryConnectionRequest { ownerType: AddArtifactoryConnectionOwnerTypeEnum; internalOwnerId: string; apiArtifactoryConnectionDTO: ApiArtifactoryConnectionDTO; } export interface ConfigureArtifactoryConnectionApiDeleteArtifactoryConnectionRequest { ownerType: DeleteArtifactoryConnectionOwnerTypeEnum; internalOwnerId: string; artifactoryConnectionId: string; } export interface ConfigureArtifactoryConnectionApiGetArtifactoryConnectionRequest { ownerType: GetArtifactoryConnectionOwnerTypeEnum; internalOwnerId: string; artifactoryConnectionId: string; } export interface ConfigureArtifactoryConnectionApiGetOwnerArtifactoryConnectionRequest { ownerType: GetOwnerArtifactoryConnectionOwnerTypeEnum; internalOwnerId: string; inherit?: boolean; } export interface ConfigureArtifactoryConnectionApiTestArtifactoryConnectionRequest { ownerType: TestArtifactoryConnectionOwnerTypeEnum; internalOwnerId: string; apiArtifactoryConnectionDTO: ApiArtifactoryConnectionDTO; } export interface ConfigureArtifactoryConnectionApiTestArtifactoryConnection1Request { ownerType: TestArtifactoryConnection1OwnerTypeEnum; internalOwnerId: string; artifactoryConnectionId: string; } export interface ConfigureArtifactoryConnectionApiUpdateArtifactoryConnectionRequest { ownerType: UpdateArtifactoryConnectionOwnerTypeEnum; internalOwnerId: string; artifactoryConnectionId: string; apiArtifactoryConnectionDTO: ApiArtifactoryConnectionDTO; } export interface ConfigureArtifactoryConnectionApiUpdateOwnerArtifactoryConnectionStatusRequest { ownerType: UpdateOwnerArtifactoryConnectionStatusOwnerTypeEnum; internalOwnerId: string; apiArtifactoryConnectionStatusRequestDTO: ApiArtifactoryConnectionStatusRequestDTO; } /** * ConfigureArtifactoryConnectionApi - interface * * @export * @interface ConfigureArtifactoryConnectionApiInterface */ export interface ConfigureArtifactoryConnectionApiInterface { /** * Use this method to add a new Artifactory connection. Permissions required: Edit IQ Elements * @param {'application' | 'organization'} ownerType Select the owner type. * @param {string} internalOwnerId Enter the internal ID of the owner. * @param {ApiArtifactoryConnectionDTO} apiArtifactoryConnectionDTO Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigureArtifactoryConnectionApiInterface */ addArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiAddArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to add a new Artifactory connection. Permissions required: Edit IQ Elements */ addArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiAddArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to delete an existing Artifactory connection. Permissions required: Edit IQ Elements * @param {'application' | 'organization'} ownerType Select the owner type. * @param {string} internalOwnerId Enter the internal ID of the owner. * @param {string} artifactoryConnectionId Enter the Artifactory connection ID. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigureArtifactoryConnectionApiInterface */ deleteArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiDeleteArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to delete an existing Artifactory connection. Permissions required: Edit IQ Elements */ deleteArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiDeleteArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve details for an Artifactory connection. Permissions required: View IQ Elements * @param {'application' | 'organization'} ownerType Select the owner type. * @param {string} internalOwnerId Enter the internal ID of the owner. * @param {string} artifactoryConnectionId Enter the Artifactory connection ID. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigureArtifactoryConnectionApiInterface */ getArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiGetArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve details for an Artifactory connection. Permissions required: View IQ Elements */ getArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiGetArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve Artifactory connection details by specifying the owner Id. Permissions required: View IQ Elements * @param {'application' | 'organization'} ownerType Select the owner type. * @param {string} internalOwnerId Enter the internal ID of the owner. * @param {boolean} [inherit] Specify whether to include details from an inherited Artifactory connection. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigureArtifactoryConnectionApiInterface */ getOwnerArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiGetOwnerArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve Artifactory connection details by specifying the owner Id. Permissions required: View IQ Elements */ getOwnerArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiGetOwnerArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to test an Artifactory connection for the specified owner. Permissons required: View IQ Elements * @param {'application' | 'organization'} ownerType Select the owner type. * @param {string} internalOwnerId Enter the internal ID of the owner. * @param {ApiArtifactoryConnectionDTO} apiArtifactoryConnectionDTO Enter values for the Artifactory connection.<ul><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigureArtifactoryConnectionApiInterface */ testArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiTestArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to test an Artifactory connection for the specified owner. Permissons required: View IQ Elements */ testArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiTestArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to test an existing Artifactory connection using the connection ID. * @param {'application' | 'organization'} ownerType Enter the owner type. * @param {string} internalOwnerId Enter the internal ID of the owner. * @param {string} artifactoryConnectionId Enter the Artifactory connection ID. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigureArtifactoryConnectionApiInterface */ testArtifactoryConnection1Raw(requestParameters: ConfigureArtifactoryConnectionApiTestArtifactoryConnection1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to test an existing Artifactory connection using the connection ID. */ testArtifactoryConnection1(requestParameters: ConfigureArtifactoryConnectionApiTestArtifactoryConnection1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to update an existing Artifactory connection. Permissions required: Edit IQ Elements * @param {'application' | 'organization'} ownerType Specify the owner type. * @param {string} internalOwnerId Enter the internal ID of the owner. * @param {string} artifactoryConnectionId Enter the Artifactory connection ID. * @param {ApiArtifactoryConnectionDTO} apiArtifactoryConnectionDTO Enter values for the new Artifactory connection.<ul><li>`isAnonymous` indicates if the connection is anonymous.</li><li>`baseUrl` is the baseURL of the Artifactory instance.</li><li>`username` and `password` to authenticate the Artifactory connection.</li></ul> * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigureArtifactoryConnectionApiInterface */ updateArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiUpdateArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to update an existing Artifactory connection. Permissions required: Edit IQ Elements */ updateArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiUpdateArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to enable/disable an existing Artifactory connection for the specified owner. Permissions required: Edit IQ Elements * @param {'application' | 'organization'} ownerType Select the owner type. * @param {string} internalOwnerId Enter the internal ID of the owner. * @param {ApiArtifactoryConnectionStatusRequestDTO} apiArtifactoryConnectionStatusRequestDTO Set values for the connection properties `enabled` and `allowOverride`. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ConfigureArtifactoryConnectionApiInterface */ updateOwnerArtifactoryConnectionStatusRaw(requestParameters: ConfigureArtifactoryConnectionApiUpdateOwnerArtifactoryConnectionStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to enable/disable an existing Artifactory connection for the specified owner. Permissions required: Edit IQ Elements */ updateOwnerArtifactoryConnectionStatus(requestParameters: ConfigureArtifactoryConnectionApiUpdateOwnerArtifactoryConnectionStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class ConfigureArtifactoryConnectionApi extends runtime.BaseAPI implements ConfigureArtifactoryConnectionApiInterface { /** * Use this method to add a new Artifactory connection. Permissions required: Edit IQ Elements */ async addArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiAddArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling addArtifactoryConnection().' ); } if (requestParameters['internalOwnerId'] == null) { throw new runtime.RequiredError( 'internalOwnerId', 'Required parameter "internalOwnerId" was null or undefined when calling addArtifactoryConnection().' ); } if (requestParameters['apiArtifactoryConnectionDTO'] == null) { throw new runtime.RequiredError( 'apiArtifactoryConnectionDTO', 'Required parameter "apiArtifactoryConnectionDTO" was null or undefined when calling addArtifactoryConnection().' ); } 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/artifactoryConnection/{ownerType}/{internalOwnerId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"internalOwnerId"}}`, encodeURIComponent(String(requestParameters['internalOwnerId']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: ApiArtifactoryConnectionDTOToJSON(requestParameters['apiArtifactoryConnectionDTO']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiArtifactoryConnectionDTOFromJSON(jsonValue)); } /** * Use this method to add a new Artifactory connection. Permissions required: Edit IQ Elements */ async addArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiAddArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.addArtifactoryConnectionRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to delete an existing Artifactory connection. Permissions required: Edit IQ Elements */ async deleteArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiDeleteArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling deleteArtifactoryConnection().' ); } if (requestParameters['internalOwnerId'] == null) { throw new runtime.RequiredError( 'internalOwnerId', 'Required parameter "internalOwnerId" was null or undefined when calling deleteArtifactoryConnection().' ); } if (requestParameters['artifactoryConnectionId'] == null) { throw new runtime.RequiredError( 'artifactoryConnectionId', 'Required parameter "artifactoryConnectionId" was null or undefined when calling deleteArtifactoryConnection().' ); } 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/artifactoryConnection/{ownerType}/{internalOwnerId}/{artifactoryConnectionId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"internalOwnerId"}}`, encodeURIComponent(String(requestParameters['internalOwnerId']))); urlPath = urlPath.replace(`{${"artifactoryConnectionId"}}`, encodeURIComponent(String(requestParameters['artifactoryConnectionId']))); 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 Artifactory connection. Permissions required: Edit IQ Elements */ async deleteArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiDeleteArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.deleteArtifactoryConnectionRaw(requestParameters, initOverrides); } /** * Use this method to retrieve details for an Artifactory connection. Permissions required: View IQ Elements */ async getArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiGetArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling getArtifactoryConnection().' ); } if (requestParameters['internalOwnerId'] == null) { throw new runtime.RequiredError( 'internalOwnerId', 'Required parameter "internalOwnerId" was null or undefined when calling getArtifactoryConnection().' ); } if (requestParameters['artifactoryConnectionId'] == null) { throw new runtime.RequiredError( 'artifactoryConnectionId', 'Required parameter "artifactoryConnectionId" was null or undefined when calling getArtifactoryConnection().' ); } 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/artifactoryConnection/{ownerType}/{internalOwnerId}/{artifactoryConnectionId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"internalOwnerId"}}`, encodeURIComponent(String(requestParameters['internalOwnerId']))); urlPath = urlPath.replace(`{${"artifactoryConnectionId"}}`, encodeURIComponent(String(requestParameters['artifactoryConnectionId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiArtifactoryConnectionDTOFromJSON(jsonValue)); } /** * Use this method to retrieve details for an Artifactory connection. Permissions required: View IQ Elements */ async getArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiGetArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getArtifactoryConnectionRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to retrieve Artifactory connection details by specifying the owner Id. Permissions required: View IQ Elements */ async getOwnerArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiGetOwnerArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling getOwnerArtifactoryConnection().' ); } if (requestParameters['internalOwnerId'] == null) { throw new runtime.RequiredError( 'internalOwnerId', 'Required parameter "internalOwnerId" was null or undefined when calling getOwnerArtifactoryConnection().' ); } const queryParameters: any = {}; if (requestParameters['inherit'] != null) { queryParameters['inherit'] = requestParameters['inherit']; } 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/artifactoryConnection/{ownerType}/{internalOwnerId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"internalOwnerId"}}`, encodeURIComponent(String(requestParameters['internalOwnerId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiOwnerArtifactoryConnectionDTOFromJSON(jsonValue)); } /** * Use this method to retrieve Artifactory connection details by specifying the owner Id. Permissions required: View IQ Elements */ async getOwnerArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiGetOwnerArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getOwnerArtifactoryConnectionRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to test an Artifactory connection for the specified owner. Permissons required: View IQ Elements */ async testArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiTestArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling testArtifactoryConnection().' ); } if (requestParameters['internalOwnerId'] == null) { throw new runtime.RequiredError( 'internalOwnerId', 'Required parameter "internalOwnerId" was null or undefined when calling testArtifactoryConnection().' ); } if (requestParameters['apiArtifactoryConnectionDTO'] == null) { throw new runtime.RequiredError( 'apiArtifactoryConnectionDTO', 'Required parameter "apiArtifactoryConnectionDTO" was null or undefined when calling testArtifactoryConnection().' ); } 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/artifactoryConnection/{ownerType}/{internalOwnerId}/test`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"internalOwnerId"}}`, encodeURIComponent(String(requestParameters['internalOwnerId']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: ApiArtifactoryConnectionDTOToJSON(requestParameters['apiArtifactoryConnectionDTO']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiStatusDTOFromJSON(jsonValue)); } /** * Use this method to test an Artifactory connection for the specified owner. Permissons required: View IQ Elements */ async testArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiTestArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.testArtifactoryConnectionRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to test an existing Artifactory connection using the connection ID. */ async testArtifactoryConnection1Raw(requestParameters: ConfigureArtifactoryConnectionApiTestArtifactoryConnection1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling testArtifactoryConnection1().' ); } if (requestParameters['internalOwnerId'] == null) { throw new runtime.RequiredError( 'internalOwnerId', 'Required parameter "internalOwnerId" was null or undefined when calling testArtifactoryConnection1().' ); } if (requestParameters['artifactoryConnectionId'] == null) { throw new runtime.RequiredError( 'artifactoryConnectionId', 'Required parameter "artifactoryConnectionId" was null or undefined when calling testArtifactoryConnection1().' ); } 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/artifactoryConnection/{ownerType}/{internalOwnerId}/{artifactoryConnectionId}/test`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"internalOwnerId"}}`, encodeURIComponent(String(requestParameters['internalOwnerId']))); urlPath = urlPath.replace(`{${"artifactoryConnectionId"}}`, encodeURIComponent(String(requestParameters['artifactoryConnectionId']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiStatusDTOFromJSON(jsonValue)); } /** * Use this method to test an existing Artifactory connection using the connection ID. */ async testArtifactoryConnection1(requestParameters: ConfigureArtifactoryConnectionApiTestArtifactoryConnection1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.testArtifactoryConnection1Raw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to update an existing Artifactory connection. Permissions required: Edit IQ Elements */ async updateArtifactoryConnectionRaw(requestParameters: ConfigureArtifactoryConnectionApiUpdateArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling updateArtifactoryConnection().' ); } if (requestParameters['internalOwnerId'] == null) { throw new runtime.RequiredError( 'internalOwnerId', 'Required parameter "internalOwnerId" was null or undefined when calling updateArtifactoryConnection().' ); } if (requestParameters['artifactoryConnectionId'] == null) { throw new runtime.RequiredError( 'artifactoryConnectionId', 'Required parameter "artifactoryConnectionId" was null or undefined when calling updateArtifactoryConnection().' ); } if (requestParameters['apiArtifactoryConnectionDTO'] == null) { throw new runtime.RequiredError( 'apiArtifactoryConnectionDTO', 'Required parameter "apiArtifactoryConnectionDTO" was null or undefined when calling updateArtifactoryConnection().' ); } 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/artifactoryConnection/{ownerType}/{internalOwnerId}/{artifactoryConnectionId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"internalOwnerId"}}`, encodeURIComponent(String(requestParameters['internalOwnerId']))); urlPath = urlPath.replace(`{${"artifactoryConnectionId"}}`, encodeURIComponent(String(requestParameters['artifactoryConnectionId']))); const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: ApiArtifactoryConnectionDTOToJSON(requestParameters['apiArtifactoryConnectionDTO']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiArtifactoryConnectionDTOFromJSON(jsonValue)); } /** * Use this method to update an existing Artifactory connection. Permissions required: Edit IQ Elements */ async updateArtifactoryConnection(requestParameters: ConfigureArtifactoryConnectionApiUpdateArtifactoryConnectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.updateArtifactoryConnectionRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to enable/disable an existing Artifactory connection for the specified owner. Permissions required: Edit IQ Elements */ async updateOwnerArtifactoryConnectionStatusRaw(requestParameters: ConfigureArtifactoryConnectionApiUpdateOwnerArtifactoryConnectionStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling updateOwnerArtifactoryConnectionStatus().' ); } if (requestParameters['internalOwnerId'] == null) { throw new runtime.RequiredError( 'internalOwnerId', 'Required parameter "internalOwnerId" was null or undefined when calling updateOwnerArtifactoryConnectionStatus().' ); } if (requestParameters['apiArtifactoryConnectionStatusRequestDTO'] == null) { throw new runtime.RequiredError( 'apiArtifactoryConnectionStatusRequestDTO', 'Required parameter "apiArtifactoryConnectionStatusRequestDTO" was null or undefined when calling updateOwnerArtifactoryConnectionStatus().' ); } 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/artifactoryConnection/{ownerType}/{internalOwnerId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"internalOwnerId"}}`, encodeURIComponent(String(requestParameters['internalOwnerId']))); const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: ApiArtifactoryConnectionStatusRequestDTOToJSON(requestParameters['apiArtifactoryConnectionStatusRequestDTO']), }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to enable/disable an existing Artifactory connection for the specified owner. Permissions required: Edit IQ Elements */ async updateOwnerArtifactoryConnectionStatus(requestParameters: ConfigureArtifactoryConnectionApiUpdateOwnerArtifactoryConnectionStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.updateOwnerArtifactoryConnectionStatusRaw(requestParameters, initOverrides); } } /** * @export */ export const AddArtifactoryConnectionOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type AddArtifactoryConnectionOwnerTypeEnum = typeof AddArtifactoryConnectionOwnerTypeEnum[keyof typeof AddArtifactoryConnectionOwnerTypeEnum]; /** * @export */ export const DeleteArtifactoryConnectionOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type DeleteArtifactoryConnectionOwnerTypeEnum = typeof DeleteArtifactoryConnectionOwnerTypeEnum[keyof typeof DeleteArtifactoryConnectionOwnerTypeEnum]; /** * @export */ export const GetArtifactoryConnectionOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type GetArtifactoryConnectionOwnerTypeEnum = typeof GetArtifactoryConnectionOwnerTypeEnum[keyof typeof GetArtifactoryConnectionOwnerTypeEnum]; /** * @export */ export const GetOwnerArtifactoryConnectionOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type GetOwnerArtifactoryConnectionOwnerTypeEnum = typeof GetOwnerArtifactoryConnectionOwnerTypeEnum[keyof typeof GetOwnerArtifactoryConnectionOwnerTypeEnum]; /** * @export */ export const TestArtifactoryConnectionOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type TestArtifactoryConnectionOwnerTypeEnum = typeof TestArtifactoryConnectionOwnerTypeEnum[keyof typeof TestArtifactoryConnectionOwnerTypeEnum]; /** * @export */ export const TestArtifactoryConnection1OwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type TestArtifactoryConnection1OwnerTypeEnum = typeof TestArtifactoryConnection1OwnerTypeEnum[keyof typeof TestArtifactoryConnection1OwnerTypeEnum]; /** * @export */ export const UpdateArtifactoryConnectionOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type UpdateArtifactoryConnectionOwnerTypeEnum = typeof UpdateArtifactoryConnectionOwnerTypeEnum[keyof typeof UpdateArtifactoryConnectionOwnerTypeEnum]; /** * @export */ export const UpdateOwnerArtifactoryConnectionStatusOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type UpdateOwnerArtifactoryConnectionStatusOwnerTypeEnum = typeof UpdateOwnerArtifactoryConnectionStatusOwnerTypeEnum[keyof typeof UpdateOwnerArtifactoryConnectionStatusOwnerTypeEnum];