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 PingMonitor(object):
12    """
13    A summary containing all of the mutable and immutable properties for a ping monitor.
14    """
15
16    #: A constant which can be used with the protocol property of a PingMonitor.
17    #: This constant has a value of "ICMP"
18    PROTOCOL_ICMP = "ICMP"
19
20    #: A constant which can be used with the protocol property of a PingMonitor.
21    #: This constant has a value of "TCP"
22    PROTOCOL_TCP = "TCP"
23
24    def __init__(self, **kwargs):
25        """
26        Initializes a new PingMonitor object with values from keyword arguments.
27        The following keyword arguments are supported (corresponding to the getters/setters of this class):
28
29        :param id:
30            The value to assign to the id property of this PingMonitor.
31        :type id: str
32
33        :param results_url:
34            The value to assign to the results_url property of this PingMonitor.
35        :type results_url: str
36
37        :param home_region:
38            The value to assign to the home_region property of this PingMonitor.
39        :type home_region: str
40
41        :param time_created:
42            The value to assign to the time_created property of this PingMonitor.
43        :type time_created: datetime
44
45        :param compartment_id:
46            The value to assign to the compartment_id property of this PingMonitor.
47        :type compartment_id: str
48
49        :param targets:
50            The value to assign to the targets property of this PingMonitor.
51        :type targets: list[str]
52
53        :param vantage_point_names:
54            The value to assign to the vantage_point_names property of this PingMonitor.
55        :type vantage_point_names: list[str]
56
57        :param port:
58            The value to assign to the port property of this PingMonitor.
59        :type port: int
60
61        :param timeout_in_seconds:
62            The value to assign to the timeout_in_seconds property of this PingMonitor.
63        :type timeout_in_seconds: int
64
65        :param protocol:
66            The value to assign to the protocol property of this PingMonitor.
67            Allowed values for this property are: "ICMP", "TCP", 'UNKNOWN_ENUM_VALUE'.
68            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
69        :type protocol: str
70
71        :param display_name:
72            The value to assign to the display_name property of this PingMonitor.
73        :type display_name: str
74
75        :param interval_in_seconds:
76            The value to assign to the interval_in_seconds property of this PingMonitor.
77        :type interval_in_seconds: int
78
79        :param is_enabled:
80            The value to assign to the is_enabled property of this PingMonitor.
81        :type is_enabled: bool
82
83        :param freeform_tags:
84            The value to assign to the freeform_tags property of this PingMonitor.
85        :type freeform_tags: dict(str, str)
86
87        :param defined_tags:
88            The value to assign to the defined_tags property of this PingMonitor.
89        :type defined_tags: dict(str, dict(str, object))
90
91        """
92        self.swagger_types = {
93            'id': 'str',
94            'results_url': 'str',
95            'home_region': 'str',
96            'time_created': 'datetime',
97            'compartment_id': 'str',
98            'targets': 'list[str]',
99            'vantage_point_names': 'list[str]',
100            'port': 'int',
101            'timeout_in_seconds': 'int',
102            'protocol': 'str',
103            'display_name': 'str',
104            'interval_in_seconds': 'int',
105            'is_enabled': 'bool',
106            'freeform_tags': 'dict(str, str)',
107            'defined_tags': 'dict(str, dict(str, object))'
108        }
109
110        self.attribute_map = {
111            'id': 'id',
112            'results_url': 'resultsUrl',
113            'home_region': 'homeRegion',
114            'time_created': 'timeCreated',
115            'compartment_id': 'compartmentId',
116            'targets': 'targets',
117            'vantage_point_names': 'vantagePointNames',
118            'port': 'port',
119            'timeout_in_seconds': 'timeoutInSeconds',
120            'protocol': 'protocol',
121            'display_name': 'displayName',
122            'interval_in_seconds': 'intervalInSeconds',
123            'is_enabled': 'isEnabled',
124            'freeform_tags': 'freeformTags',
125            'defined_tags': 'definedTags'
126        }
127
128        self._id = None
129        self._results_url = None
130        self._home_region = None
131        self._time_created = None
132        self._compartment_id = None
133        self._targets = None
134        self._vantage_point_names = None
135        self._port = None
136        self._timeout_in_seconds = None
137        self._protocol = None
138        self._display_name = None
139        self._interval_in_seconds = None
140        self._is_enabled = None
141        self._freeform_tags = None
142        self._defined_tags = None
143
144    @property
145    def id(self):
146        """
147        Gets the id of this PingMonitor.
148        The OCID of the resource.
149
150
151        :return: The id of this PingMonitor.
152        :rtype: str
153        """
154        return self._id
155
156    @id.setter
157    def id(self, id):
158        """
159        Sets the id of this PingMonitor.
160        The OCID of the resource.
161
162
163        :param id: The id of this PingMonitor.
164        :type: str
165        """
166        self._id = id
167
168    @property
169    def results_url(self):
170        """
171        Gets the results_url of this PingMonitor.
172        A URL for fetching the probe results.
173
174
175        :return: The results_url of this PingMonitor.
176        :rtype: str
177        """
178        return self._results_url
179
180    @results_url.setter
181    def results_url(self, results_url):
182        """
183        Sets the results_url of this PingMonitor.
184        A URL for fetching the probe results.
185
186
187        :param results_url: The results_url of this PingMonitor.
188        :type: str
189        """
190        self._results_url = results_url
191
192    @property
193    def home_region(self):
194        """
195        Gets the home_region of this PingMonitor.
196        The region where updates must be made and where results must be fetched from.
197
198
199        :return: The home_region of this PingMonitor.
200        :rtype: str
201        """
202        return self._home_region
203
204    @home_region.setter
205    def home_region(self, home_region):
206        """
207        Sets the home_region of this PingMonitor.
208        The region where updates must be made and where results must be fetched from.
209
210
211        :param home_region: The home_region of this PingMonitor.
212        :type: str
213        """
214        self._home_region = home_region
215
216    @property
217    def time_created(self):
218        """
219        Gets the time_created of this PingMonitor.
220        The RFC 3339-formatted creation date and time of the probe.
221
222
223        :return: The time_created of this PingMonitor.
224        :rtype: datetime
225        """
226        return self._time_created
227
228    @time_created.setter
229    def time_created(self, time_created):
230        """
231        Sets the time_created of this PingMonitor.
232        The RFC 3339-formatted creation date and time of the probe.
233
234
235        :param time_created: The time_created of this PingMonitor.
236        :type: datetime
237        """
238        self._time_created = time_created
239
240    @property
241    def compartment_id(self):
242        """
243        Gets the compartment_id of this PingMonitor.
244        The OCID of the compartment.
245
246
247        :return: The compartment_id of this PingMonitor.
248        :rtype: str
249        """
250        return self._compartment_id
251
252    @compartment_id.setter
253    def compartment_id(self, compartment_id):
254        """
255        Sets the compartment_id of this PingMonitor.
256        The OCID of the compartment.
257
258
259        :param compartment_id: The compartment_id of this PingMonitor.
260        :type: str
261        """
262        self._compartment_id = compartment_id
263
264    @property
265    def targets(self):
266        """
267        Gets the targets of this PingMonitor.
268        A list of targets (hostnames or IP addresses) of the probe.
269
270
271        :return: The targets of this PingMonitor.
272        :rtype: list[str]
273        """
274        return self._targets
275
276    @targets.setter
277    def targets(self, targets):
278        """
279        Sets the targets of this PingMonitor.
280        A list of targets (hostnames or IP addresses) of the probe.
281
282
283        :param targets: The targets of this PingMonitor.
284        :type: list[str]
285        """
286        self._targets = targets
287
288    @property
289    def vantage_point_names(self):
290        """
291        Gets the vantage_point_names of this PingMonitor.
292        A list of names of vantage points from which to execute the probe.
293
294
295        :return: The vantage_point_names of this PingMonitor.
296        :rtype: list[str]
297        """
298        return self._vantage_point_names
299
300    @vantage_point_names.setter
301    def vantage_point_names(self, vantage_point_names):
302        """
303        Sets the vantage_point_names of this PingMonitor.
304        A list of names of vantage points from which to execute the probe.
305
306
307        :param vantage_point_names: The vantage_point_names of this PingMonitor.
308        :type: list[str]
309        """
310        self._vantage_point_names = vantage_point_names
311
312    @property
313    def port(self):
314        """
315        Gets the port of this PingMonitor.
316        The port on which to probe endpoints. If unspecified, probes will use the
317        default port of their protocol.
318
319
320        :return: The port of this PingMonitor.
321        :rtype: int
322        """
323        return self._port
324
325    @port.setter
326    def port(self, port):
327        """
328        Sets the port of this PingMonitor.
329        The port on which to probe endpoints. If unspecified, probes will use the
330        default port of their protocol.
331
332
333        :param port: The port of this PingMonitor.
334        :type: int
335        """
336        self._port = port
337
338    @property
339    def timeout_in_seconds(self):
340        """
341        Gets the timeout_in_seconds of this PingMonitor.
342        The probe timeout in seconds. Valid values: 10, 20, 30, and 60.
343        The probe timeout must be less than or equal to `intervalInSeconds` for monitors.
344
345
346        :return: The timeout_in_seconds of this PingMonitor.
347        :rtype: int
348        """
349        return self._timeout_in_seconds
350
351    @timeout_in_seconds.setter
352    def timeout_in_seconds(self, timeout_in_seconds):
353        """
354        Sets the timeout_in_seconds of this PingMonitor.
355        The probe timeout in seconds. Valid values: 10, 20, 30, and 60.
356        The probe timeout must be less than or equal to `intervalInSeconds` for monitors.
357
358
359        :param timeout_in_seconds: The timeout_in_seconds of this PingMonitor.
360        :type: int
361        """
362        self._timeout_in_seconds = timeout_in_seconds
363
364    @property
365    def protocol(self):
366        """
367        Gets the protocol of this PingMonitor.
368        Allowed values for this property are: "ICMP", "TCP", 'UNKNOWN_ENUM_VALUE'.
369        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
370
371
372        :return: The protocol of this PingMonitor.
373        :rtype: str
374        """
375        return self._protocol
376
377    @protocol.setter
378    def protocol(self, protocol):
379        """
380        Sets the protocol of this PingMonitor.
381
382        :param protocol: The protocol of this PingMonitor.
383        :type: str
384        """
385        allowed_values = ["ICMP", "TCP"]
386        if not value_allowed_none_or_none_sentinel(protocol, allowed_values):
387            protocol = 'UNKNOWN_ENUM_VALUE'
388        self._protocol = protocol
389
390    @property
391    def display_name(self):
392        """
393        Gets the display_name of this PingMonitor.
394        A user-friendly and mutable name suitable for display in a user interface.
395
396
397        :return: The display_name of this PingMonitor.
398        :rtype: str
399        """
400        return self._display_name
401
402    @display_name.setter
403    def display_name(self, display_name):
404        """
405        Sets the display_name of this PingMonitor.
406        A user-friendly and mutable name suitable for display in a user interface.
407
408
409        :param display_name: The display_name of this PingMonitor.
410        :type: str
411        """
412        self._display_name = display_name
413
414    @property
415    def interval_in_seconds(self):
416        """
417        Gets the interval_in_seconds of this PingMonitor.
418        The monitor interval in seconds. Valid values: 10, 30, and 60.
419
420
421        :return: The interval_in_seconds of this PingMonitor.
422        :rtype: int
423        """
424        return self._interval_in_seconds
425
426    @interval_in_seconds.setter
427    def interval_in_seconds(self, interval_in_seconds):
428        """
429        Sets the interval_in_seconds of this PingMonitor.
430        The monitor interval in seconds. Valid values: 10, 30, and 60.
431
432
433        :param interval_in_seconds: The interval_in_seconds of this PingMonitor.
434        :type: int
435        """
436        self._interval_in_seconds = interval_in_seconds
437
438    @property
439    def is_enabled(self):
440        """
441        Gets the is_enabled of this PingMonitor.
442        Enables or disables the monitor. Set to 'true' to launch monitoring.
443
444
445        :return: The is_enabled of this PingMonitor.
446        :rtype: bool
447        """
448        return self._is_enabled
449
450    @is_enabled.setter
451    def is_enabled(self, is_enabled):
452        """
453        Sets the is_enabled of this PingMonitor.
454        Enables or disables the monitor. Set to 'true' to launch monitoring.
455
456
457        :param is_enabled: The is_enabled of this PingMonitor.
458        :type: bool
459        """
460        self._is_enabled = is_enabled
461
462    @property
463    def freeform_tags(self):
464        """
465        Gets the freeform_tags of this PingMonitor.
466        Free-form tags for this resource. Each tag is a simple key-value pair with no
467        predefined name, type, or namespace.  For more information,
468        see `Resource Tags`__.
469        Example: `{\"Department\": \"Finance\"}`
470
471        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
472
473
474        :return: The freeform_tags of this PingMonitor.
475        :rtype: dict(str, str)
476        """
477        return self._freeform_tags
478
479    @freeform_tags.setter
480    def freeform_tags(self, freeform_tags):
481        """
482        Sets the freeform_tags of this PingMonitor.
483        Free-form tags for this resource. Each tag is a simple key-value pair with no
484        predefined name, type, or namespace.  For more information,
485        see `Resource Tags`__.
486        Example: `{\"Department\": \"Finance\"}`
487
488        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
489
490
491        :param freeform_tags: The freeform_tags of this PingMonitor.
492        :type: dict(str, str)
493        """
494        self._freeform_tags = freeform_tags
495
496    @property
497    def defined_tags(self):
498        """
499        Gets the defined_tags of this PingMonitor.
500        Defined tags for this resource. Each key is predefined and scoped to a namespace.
501        For more information, see `Resource Tags`__.
502        Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
503
504        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
505
506
507        :return: The defined_tags of this PingMonitor.
508        :rtype: dict(str, dict(str, object))
509        """
510        return self._defined_tags
511
512    @defined_tags.setter
513    def defined_tags(self, defined_tags):
514        """
515        Sets the defined_tags of this PingMonitor.
516        Defined tags for this resource. Each key is predefined and scoped to a namespace.
517        For more information, see `Resource Tags`__.
518        Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
519
520        __ https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm
521
522
523        :param defined_tags: The defined_tags of this PingMonitor.
524        :type: dict(str, dict(str, object))
525        """
526        self._defined_tags = defined_tags
527
528    def __repr__(self):
529        return formatted_flat_dict(self)
530
531    def __eq__(self, other):
532        if other is None:
533            return False
534
535        return self.__dict__ == other.__dict__
536
537    def __ne__(self, other):
538        return not self == other
539