/* 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 { ScanHealthConfigDTO, } from '../models/index'; import { ScanHealthConfigDTOFromJSON, ScanHealthConfigDTOToJSON, } from '../models/index'; export interface ScanHealthConfigurationApiDeleteConfiguration6Request { ownerType: DeleteConfiguration6OwnerTypeEnum; ownerId: string; } export interface ScanHealthConfigurationApiGetConfiguration6Request { ownerType: GetConfiguration6OwnerTypeEnum; ownerId: string; } export interface ScanHealthConfigurationApiSaveConfigurationRequest { ownerType: SaveConfigurationOwnerTypeEnum; ownerId: string; scanHealthConfigDTO?: ScanHealthConfigDTO; } /** * ScanHealthConfigurationApi - interface * * @export * @interface ScanHealthConfigurationApiInterface */ export interface ScanHealthConfigurationApiInterface { /** * Use this method to delete Scan Health configuration for the specified owner. After deletion, the configuration will be inherited from the parent organization or default to disabled. Permissions required: Edit IQ Elements * @param {'application' | 'organization'} ownerType The owner type (application or organization) * @param {string} ownerId The internal ID of the owner * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ScanHealthConfigurationApiInterface */ deleteConfiguration6Raw(requestParameters: ScanHealthConfigurationApiDeleteConfiguration6Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to delete Scan Health configuration for the specified owner. After deletion, the configuration will be inherited from the parent organization or default to disabled. Permissions required: Edit IQ Elements */ deleteConfiguration6(requestParameters: ScanHealthConfigurationApiDeleteConfiguration6Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve Scan Health configuration for the specified owner. The response includes the `failOnZeroComponents` setting. A null value indicates the setting is inherited from the parent organization (or default disabled if no parent configuration exists). Permissions required: View IQ Elements * @param {'application' | 'organization'} ownerType The owner type (application or organization) * @param {string} ownerId The internal ID of the owner * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ScanHealthConfigurationApiInterface */ getConfiguration6Raw(requestParameters: ScanHealthConfigurationApiGetConfiguration6Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve Scan Health configuration for the specified owner. The response includes the `failOnZeroComponents` setting. A null value indicates the setting is inherited from the parent organization (or default disabled if no parent configuration exists). Permissions required: View IQ Elements */ getConfiguration6(requestParameters: ScanHealthConfigurationApiGetConfiguration6Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to create or update Scan Health configuration for the specified owner. Set `failOnZeroComponents` to `true` to fail scans that detect zero components. Set to `false` to explicitly disable this check. Set to `null` to inherit from the parent organization. Permissions required: Edit IQ Elements * @param {'application' | 'organization'} ownerType The owner type (application or organization) * @param {string} ownerId The internal ID of the owner * @param {ScanHealthConfigDTO} [scanHealthConfigDTO] The Scan Health configuration to save. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ScanHealthConfigurationApiInterface */ saveConfigurationRaw(requestParameters: ScanHealthConfigurationApiSaveConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to create or update Scan Health configuration for the specified owner. Set `failOnZeroComponents` to `true` to fail scans that detect zero components. Set to `false` to explicitly disable this check. Set to `null` to inherit from the parent organization. Permissions required: Edit IQ Elements */ saveConfiguration(requestParameters: ScanHealthConfigurationApiSaveConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class ScanHealthConfigurationApi extends runtime.BaseAPI implements ScanHealthConfigurationApiInterface { /** * Use this method to delete Scan Health configuration for the specified owner. After deletion, the configuration will be inherited from the parent organization or default to disabled. Permissions required: Edit IQ Elements */ async deleteConfiguration6Raw(requestParameters: ScanHealthConfigurationApiDeleteConfiguration6Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling deleteConfiguration6().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling deleteConfiguration6().' ); } 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/scanHealth/{ownerType}/{ownerId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.VoidApiResponse(response); } /** * Use this method to delete Scan Health configuration for the specified owner. After deletion, the configuration will be inherited from the parent organization or default to disabled. Permissions required: Edit IQ Elements */ async deleteConfiguration6(requestParameters: ScanHealthConfigurationApiDeleteConfiguration6Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { await this.deleteConfiguration6Raw(requestParameters, initOverrides); } /** * Use this method to retrieve Scan Health configuration for the specified owner. The response includes the `failOnZeroComponents` setting. A null value indicates the setting is inherited from the parent organization (or default disabled if no parent configuration exists). Permissions required: View IQ Elements */ async getConfiguration6Raw(requestParameters: ScanHealthConfigurationApiGetConfiguration6Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling getConfiguration6().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling getConfiguration6().' ); } 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/scanHealth/{ownerType}/{ownerId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ScanHealthConfigDTOFromJSON(jsonValue)); } /** * Use this method to retrieve Scan Health configuration for the specified owner. The response includes the `failOnZeroComponents` setting. A null value indicates the setting is inherited from the parent organization (or default disabled if no parent configuration exists). Permissions required: View IQ Elements */ async getConfiguration6(requestParameters: ScanHealthConfigurationApiGetConfiguration6Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getConfiguration6Raw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to create or update Scan Health configuration for the specified owner. Set `failOnZeroComponents` to `true` to fail scans that detect zero components. Set to `false` to explicitly disable this check. Set to `null` to inherit from the parent organization. Permissions required: Edit IQ Elements */ async saveConfigurationRaw(requestParameters: ScanHealthConfigurationApiSaveConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling saveConfiguration().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling saveConfiguration().' ); } 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/scanHealth/{ownerType}/{ownerId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId']))); const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: ScanHealthConfigDTOToJSON(requestParameters['scanHealthConfigDTO']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ScanHealthConfigDTOFromJSON(jsonValue)); } /** * Use this method to create or update Scan Health configuration for the specified owner. Set `failOnZeroComponents` to `true` to fail scans that detect zero components. Set to `false` to explicitly disable this check. Set to `null` to inherit from the parent organization. Permissions required: Edit IQ Elements */ async saveConfiguration(requestParameters: ScanHealthConfigurationApiSaveConfigurationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.saveConfigurationRaw(requestParameters, initOverrides); return await response.value(); } } /** * @export */ export const DeleteConfiguration6OwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type DeleteConfiguration6OwnerTypeEnum = typeof DeleteConfiguration6OwnerTypeEnum[keyof typeof DeleteConfiguration6OwnerTypeEnum]; /** * @export */ export const GetConfiguration6OwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type GetConfiguration6OwnerTypeEnum = typeof GetConfiguration6OwnerTypeEnum[keyof typeof GetConfiguration6OwnerTypeEnum]; /** * @export */ export const SaveConfigurationOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type SaveConfigurationOwnerTypeEnum = typeof SaveConfigurationOwnerTypeEnum[keyof typeof SaveConfigurationOwnerTypeEnum];