/* 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 { ApiApplicationDTO, ApiApplicationListDTO, ApiMoveApplicationResponseDTOV2, } from '../models/index'; import { ApiApplicationDTOFromJSON, ApiApplicationDTOToJSON, ApiApplicationListDTOFromJSON, ApiApplicationListDTOToJSON, ApiMoveApplicationResponseDTOV2FromJSON, ApiMoveApplicationResponseDTOV2ToJSON, } from '../models/index'; export interface ApplicationsApiAddApplicationRequest { apiApplicationDTO?: ApiApplicationDTO; } export interface ApplicationsApiCloneApplicationRequest { sourceApplicationId: string; clonedApplicationName?: string; clonedApplicationPublicId?: string; } export interface ApplicationsApiDeleteApplicationRequest { applicationId: string; } export interface ApplicationsApiGetApplicationRequest { applicationId: string; } export interface ApplicationsApiGetApplicationsRequest { publicId?: Set; includeCategories?: boolean; } export interface ApplicationsApiGetApplicationsByOrganizationIdRequest { organizationId: string; } export interface ApplicationsApiMoveApplicationRequest { applicationId: string; organizationId: string; } export interface ApplicationsApiUpdateApplicationRequest { applicationId: string; apiApplicationDTO?: ApiApplicationDTO; } /** * ApplicationsApi - interface * * @export * @interface ApplicationsApiInterface */ export interface ApplicationsApiInterface { /** * Use this method to create an application under an organization. Use the Organization REST API to obtain organizationId. Permissions required: Add Application (on parent organization) * @param {ApiApplicationDTO} [apiApplicationDTO] Specify the applicationId, application name and the organizationId under which the application should be created. `contactUserName` corresponds to the \'contact\' field in the UI and represents the user name. If LDAP is used for authentication, you can use LDAP usernames.`tagId` is the internal identifier for the Application Category that you want to apply to the application. Use the Application Categories REST API for the available categories and the corresponding tagIds. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApplicationsApiInterface */ addApplicationRaw(requestParameters: ApplicationsApiAddApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to create an application under an organization. Use the Organization REST API to obtain organizationId. Permissions required: Add Application (on parent organization) */ addApplication(requestParameters: ApplicationsApiAddApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to clone an existing application. Permissions required: Add Application (on the parent organization) * @param {string} sourceApplicationId Enter the applicationId for the application to be cloned. * @param {string} [clonedApplicationName] Enter the application name for the new cloned application. * @param {string} [clonedApplicationPublicId] Enter the applicationPublicId for the cloned application. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApplicationsApiInterface */ cloneApplicationRaw(requestParameters: ApplicationsApiCloneApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to clone an existing application. Permissions required: Add Application (on the parent organization) */ cloneApplication(requestParameters: ApplicationsApiCloneApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to permanently delete an existing application and all data associated with it. This action cannot be un-done. Before deleting, confirm that the application being deleted does not impact any integrations that could depend on it. Permissions required: Edit IQ Elements * @param {string} applicationId Enter the applicationId to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApplicationsApiInterface */ deleteApplicationRaw(requestParameters: ApplicationsApiDeleteApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to permanently delete an existing application and all data associated with it. This action cannot be un-done. Before deleting, confirm that the application being deleted does not impact any integrations that could depend on it. Permissions required: Edit IQ Elements */ deleteApplication(requestParameters: ApplicationsApiDeleteApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve the application details, by providing the applicationId. Permissions required: View IQ Elements * @param {string} applicationId Enter the applicationId. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApplicationsApiInterface */ getApplicationRaw(requestParameters: ApplicationsApiGetApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve the application details, by providing the applicationId. Permissions required: View IQ Elements */ getApplication(requestParameters: ApplicationsApiGetApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve the application details for the applicationId(s) provided. Permissions required: View IQ Elements * @param {Set} [publicId] Enter the applicationId. * @param {boolean} [includeCategories] Set this parameter to `true` to obtain the application tags (application categories) in the response. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApplicationsApiInterface */ getApplicationsRaw(requestParameters: ApplicationsApiGetApplicationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve the application details for the applicationId(s) provided. Permissions required: View IQ Elements */ getApplications(requestParameters: ApplicationsApiGetApplicationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve application details for all applications under the organizationId provided. Permissions required: View IQ Elements * @param {string} organizationId Enter the organizationId. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApplicationsApiInterface */ getApplicationsByOrganizationIdRaw(requestParameters: ApplicationsApiGetApplicationsByOrganizationIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve application details for all applications under the organizationId provided. Permissions required: View IQ Elements */ getApplicationsByOrganizationId(requestParameters: ApplicationsApiGetApplicationsByOrganizationIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to move an application from one organization to another. Permissions required: Edit IQ Elements * @param {string} applicationId Enter the applicationId of the application to be moved. * @param {string} organizationId Enter the organizationId of the destination organization. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApplicationsApiInterface */ moveApplicationRaw(requestParameters: ApplicationsApiMoveApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to move an application from one organization to another. Permissions required: Edit IQ Elements */ moveApplication(requestParameters: ApplicationsApiMoveApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to update the application name, application tags or the contact user name for an existing application by providing the applicationId. NOTE: This method cannot be used to change the organizationId of an application. Permissions required: Edit IQ Elements * @param {string} applicationId * @param {ApiApplicationDTO} [apiApplicationDTO] Specify the applicationId, application name and the organizationId under which the application exists. `contactUserName` corresponds to the \'contact\' field in the UI and represents the user name. If LDAP is used for authentication, you can use LDAP usernames.`tagId` is the internal identifier for the Application Category that you want to apply to the application. . Use the Application Categories REST API for the available categories and the corresponding tagIds. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApplicationsApiInterface */ updateApplicationRaw(requestParameters: ApplicationsApiUpdateApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to update the application name, application tags or the contact user name for an existing application by providing the applicationId. NOTE: This method cannot be used to change the organizationId of an application. Permissions required: Edit IQ Elements */ updateApplication(requestParameters: ApplicationsApiUpdateApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class ApplicationsApi extends runtime.BaseAPI implements ApplicationsApiInterface { /** * Use this method to create an application under an organization. Use the Organization REST API to obtain organizationId. Permissions required: Add Application (on parent organization) */ async addApplicationRaw(requestParameters: ApplicationsApiAddApplicationRequest, 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/applications`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: ApiApplicationDTOToJSON(requestParameters['apiApplicationDTO']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiApplicationDTOFromJSON(jsonValue)); } /** * Use this method to create an application under an organization. Use the Organization REST API to obtain organizationId. Permissions required: Add Application (on parent organization) */ async addApplication(requestParameters: ApplicationsApiAddApplicationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.addApplicationRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to clone an existing application. Permissions required: Add Application (on the parent organization) */ async cloneApplicationRaw(requestParameters: ApplicationsApiCloneApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['sourceApplicationId'] == null) { throw new runtime.RequiredError( 'sourceApplicationId', 'Required parameter "sourceApplicationId" was null or undefined when calling cloneApplication().' ); } const queryParameters: any = {}; if (requestParameters['clonedApplicationName'] != null) { queryParameters['clonedApplicationName'] = requestParameters['clonedApplicationName']; } if (requestParameters['clonedApplicationPublicId'] != null) { queryParameters['clonedApplicationPublicId'] = requestParameters['clonedApplicationPublicId']; } 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/applications/{sourceApplicationId}/clone`; urlPath = urlPath.replace(`{${"sourceApplicationId"}}`, encodeURIComponent(String(requestParameters['sourceApplicationId']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiApplicationDTOFromJSON(jsonValue)); } /** * Use this method to clone an existing application. Permissions required: Add Application (on the parent organization) */ async cloneApplication(requestParameters: ApplicationsApiCloneApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.cloneApplicationRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to permanently delete an existing application and all data associated with it. This action cannot be un-done. Before deleting, confirm that the application being deleted does not impact any integrations that could depend on it. Permissions required: Edit IQ Elements */ async deleteApplicationRaw(requestParameters: ApplicationsApiDeleteApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['applicationId'] == null) { throw new runtime.RequiredError( 'applicationId', 'Required parameter "applicationId" was null or undefined when calling deleteApplication().' ); } 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/applications/{applicationId}`; urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to permanently delete an existing application and all data associated with it. This action cannot be un-done. Before deleting, confirm that the application being deleted does not impact any integrations that could depend on it. Permissions required: Edit IQ Elements */ async deleteApplication(requestParameters: ApplicationsApiDeleteApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.deleteApplicationRaw(requestParameters, initOverrides); } /** * Use this method to retrieve the application details, by providing the applicationId. Permissions required: View IQ Elements */ async getApplicationRaw(requestParameters: ApplicationsApiGetApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['applicationId'] == null) { throw new runtime.RequiredError( 'applicationId', 'Required parameter "applicationId" was null or undefined when calling getApplication().' ); } 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/applications/{applicationId}`; urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiApplicationDTOFromJSON(jsonValue)); } /** * Use this method to retrieve the application details, by providing the applicationId. Permissions required: View IQ Elements */ async getApplication(requestParameters: ApplicationsApiGetApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getApplicationRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to retrieve the application details for the applicationId(s) provided. Permissions required: View IQ Elements */ async getApplicationsRaw(requestParameters: ApplicationsApiGetApplicationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; if (requestParameters['publicId'] != null) { queryParameters['publicId'] = requestParameters['publicId']; } if (requestParameters['includeCategories'] != null) { queryParameters['includeCategories'] = requestParameters['includeCategories']; } 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/applications`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiApplicationListDTOFromJSON(jsonValue)); } /** * Use this method to retrieve the application details for the applicationId(s) provided. Permissions required: View IQ Elements */ async getApplications(requestParameters: ApplicationsApiGetApplicationsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getApplicationsRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to retrieve application details for all applications under the organizationId provided. Permissions required: View IQ Elements */ async getApplicationsByOrganizationIdRaw(requestParameters: ApplicationsApiGetApplicationsByOrganizationIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['organizationId'] == null) { throw new runtime.RequiredError( 'organizationId', 'Required parameter "organizationId" was null or undefined when calling getApplicationsByOrganizationId().' ); } 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/applications/organization/{organizationId}`; urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiApplicationListDTOFromJSON(jsonValue)); } /** * Use this method to retrieve application details for all applications under the organizationId provided. Permissions required: View IQ Elements */ async getApplicationsByOrganizationId(requestParameters: ApplicationsApiGetApplicationsByOrganizationIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getApplicationsByOrganizationIdRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to move an application from one organization to another. Permissions required: Edit IQ Elements */ async moveApplicationRaw(requestParameters: ApplicationsApiMoveApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['applicationId'] == null) { throw new runtime.RequiredError( 'applicationId', 'Required parameter "applicationId" was null or undefined when calling moveApplication().' ); } if (requestParameters['organizationId'] == null) { throw new runtime.RequiredError( 'organizationId', 'Required parameter "organizationId" was null or undefined when calling moveApplication().' ); } 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/applications/{applicationId}/move/organization/{organizationId}`; urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId']))); urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiMoveApplicationResponseDTOV2FromJSON(jsonValue)); } /** * Use this method to move an application from one organization to another. Permissions required: Edit IQ Elements */ async moveApplication(requestParameters: ApplicationsApiMoveApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.moveApplicationRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to update the application name, application tags or the contact user name for an existing application by providing the applicationId. NOTE: This method cannot be used to change the organizationId of an application. Permissions required: Edit IQ Elements */ async updateApplicationRaw(requestParameters: ApplicationsApiUpdateApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['applicationId'] == null) { throw new runtime.RequiredError( 'applicationId', 'Required parameter "applicationId" was null or undefined when calling updateApplication().' ); } 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/applications/{applicationId}`; urlPath = urlPath.replace(`{${"applicationId"}}`, encodeURIComponent(String(requestParameters['applicationId']))); const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: ApiApplicationDTOToJSON(requestParameters['apiApplicationDTO']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiApplicationDTOFromJSON(jsonValue)); } /** * Use this method to update the application name, application tags or the contact user name for an existing application by providing the applicationId. NOTE: This method cannot be used to change the organizationId of an application. Permissions required: Edit IQ Elements */ async updateApplication(requestParameters: ApplicationsApiUpdateApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.updateApplicationRaw(requestParameters, initOverrides); return await response.value(); } }