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 .create_resolver_endpoint_details import CreateResolverEndpointDetails 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 CreateResolverVnicEndpointDetails(CreateResolverEndpointDetails): 12 """ 13 The body for defining a new resolver VNIC endpoint. Either isForwarding or isListening must be true, but not both. 14 If isListening is true, a listeningAddress may be provided. If isForwarding is true, a forwardingAddress 15 may be provided. When not provided, an address will be chosen automatically. 16 17 **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API. 18 """ 19 20 def __init__(self, **kwargs): 21 """ 22 Initializes a new CreateResolverVnicEndpointDetails object with values from keyword arguments. The default value of the :py:attr:`~oci.dns.models.CreateResolverVnicEndpointDetails.endpoint_type` attribute 23 of this class is ``VNIC`` and it should not be changed. 24 The following keyword arguments are supported (corresponding to the getters/setters of this class): 25 26 :param name: 27 The value to assign to the name property of this CreateResolverVnicEndpointDetails. 28 :type name: str 29 30 :param endpoint_type: 31 The value to assign to the endpoint_type property of this CreateResolverVnicEndpointDetails. 32 Allowed values for this property are: "VNIC" 33 :type endpoint_type: str 34 35 :param forwarding_address: 36 The value to assign to the forwarding_address property of this CreateResolverVnicEndpointDetails. 37 :type forwarding_address: str 38 39 :param is_forwarding: 40 The value to assign to the is_forwarding property of this CreateResolverVnicEndpointDetails. 41 :type is_forwarding: bool 42 43 :param is_listening: 44 The value to assign to the is_listening property of this CreateResolverVnicEndpointDetails. 45 :type is_listening: bool 46 47 :param listening_address: 48 The value to assign to the listening_address property of this CreateResolverVnicEndpointDetails. 49 :type listening_address: str 50 51 :param subnet_id: 52 The value to assign to the subnet_id property of this CreateResolverVnicEndpointDetails. 53 :type subnet_id: str 54 55 :param nsg_ids: 56 The value to assign to the nsg_ids property of this CreateResolverVnicEndpointDetails. 57 :type nsg_ids: list[str] 58 59 """ 60 self.swagger_types = { 61 'name': 'str', 62 'endpoint_type': 'str', 63 'forwarding_address': 'str', 64 'is_forwarding': 'bool', 65 'is_listening': 'bool', 66 'listening_address': 'str', 67 'subnet_id': 'str', 68 'nsg_ids': 'list[str]' 69 } 70 71 self.attribute_map = { 72 'name': 'name', 73 'endpoint_type': 'endpointType', 74 'forwarding_address': 'forwardingAddress', 75 'is_forwarding': 'isForwarding', 76 'is_listening': 'isListening', 77 'listening_address': 'listeningAddress', 78 'subnet_id': 'subnetId', 79 'nsg_ids': 'nsgIds' 80 } 81 82 self._name = None 83 self._endpoint_type = None 84 self._forwarding_address = None 85 self._is_forwarding = None 86 self._is_listening = None 87 self._listening_address = None 88 self._subnet_id = None 89 self._nsg_ids = None 90 self._endpoint_type = 'VNIC' 91 92 @property 93 def subnet_id(self): 94 """ 95 **[Required]** Gets the subnet_id of this CreateResolverVnicEndpointDetails. 96 The OCID of a subnet. Must be part of the VCN that the resolver is attached to. 97 98 99 :return: The subnet_id of this CreateResolverVnicEndpointDetails. 100 :rtype: str 101 """ 102 return self._subnet_id 103 104 @subnet_id.setter 105 def subnet_id(self, subnet_id): 106 """ 107 Sets the subnet_id of this CreateResolverVnicEndpointDetails. 108 The OCID of a subnet. Must be part of the VCN that the resolver is attached to. 109 110 111 :param subnet_id: The subnet_id of this CreateResolverVnicEndpointDetails. 112 :type: str 113 """ 114 self._subnet_id = subnet_id 115 116 @property 117 def nsg_ids(self): 118 """ 119 Gets the nsg_ids of this CreateResolverVnicEndpointDetails. 120 An array of network security group OCIDs for the resolver endpoint. These must be part of the VCN that the 121 resolver endpoint is a part of. 122 123 124 :return: The nsg_ids of this CreateResolverVnicEndpointDetails. 125 :rtype: list[str] 126 """ 127 return self._nsg_ids 128 129 @nsg_ids.setter 130 def nsg_ids(self, nsg_ids): 131 """ 132 Sets the nsg_ids of this CreateResolverVnicEndpointDetails. 133 An array of network security group OCIDs for the resolver endpoint. These must be part of the VCN that the 134 resolver endpoint is a part of. 135 136 137 :param nsg_ids: The nsg_ids of this CreateResolverVnicEndpointDetails. 138 :type: list[str] 139 """ 140 self._nsg_ids = nsg_ids 141 142 def __repr__(self): 143 return formatted_flat_dict(self) 144 145 def __eq__(self, other): 146 if other is None: 147 return False 148 149 return self.__dict__ == other.__dict__ 150 151 def __ne__(self, other): 152 return not self == other 153