1# coding: utf-8
2# Copyright (c) 2016, 2021, Oracle and/or its affiliates.  All rights reserved.
3# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4
5
6from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel  # noqa: F401
7from oci.decorators import init_model_state_from_kwargs
8
9
10@init_model_state_from_kwargs
11class UpdateDetectorRuleDetails(object):
12    """
13    Details of a Detector Rule to be overriden in Detector Recipe
14    """
15
16    #: A constant which can be used with the risk_level property of a UpdateDetectorRuleDetails.
17    #: This constant has a value of "CRITICAL"
18    RISK_LEVEL_CRITICAL = "CRITICAL"
19
20    #: A constant which can be used with the risk_level property of a UpdateDetectorRuleDetails.
21    #: This constant has a value of "HIGH"
22    RISK_LEVEL_HIGH = "HIGH"
23
24    #: A constant which can be used with the risk_level property of a UpdateDetectorRuleDetails.
25    #: This constant has a value of "MEDIUM"
26    RISK_LEVEL_MEDIUM = "MEDIUM"
27
28    #: A constant which can be used with the risk_level property of a UpdateDetectorRuleDetails.
29    #: This constant has a value of "LOW"
30    RISK_LEVEL_LOW = "LOW"
31
32    #: A constant which can be used with the risk_level property of a UpdateDetectorRuleDetails.
33    #: This constant has a value of "MINOR"
34    RISK_LEVEL_MINOR = "MINOR"
35
36    def __init__(self, **kwargs):
37        """
38        Initializes a new UpdateDetectorRuleDetails object with values from keyword arguments.
39        The following keyword arguments are supported (corresponding to the getters/setters of this class):
40
41        :param is_enabled:
42            The value to assign to the is_enabled property of this UpdateDetectorRuleDetails.
43        :type is_enabled: bool
44
45        :param risk_level:
46            The value to assign to the risk_level property of this UpdateDetectorRuleDetails.
47            Allowed values for this property are: "CRITICAL", "HIGH", "MEDIUM", "LOW", "MINOR"
48        :type risk_level: str
49
50        :param configurations:
51            The value to assign to the configurations property of this UpdateDetectorRuleDetails.
52        :type configurations: list[oci.cloud_guard.models.DetectorConfiguration]
53
54        :param condition:
55            The value to assign to the condition property of this UpdateDetectorRuleDetails.
56        :type condition: oci.cloud_guard.models.Condition
57
58        :param labels:
59            The value to assign to the labels property of this UpdateDetectorRuleDetails.
60        :type labels: list[str]
61
62        """
63        self.swagger_types = {
64            'is_enabled': 'bool',
65            'risk_level': 'str',
66            'configurations': 'list[DetectorConfiguration]',
67            'condition': 'Condition',
68            'labels': 'list[str]'
69        }
70
71        self.attribute_map = {
72            'is_enabled': 'isEnabled',
73            'risk_level': 'riskLevel',
74            'configurations': 'configurations',
75            'condition': 'condition',
76            'labels': 'labels'
77        }
78
79        self._is_enabled = None
80        self._risk_level = None
81        self._configurations = None
82        self._condition = None
83        self._labels = None
84
85    @property
86    def is_enabled(self):
87        """
88        **[Required]** Gets the is_enabled of this UpdateDetectorRuleDetails.
89        Enables the control
90
91
92        :return: The is_enabled of this UpdateDetectorRuleDetails.
93        :rtype: bool
94        """
95        return self._is_enabled
96
97    @is_enabled.setter
98    def is_enabled(self, is_enabled):
99        """
100        Sets the is_enabled of this UpdateDetectorRuleDetails.
101        Enables the control
102
103
104        :param is_enabled: The is_enabled of this UpdateDetectorRuleDetails.
105        :type: bool
106        """
107        self._is_enabled = is_enabled
108
109    @property
110    def risk_level(self):
111        """
112        **[Required]** Gets the risk_level of this UpdateDetectorRuleDetails.
113        The Risk Level
114
115        Allowed values for this property are: "CRITICAL", "HIGH", "MEDIUM", "LOW", "MINOR"
116
117
118        :return: The risk_level of this UpdateDetectorRuleDetails.
119        :rtype: str
120        """
121        return self._risk_level
122
123    @risk_level.setter
124    def risk_level(self, risk_level):
125        """
126        Sets the risk_level of this UpdateDetectorRuleDetails.
127        The Risk Level
128
129
130        :param risk_level: The risk_level of this UpdateDetectorRuleDetails.
131        :type: str
132        """
133        allowed_values = ["CRITICAL", "HIGH", "MEDIUM", "LOW", "MINOR"]
134        if not value_allowed_none_or_none_sentinel(risk_level, allowed_values):
135            raise ValueError(
136                "Invalid value for `risk_level`, must be None or one of {0}"
137                .format(allowed_values)
138            )
139        self._risk_level = risk_level
140
141    @property
142    def configurations(self):
143        """
144        Gets the configurations of this UpdateDetectorRuleDetails.
145        Configuration details
146
147
148        :return: The configurations of this UpdateDetectorRuleDetails.
149        :rtype: list[oci.cloud_guard.models.DetectorConfiguration]
150        """
151        return self._configurations
152
153    @configurations.setter
154    def configurations(self, configurations):
155        """
156        Sets the configurations of this UpdateDetectorRuleDetails.
157        Configuration details
158
159
160        :param configurations: The configurations of this UpdateDetectorRuleDetails.
161        :type: list[oci.cloud_guard.models.DetectorConfiguration]
162        """
163        self._configurations = configurations
164
165    @property
166    def condition(self):
167        """
168        Gets the condition of this UpdateDetectorRuleDetails.
169
170        :return: The condition of this UpdateDetectorRuleDetails.
171        :rtype: oci.cloud_guard.models.Condition
172        """
173        return self._condition
174
175    @condition.setter
176    def condition(self, condition):
177        """
178        Sets the condition of this UpdateDetectorRuleDetails.
179
180        :param condition: The condition of this UpdateDetectorRuleDetails.
181        :type: oci.cloud_guard.models.Condition
182        """
183        self._condition = condition
184
185    @property
186    def labels(self):
187        """
188        Gets the labels of this UpdateDetectorRuleDetails.
189        user defined labels for a detector rule
190
191
192        :return: The labels of this UpdateDetectorRuleDetails.
193        :rtype: list[str]
194        """
195        return self._labels
196
197    @labels.setter
198    def labels(self, labels):
199        """
200        Sets the labels of this UpdateDetectorRuleDetails.
201        user defined labels for a detector rule
202
203
204        :param labels: The labels of this UpdateDetectorRuleDetails.
205        :type: list[str]
206        """
207        self._labels = labels
208
209    def __repr__(self):
210        return formatted_flat_dict(self)
211
212    def __eq__(self, other):
213        if other is None:
214            return False
215
216        return self.__dict__ == other.__dict__
217
218    def __ne__(self, other):
219        return not self == other
220