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 CustomProtectionRuleSummary(object):
12    """
13    An overview of a custom protection rule.
14    """
15
16    #: A constant which can be used with the lifecycle_state property of a CustomProtectionRuleSummary.
17    #: This constant has a value of "CREATING"
18    LIFECYCLE_STATE_CREATING = "CREATING"
19
20    #: A constant which can be used with the lifecycle_state property of a CustomProtectionRuleSummary.
21    #: This constant has a value of "ACTIVE"
22    LIFECYCLE_STATE_ACTIVE = "ACTIVE"
23
24    #: A constant which can be used with the lifecycle_state property of a CustomProtectionRuleSummary.
25    #: This constant has a value of "FAILED"
26    LIFECYCLE_STATE_FAILED = "FAILED"
27
28    #: A constant which can be used with the lifecycle_state property of a CustomProtectionRuleSummary.
29    #: This constant has a value of "UPDATING"
30    LIFECYCLE_STATE_UPDATING = "UPDATING"
31
32    #: A constant which can be used with the lifecycle_state property of a CustomProtectionRuleSummary.
33    #: This constant has a value of "DELETING"
34    LIFECYCLE_STATE_DELETING = "DELETING"
35
36    #: A constant which can be used with the lifecycle_state property of a CustomProtectionRuleSummary.
37    #: This constant has a value of "DELETED"
38    LIFECYCLE_STATE_DELETED = "DELETED"
39
40    def __init__(self, **kwargs):
41        """
42        Initializes a new CustomProtectionRuleSummary object with values from keyword arguments.
43        The following keyword arguments are supported (corresponding to the getters/setters of this class):
44
45        :param id:
46            The value to assign to the id property of this CustomProtectionRuleSummary.
47        :type id: str
48
49        :param compartment_id:
50            The value to assign to the compartment_id property of this CustomProtectionRuleSummary.
51        :type compartment_id: str
52
53        :param display_name:
54            The value to assign to the display_name property of this CustomProtectionRuleSummary.
55        :type display_name: str
56
57        :param mod_security_rule_ids:
58            The value to assign to the mod_security_rule_ids property of this CustomProtectionRuleSummary.
59        :type mod_security_rule_ids: list[str]
60
61        :param lifecycle_state:
62            The value to assign to the lifecycle_state property of this CustomProtectionRuleSummary.
63            Allowed values for this property are: "CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'.
64            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
65        :type lifecycle_state: str
66
67        :param time_created:
68            The value to assign to the time_created property of this CustomProtectionRuleSummary.
69        :type time_created: datetime
70
71        :param freeform_tags:
72            The value to assign to the freeform_tags property of this CustomProtectionRuleSummary.
73        :type freeform_tags: dict(str, str)
74
75        :param defined_tags:
76            The value to assign to the defined_tags property of this CustomProtectionRuleSummary.
77        :type defined_tags: dict(str, dict(str, object))
78
79        """
80        self.swagger_types = {
81            'id': 'str',
82            'compartment_id': 'str',
83            'display_name': 'str',
84            'mod_security_rule_ids': 'list[str]',
85            'lifecycle_state': 'str',
86            'time_created': 'datetime',
87            'freeform_tags': 'dict(str, str)',
88            'defined_tags': 'dict(str, dict(str, object))'
89        }
90
91        self.attribute_map = {
92            'id': 'id',
93            'compartment_id': 'compartmentId',
94            'display_name': 'displayName',
95            'mod_security_rule_ids': 'modSecurityRuleIds',
96            'lifecycle_state': 'lifecycleState',
97            'time_created': 'timeCreated',
98            'freeform_tags': 'freeformTags',
99            'defined_tags': 'definedTags'
100        }
101
102        self._id = None
103        self._compartment_id = None
104        self._display_name = None
105        self._mod_security_rule_ids = None
106        self._lifecycle_state = None
107        self._time_created = None
108        self._freeform_tags = None
109        self._defined_tags = None
110
111    @property
112    def id(self):
113        """
114        Gets the id of this CustomProtectionRuleSummary.
115        The `OCID`__ of the custom protection rule.
116
117        __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
118
119
120        :return: The id of this CustomProtectionRuleSummary.
121        :rtype: str
122        """
123        return self._id
124
125    @id.setter
126    def id(self, id):
127        """
128        Sets the id of this CustomProtectionRuleSummary.
129        The `OCID`__ of the custom protection rule.
130
131        __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
132
133
134        :param id: The id of this CustomProtectionRuleSummary.
135        :type: str
136        """
137        self._id = id
138
139    @property
140    def compartment_id(self):
141        """
142        Gets the compartment_id of this CustomProtectionRuleSummary.
143        The `OCID`__ of the custom protection rule's compartment.
144
145        __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
146
147
148        :return: The compartment_id of this CustomProtectionRuleSummary.
149        :rtype: str
150        """
151        return self._compartment_id
152
153    @compartment_id.setter
154    def compartment_id(self, compartment_id):
155        """
156        Sets the compartment_id of this CustomProtectionRuleSummary.
157        The `OCID`__ of the custom protection rule's compartment.
158
159        __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
160
161
162        :param compartment_id: The compartment_id of this CustomProtectionRuleSummary.
163        :type: str
164        """
165        self._compartment_id = compartment_id
166
167    @property
168    def display_name(self):
169        """
170        Gets the display_name of this CustomProtectionRuleSummary.
171        The user-friendly name of the custom protection rule.
172
173
174        :return: The display_name of this CustomProtectionRuleSummary.
175        :rtype: str
176        """
177        return self._display_name
178
179    @display_name.setter
180    def display_name(self, display_name):
181        """
182        Sets the display_name of this CustomProtectionRuleSummary.
183        The user-friendly name of the custom protection rule.
184
185
186        :param display_name: The display_name of this CustomProtectionRuleSummary.
187        :type: str
188        """
189        self._display_name = display_name
190
191    @property
192    def mod_security_rule_ids(self):
193        """
194        Gets the mod_security_rule_ids of this CustomProtectionRuleSummary.
195        The auto-generated ID for the custom protection rule. These IDs are referenced in logs.
196
197
198        :return: The mod_security_rule_ids of this CustomProtectionRuleSummary.
199        :rtype: list[str]
200        """
201        return self._mod_security_rule_ids
202
203    @mod_security_rule_ids.setter
204    def mod_security_rule_ids(self, mod_security_rule_ids):
205        """
206        Sets the mod_security_rule_ids of this CustomProtectionRuleSummary.
207        The auto-generated ID for the custom protection rule. These IDs are referenced in logs.
208
209
210        :param mod_security_rule_ids: The mod_security_rule_ids of this CustomProtectionRuleSummary.
211        :type: list[str]
212        """
213        self._mod_security_rule_ids = mod_security_rule_ids
214
215    @property
216    def lifecycle_state(self):
217        """
218        Gets the lifecycle_state of this CustomProtectionRuleSummary.
219        The current lifecycle state of the custom protection rule.
220
221        Allowed values for this property are: "CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED", 'UNKNOWN_ENUM_VALUE'.
222        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
223
224
225        :return: The lifecycle_state of this CustomProtectionRuleSummary.
226        :rtype: str
227        """
228        return self._lifecycle_state
229
230    @lifecycle_state.setter
231    def lifecycle_state(self, lifecycle_state):
232        """
233        Sets the lifecycle_state of this CustomProtectionRuleSummary.
234        The current lifecycle state of the custom protection rule.
235
236
237        :param lifecycle_state: The lifecycle_state of this CustomProtectionRuleSummary.
238        :type: str
239        """
240        allowed_values = ["CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED"]
241        if not value_allowed_none_or_none_sentinel(lifecycle_state, allowed_values):
242            lifecycle_state = 'UNKNOWN_ENUM_VALUE'
243        self._lifecycle_state = lifecycle_state
244
245    @property
246    def time_created(self):
247        """
248        Gets the time_created of this CustomProtectionRuleSummary.
249        The date and time the protection rule was created, expressed in RFC 3339 timestamp format.
250
251
252        :return: The time_created of this CustomProtectionRuleSummary.
253        :rtype: datetime
254        """
255        return self._time_created
256
257    @time_created.setter
258    def time_created(self, time_created):
259        """
260        Sets the time_created of this CustomProtectionRuleSummary.
261        The date and time the protection rule was created, expressed in RFC 3339 timestamp format.
262
263
264        :param time_created: The time_created of this CustomProtectionRuleSummary.
265        :type: datetime
266        """
267        self._time_created = time_created
268
269    @property
270    def freeform_tags(self):
271        """
272        Gets the freeform_tags of this CustomProtectionRuleSummary.
273        Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
274        For more information, see `Resource Tags`__.
275
276        Example: `{\"Department\": \"Finance\"}`
277
278        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
279
280
281        :return: The freeform_tags of this CustomProtectionRuleSummary.
282        :rtype: dict(str, str)
283        """
284        return self._freeform_tags
285
286    @freeform_tags.setter
287    def freeform_tags(self, freeform_tags):
288        """
289        Sets the freeform_tags of this CustomProtectionRuleSummary.
290        Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
291        For more information, see `Resource Tags`__.
292
293        Example: `{\"Department\": \"Finance\"}`
294
295        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
296
297
298        :param freeform_tags: The freeform_tags of this CustomProtectionRuleSummary.
299        :type: dict(str, str)
300        """
301        self._freeform_tags = freeform_tags
302
303    @property
304    def defined_tags(self):
305        """
306        Gets the defined_tags of this CustomProtectionRuleSummary.
307        Defined tags for this resource. Each key is predefined and scoped to a namespace.
308        For more information, see `Resource Tags`__.
309
310        Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
311
312        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
313
314
315        :return: The defined_tags of this CustomProtectionRuleSummary.
316        :rtype: dict(str, dict(str, object))
317        """
318        return self._defined_tags
319
320    @defined_tags.setter
321    def defined_tags(self, defined_tags):
322        """
323        Sets the defined_tags of this CustomProtectionRuleSummary.
324        Defined tags for this resource. Each key is predefined and scoped to a namespace.
325        For more information, see `Resource Tags`__.
326
327        Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
328
329        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
330
331
332        :param defined_tags: The defined_tags of this CustomProtectionRuleSummary.
333        :type: dict(str, dict(str, object))
334        """
335        self._defined_tags = defined_tags
336
337    def __repr__(self):
338        return formatted_flat_dict(self)
339
340    def __eq__(self, other):
341        if other is None:
342            return False
343
344        return self.__dict__ == other.__dict__
345
346    def __ne__(self, other):
347        return not self == other
348