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 AddDrgRouteRuleDetails(object):
12    """
13    Details needed when adding a DRG route rule.
14    """
15
16    #: A constant which can be used with the destination_type property of a AddDrgRouteRuleDetails.
17    #: This constant has a value of "CIDR_BLOCK"
18    DESTINATION_TYPE_CIDR_BLOCK = "CIDR_BLOCK"
19
20    def __init__(self, **kwargs):
21        """
22        Initializes a new AddDrgRouteRuleDetails object with values from keyword arguments.
23        The following keyword arguments are supported (corresponding to the getters/setters of this class):
24
25        :param destination_type:
26            The value to assign to the destination_type property of this AddDrgRouteRuleDetails.
27            Allowed values for this property are: "CIDR_BLOCK"
28        :type destination_type: str
29
30        :param destination:
31            The value to assign to the destination property of this AddDrgRouteRuleDetails.
32        :type destination: str
33
34        :param next_hop_drg_attachment_id:
35            The value to assign to the next_hop_drg_attachment_id property of this AddDrgRouteRuleDetails.
36        :type next_hop_drg_attachment_id: str
37
38        """
39        self.swagger_types = {
40            'destination_type': 'str',
41            'destination': 'str',
42            'next_hop_drg_attachment_id': 'str'
43        }
44
45        self.attribute_map = {
46            'destination_type': 'destinationType',
47            'destination': 'destination',
48            'next_hop_drg_attachment_id': 'nextHopDrgAttachmentId'
49        }
50
51        self._destination_type = None
52        self._destination = None
53        self._next_hop_drg_attachment_id = None
54
55    @property
56    def destination_type(self):
57        """
58        **[Required]** Gets the destination_type of this AddDrgRouteRuleDetails.
59        Type of destination for the rule. Required if `direction` = `EGRESS`.
60        Allowed values:
61          * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation.
62
63        Allowed values for this property are: "CIDR_BLOCK"
64
65
66        :return: The destination_type of this AddDrgRouteRuleDetails.
67        :rtype: str
68        """
69        return self._destination_type
70
71    @destination_type.setter
72    def destination_type(self, destination_type):
73        """
74        Sets the destination_type of this AddDrgRouteRuleDetails.
75        Type of destination for the rule. Required if `direction` = `EGRESS`.
76        Allowed values:
77          * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation.
78
79
80        :param destination_type: The destination_type of this AddDrgRouteRuleDetails.
81        :type: str
82        """
83        allowed_values = ["CIDR_BLOCK"]
84        if not value_allowed_none_or_none_sentinel(destination_type, allowed_values):
85            raise ValueError(
86                "Invalid value for `destination_type`, must be None or one of {0}"
87                .format(allowed_values)
88            )
89        self._destination_type = destination_type
90
91    @property
92    def destination(self):
93        """
94        **[Required]** Gets the destination of this AddDrgRouteRuleDetails.
95        This is the range of IP addresses used for matching when routing
96        traffic. Only CIDR_BLOCK values are allowed.
97
98        Potential values:
99          * IP address range in CIDR notation. This can be an IPv4 or IPv6 CIDR. For example: `192.168.1.0/24`
100          or `2001:0db8:0123:45::/56`.
101
102
103        :return: The destination of this AddDrgRouteRuleDetails.
104        :rtype: str
105        """
106        return self._destination
107
108    @destination.setter
109    def destination(self, destination):
110        """
111        Sets the destination of this AddDrgRouteRuleDetails.
112        This is the range of IP addresses used for matching when routing
113        traffic. Only CIDR_BLOCK values are allowed.
114
115        Potential values:
116          * IP address range in CIDR notation. This can be an IPv4 or IPv6 CIDR. For example: `192.168.1.0/24`
117          or `2001:0db8:0123:45::/56`.
118
119
120        :param destination: The destination of this AddDrgRouteRuleDetails.
121        :type: str
122        """
123        self._destination = destination
124
125    @property
126    def next_hop_drg_attachment_id(self):
127        """
128        **[Required]** Gets the next_hop_drg_attachment_id of this AddDrgRouteRuleDetails.
129        The `OCID`__ of the next hop DRG attachment. The next hop DRG attachment is responsible
130        for reaching the network destination.
131
132        __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
133
134
135        :return: The next_hop_drg_attachment_id of this AddDrgRouteRuleDetails.
136        :rtype: str
137        """
138        return self._next_hop_drg_attachment_id
139
140    @next_hop_drg_attachment_id.setter
141    def next_hop_drg_attachment_id(self, next_hop_drg_attachment_id):
142        """
143        Sets the next_hop_drg_attachment_id of this AddDrgRouteRuleDetails.
144        The `OCID`__ of the next hop DRG attachment. The next hop DRG attachment is responsible
145        for reaching the network destination.
146
147        __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm
148
149
150        :param next_hop_drg_attachment_id: The next_hop_drg_attachment_id of this AddDrgRouteRuleDetails.
151        :type: str
152        """
153        self._next_hop_drg_attachment_id = next_hop_drg_attachment_id
154
155    def __repr__(self):
156        return formatted_flat_dict(self)
157
158    def __eq__(self, other):
159        if other is None:
160            return False
161
162        return self.__dict__ == other.__dict__
163
164    def __ne__(self, other):
165        return not self == other
166