/* 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'; import type { Constraint } from './Constraint'; import { ConstraintFromJSON, ConstraintFromJSONTyped, ConstraintToJSON, ConstraintToJSONTyped, } from './Constraint'; import type { Notifications } from './Notifications'; import { NotificationsFromJSON, NotificationsFromJSONTyped, NotificationsToJSON, NotificationsToJSONTyped, } from './Notifications'; /** * * @export * @interface Policy */ export interface Policy { /** * * @type {{ [key: string]: string; }} * @memberof Policy */ actions?: { [key: string]: string; }; /** * * @type {Array} * @memberof Policy */ constraints?: Array; /** * * @type {string} * @memberof Policy */ id?: string; /** * * @type {boolean} * @memberof Policy */ legacyViolationAllowed?: boolean; /** * * @type {string} * @memberof Policy */ name?: string; /** * * @type {Notifications} * @memberof Policy */ notifications?: Notifications; /** * * @type {string} * @memberof Policy */ ownerId?: string; /** * * @type {boolean} * @memberof Policy */ policyActionsOverrideAllowed?: boolean; /** * * @type {{ [key: string]: { [key: string]: string; }; }} * @memberof Policy */ policyActionsOverrides?: { [key: string]: { [key: string]: string; }; }; /** * * @type {boolean} * @memberof Policy */ policyNotificationsOverrideAllowed?: boolean; /** * * @type {{ [key: string]: Notifications; }} * @memberof Policy */ policyNotificationsOverrides?: { [key: string]: Notifications; }; /** * * @type {boolean} * @memberof Policy */ policyViolationGrandfatheringAllowed?: boolean; /** * * @type {number} * @memberof Policy */ threatLevel?: number; } /** * Check if a given object implements the Policy interface. */ export function instanceOfPolicy(value: object): value is Policy { return true; } export function PolicyFromJSON(json: any): Policy { return PolicyFromJSONTyped(json, false); } export function PolicyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Policy { if (json == null) { return json; } return { 'actions': json['actions'] == null ? undefined : json['actions'], 'constraints': json['constraints'] == null ? undefined : ((json['constraints'] as Array).map(ConstraintFromJSON)), 'id': json['id'] == null ? undefined : json['id'], 'legacyViolationAllowed': json['legacyViolationAllowed'] == null ? undefined : json['legacyViolationAllowed'], 'name': json['name'] == null ? undefined : json['name'], 'notifications': json['notifications'] == null ? undefined : NotificationsFromJSON(json['notifications']), 'ownerId': json['ownerId'] == null ? undefined : json['ownerId'], 'policyActionsOverrideAllowed': json['policyActionsOverrideAllowed'] == null ? undefined : json['policyActionsOverrideAllowed'], 'policyActionsOverrides': json['policyActionsOverrides'] == null ? undefined : json['policyActionsOverrides'], 'policyNotificationsOverrideAllowed': json['policyNotificationsOverrideAllowed'] == null ? undefined : json['policyNotificationsOverrideAllowed'], 'policyNotificationsOverrides': json['policyNotificationsOverrides'] == null ? undefined : (mapValues(json['policyNotificationsOverrides'], NotificationsFromJSON)), 'policyViolationGrandfatheringAllowed': json['policyViolationGrandfatheringAllowed'] == null ? undefined : json['policyViolationGrandfatheringAllowed'], 'threatLevel': json['threatLevel'] == null ? undefined : json['threatLevel'], }; } export function PolicyToJSON(json: any): Policy { return PolicyToJSONTyped(json, false); } export function PolicyToJSONTyped(value?: Policy | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'actions': value['actions'], 'constraints': value['constraints'] == null ? undefined : ((value['constraints'] as Array).map(ConstraintToJSON)), 'id': value['id'], 'legacyViolationAllowed': value['legacyViolationAllowed'], 'name': value['name'], 'notifications': NotificationsToJSON(value['notifications']), 'ownerId': value['ownerId'], 'policyActionsOverrideAllowed': value['policyActionsOverrideAllowed'], 'policyActionsOverrides': value['policyActionsOverrides'], 'policyNotificationsOverrideAllowed': value['policyNotificationsOverrideAllowed'], 'policyNotificationsOverrides': value['policyNotificationsOverrides'] == null ? undefined : (mapValues(value['policyNotificationsOverrides'], NotificationsToJSON)), 'policyViolationGrandfatheringAllowed': value['policyViolationGrandfatheringAllowed'], 'threatLevel': value['threatLevel'], }; }