Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_service_account.py261 linesDownload Raw Back to models
1# coding: utf-82 3"""4    Kubernetes5 6    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E5017 8    The version of the OpenAPI document: release-1.359    Generated by: https://openapi-generator.tech10"""11 12 13import pprint14import re  # noqa: F40115 16import six17 18from kubernetes.client.configuration import Configuration19 20 21class V1ServiceAccount(object):22    """NOTE: This class is auto generated by OpenAPI Generator.23    Ref: https://openapi-generator.tech24 25    Do not edit the class manually.26    """27 28    """29    Attributes:30      openapi_types (dict): The key is attribute name31                            and the value is attribute type.32      attribute_map (dict): The key is attribute name33                            and the value is json key in definition.34    """35    openapi_types = {36        'api_version': 'str',37        'automount_service_account_token': 'bool',38        'image_pull_secrets': 'list[V1LocalObjectReference]',39        'kind': 'str',40        'metadata': 'V1ObjectMeta',41        'secrets': 'list[V1ObjectReference]'42    }43 44    attribute_map = {45        'api_version': 'apiVersion',46        'automount_service_account_token': 'automountServiceAccountToken',47        'image_pull_secrets': 'imagePullSecrets',48        'kind': 'kind',49        'metadata': 'metadata',50        'secrets': 'secrets'51    }52 53    def __init__(self, api_version=None, automount_service_account_token=None, image_pull_secrets=None, kind=None, metadata=None, secrets=None, local_vars_configuration=None):  # noqa: E50154        """V1ServiceAccount - a model defined in OpenAPI"""  # noqa: E50155        if local_vars_configuration is None:56            local_vars_configuration = Configuration()57        self.local_vars_configuration = local_vars_configuration58 59        self._api_version = None60        self._automount_service_account_token = None61        self._image_pull_secrets = None62        self._kind = None63        self._metadata = None64        self._secrets = None65        self.discriminator = None66 67        if api_version is not None:68            self.api_version = api_version69        if automount_service_account_token is not None:70            self.automount_service_account_token = automount_service_account_token71        if image_pull_secrets is not None:72            self.image_pull_secrets = image_pull_secrets73        if kind is not None:74            self.kind = kind75        if metadata is not None:76            self.metadata = metadata77        if secrets is not None:78            self.secrets = secrets79 80    @property81    def api_version(self):82        """Gets the api_version of this V1ServiceAccount.  # noqa: E50183 84        APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources  # noqa: E50185 86        :return: The api_version of this V1ServiceAccount.  # noqa: E50187        :rtype: str88        """89        return self._api_version90 91    @api_version.setter92    def api_version(self, api_version):93        """Sets the api_version of this V1ServiceAccount.94 95        APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources  # noqa: E50196 97        :param api_version: The api_version of this V1ServiceAccount.  # noqa: E50198        :type: str99        """100 101        self._api_version = api_version102 103    @property104    def automount_service_account_token(self):105        """Gets the automount_service_account_token of this V1ServiceAccount.  # noqa: E501106 107        AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level.  # noqa: E501108 109        :return: The automount_service_account_token of this V1ServiceAccount.  # noqa: E501110        :rtype: bool111        """112        return self._automount_service_account_token113 114    @automount_service_account_token.setter115    def automount_service_account_token(self, automount_service_account_token):116        """Sets the automount_service_account_token of this V1ServiceAccount.117 118        AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level.  # noqa: E501119 120        :param automount_service_account_token: The automount_service_account_token of this V1ServiceAccount.  # noqa: E501121        :type: bool122        """123 124        self._automount_service_account_token = automount_service_account_token125 126    @property127    def image_pull_secrets(self):128        """Gets the image_pull_secrets of this V1ServiceAccount.  # noqa: E501129 130        ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod  # noqa: E501131 132        :return: The image_pull_secrets of this V1ServiceAccount.  # noqa: E501133        :rtype: list[V1LocalObjectReference]134        """135        return self._image_pull_secrets136 137    @image_pull_secrets.setter138    def image_pull_secrets(self, image_pull_secrets):139        """Sets the image_pull_secrets of this V1ServiceAccount.140 141        ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod  # noqa: E501142 143        :param image_pull_secrets: The image_pull_secrets of this V1ServiceAccount.  # noqa: E501144        :type: list[V1LocalObjectReference]145        """146 147        self._image_pull_secrets = image_pull_secrets148 149    @property150    def kind(self):151        """Gets the kind of this V1ServiceAccount.  # noqa: E501152 153        Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds  # noqa: E501154 155        :return: The kind of this V1ServiceAccount.  # noqa: E501156        :rtype: str157        """158        return self._kind159 160    @kind.setter161    def kind(self, kind):162        """Sets the kind of this V1ServiceAccount.163 164        Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds  # noqa: E501165 166        :param kind: The kind of this V1ServiceAccount.  # noqa: E501167        :type: str168        """169 170        self._kind = kind171 172    @property173    def metadata(self):174        """Gets the metadata of this V1ServiceAccount.  # noqa: E501175 176 177        :return: The metadata of this V1ServiceAccount.  # noqa: E501178        :rtype: V1ObjectMeta179        """180        return self._metadata181 182    @metadata.setter183    def metadata(self, metadata):184        """Sets the metadata of this V1ServiceAccount.185 186 187        :param metadata: The metadata of this V1ServiceAccount.  # noqa: E501188        :type: V1ObjectMeta189        """190 191        self._metadata = metadata192 193    @property194    def secrets(self):195        """Gets the secrets of this V1ServiceAccount.  # noqa: E501196 197        Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a \"kubernetes.io/enforce-mountable-secrets\" annotation set to \"true\". The \"kubernetes.io/enforce-mountable-secrets\" annotation is deprecated since v1.32. Prefer separate namespaces to isolate access to mounted secrets. This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret  # noqa: E501198 199        :return: The secrets of this V1ServiceAccount.  # noqa: E501200        :rtype: list[V1ObjectReference]201        """202        return self._secrets203 204    @secrets.setter205    def secrets(self, secrets):206        """Sets the secrets of this V1ServiceAccount.207 208        Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a \"kubernetes.io/enforce-mountable-secrets\" annotation set to \"true\". The \"kubernetes.io/enforce-mountable-secrets\" annotation is deprecated since v1.32. Prefer separate namespaces to isolate access to mounted secrets. This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret  # noqa: E501209 210        :param secrets: The secrets of this V1ServiceAccount.  # noqa: E501211        :type: list[V1ObjectReference]212        """213 214        self._secrets = secrets215 216    def to_dict(self):217        """Returns the model properties as a dict"""218        result = {}219 220        for attr, _ in six.iteritems(self.openapi_types):221            value = getattr(self, attr)222            if isinstance(value, list):223                result[attr] = list(map(224                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,225                    value226                ))227            elif hasattr(value, "to_dict"):228                result[attr] = value.to_dict()229            elif isinstance(value, dict):230                result[attr] = dict(map(231                    lambda item: (item[0], item[1].to_dict())232                    if hasattr(item[1], "to_dict") else item,233                    value.items()234                ))235            else:236                result[attr] = value237 238        return result239 240    def to_str(self):241        """Returns the string representation of the model"""242        return pprint.pformat(self.to_dict())243 244    def __repr__(self):245        """For `print` and `pprint`"""246        return self.to_str()247 248    def __eq__(self, other):249        """Returns true if both objects are equal"""250        if not isinstance(other, V1ServiceAccount):251            return False252 253        return self.to_dict() == other.to_dict()254 255    def __ne__(self, other):256        """Returns true if both objects are not equal"""257        if not isinstance(other, V1ServiceAccount):258            return True259 260        return self.to_dict() != other.to_dict()261 
codekingpro/portable-devtools · Team Ai