Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_role_binding.py232 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 V1RoleBinding(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        'kind': 'str',38        'metadata': 'V1ObjectMeta',39        'role_ref': 'V1RoleRef',40        'subjects': 'list[RbacV1Subject]'41    }42 43    attribute_map = {44        'api_version': 'apiVersion',45        'kind': 'kind',46        'metadata': 'metadata',47        'role_ref': 'roleRef',48        'subjects': 'subjects'49    }50 51    def __init__(self, api_version=None, kind=None, metadata=None, role_ref=None, subjects=None, local_vars_configuration=None):  # noqa: E50152        """V1RoleBinding - a model defined in OpenAPI"""  # noqa: E50153        if local_vars_configuration is None:54            local_vars_configuration = Configuration()55        self.local_vars_configuration = local_vars_configuration56 57        self._api_version = None58        self._kind = None59        self._metadata = None60        self._role_ref = None61        self._subjects = None62        self.discriminator = None63 64        if api_version is not None:65            self.api_version = api_version66        if kind is not None:67            self.kind = kind68        if metadata is not None:69            self.metadata = metadata70        self.role_ref = role_ref71        if subjects is not None:72            self.subjects = subjects73 74    @property75    def api_version(self):76        """Gets the api_version of this V1RoleBinding.  # noqa: E50177 78        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: E50179 80        :return: The api_version of this V1RoleBinding.  # noqa: E50181        :rtype: str82        """83        return self._api_version84 85    @api_version.setter86    def api_version(self, api_version):87        """Sets the api_version of this V1RoleBinding.88 89        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: E50190 91        :param api_version: The api_version of this V1RoleBinding.  # noqa: E50192        :type: str93        """94 95        self._api_version = api_version96 97    @property98    def kind(self):99        """Gets the kind of this V1RoleBinding.  # noqa: E501100 101        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: E501102 103        :return: The kind of this V1RoleBinding.  # noqa: E501104        :rtype: str105        """106        return self._kind107 108    @kind.setter109    def kind(self, kind):110        """Sets the kind of this V1RoleBinding.111 112        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: E501113 114        :param kind: The kind of this V1RoleBinding.  # noqa: E501115        :type: str116        """117 118        self._kind = kind119 120    @property121    def metadata(self):122        """Gets the metadata of this V1RoleBinding.  # noqa: E501123 124 125        :return: The metadata of this V1RoleBinding.  # noqa: E501126        :rtype: V1ObjectMeta127        """128        return self._metadata129 130    @metadata.setter131    def metadata(self, metadata):132        """Sets the metadata of this V1RoleBinding.133 134 135        :param metadata: The metadata of this V1RoleBinding.  # noqa: E501136        :type: V1ObjectMeta137        """138 139        self._metadata = metadata140 141    @property142    def role_ref(self):143        """Gets the role_ref of this V1RoleBinding.  # noqa: E501144 145 146        :return: The role_ref of this V1RoleBinding.  # noqa: E501147        :rtype: V1RoleRef148        """149        return self._role_ref150 151    @role_ref.setter152    def role_ref(self, role_ref):153        """Sets the role_ref of this V1RoleBinding.154 155 156        :param role_ref: The role_ref of this V1RoleBinding.  # noqa: E501157        :type: V1RoleRef158        """159        if self.local_vars_configuration.client_side_validation and role_ref is None:  # noqa: E501160            raise ValueError("Invalid value for `role_ref`, must not be `None`")  # noqa: E501161 162        self._role_ref = role_ref163 164    @property165    def subjects(self):166        """Gets the subjects of this V1RoleBinding.  # noqa: E501167 168        Subjects holds references to the objects the role applies to.  # noqa: E501169 170        :return: The subjects of this V1RoleBinding.  # noqa: E501171        :rtype: list[RbacV1Subject]172        """173        return self._subjects174 175    @subjects.setter176    def subjects(self, subjects):177        """Sets the subjects of this V1RoleBinding.178 179        Subjects holds references to the objects the role applies to.  # noqa: E501180 181        :param subjects: The subjects of this V1RoleBinding.  # noqa: E501182        :type: list[RbacV1Subject]183        """184 185        self._subjects = subjects186 187    def to_dict(self):188        """Returns the model properties as a dict"""189        result = {}190 191        for attr, _ in six.iteritems(self.openapi_types):192            value = getattr(self, attr)193            if isinstance(value, list):194                result[attr] = list(map(195                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,196                    value197                ))198            elif hasattr(value, "to_dict"):199                result[attr] = value.to_dict()200            elif isinstance(value, dict):201                result[attr] = dict(map(202                    lambda item: (item[0], item[1].to_dict())203                    if hasattr(item[1], "to_dict") else item,204                    value.items()205                ))206            else:207                result[attr] = value208 209        return result210 211    def to_str(self):212        """Returns the string representation of the model"""213        return pprint.pformat(self.to_dict())214 215    def __repr__(self):216        """For `print` and `pprint`"""217        return self.to_str()218 219    def __eq__(self, other):220        """Returns true if both objects are equal"""221        if not isinstance(other, V1RoleBinding):222            return False223 224        return self.to_dict() == other.to_dict()225 226    def __ne__(self, other):227        """Returns true if both objects are not equal"""228        if not isinstance(other, V1RoleBinding):229            return True230 231        return self.to_dict() != other.to_dict()232 
codekingpro/portable-devtools · Team Ai