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 V1APIGroup(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 'api_version': 'str', 32 'kind': 'str', 33 'name': 'str', 34 'preferred_version': 'V1GroupVersionForDiscovery', 35 'server_address_by_client_cid_rs': 'list[V1ServerAddressByClientCIDR]', 36 'versions': 'list[V1GroupVersionForDiscovery]' 37 } 38 39 attribute_map = { 40 'api_version': 'apiVersion', 41 'kind': 'kind', 42 'name': 'name', 43 'preferred_version': 'preferredVersion', 44 'server_address_by_client_cid_rs': 'serverAddressByClientCIDRs', 45 'versions': 'versions' 46 } 47 48 def __init__(self, 49 api_version=None, 50 kind=None, 51 name=None, 52 preferred_version=None, 53 server_address_by_client_cid_rs=None, 54 versions=None): 55 """ 56 V1APIGroup - a model defined in Swagger 57 """ 58 59 self._api_version = None 60 self._kind = None 61 self._name = None 62 self._preferred_version = None 63 self._server_address_by_client_cid_rs = None 64 self._versions = None 65 self.discriminator = None 66 67 if api_version is not None: 68 self.api_version = api_version 69 if kind is not None: 70 self.kind = kind 71 self.name = name 72 if preferred_version is not None: 73 self.preferred_version = preferred_version 74 if server_address_by_client_cid_rs is not None: 75 self.server_address_by_client_cid_rs = server_address_by_client_cid_rs 76 self.versions = versions 77 78 @property 79 def api_version(self): 80 """ 81 Gets the api_version of this V1APIGroup. 82 APIVersion defines the versioned schema of this representation of an 83 object. Servers should convert recognized schemas to the latest internal 84 value, and may reject unrecognized values. More info: 85 https://git.k8s.io/community/contributors/devel/api-conventions.md#resources 86 87 :return: The api_version of this V1APIGroup. 88 :rtype: str 89 """ 90 return self._api_version 91 92 @api_version.setter 93 def api_version(self, api_version): 94 """ 95 Sets the api_version of this V1APIGroup. 96 APIVersion defines the versioned schema of this representation of an 97 object. Servers should convert recognized schemas to the latest internal 98 value, and may reject unrecognized values. More info: 99 https://git.k8s.io/community/contributors/devel/api-conventions.md#resources 100 101 :param api_version: The api_version of this V1APIGroup. 102 :type: str 103 """ 104 105 self._api_version = api_version 106 107 @property 108 def kind(self): 109 """ 110 Gets the kind of this V1APIGroup. 111 Kind is a string value representing the REST resource this object 112 represents. Servers may infer this from the endpoint the client submits 113 requests to. Cannot be updated. In CamelCase. More info: 114 https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds 115 116 :return: The kind of this V1APIGroup. 117 :rtype: str 118 """ 119 return self._kind 120 121 @kind.setter 122 def kind(self, kind): 123 """ 124 Sets the kind of this V1APIGroup. 125 Kind is a string value representing the REST resource this object 126 represents. Servers may infer this from the endpoint the client submits 127 requests to. Cannot be updated. In CamelCase. More info: 128 https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds 129 130 :param kind: The kind of this V1APIGroup. 131 :type: str 132 """ 133 134 self._kind = kind 135 136 @property 137 def name(self): 138 """ 139 Gets the name of this V1APIGroup. 140 name is the name of the group. 141 142 :return: The name of this V1APIGroup. 143 :rtype: str 144 """ 145 return self._name 146 147 @name.setter 148 def name(self, name): 149 """ 150 Sets the name of this V1APIGroup. 151 name is the name of the group. 152 153 :param name: The name of this V1APIGroup. 154 :type: str 155 """ 156 if name is None: 157 raise ValueError('Invalid value for `name`, must not be `None`') 158 159 self._name = name 160 161 @property 162 def preferred_version(self): 163 """ 164 Gets the preferred_version of this V1APIGroup. 165 preferredVersion is the version preferred by the API server, which 166 probably is the storage version. 167 168 :return: The preferred_version of this V1APIGroup. 169 :rtype: V1GroupVersionForDiscovery 170 """ 171 return self._preferred_version 172 173 @preferred_version.setter 174 def preferred_version(self, preferred_version): 175 """ 176 Sets the preferred_version of this V1APIGroup. 177 preferredVersion is the version preferred by the API server, which 178 probably is the storage version. 179 180 :param preferred_version: The preferred_version of this V1APIGroup. 181 :type: V1GroupVersionForDiscovery 182 """ 183 184 self._preferred_version = preferred_version 185 186 @property 187 def server_address_by_client_cid_rs(self): 188 """ 189 Gets the server_address_by_client_cid_rs of this V1APIGroup. 190 a map of client CIDR to server address that is serving this group. This 191 is to help clients reach servers in the most network-efficient way 192 possible. Clients can use the appropriate server address as per the CIDR 193 that they match. In case of multiple matches, clients should use the 194 longest matching CIDR. The server returns only those CIDRs that it 195 thinks that the client can match. For example: the master will return an 196 internal IP CIDR only, if the client reaches the server using an 197 internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header 198 or request.RemoteAddr (in that order) to get the client IP. 199 200 :return: The server_address_by_client_cid_rs of this V1APIGroup. 201 :rtype: list[V1ServerAddressByClientCIDR] 202 """ 203 return self._server_address_by_client_cid_rs 204 205 @server_address_by_client_cid_rs.setter 206 def server_address_by_client_cid_rs(self, server_address_by_client_cid_rs): 207 """ 208 Sets the server_address_by_client_cid_rs of this V1APIGroup. 209 a map of client CIDR to server address that is serving this group. This 210 is to help clients reach servers in the most network-efficient way 211 possible. Clients can use the appropriate server address as per the CIDR 212 that they match. In case of multiple matches, clients should use the 213 longest matching CIDR. The server returns only those CIDRs that it 214 thinks that the client can match. For example: the master will return an 215 internal IP CIDR only, if the client reaches the server using an 216 internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header 217 or request.RemoteAddr (in that order) to get the client IP. 218 219 :param server_address_by_client_cid_rs: The 220 server_address_by_client_cid_rs of this V1APIGroup. 221 :type: list[V1ServerAddressByClientCIDR] 222 """ 223 224 self._server_address_by_client_cid_rs = server_address_by_client_cid_rs 225 226 @property 227 def versions(self): 228 """ 229 Gets the versions of this V1APIGroup. 230 versions are the versions supported in this group. 231 232 :return: The versions of this V1APIGroup. 233 :rtype: list[V1GroupVersionForDiscovery] 234 """ 235 return self._versions 236 237 @versions.setter 238 def versions(self, versions): 239 """ 240 Sets the versions of this V1APIGroup. 241 versions are the versions supported in this group. 242 243 :param versions: The versions of this V1APIGroup. 244 :type: list[V1GroupVersionForDiscovery] 245 """ 246 if versions is None: 247 raise ValueError('Invalid value for `versions`, must not be `None`') 248 249 self._versions = versions 250 251 def to_dict(self): 252 """ 253 Returns the model properties as a dict 254 """ 255 result = {} 256 257 for attr, _ in iteritems(self.swagger_types): 258 value = getattr(self, attr) 259 if isinstance(value, list): 260 result[attr] = list( 261 map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x, value)) 262 elif hasattr(value, 'to_dict'): 263 result[attr] = value.to_dict() 264 elif isinstance(value, dict): 265 result[attr] = dict( 266 map( 267 lambda item: (item[0], item[1].to_dict()) 268 if hasattr(item[1], 'to_dict') else item, value.items())) 269 else: 270 result[attr] = value 271 272 return result 273 274 def to_str(self): 275 """ 276 Returns the string representation of the model 277 """ 278 return pformat(self.to_dict()) 279 280 def __repr__(self): 281 """ 282 For `print` and `pprint` 283 """ 284 return self.to_str() 285 286 def __eq__(self, other): 287 """ 288 Returns true if both objects are equal 289 """ 290 if not isinstance(other, V1APIGroup): 291 return False 292 293 return self.__dict__ == other.__dict__ 294 295 def __ne__(self, other): 296 """ 297 Returns true if both objects are not equal 298 """ 299 return not self == other 300