/* 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 { ApiApplicationViolationListDTOV2, ApiAutoPolicyWaiverDTO, ApiComponentTransitivePolicyViolationsDTO, ApiCrossStageViolationDTOV2, ApiPolicyWaiverDTO, ApiPolicyWaiverRequestsApplicableToViolationDTO, ApiPolicyWaiversApplicableToViolationDTO, ComponentIdentifier, } from '../models/index'; import { ApiApplicationViolationListDTOV2FromJSON, ApiApplicationViolationListDTOV2ToJSON, ApiAutoPolicyWaiverDTOFromJSON, ApiAutoPolicyWaiverDTOToJSON, ApiComponentTransitivePolicyViolationsDTOFromJSON, ApiComponentTransitivePolicyViolationsDTOToJSON, ApiCrossStageViolationDTOV2FromJSON, ApiCrossStageViolationDTOV2ToJSON, ApiPolicyWaiverDTOFromJSON, ApiPolicyWaiverDTOToJSON, ApiPolicyWaiverRequestsApplicableToViolationDTOFromJSON, ApiPolicyWaiverRequestsApplicableToViolationDTOToJSON, ApiPolicyWaiversApplicableToViolationDTOFromJSON, ApiPolicyWaiversApplicableToViolationDTOToJSON, ComponentIdentifierFromJSON, ComponentIdentifierToJSON, } from '../models/index'; export interface PolicyViolationDetailsApiGetApplicableAutoWaiverRequest { violationId: string; } export interface PolicyViolationDetailsApiGetApplicableWaiverRequestsRequest { violationId: string; } export interface PolicyViolationDetailsApiGetApplicableWaiversRequest { violationId: string; } export interface PolicyViolationDetailsApiGetCrossStagePolicyViolationByConstituentIdRequest { constituentId: string; } export interface PolicyViolationDetailsApiGetCrossStagePolicyViolationByIdRequest { violationId: string; } export interface PolicyViolationDetailsApiGetPolicyViolations1Request { p: Set; openTimeAfter?: string; openTimeBefore?: string; type?: Set; } export interface PolicyViolationDetailsApiGetSimilarWaiversRequest { violationId: string; } export interface PolicyViolationDetailsApiGetTransitivePolicyViolationsByAppScanComponentRequest { ownerType: GetTransitivePolicyViolationsByAppScanComponentOwnerTypeEnum; ownerId: string; scanId: string; componentIdentifier?: ComponentIdentifier; packageUrl?: string; hash?: string; } export interface PolicyViolationDetailsApiGetTransitivePolicyViolationsByOwnerStageComponentRequest { ownerType: GetTransitivePolicyViolationsByOwnerStageComponentOwnerTypeEnum; ownerId: string; stageId: string; componentIdentifier?: ComponentIdentifier; packageUrl?: string; hash?: string; } /** * PolicyViolationDetailsApi - interface * * @export * @interface PolicyViolationDetailsApiInterface */ export interface PolicyViolationDetailsApiInterface { /** * Use this method to obtain the existing auto waiver applicable to a policy violationviolation. Permissions required: View IQ Elements * @param {string} violationId Enter the policy violationId for which you want to obtain the applicable auto policy waiver * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PolicyViolationDetailsApiInterface */ getApplicableAutoWaiverRaw(requestParameters: PolicyViolationDetailsApiGetApplicableAutoWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to obtain the existing auto waiver applicable to a policy violationviolation. Permissions required: View IQ Elements */ getApplicableAutoWaiver(requestParameters: PolicyViolationDetailsApiGetApplicableAutoWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to obtain all existing waiver requests that are applicable to a policy violation. A waiver request is considered as \'applicable\' if it matches the following conditions:
  • The policyId for the policy violation matches the policyId associated with the waiver request
  • The violated policy conditions match the policy conditions of the waiver request/li>
  • The waiver request scope matches the violating component
Permissions required: View IQ Elements * @param {string} violationId Enter the policy violationId for which you want to obtain the applicable waiver requests. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PolicyViolationDetailsApiInterface */ getApplicableWaiverRequestsRaw(requestParameters: PolicyViolationDetailsApiGetApplicableWaiverRequestsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to obtain all existing waiver requests that are applicable to a policy violation. A waiver request is considered as \'applicable\' if it matches the following conditions:
  • The policyId for the policy violation matches the policyId associated with the waiver request
  • The violated policy conditions match the policy conditions of the waiver request/li>
  • The waiver request scope matches the violating component
Permissions required: View IQ Elements */ getApplicableWaiverRequests(requestParameters: PolicyViolationDetailsApiGetApplicableWaiverRequestsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to obtain all existing waivers that are applicable to a policy violation. A waiver is considered as \'applicable\' if it matches the following conditions:
  • The policyId for the policy violation matches the policyId associated with the waiver
  • The violated policy conditions match the policy conditions of the waiver/li>
  • The waiver scope matches the violating component
Permissions required: View IQ Elements * @param {string} violationId Enter the policy violationId for which you want to obtain the applicable waivers. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PolicyViolationDetailsApiInterface */ getApplicableWaiversRaw(requestParameters: PolicyViolationDetailsApiGetApplicableWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to obtain all existing waivers that are applicable to a policy violation. A waiver is considered as \'applicable\' if it matches the following conditions:
  • The policyId for the policy violation matches the policyId associated with the waiver
  • The violated policy conditions match the policy conditions of the waiver/li>
  • The waiver scope matches the violating component
Permissions required: View IQ Elements */ getApplicableWaivers(requestParameters: PolicyViolationDetailsApiGetApplicableWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * A cross-stage policy violation represents an aggregate of all violations of a policy occurring across multiple stages of an application. Cross-stage policy violations are helpful in performance analysis by determining the time taken to remediate a violation across all stages where it was detected. Use this method to retrieve all cross-stage violations, irrespective of the time they were detected. Permissions required: View IQ Elements * @param {string} constituentId Enter the violationId. Use the GET method described for the endpoint /api/v2/policyViolations to obtain the policy violationId. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PolicyViolationDetailsApiInterface */ getCrossStagePolicyViolationByConstituentIdRaw(requestParameters: PolicyViolationDetailsApiGetCrossStagePolicyViolationByConstituentIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * A cross-stage policy violation represents an aggregate of all violations of a policy occurring across multiple stages of an application. Cross-stage policy violations are helpful in performance analysis by determining the time taken to remediate a violation across all stages where it was detected. Use this method to retrieve all cross-stage violations, irrespective of the time they were detected. Permissions required: View IQ Elements */ getCrossStagePolicyViolationByConstituentId(requestParameters: PolicyViolationDetailsApiGetCrossStagePolicyViolationByConstituentIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * A cross-stage policy violation represents an aggregate of all violations of the same policy, occurring at multiple stages for an application. Cross-stage policy violations are helpful in performance analysis by determining the time taken to remediate a violation across all stages where it was detected. Use this method to retrieve cross-stage policy violations. Permissions required: View IQ Elements * @param {string} violationId Enter the policy `violationId`. Use the GET method described for the endpoint /api/v2/policyViolations to obtain the policy violationId. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PolicyViolationDetailsApiInterface */ getCrossStagePolicyViolationByIdRaw(requestParameters: PolicyViolationDetailsApiGetCrossStagePolicyViolationByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * A cross-stage policy violation represents an aggregate of all violations of the same policy, occurring at multiple stages for an application. Cross-stage policy violations are helpful in performance analysis by determining the time taken to remediate a violation across all stages where it was detected. Use this method to retrieve cross-stage policy violations. Permissions required: View IQ Elements */ getCrossStagePolicyViolationById(requestParameters: PolicyViolationDetailsApiGetCrossStagePolicyViolationByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve policy violation details for a policy/policies. You will need the policyId(s) to retrieve the policy violations details. policyId is available as the response field of the Policies REST API. Permissions required: View IQ Elements * @param {Set} p Enter the policyIds to obtain the corresponding violation details * @param {string} [openTimeAfter] Enter the date (format YYYY-MM-DD) from which you want to retrieve the violation details * @param {string} [openTimeBefore] Enter the date (format YYYY-MM-DD) until which you want to retrieve the violation details * @param {Set<'ACTIVE' | 'WAIVED' | 'LEGACY'>} [type] Set one or more policy violation type (active, legacy, waived) to include * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PolicyViolationDetailsApiInterface */ getPolicyViolations1Raw(requestParameters: PolicyViolationDetailsApiGetPolicyViolations1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve policy violation details for a policy/policies. You will need the policyId(s) to retrieve the policy violations details. policyId is available as the response field of the Policies REST API. Permissions required: View IQ Elements */ getPolicyViolations1(requestParameters: PolicyViolationDetailsApiGetPolicyViolations1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to retrieve similar policy waivers for the given policy violation id. Permissions required: View IQ Elements * @param {string} violationId Policy violation id to find similar waivers for. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PolicyViolationDetailsApiInterface */ getSimilarWaiversRaw(requestParameters: PolicyViolationDetailsApiGetSimilarWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>>; /** * Use this method to retrieve similar policy waivers for the given policy violation id. Permissions required: View IQ Elements */ getSimilarWaivers(requestParameters: PolicyViolationDetailsApiGetSimilarWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve transitive policy violations for a given component in a specific scan. Permissions required: View IQ Elements * @param {'application'} ownerType Enter the scope for this violation. Possible values are \'application\' * @param {string} ownerId Enter the identifier for the scope specified above. E.g. applicationId * @param {string} scanId Enter the scanId/reportId corresponding to the scan. * @param {ComponentIdentifier} [componentIdentifier] Enter the component identifier and the coordinates of the component for which you want to retrieve the transitive policy violations. This is optional, not required if package URL or hash value is provided. * @param {string} [packageUrl] Enter the package URL for the component for which you want to retrieve the transitive policy violations in the specific scan. * @param {string} [hash] Enter the hash value for the component for which you want to retrieve the transitive policy violations in the specific scan. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PolicyViolationDetailsApiInterface */ getTransitivePolicyViolationsByAppScanComponentRaw(requestParameters: PolicyViolationDetailsApiGetTransitivePolicyViolationsByAppScanComponentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to retrieve transitive policy violations for a given component in a specific scan. Permissions required: View IQ Elements */ getTransitivePolicyViolationsByAppScanComponent(requestParameters: PolicyViolationDetailsApiGetTransitivePolicyViolationsByAppScanComponentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Use this method to obtain all transitive policy violations for a given component in a specific stage. Transitive policy violations are violations caused by transitive dependencies. Permissions required: View IQ Elements * @param {'application' | 'organization'} ownerType Possible values are \'application\' or \'organization\' * @param {string} ownerId Possible values are applicationId, organizationId * @param {string} stageId Possible values are \'develop\', \'source\', \'build\', \'stage-release\', \'release\', and, \'operate\'. * @param {ComponentIdentifier} [componentIdentifier] Enter the component identifier and the coordinates of the component for which you want to obtain the transitive violations. This is optional, not required if package URL or hash value is provided. * @param {string} [packageUrl] Enter the package URL of the component. This is optional, not required if component identifier or hash value is provided. * @param {string} [hash] Enter the hash value of the component. This is optional, not required if component identifier or package URL is provided. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PolicyViolationDetailsApiInterface */ getTransitivePolicyViolationsByOwnerStageComponentRaw(requestParameters: PolicyViolationDetailsApiGetTransitivePolicyViolationsByOwnerStageComponentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Use this method to obtain all transitive policy violations for a given component in a specific stage. Transitive policy violations are violations caused by transitive dependencies. Permissions required: View IQ Elements */ getTransitivePolicyViolationsByOwnerStageComponent(requestParameters: PolicyViolationDetailsApiGetTransitivePolicyViolationsByOwnerStageComponentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } /** * */ export class PolicyViolationDetailsApi extends runtime.BaseAPI implements PolicyViolationDetailsApiInterface { /** * Use this method to obtain the existing auto waiver applicable to a policy violationviolation. Permissions required: View IQ Elements */ async getApplicableAutoWaiverRaw(requestParameters: PolicyViolationDetailsApiGetApplicableAutoWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['violationId'] == null) { throw new runtime.RequiredError( 'violationId', 'Required parameter "violationId" was null or undefined when calling getApplicableAutoWaiver().' ); } 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/policyViolations/{violationId}/applicableAutoWaiver`; urlPath = urlPath.replace(`{${"violationId"}}`, encodeURIComponent(String(requestParameters['violationId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiAutoPolicyWaiverDTOFromJSON(jsonValue)); } /** * Use this method to obtain the existing auto waiver applicable to a policy violationviolation. Permissions required: View IQ Elements */ async getApplicableAutoWaiver(requestParameters: PolicyViolationDetailsApiGetApplicableAutoWaiverRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getApplicableAutoWaiverRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to obtain all existing waiver requests that are applicable to a policy violation. A waiver request is considered as \'applicable\' if it matches the following conditions:
  • The policyId for the policy violation matches the policyId associated with the waiver request
  • The violated policy conditions match the policy conditions of the waiver request/li>
  • The waiver request scope matches the violating component
Permissions required: View IQ Elements */ async getApplicableWaiverRequestsRaw(requestParameters: PolicyViolationDetailsApiGetApplicableWaiverRequestsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['violationId'] == null) { throw new runtime.RequiredError( 'violationId', 'Required parameter "violationId" was null or undefined when calling getApplicableWaiverRequests().' ); } 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/policyViolations/{violationId}/applicableWaiverRequests`; urlPath = urlPath.replace(`{${"violationId"}}`, encodeURIComponent(String(requestParameters['violationId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiPolicyWaiverRequestsApplicableToViolationDTOFromJSON(jsonValue)); } /** * Use this method to obtain all existing waiver requests that are applicable to a policy violation. A waiver request is considered as \'applicable\' if it matches the following conditions:
  • The policyId for the policy violation matches the policyId associated with the waiver request
  • The violated policy conditions match the policy conditions of the waiver request/li>
  • The waiver request scope matches the violating component
Permissions required: View IQ Elements */ async getApplicableWaiverRequests(requestParameters: PolicyViolationDetailsApiGetApplicableWaiverRequestsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getApplicableWaiverRequestsRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to obtain all existing waivers that are applicable to a policy violation. A waiver is considered as \'applicable\' if it matches the following conditions:
  • The policyId for the policy violation matches the policyId associated with the waiver
  • The violated policy conditions match the policy conditions of the waiver/li>
  • The waiver scope matches the violating component
Permissions required: View IQ Elements */ async getApplicableWaiversRaw(requestParameters: PolicyViolationDetailsApiGetApplicableWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['violationId'] == null) { throw new runtime.RequiredError( 'violationId', 'Required parameter "violationId" was null or undefined when calling getApplicableWaivers().' ); } 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/policyViolations/{violationId}/applicableWaivers`; urlPath = urlPath.replace(`{${"violationId"}}`, encodeURIComponent(String(requestParameters['violationId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiPolicyWaiversApplicableToViolationDTOFromJSON(jsonValue)); } /** * Use this method to obtain all existing waivers that are applicable to a policy violation. A waiver is considered as \'applicable\' if it matches the following conditions:
  • The policyId for the policy violation matches the policyId associated with the waiver
  • The violated policy conditions match the policy conditions of the waiver/li>
  • The waiver scope matches the violating component
Permissions required: View IQ Elements */ async getApplicableWaivers(requestParameters: PolicyViolationDetailsApiGetApplicableWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getApplicableWaiversRaw(requestParameters, initOverrides); return await response.value(); } /** * A cross-stage policy violation represents an aggregate of all violations of a policy occurring across multiple stages of an application. Cross-stage policy violations are helpful in performance analysis by determining the time taken to remediate a violation across all stages where it was detected. Use this method to retrieve all cross-stage violations, irrespective of the time they were detected. Permissions required: View IQ Elements */ async getCrossStagePolicyViolationByConstituentIdRaw(requestParameters: PolicyViolationDetailsApiGetCrossStagePolicyViolationByConstituentIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['constituentId'] == null) { throw new runtime.RequiredError( 'constituentId', 'Required parameter "constituentId" was null or undefined when calling getCrossStagePolicyViolationByConstituentId().' ); } const queryParameters: any = {}; if (requestParameters['constituentId'] != null) { queryParameters['constituentId'] = requestParameters['constituentId']; } 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/policyViolations/crossStage`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiCrossStageViolationDTOV2FromJSON(jsonValue)); } /** * A cross-stage policy violation represents an aggregate of all violations of a policy occurring across multiple stages of an application. Cross-stage policy violations are helpful in performance analysis by determining the time taken to remediate a violation across all stages where it was detected. Use this method to retrieve all cross-stage violations, irrespective of the time they were detected. Permissions required: View IQ Elements */ async getCrossStagePolicyViolationByConstituentId(requestParameters: PolicyViolationDetailsApiGetCrossStagePolicyViolationByConstituentIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getCrossStagePolicyViolationByConstituentIdRaw(requestParameters, initOverrides); return await response.value(); } /** * A cross-stage policy violation represents an aggregate of all violations of the same policy, occurring at multiple stages for an application. Cross-stage policy violations are helpful in performance analysis by determining the time taken to remediate a violation across all stages where it was detected. Use this method to retrieve cross-stage policy violations. Permissions required: View IQ Elements */ async getCrossStagePolicyViolationByIdRaw(requestParameters: PolicyViolationDetailsApiGetCrossStagePolicyViolationByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['violationId'] == null) { throw new runtime.RequiredError( 'violationId', 'Required parameter "violationId" was null or undefined when calling getCrossStagePolicyViolationById().' ); } 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/policyViolations/crossStage/{violationId}`; urlPath = urlPath.replace(`{${"violationId"}}`, encodeURIComponent(String(requestParameters['violationId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiCrossStageViolationDTOV2FromJSON(jsonValue)); } /** * A cross-stage policy violation represents an aggregate of all violations of the same policy, occurring at multiple stages for an application. Cross-stage policy violations are helpful in performance analysis by determining the time taken to remediate a violation across all stages where it was detected. Use this method to retrieve cross-stage policy violations. Permissions required: View IQ Elements */ async getCrossStagePolicyViolationById(requestParameters: PolicyViolationDetailsApiGetCrossStagePolicyViolationByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getCrossStagePolicyViolationByIdRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to retrieve policy violation details for a policy/policies. You will need the policyId(s) to retrieve the policy violations details. policyId is available as the response field of the Policies REST API. Permissions required: View IQ Elements */ async getPolicyViolations1Raw(requestParameters: PolicyViolationDetailsApiGetPolicyViolations1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['p'] == null) { throw new runtime.RequiredError( 'p', 'Required parameter "p" was null or undefined when calling getPolicyViolations1().' ); } const queryParameters: any = {}; if (requestParameters['p'] != null) { queryParameters['p'] = requestParameters['p']; } if (requestParameters['openTimeAfter'] != null) { queryParameters['openTimeAfter'] = requestParameters['openTimeAfter']; } if (requestParameters['openTimeBefore'] != null) { queryParameters['openTimeBefore'] = requestParameters['openTimeBefore']; } if (requestParameters['type'] != null) { queryParameters['type'] = requestParameters['type']; } 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/policyViolations`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiApplicationViolationListDTOV2FromJSON(jsonValue)); } /** * Use this method to retrieve policy violation details for a policy/policies. You will need the policyId(s) to retrieve the policy violations details. policyId is available as the response field of the Policies REST API. Permissions required: View IQ Elements */ async getPolicyViolations1(requestParameters: PolicyViolationDetailsApiGetPolicyViolations1Request, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getPolicyViolations1Raw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to retrieve similar policy waivers for the given policy violation id. Permissions required: View IQ Elements */ async getSimilarWaiversRaw(requestParameters: PolicyViolationDetailsApiGetSimilarWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { if (requestParameters['violationId'] == null) { throw new runtime.RequiredError( 'violationId', 'Required parameter "violationId" was null or undefined when calling getSimilarWaivers().' ); } 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/policyViolations/{violationId}/similarWaivers`; urlPath = urlPath.replace(`{${"violationId"}}`, encodeURIComponent(String(requestParameters['violationId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ApiPolicyWaiverDTOFromJSON)); } /** * Use this method to retrieve similar policy waivers for the given policy violation id. Permissions required: View IQ Elements */ async getSimilarWaivers(requestParameters: PolicyViolationDetailsApiGetSimilarWaiversRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getSimilarWaiversRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to retrieve transitive policy violations for a given component in a specific scan. Permissions required: View IQ Elements */ async getTransitivePolicyViolationsByAppScanComponentRaw(requestParameters: PolicyViolationDetailsApiGetTransitivePolicyViolationsByAppScanComponentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling getTransitivePolicyViolationsByAppScanComponent().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling getTransitivePolicyViolationsByAppScanComponent().' ); } if (requestParameters['scanId'] == null) { throw new runtime.RequiredError( 'scanId', 'Required parameter "scanId" was null or undefined when calling getTransitivePolicyViolationsByAppScanComponent().' ); } const queryParameters: any = {}; if (requestParameters['componentIdentifier'] != null) { queryParameters['componentIdentifier'] = requestParameters['componentIdentifier']; } if (requestParameters['packageUrl'] != null) { queryParameters['packageUrl'] = requestParameters['packageUrl']; } if (requestParameters['hash'] != null) { queryParameters['hash'] = requestParameters['hash']; } 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/policyViolations/transitive/{ownerType}/{ownerId}/{scanId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId']))); urlPath = urlPath.replace(`{${"scanId"}}`, encodeURIComponent(String(requestParameters['scanId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiComponentTransitivePolicyViolationsDTOFromJSON(jsonValue)); } /** * Use this method to retrieve transitive policy violations for a given component in a specific scan. Permissions required: View IQ Elements */ async getTransitivePolicyViolationsByAppScanComponent(requestParameters: PolicyViolationDetailsApiGetTransitivePolicyViolationsByAppScanComponentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getTransitivePolicyViolationsByAppScanComponentRaw(requestParameters, initOverrides); return await response.value(); } /** * Use this method to obtain all transitive policy violations for a given component in a specific stage. Transitive policy violations are violations caused by transitive dependencies. Permissions required: View IQ Elements */ async getTransitivePolicyViolationsByOwnerStageComponentRaw(requestParameters: PolicyViolationDetailsApiGetTransitivePolicyViolationsByOwnerStageComponentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['ownerType'] == null) { throw new runtime.RequiredError( 'ownerType', 'Required parameter "ownerType" was null or undefined when calling getTransitivePolicyViolationsByOwnerStageComponent().' ); } if (requestParameters['ownerId'] == null) { throw new runtime.RequiredError( 'ownerId', 'Required parameter "ownerId" was null or undefined when calling getTransitivePolicyViolationsByOwnerStageComponent().' ); } if (requestParameters['stageId'] == null) { throw new runtime.RequiredError( 'stageId', 'Required parameter "stageId" was null or undefined when calling getTransitivePolicyViolationsByOwnerStageComponent().' ); } const queryParameters: any = {}; if (requestParameters['componentIdentifier'] != null) { queryParameters['componentIdentifier'] = requestParameters['componentIdentifier']; } if (requestParameters['packageUrl'] != null) { queryParameters['packageUrl'] = requestParameters['packageUrl']; } if (requestParameters['hash'] != null) { queryParameters['hash'] = requestParameters['hash']; } 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/policyViolations/transitive/{ownerType}/{ownerId}/stages/{stageId}`; urlPath = urlPath.replace(`{${"ownerType"}}`, encodeURIComponent(String(requestParameters['ownerType']))); urlPath = urlPath.replace(`{${"ownerId"}}`, encodeURIComponent(String(requestParameters['ownerId']))); urlPath = urlPath.replace(`{${"stageId"}}`, encodeURIComponent(String(requestParameters['stageId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => ApiComponentTransitivePolicyViolationsDTOFromJSON(jsonValue)); } /** * Use this method to obtain all transitive policy violations for a given component in a specific stage. Transitive policy violations are violations caused by transitive dependencies. Permissions required: View IQ Elements */ async getTransitivePolicyViolationsByOwnerStageComponent(requestParameters: PolicyViolationDetailsApiGetTransitivePolicyViolationsByOwnerStageComponentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getTransitivePolicyViolationsByOwnerStageComponentRaw(requestParameters, initOverrides); return await response.value(); } } /** * @export */ export const GetPolicyViolations1TypeEnum = { Active: 'ACTIVE', Waived: 'WAIVED', Legacy: 'LEGACY' } as const; export type GetPolicyViolations1TypeEnum = typeof GetPolicyViolations1TypeEnum[keyof typeof GetPolicyViolations1TypeEnum]; /** * @export */ export const GetTransitivePolicyViolationsByAppScanComponentOwnerTypeEnum = { Application: 'application' } as const; export type GetTransitivePolicyViolationsByAppScanComponentOwnerTypeEnum = typeof GetTransitivePolicyViolationsByAppScanComponentOwnerTypeEnum[keyof typeof GetTransitivePolicyViolationsByAppScanComponentOwnerTypeEnum]; /** * @export */ export const GetTransitivePolicyViolationsByOwnerStageComponentOwnerTypeEnum = { Application: 'application', Organization: 'organization' } as const; export type GetTransitivePolicyViolationsByOwnerStageComponentOwnerTypeEnum = typeof GetTransitivePolicyViolationsByOwnerStageComponentOwnerTypeEnum[keyof typeof GetTransitivePolicyViolationsByOwnerStageComponentOwnerTypeEnum];