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
5from .steering_policy_rule import SteeringPolicyRule
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 SteeringPolicyHealthRule(SteeringPolicyRule):
12    """
13    SteeringPolicyHealthRule model.
14    """
15
16    def __init__(self, **kwargs):
17        """
18        Initializes a new SteeringPolicyHealthRule object with values from keyword arguments. The default value of the :py:attr:`~oci.dns.models.SteeringPolicyHealthRule.rule_type` attribute
19        of this class is ``HEALTH`` and it should not be changed.
20        The following keyword arguments are supported (corresponding to the getters/setters of this class):
21
22        :param description:
23            The value to assign to the description property of this SteeringPolicyHealthRule.
24        :type description: str
25
26        :param rule_type:
27            The value to assign to the rule_type property of this SteeringPolicyHealthRule.
28            Allowed values for this property are: "FILTER", "HEALTH", "WEIGHTED", "PRIORITY", "LIMIT"
29        :type rule_type: str
30
31        :param cases:
32            The value to assign to the cases property of this SteeringPolicyHealthRule.
33        :type cases: list[oci.dns.models.SteeringPolicyHealthRuleCase]
34
35        """
36        self.swagger_types = {
37            'description': 'str',
38            'rule_type': 'str',
39            'cases': 'list[SteeringPolicyHealthRuleCase]'
40        }
41
42        self.attribute_map = {
43            'description': 'description',
44            'rule_type': 'ruleType',
45            'cases': 'cases'
46        }
47
48        self._description = None
49        self._rule_type = None
50        self._cases = None
51        self._rule_type = 'HEALTH'
52
53    @property
54    def cases(self):
55        """
56        Gets the cases of this SteeringPolicyHealthRule.
57        An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate
58        configurations for how it should behave during processing for any given DNS query. When a rule has
59        no sequence of `cases`, it is always evaluated with the same configuration during processing. When
60        a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a
61        non-empty sequence of `cases`, its behavior during processing is configured by the first matching
62        `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no
63        `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression
64        evaluates to true for the given query.
65
66
67        :return: The cases of this SteeringPolicyHealthRule.
68        :rtype: list[oci.dns.models.SteeringPolicyHealthRuleCase]
69        """
70        return self._cases
71
72    @cases.setter
73    def cases(self, cases):
74        """
75        Sets the cases of this SteeringPolicyHealthRule.
76        An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate
77        configurations for how it should behave during processing for any given DNS query. When a rule has
78        no sequence of `cases`, it is always evaluated with the same configuration during processing. When
79        a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a
80        non-empty sequence of `cases`, its behavior during processing is configured by the first matching
81        `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no
82        `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression
83        evaluates to true for the given query.
84
85
86        :param cases: The cases of this SteeringPolicyHealthRule.
87        :type: list[oci.dns.models.SteeringPolicyHealthRuleCase]
88        """
89        self._cases = cases
90
91    def __repr__(self):
92        return formatted_flat_dict(self)
93
94    def __eq__(self, other):
95        if other is None:
96            return False
97
98        return self.__dict__ == other.__dict__
99
100    def __ne__(self, other):
101        return not self == other
102