1# coding: utf-8 2""" 3 Kubernetes 4 5 No description provided (generated by Swagger Codegen 6 https://github.com/swagger-api/swagger-codegen) 7 8 OpenAPI spec version: v1.14.4 9 10 Generated by: https://github.com/swagger-api/swagger-codegen.git 11""" 12 13from pprint import pformat 14from six import iteritems 15import re 16 17 18class V1EndpointAddress(object): 19 """ 20 NOTE: This class is auto generated by the swagger code generator program. 21 Do not edit the class manually. 22 """ 23 """ 24 Attributes: 25 swagger_types (dict): The key is attribute name and the value is attribute 26 type. 27 attribute_map (dict): The key is attribute name and the value is json key 28 in definition. 29 """ 30 swagger_types = { 31 'hostname': 'str', 32 'ip': 'str', 33 'node_name': 'str', 34 'target_ref': 'V1ObjectReference' 35 } 36 37 attribute_map = { 38 'hostname': 'hostname', 39 'ip': 'ip', 40 'node_name': 'nodeName', 41 'target_ref': 'targetRef' 42 } 43 44 def __init__(self, hostname=None, ip=None, node_name=None, target_ref=None): 45 """ 46 V1EndpointAddress - a model defined in Swagger 47 """ 48 49 self._hostname = None 50 self._ip = None 51 self._node_name = None 52 self._target_ref = None 53 self.discriminator = None 54 55 if hostname is not None: 56 self.hostname = hostname 57 self.ip = ip 58 if node_name is not None: 59 self.node_name = node_name 60 if target_ref is not None: 61 self.target_ref = target_ref 62 63 @property 64 def hostname(self): 65 """ 66 Gets the hostname of this V1EndpointAddress. 67 The Hostname of this endpoint 68 69 :return: The hostname of this V1EndpointAddress. 70 :rtype: str 71 """ 72 return self._hostname 73 74 @hostname.setter 75 def hostname(self, hostname): 76 """ 77 Sets the hostname of this V1EndpointAddress. 78 The Hostname of this endpoint 79 80 :param hostname: The hostname of this V1EndpointAddress. 81 :type: str 82 """ 83 84 self._hostname = hostname 85 86 @property 87 def ip(self): 88 """ 89 Gets the ip of this V1EndpointAddress. 90 The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local 91 (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is also 92 accepted but not fully supported on all platforms. Also, certain 93 kubernetes components, like kube-proxy, are not IPv6 ready. 94 95 :return: The ip of this V1EndpointAddress. 96 :rtype: str 97 """ 98 return self._ip 99 100 @ip.setter 101 def ip(self, ip): 102 """ 103 Sets the ip of this V1EndpointAddress. 104 The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local 105 (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is also 106 accepted but not fully supported on all platforms. Also, certain 107 kubernetes components, like kube-proxy, are not IPv6 ready. 108 109 :param ip: The ip of this V1EndpointAddress. 110 :type: str 111 """ 112 if ip is None: 113 raise ValueError('Invalid value for `ip`, must not be `None`') 114 115 self._ip = ip 116 117 @property 118 def node_name(self): 119 """ 120 Gets the node_name of this V1EndpointAddress. 121 Optional: Node hosting this endpoint. This can be used to determine 122 endpoints local to a node. 123 124 :return: The node_name of this V1EndpointAddress. 125 :rtype: str 126 """ 127 return self._node_name 128 129 @node_name.setter 130 def node_name(self, node_name): 131 """ 132 Sets the node_name of this V1EndpointAddress. 133 Optional: Node hosting this endpoint. This can be used to determine 134 endpoints local to a node. 135 136 :param node_name: The node_name of this V1EndpointAddress. 137 :type: str 138 """ 139 140 self._node_name = node_name 141 142 @property 143 def target_ref(self): 144 """ 145 Gets the target_ref of this V1EndpointAddress. 146 Reference to object providing the endpoint. 147 148 :return: The target_ref of this V1EndpointAddress. 149 :rtype: V1ObjectReference 150 """ 151 return self._target_ref 152 153 @target_ref.setter 154 def target_ref(self, target_ref): 155 """ 156 Sets the target_ref of this V1EndpointAddress. 157 Reference to object providing the endpoint. 158 159 :param target_ref: The target_ref of this V1EndpointAddress. 160 :type: V1ObjectReference 161 """ 162 163 self._target_ref = target_ref 164 165 def to_dict(self): 166 """ 167 Returns the model properties as a dict 168 """ 169 result = {} 170 171 for attr, _ in iteritems(self.swagger_types): 172 value = getattr(self, attr) 173 if isinstance(value, list): 174 result[attr] = list( 175 map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x, value)) 176 elif hasattr(value, 'to_dict'): 177 result[attr] = value.to_dict() 178 elif isinstance(value, dict): 179 result[attr] = dict( 180 map( 181 lambda item: (item[0], item[1].to_dict()) 182 if hasattr(item[1], 'to_dict') else item, value.items())) 183 else: 184 result[attr] = value 185 186 return result 187 188 def to_str(self): 189 """ 190 Returns the string representation of the model 191 """ 192 return pformat(self.to_dict()) 193 194 def __repr__(self): 195 """ 196 For `print` and `pprint` 197 """ 198 return self.to_str() 199 200 def __eq__(self, other): 201 """ 202 Returns true if both objects are equal 203 """ 204 if not isinstance(other, V1EndpointAddress): 205 return False 206 207 return self.__dict__ == other.__dict__ 208 209 def __ne__(self, other): 210 """ 211 Returns true if both objects are not equal 212 """ 213 return not self == other 214