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 V1ServiceAccount(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 'automount_service_account_token': 'bool', 33 'image_pull_secrets': 'list[V1LocalObjectReference]', 34 'kind': 'str', 35 'metadata': 'V1ObjectMeta', 36 'secrets': 'list[V1ObjectReference]' 37 } 38 39 attribute_map = { 40 'api_version': 'apiVersion', 41 'automount_service_account_token': 'automountServiceAccountToken', 42 'image_pull_secrets': 'imagePullSecrets', 43 'kind': 'kind', 44 'metadata': 'metadata', 45 'secrets': 'secrets' 46 } 47 48 def __init__(self, 49 api_version=None, 50 automount_service_account_token=None, 51 image_pull_secrets=None, 52 kind=None, 53 metadata=None, 54 secrets=None): 55 """ 56 V1ServiceAccount - a model defined in Swagger 57 """ 58 59 self._api_version = None 60 self._automount_service_account_token = None 61 self._image_pull_secrets = None 62 self._kind = None 63 self._metadata = None 64 self._secrets = None 65 self.discriminator = None 66 67 if api_version is not None: 68 self.api_version = api_version 69 if automount_service_account_token is not None: 70 self.automount_service_account_token = automount_service_account_token 71 if image_pull_secrets is not None: 72 self.image_pull_secrets = image_pull_secrets 73 if kind is not None: 74 self.kind = kind 75 if metadata is not None: 76 self.metadata = metadata 77 if secrets is not None: 78 self.secrets = secrets 79 80 @property 81 def api_version(self): 82 """ 83 Gets the api_version of this V1ServiceAccount. 84 APIVersion defines the versioned schema of this representation of an 85 object. Servers should convert recognized schemas to the latest internal 86 value, and may reject unrecognized values. More info: 87 https://git.k8s.io/community/contributors/devel/api-conventions.md#resources 88 89 :return: The api_version of this V1ServiceAccount. 90 :rtype: str 91 """ 92 return self._api_version 93 94 @api_version.setter 95 def api_version(self, api_version): 96 """ 97 Sets the api_version of this V1ServiceAccount. 98 APIVersion defines the versioned schema of this representation of an 99 object. Servers should convert recognized schemas to the latest internal 100 value, and may reject unrecognized values. More info: 101 https://git.k8s.io/community/contributors/devel/api-conventions.md#resources 102 103 :param api_version: The api_version of this V1ServiceAccount. 104 :type: str 105 """ 106 107 self._api_version = api_version 108 109 @property 110 def automount_service_account_token(self): 111 """ 112 Gets the automount_service_account_token of this V1ServiceAccount. 113 AutomountServiceAccountToken indicates whether pods running as this 114 service account should have an API token automatically mounted. Can be 115 overridden at the pod level. 116 117 :return: The automount_service_account_token of this V1ServiceAccount. 118 :rtype: bool 119 """ 120 return self._automount_service_account_token 121 122 @automount_service_account_token.setter 123 def automount_service_account_token(self, automount_service_account_token): 124 """ 125 Sets the automount_service_account_token of this V1ServiceAccount. 126 AutomountServiceAccountToken indicates whether pods running as this 127 service account should have an API token automatically mounted. Can be 128 overridden at the pod level. 129 130 :param automount_service_account_token: The 131 automount_service_account_token of this V1ServiceAccount. 132 :type: bool 133 """ 134 135 self._automount_service_account_token = automount_service_account_token 136 137 @property 138 def image_pull_secrets(self): 139 """ 140 Gets the image_pull_secrets of this V1ServiceAccount. 141 ImagePullSecrets is a list of references to secrets in the same 142 namespace to use for pulling any images in pods that reference this 143 ServiceAccount. ImagePullSecrets are distinct from Secrets because 144 Secrets can be mounted in the pod, but ImagePullSecrets are only 145 accessed by the kubelet. More info: 146 https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod 147 148 :return: The image_pull_secrets of this V1ServiceAccount. 149 :rtype: list[V1LocalObjectReference] 150 """ 151 return self._image_pull_secrets 152 153 @image_pull_secrets.setter 154 def image_pull_secrets(self, image_pull_secrets): 155 """ 156 Sets the image_pull_secrets of this V1ServiceAccount. 157 ImagePullSecrets is a list of references to secrets in the same 158 namespace to use for pulling any images in pods that reference this 159 ServiceAccount. ImagePullSecrets are distinct from Secrets because 160 Secrets can be mounted in the pod, but ImagePullSecrets are only 161 accessed by the kubelet. More info: 162 https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod 163 164 :param image_pull_secrets: The image_pull_secrets of this 165 V1ServiceAccount. 166 :type: list[V1LocalObjectReference] 167 """ 168 169 self._image_pull_secrets = image_pull_secrets 170 171 @property 172 def kind(self): 173 """ 174 Gets the kind of this V1ServiceAccount. 175 Kind is a string value representing the REST resource this object 176 represents. Servers may infer this from the endpoint the client submits 177 requests to. Cannot be updated. In CamelCase. More info: 178 https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds 179 180 :return: The kind of this V1ServiceAccount. 181 :rtype: str 182 """ 183 return self._kind 184 185 @kind.setter 186 def kind(self, kind): 187 """ 188 Sets the kind of this V1ServiceAccount. 189 Kind is a string value representing the REST resource this object 190 represents. Servers may infer this from the endpoint the client submits 191 requests to. Cannot be updated. In CamelCase. More info: 192 https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds 193 194 :param kind: The kind of this V1ServiceAccount. 195 :type: str 196 """ 197 198 self._kind = kind 199 200 @property 201 def metadata(self): 202 """ 203 Gets the metadata of this V1ServiceAccount. 204 Standard object's metadata. More info: 205 https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 206 207 :return: The metadata of this V1ServiceAccount. 208 :rtype: V1ObjectMeta 209 """ 210 return self._metadata 211 212 @metadata.setter 213 def metadata(self, metadata): 214 """ 215 Sets the metadata of this V1ServiceAccount. 216 Standard object's metadata. More info: 217 https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 218 219 :param metadata: The metadata of this V1ServiceAccount. 220 :type: V1ObjectMeta 221 """ 222 223 self._metadata = metadata 224 225 @property 226 def secrets(self): 227 """ 228 Gets the secrets of this V1ServiceAccount. 229 Secrets is the list of secrets allowed to be used by pods running using 230 this ServiceAccount. More info: 231 https://kubernetes.io/docs/concepts/configuration/secret 232 233 :return: The secrets of this V1ServiceAccount. 234 :rtype: list[V1ObjectReference] 235 """ 236 return self._secrets 237 238 @secrets.setter 239 def secrets(self, secrets): 240 """ 241 Sets the secrets of this V1ServiceAccount. 242 Secrets is the list of secrets allowed to be used by pods running using 243 this ServiceAccount. More info: 244 https://kubernetes.io/docs/concepts/configuration/secret 245 246 :param secrets: The secrets of this V1ServiceAccount. 247 :type: list[V1ObjectReference] 248 """ 249 250 self._secrets = secrets 251 252 def to_dict(self): 253 """ 254 Returns the model properties as a dict 255 """ 256 result = {} 257 258 for attr, _ in iteritems(self.swagger_types): 259 value = getattr(self, attr) 260 if isinstance(value, list): 261 result[attr] = list( 262 map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x, value)) 263 elif hasattr(value, 'to_dict'): 264 result[attr] = value.to_dict() 265 elif isinstance(value, dict): 266 result[attr] = dict( 267 map( 268 lambda item: (item[0], item[1].to_dict()) 269 if hasattr(item[1], 'to_dict') else item, value.items())) 270 else: 271 result[attr] = value 272 273 return result 274 275 def to_str(self): 276 """ 277 Returns the string representation of the model 278 """ 279 return pformat(self.to_dict()) 280 281 def __repr__(self): 282 """ 283 For `print` and `pprint` 284 """ 285 return self.to_str() 286 287 def __eq__(self, other): 288 """ 289 Returns true if both objects are equal 290 """ 291 if not isinstance(other, V1ServiceAccount): 292 return False 293 294 return self.__dict__ == other.__dict__ 295 296 def __ne__(self, other): 297 """ 298 Returns true if both objects are not equal 299 """ 300 return not self == other 301