/* 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 { mapValues } from '../runtime'; /** * Options for creating policy waivers * @export * @interface ApiWaiverOptionsDTO */ export interface ApiWaiverOptionsDTO { /** * Reason for waiving the violation(s). Must be non-blank. * @type {string} * @memberof ApiWaiverOptionsDTO */ comment: string; /** * If true, the waiver will automatically expire when a remediation becomes available. Can only be set to true when matcherStrategy is EXACT_COMPONENT. * @type {boolean} * @memberof ApiWaiverOptionsDTO */ expireWhenRemediationAvailable?: boolean; /** * Optional expiration date/time for the waiver in ISO 8601 format. Must be in the future if provided. * @type {Date} * @memberof ApiWaiverOptionsDTO */ expiryTime?: Date; /** * Component matching strategy. For Firewall bulk waivers, only EXACT_COMPONENT and ALL_VERSIONS are supported. * @type {string} * @memberof ApiWaiverOptionsDTO */ matcherStrategy: ApiWaiverOptionsDTOMatcherStrategyEnum; /** * Optional reference to a pre-defined waiver reason ID * @type {string} * @memberof ApiWaiverOptionsDTO */ waiverReasonId?: string; } /** * @export */ export const ApiWaiverOptionsDTOMatcherStrategyEnum = { Default: 'DEFAULT', ExactComponent: 'EXACT_COMPONENT', AllComponents: 'ALL_COMPONENTS', AllVersions: 'ALL_VERSIONS', ExactComponent2: 'EXACT_COMPONENT', AllVersions2: 'ALL_VERSIONS' } as const; export type ApiWaiverOptionsDTOMatcherStrategyEnum = typeof ApiWaiverOptionsDTOMatcherStrategyEnum[keyof typeof ApiWaiverOptionsDTOMatcherStrategyEnum]; /** * Check if a given object implements the ApiWaiverOptionsDTO interface. */ export function instanceOfApiWaiverOptionsDTO(value: object): value is ApiWaiverOptionsDTO { if (!('comment' in value) || value['comment'] === undefined) return false; if (!('matcherStrategy' in value) || value['matcherStrategy'] === undefined) return false; return true; } export function ApiWaiverOptionsDTOFromJSON(json: any): ApiWaiverOptionsDTO { return ApiWaiverOptionsDTOFromJSONTyped(json, false); } export function ApiWaiverOptionsDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiWaiverOptionsDTO { if (json == null) { return json; } return { 'comment': json['comment'], 'expireWhenRemediationAvailable': json['expireWhenRemediationAvailable'] == null ? undefined : json['expireWhenRemediationAvailable'], 'expiryTime': json['expiryTime'] == null ? undefined : (new Date(json['expiryTime'])), 'matcherStrategy': json['matcherStrategy'], 'waiverReasonId': json['waiverReasonId'] == null ? undefined : json['waiverReasonId'], }; } export function ApiWaiverOptionsDTOToJSON(json: any): ApiWaiverOptionsDTO { return ApiWaiverOptionsDTOToJSONTyped(json, false); } export function ApiWaiverOptionsDTOToJSONTyped(value?: ApiWaiverOptionsDTO | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'comment': value['comment'], 'expireWhenRemediationAvailable': value['expireWhenRemediationAvailable'], 'expiryTime': value['expiryTime'] == null ? value['expiryTime'] : value['expiryTime'].toISOString(), 'matcherStrategy': value['matcherStrategy'], 'waiverReasonId': value['waiverReasonId'], }; }