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 MonitorSummary(object):
12    """
13    Information about the monitor.
14    """
15
16    #: A constant which can be used with the monitor_type property of a MonitorSummary.
17    #: This constant has a value of "SCRIPTED_BROWSER"
18    MONITOR_TYPE_SCRIPTED_BROWSER = "SCRIPTED_BROWSER"
19
20    #: A constant which can be used with the monitor_type property of a MonitorSummary.
21    #: This constant has a value of "BROWSER"
22    MONITOR_TYPE_BROWSER = "BROWSER"
23
24    #: A constant which can be used with the monitor_type property of a MonitorSummary.
25    #: This constant has a value of "SCRIPTED_REST"
26    MONITOR_TYPE_SCRIPTED_REST = "SCRIPTED_REST"
27
28    #: A constant which can be used with the monitor_type property of a MonitorSummary.
29    #: This constant has a value of "REST"
30    MONITOR_TYPE_REST = "REST"
31
32    #: A constant which can be used with the status property of a MonitorSummary.
33    #: This constant has a value of "ENABLED"
34    STATUS_ENABLED = "ENABLED"
35
36    #: A constant which can be used with the status property of a MonitorSummary.
37    #: This constant has a value of "DISABLED"
38    STATUS_DISABLED = "DISABLED"
39
40    #: A constant which can be used with the status property of a MonitorSummary.
41    #: This constant has a value of "INVALID"
42    STATUS_INVALID = "INVALID"
43
44    def __init__(self, **kwargs):
45        """
46        Initializes a new MonitorSummary object with values from keyword arguments.
47        The following keyword arguments are supported (corresponding to the getters/setters of this class):
48
49        :param id:
50            The value to assign to the id property of this MonitorSummary.
51        :type id: str
52
53        :param display_name:
54            The value to assign to the display_name property of this MonitorSummary.
55        :type display_name: str
56
57        :param monitor_type:
58            The value to assign to the monitor_type property of this MonitorSummary.
59            Allowed values for this property are: "SCRIPTED_BROWSER", "BROWSER", "SCRIPTED_REST", "REST", 'UNKNOWN_ENUM_VALUE'.
60            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
61        :type monitor_type: str
62
63        :param vantage_points:
64            The value to assign to the vantage_points property of this MonitorSummary.
65        :type vantage_points: list[oci.apm_synthetics.models.VantagePointInfo]
66
67        :param vantage_point_count:
68            The value to assign to the vantage_point_count property of this MonitorSummary.
69        :type vantage_point_count: int
70
71        :param script_id:
72            The value to assign to the script_id property of this MonitorSummary.
73        :type script_id: str
74
75        :param script_name:
76            The value to assign to the script_name property of this MonitorSummary.
77        :type script_name: str
78
79        :param status:
80            The value to assign to the status property of this MonitorSummary.
81            Allowed values for this property are: "ENABLED", "DISABLED", "INVALID", 'UNKNOWN_ENUM_VALUE'.
82            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
83        :type status: str
84
85        :param repeat_interval_in_seconds:
86            The value to assign to the repeat_interval_in_seconds property of this MonitorSummary.
87        :type repeat_interval_in_seconds: int
88
89        :param is_run_once:
90            The value to assign to the is_run_once property of this MonitorSummary.
91        :type is_run_once: bool
92
93        :param timeout_in_seconds:
94            The value to assign to the timeout_in_seconds property of this MonitorSummary.
95        :type timeout_in_seconds: int
96
97        :param target:
98            The value to assign to the target property of this MonitorSummary.
99        :type target: str
100
101        :param time_created:
102            The value to assign to the time_created property of this MonitorSummary.
103        :type time_created: datetime
104
105        :param time_updated:
106            The value to assign to the time_updated property of this MonitorSummary.
107        :type time_updated: datetime
108
109        :param freeform_tags:
110            The value to assign to the freeform_tags property of this MonitorSummary.
111        :type freeform_tags: dict(str, str)
112
113        :param defined_tags:
114            The value to assign to the defined_tags property of this MonitorSummary.
115        :type defined_tags: dict(str, dict(str, object))
116
117        """
118        self.swagger_types = {
119            'id': 'str',
120            'display_name': 'str',
121            'monitor_type': 'str',
122            'vantage_points': 'list[VantagePointInfo]',
123            'vantage_point_count': 'int',
124            'script_id': 'str',
125            'script_name': 'str',
126            'status': 'str',
127            'repeat_interval_in_seconds': 'int',
128            'is_run_once': 'bool',
129            'timeout_in_seconds': 'int',
130            'target': 'str',
131            'time_created': 'datetime',
132            'time_updated': 'datetime',
133            'freeform_tags': 'dict(str, str)',
134            'defined_tags': 'dict(str, dict(str, object))'
135        }
136
137        self.attribute_map = {
138            'id': 'id',
139            'display_name': 'displayName',
140            'monitor_type': 'monitorType',
141            'vantage_points': 'vantagePoints',
142            'vantage_point_count': 'vantagePointCount',
143            'script_id': 'scriptId',
144            'script_name': 'scriptName',
145            'status': 'status',
146            'repeat_interval_in_seconds': 'repeatIntervalInSeconds',
147            'is_run_once': 'isRunOnce',
148            'timeout_in_seconds': 'timeoutInSeconds',
149            'target': 'target',
150            'time_created': 'timeCreated',
151            'time_updated': 'timeUpdated',
152            'freeform_tags': 'freeformTags',
153            'defined_tags': 'definedTags'
154        }
155
156        self._id = None
157        self._display_name = None
158        self._monitor_type = None
159        self._vantage_points = None
160        self._vantage_point_count = None
161        self._script_id = None
162        self._script_name = None
163        self._status = None
164        self._repeat_interval_in_seconds = None
165        self._is_run_once = None
166        self._timeout_in_seconds = None
167        self._target = None
168        self._time_created = None
169        self._time_updated = None
170        self._freeform_tags = None
171        self._defined_tags = None
172
173    @property
174    def id(self):
175        """
176        **[Required]** Gets the id of this MonitorSummary.
177        The `OCID`__ of the monitor.
178
179        __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
180
181
182        :return: The id of this MonitorSummary.
183        :rtype: str
184        """
185        return self._id
186
187    @id.setter
188    def id(self, id):
189        """
190        Sets the id of this MonitorSummary.
191        The `OCID`__ of the monitor.
192
193        __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
194
195
196        :param id: The id of this MonitorSummary.
197        :type: str
198        """
199        self._id = id
200
201    @property
202    def display_name(self):
203        """
204        **[Required]** Gets the display_name of this MonitorSummary.
205        Unique name that can be edited. The name should not contain any confidential information.
206
207
208        :return: The display_name of this MonitorSummary.
209        :rtype: str
210        """
211        return self._display_name
212
213    @display_name.setter
214    def display_name(self, display_name):
215        """
216        Sets the display_name of this MonitorSummary.
217        Unique name that can be edited. The name should not contain any confidential information.
218
219
220        :param display_name: The display_name of this MonitorSummary.
221        :type: str
222        """
223        self._display_name = display_name
224
225    @property
226    def monitor_type(self):
227        """
228        **[Required]** Gets the monitor_type of this MonitorSummary.
229        The type of monitor.
230
231        Allowed values for this property are: "SCRIPTED_BROWSER", "BROWSER", "SCRIPTED_REST", "REST", 'UNKNOWN_ENUM_VALUE'.
232        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
233
234
235        :return: The monitor_type of this MonitorSummary.
236        :rtype: str
237        """
238        return self._monitor_type
239
240    @monitor_type.setter
241    def monitor_type(self, monitor_type):
242        """
243        Sets the monitor_type of this MonitorSummary.
244        The type of monitor.
245
246
247        :param monitor_type: The monitor_type of this MonitorSummary.
248        :type: str
249        """
250        allowed_values = ["SCRIPTED_BROWSER", "BROWSER", "SCRIPTED_REST", "REST"]
251        if not value_allowed_none_or_none_sentinel(monitor_type, allowed_values):
252            monitor_type = 'UNKNOWN_ENUM_VALUE'
253        self._monitor_type = monitor_type
254
255    @property
256    def vantage_points(self):
257        """
258        **[Required]** Gets the vantage_points of this MonitorSummary.
259        List of vantage points where the monitor is running.
260
261
262        :return: The vantage_points of this MonitorSummary.
263        :rtype: list[oci.apm_synthetics.models.VantagePointInfo]
264        """
265        return self._vantage_points
266
267    @vantage_points.setter
268    def vantage_points(self, vantage_points):
269        """
270        Sets the vantage_points of this MonitorSummary.
271        List of vantage points where the monitor is running.
272
273
274        :param vantage_points: The vantage_points of this MonitorSummary.
275        :type: list[oci.apm_synthetics.models.VantagePointInfo]
276        """
277        self._vantage_points = vantage_points
278
279    @property
280    def vantage_point_count(self):
281        """
282        **[Required]** Gets the vantage_point_count of this MonitorSummary.
283        Number of vantage points where monitor is running.
284
285
286        :return: The vantage_point_count of this MonitorSummary.
287        :rtype: int
288        """
289        return self._vantage_point_count
290
291    @vantage_point_count.setter
292    def vantage_point_count(self, vantage_point_count):
293        """
294        Sets the vantage_point_count of this MonitorSummary.
295        Number of vantage points where monitor is running.
296
297
298        :param vantage_point_count: The vantage_point_count of this MonitorSummary.
299        :type: int
300        """
301        self._vantage_point_count = vantage_point_count
302
303    @property
304    def script_id(self):
305        """
306        **[Required]** Gets the script_id of this MonitorSummary.
307        The `OCID`__ of the script.
308        scriptId is mandatory for creation of SCRIPTED_BROWSER and SCRIPTED_REST monitor types. For other monitor types, it should be set to null.
309
310        __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
311
312
313        :return: The script_id of this MonitorSummary.
314        :rtype: str
315        """
316        return self._script_id
317
318    @script_id.setter
319    def script_id(self, script_id):
320        """
321        Sets the script_id of this MonitorSummary.
322        The `OCID`__ of the script.
323        scriptId is mandatory for creation of SCRIPTED_BROWSER and SCRIPTED_REST monitor types. For other monitor types, it should be set to null.
324
325        __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
326
327
328        :param script_id: The script_id of this MonitorSummary.
329        :type: str
330        """
331        self._script_id = script_id
332
333    @property
334    def script_name(self):
335        """
336        **[Required]** Gets the script_name of this MonitorSummary.
337        Name of the script.
338
339
340        :return: The script_name of this MonitorSummary.
341        :rtype: str
342        """
343        return self._script_name
344
345    @script_name.setter
346    def script_name(self, script_name):
347        """
348        Sets the script_name of this MonitorSummary.
349        Name of the script.
350
351
352        :param script_name: The script_name of this MonitorSummary.
353        :type: str
354        """
355        self._script_name = script_name
356
357    @property
358    def status(self):
359        """
360        **[Required]** Gets the status of this MonitorSummary.
361        Enables or disables the monitor.
362
363        Allowed values for this property are: "ENABLED", "DISABLED", "INVALID", 'UNKNOWN_ENUM_VALUE'.
364        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
365
366
367        :return: The status of this MonitorSummary.
368        :rtype: str
369        """
370        return self._status
371
372    @status.setter
373    def status(self, status):
374        """
375        Sets the status of this MonitorSummary.
376        Enables or disables the monitor.
377
378
379        :param status: The status of this MonitorSummary.
380        :type: str
381        """
382        allowed_values = ["ENABLED", "DISABLED", "INVALID"]
383        if not value_allowed_none_or_none_sentinel(status, allowed_values):
384            status = 'UNKNOWN_ENUM_VALUE'
385        self._status = status
386
387    @property
388    def repeat_interval_in_seconds(self):
389        """
390        **[Required]** Gets the repeat_interval_in_seconds of this MonitorSummary.
391        Interval in seconds after the start time when the job should be repeated.
392        Minimum repeatIntervalInSeconds should be 300 seconds.
393
394
395        :return: The repeat_interval_in_seconds of this MonitorSummary.
396        :rtype: int
397        """
398        return self._repeat_interval_in_seconds
399
400    @repeat_interval_in_seconds.setter
401    def repeat_interval_in_seconds(self, repeat_interval_in_seconds):
402        """
403        Sets the repeat_interval_in_seconds of this MonitorSummary.
404        Interval in seconds after the start time when the job should be repeated.
405        Minimum repeatIntervalInSeconds should be 300 seconds.
406
407
408        :param repeat_interval_in_seconds: The repeat_interval_in_seconds of this MonitorSummary.
409        :type: int
410        """
411        self._repeat_interval_in_seconds = repeat_interval_in_seconds
412
413    @property
414    def is_run_once(self):
415        """
416        **[Required]** Gets the is_run_once of this MonitorSummary.
417        If runOnce is enabled, then the monitor will run once.
418
419
420        :return: The is_run_once of this MonitorSummary.
421        :rtype: bool
422        """
423        return self._is_run_once
424
425    @is_run_once.setter
426    def is_run_once(self, is_run_once):
427        """
428        Sets the is_run_once of this MonitorSummary.
429        If runOnce is enabled, then the monitor will run once.
430
431
432        :param is_run_once: The is_run_once of this MonitorSummary.
433        :type: bool
434        """
435        self._is_run_once = is_run_once
436
437    @property
438    def timeout_in_seconds(self):
439        """
440        **[Required]** Gets the timeout_in_seconds of this MonitorSummary.
441        Timeout in seconds. Timeout cannot be more than 30% of repeatIntervalInSeconds time for monitors.
442        Also, timeoutInSeconds should be a multiple of 60.
443        Monitor will be allowed to run only for timeoutInSeconds time. It would be terminated after that.
444
445
446        :return: The timeout_in_seconds of this MonitorSummary.
447        :rtype: int
448        """
449        return self._timeout_in_seconds
450
451    @timeout_in_seconds.setter
452    def timeout_in_seconds(self, timeout_in_seconds):
453        """
454        Sets the timeout_in_seconds of this MonitorSummary.
455        Timeout in seconds. Timeout cannot be more than 30% of repeatIntervalInSeconds time for monitors.
456        Also, timeoutInSeconds should be a multiple of 60.
457        Monitor will be allowed to run only for timeoutInSeconds time. It would be terminated after that.
458
459
460        :param timeout_in_seconds: The timeout_in_seconds of this MonitorSummary.
461        :type: int
462        """
463        self._timeout_in_seconds = timeout_in_seconds
464
465    @property
466    def target(self):
467        """
468        Gets the target of this MonitorSummary.
469        Specify the endpoint on which to run the monitor.
470        For BROWSER and REST monitor types, target is mandatory.
471        If target is specified in the SCRIPTED_BROWSER monitor type, then the monitor will run the selected script (specified by scriptId in monitor) against the specified target endpoint.
472        If target is not specified in the SCRIPTED_BROWSER monitor type, then the monitor will run the selected script as it is.
473
474
475        :return: The target of this MonitorSummary.
476        :rtype: str
477        """
478        return self._target
479
480    @target.setter
481    def target(self, target):
482        """
483        Sets the target of this MonitorSummary.
484        Specify the endpoint on which to run the monitor.
485        For BROWSER and REST monitor types, target is mandatory.
486        If target is specified in the SCRIPTED_BROWSER monitor type, then the monitor will run the selected script (specified by scriptId in monitor) against the specified target endpoint.
487        If target is not specified in the SCRIPTED_BROWSER monitor type, then the monitor will run the selected script as it is.
488
489
490        :param target: The target of this MonitorSummary.
491        :type: str
492        """
493        self._target = target
494
495    @property
496    def time_created(self):
497        """
498        Gets the time_created of this MonitorSummary.
499        The time the resource was created, expressed in `RFC 3339`__
500        timestamp format.
501        Example: `2020-02-12T22:47:12.613Z`
502
503        __ https://tools.ietf.org/html/rfc3339
504
505
506        :return: The time_created of this MonitorSummary.
507        :rtype: datetime
508        """
509        return self._time_created
510
511    @time_created.setter
512    def time_created(self, time_created):
513        """
514        Sets the time_created of this MonitorSummary.
515        The time the resource was created, expressed in `RFC 3339`__
516        timestamp format.
517        Example: `2020-02-12T22:47:12.613Z`
518
519        __ https://tools.ietf.org/html/rfc3339
520
521
522        :param time_created: The time_created of this MonitorSummary.
523        :type: datetime
524        """
525        self._time_created = time_created
526
527    @property
528    def time_updated(self):
529        """
530        Gets the time_updated of this MonitorSummary.
531        The time the resource was updated, expressed in `RFC 3339`__
532        timestamp format.
533        Example: `2020-02-13T22:47:12.613Z`
534
535        __ https://tools.ietf.org/html/rfc3339
536
537
538        :return: The time_updated of this MonitorSummary.
539        :rtype: datetime
540        """
541        return self._time_updated
542
543    @time_updated.setter
544    def time_updated(self, time_updated):
545        """
546        Sets the time_updated of this MonitorSummary.
547        The time the resource was updated, expressed in `RFC 3339`__
548        timestamp format.
549        Example: `2020-02-13T22:47:12.613Z`
550
551        __ https://tools.ietf.org/html/rfc3339
552
553
554        :param time_updated: The time_updated of this MonitorSummary.
555        :type: datetime
556        """
557        self._time_updated = time_updated
558
559    @property
560    def freeform_tags(self):
561        """
562        Gets the freeform_tags of this MonitorSummary.
563        Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.
564        Example: `{\"bar-key\": \"value\"}`
565
566
567        :return: The freeform_tags of this MonitorSummary.
568        :rtype: dict(str, str)
569        """
570        return self._freeform_tags
571
572    @freeform_tags.setter
573    def freeform_tags(self, freeform_tags):
574        """
575        Sets the freeform_tags of this MonitorSummary.
576        Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.
577        Example: `{\"bar-key\": \"value\"}`
578
579
580        :param freeform_tags: The freeform_tags of this MonitorSummary.
581        :type: dict(str, str)
582        """
583        self._freeform_tags = freeform_tags
584
585    @property
586    def defined_tags(self):
587        """
588        Gets the defined_tags of this MonitorSummary.
589        Defined tags for this resource. Each key is predefined and scoped to a namespace.
590        Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`
591
592
593        :return: The defined_tags of this MonitorSummary.
594        :rtype: dict(str, dict(str, object))
595        """
596        return self._defined_tags
597
598    @defined_tags.setter
599    def defined_tags(self, defined_tags):
600        """
601        Sets the defined_tags of this MonitorSummary.
602        Defined tags for this resource. Each key is predefined and scoped to a namespace.
603        Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`
604
605
606        :param defined_tags: The defined_tags of this MonitorSummary.
607        :type: dict(str, dict(str, object))
608        """
609        self._defined_tags = defined_tags
610
611    def __repr__(self):
612        return formatted_flat_dict(self)
613
614    def __eq__(self, other):
615        if other is None:
616            return False
617
618        return self.__dict__ == other.__dict__
619
620    def __ne__(self, other):
621        return not self == other
622