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 CreateResolverEndpointDetails(object): 12 """ 13 The body for defining a new resolver endpoint. 14 15 **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. 16 """ 17 18 #: A constant which can be used with the endpoint_type property of a CreateResolverEndpointDetails. 19 #: This constant has a value of "VNIC" 20 ENDPOINT_TYPE_VNIC = "VNIC" 21 22 def __init__(self, **kwargs): 23 """ 24 Initializes a new CreateResolverEndpointDetails object with values from keyword arguments. This class has the following subclasses and if you are using this class as input 25 to a service operations then you should favor using a subclass over the base class: 26 27 * :class:`~oci.dns.models.CreateResolverVnicEndpointDetails` 28 29 The following keyword arguments are supported (corresponding to the getters/setters of this class): 30 31 :param name: 32 The value to assign to the name property of this CreateResolverEndpointDetails. 33 :type name: str 34 35 :param endpoint_type: 36 The value to assign to the endpoint_type property of this CreateResolverEndpointDetails. 37 Allowed values for this property are: "VNIC" 38 :type endpoint_type: str 39 40 :param forwarding_address: 41 The value to assign to the forwarding_address property of this CreateResolverEndpointDetails. 42 :type forwarding_address: str 43 44 :param is_forwarding: 45 The value to assign to the is_forwarding property of this CreateResolverEndpointDetails. 46 :type is_forwarding: bool 47 48 :param is_listening: 49 The value to assign to the is_listening property of this CreateResolverEndpointDetails. 50 :type is_listening: bool 51 52 :param listening_address: 53 The value to assign to the listening_address property of this CreateResolverEndpointDetails. 54 :type listening_address: str 55 56 """ 57 self.swagger_types = { 58 'name': 'str', 59 'endpoint_type': 'str', 60 'forwarding_address': 'str', 61 'is_forwarding': 'bool', 62 'is_listening': 'bool', 63 'listening_address': 'str' 64 } 65 66 self.attribute_map = { 67 'name': 'name', 68 'endpoint_type': 'endpointType', 69 'forwarding_address': 'forwardingAddress', 70 'is_forwarding': 'isForwarding', 71 'is_listening': 'isListening', 72 'listening_address': 'listeningAddress' 73 } 74 75 self._name = None 76 self._endpoint_type = None 77 self._forwarding_address = None 78 self._is_forwarding = None 79 self._is_listening = None 80 self._listening_address = None 81 82 @staticmethod 83 def get_subtype(object_dictionary): 84 """ 85 Given the hash representation of a subtype of this class, 86 use the info in the hash to return the class of the subtype. 87 """ 88 type = object_dictionary['endpointType'] 89 90 if type == 'VNIC': 91 return 'CreateResolverVnicEndpointDetails' 92 else: 93 return 'CreateResolverEndpointDetails' 94 95 @property 96 def name(self): 97 """ 98 **[Required]** Gets the name of this CreateResolverEndpointDetails. 99 The name of the resolver endpoint. Must be unique, case-insensitive, within the resolver. 100 101 102 :return: The name of this CreateResolverEndpointDetails. 103 :rtype: str 104 """ 105 return self._name 106 107 @name.setter 108 def name(self, name): 109 """ 110 Sets the name of this CreateResolverEndpointDetails. 111 The name of the resolver endpoint. Must be unique, case-insensitive, within the resolver. 112 113 114 :param name: The name of this CreateResolverEndpointDetails. 115 :type: str 116 """ 117 self._name = name 118 119 @property 120 def endpoint_type(self): 121 """ 122 Gets the endpoint_type of this CreateResolverEndpointDetails. 123 The type of resolver endpoint. VNIC is currently the only supported type. 124 125 Allowed values for this property are: "VNIC" 126 127 128 :return: The endpoint_type of this CreateResolverEndpointDetails. 129 :rtype: str 130 """ 131 return self._endpoint_type 132 133 @endpoint_type.setter 134 def endpoint_type(self, endpoint_type): 135 """ 136 Sets the endpoint_type of this CreateResolverEndpointDetails. 137 The type of resolver endpoint. VNIC is currently the only supported type. 138 139 140 :param endpoint_type: The endpoint_type of this CreateResolverEndpointDetails. 141 :type: str 142 """ 143 allowed_values = ["VNIC"] 144 if not value_allowed_none_or_none_sentinel(endpoint_type, allowed_values): 145 raise ValueError( 146 "Invalid value for `endpoint_type`, must be None or one of {0}" 147 .format(allowed_values) 148 ) 149 self._endpoint_type = endpoint_type 150 151 @property 152 def forwarding_address(self): 153 """ 154 Gets the forwarding_address of this CreateResolverEndpointDetails. 155 An IP address from which forwarded queries may be sent. For VNIC endpoints, this IP address must be part 156 of the subnet and will be assigned by the system if unspecified when isForwarding is true. 157 158 159 :return: The forwarding_address of this CreateResolverEndpointDetails. 160 :rtype: str 161 """ 162 return self._forwarding_address 163 164 @forwarding_address.setter 165 def forwarding_address(self, forwarding_address): 166 """ 167 Sets the forwarding_address of this CreateResolverEndpointDetails. 168 An IP address from which forwarded queries may be sent. For VNIC endpoints, this IP address must be part 169 of the subnet and will be assigned by the system if unspecified when isForwarding is true. 170 171 172 :param forwarding_address: The forwarding_address of this CreateResolverEndpointDetails. 173 :type: str 174 """ 175 self._forwarding_address = forwarding_address 176 177 @property 178 def is_forwarding(self): 179 """ 180 **[Required]** Gets the is_forwarding of this CreateResolverEndpointDetails. 181 A Boolean flag indicating whether or not the resolver endpoint is for forwarding. 182 183 184 :return: The is_forwarding of this CreateResolverEndpointDetails. 185 :rtype: bool 186 """ 187 return self._is_forwarding 188 189 @is_forwarding.setter 190 def is_forwarding(self, is_forwarding): 191 """ 192 Sets the is_forwarding of this CreateResolverEndpointDetails. 193 A Boolean flag indicating whether or not the resolver endpoint is for forwarding. 194 195 196 :param is_forwarding: The is_forwarding of this CreateResolverEndpointDetails. 197 :type: bool 198 """ 199 self._is_forwarding = is_forwarding 200 201 @property 202 def is_listening(self): 203 """ 204 **[Required]** Gets the is_listening of this CreateResolverEndpointDetails. 205 A Boolean flag indicating whether or not the resolver endpoint is for listening. 206 207 208 :return: The is_listening of this CreateResolverEndpointDetails. 209 :rtype: bool 210 """ 211 return self._is_listening 212 213 @is_listening.setter 214 def is_listening(self, is_listening): 215 """ 216 Sets the is_listening of this CreateResolverEndpointDetails. 217 A Boolean flag indicating whether or not the resolver endpoint is for listening. 218 219 220 :param is_listening: The is_listening of this CreateResolverEndpointDetails. 221 :type: bool 222 """ 223 self._is_listening = is_listening 224 225 @property 226 def listening_address(self): 227 """ 228 Gets the listening_address of this CreateResolverEndpointDetails. 229 An IP address to listen to queries on. For VNIC endpoints this IP address must be part of the 230 subnet and will be assigned by the system if unspecified when isListening is true. 231 232 233 :return: The listening_address of this CreateResolverEndpointDetails. 234 :rtype: str 235 """ 236 return self._listening_address 237 238 @listening_address.setter 239 def listening_address(self, listening_address): 240 """ 241 Sets the listening_address of this CreateResolverEndpointDetails. 242 An IP address to listen to queries on. For VNIC endpoints this IP address must be part of the 243 subnet and will be assigned by the system if unspecified when isListening is true. 244 245 246 :param listening_address: The listening_address of this CreateResolverEndpointDetails. 247 :type: str 248 """ 249 self._listening_address = listening_address 250 251 def __repr__(self): 252 return formatted_flat_dict(self) 253 254 def __eq__(self, other): 255 if other is None: 256 return False 257 258 return self.__dict__ == other.__dict__ 259 260 def __ne__(self, other): 261 return not self == other 262