Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_role.py205 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 V1Role(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        'rules': 'list[V1PolicyRule]'40    }41 42    attribute_map = {43        'api_version': 'apiVersion',44        'kind': 'kind',45        'metadata': 'metadata',46        'rules': 'rules'47    }48 49    def __init__(self, api_version=None, kind=None, metadata=None, rules=None, local_vars_configuration=None):  # noqa: E50150        """V1Role - a model defined in OpenAPI"""  # noqa: E50151        if local_vars_configuration is None:52            local_vars_configuration = Configuration()53        self.local_vars_configuration = local_vars_configuration54 55        self._api_version = None56        self._kind = None57        self._metadata = None58        self._rules = None59        self.discriminator = None60 61        if api_version is not None:62            self.api_version = api_version63        if kind is not None:64            self.kind = kind65        if metadata is not None:66            self.metadata = metadata67        if rules is not None:68            self.rules = rules69 70    @property71    def api_version(self):72        """Gets the api_version of this V1Role.  # noqa: E50173 74        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: E50175 76        :return: The api_version of this V1Role.  # noqa: E50177        :rtype: str78        """79        return self._api_version80 81    @api_version.setter82    def api_version(self, api_version):83        """Sets the api_version of this V1Role.84 85        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: E50186 87        :param api_version: The api_version of this V1Role.  # noqa: E50188        :type: str89        """90 91        self._api_version = api_version92 93    @property94    def kind(self):95        """Gets the kind of this V1Role.  # noqa: E50196 97        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: E50198 99        :return: The kind of this V1Role.  # noqa: E501100        :rtype: str101        """102        return self._kind103 104    @kind.setter105    def kind(self, kind):106        """Sets the kind of this V1Role.107 108        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: E501109 110        :param kind: The kind of this V1Role.  # noqa: E501111        :type: str112        """113 114        self._kind = kind115 116    @property117    def metadata(self):118        """Gets the metadata of this V1Role.  # noqa: E501119 120 121        :return: The metadata of this V1Role.  # noqa: E501122        :rtype: V1ObjectMeta123        """124        return self._metadata125 126    @metadata.setter127    def metadata(self, metadata):128        """Sets the metadata of this V1Role.129 130 131        :param metadata: The metadata of this V1Role.  # noqa: E501132        :type: V1ObjectMeta133        """134 135        self._metadata = metadata136 137    @property138    def rules(self):139        """Gets the rules of this V1Role.  # noqa: E501140 141        Rules holds all the PolicyRules for this Role  # noqa: E501142 143        :return: The rules of this V1Role.  # noqa: E501144        :rtype: list[V1PolicyRule]145        """146        return self._rules147 148    @rules.setter149    def rules(self, rules):150        """Sets the rules of this V1Role.151 152        Rules holds all the PolicyRules for this Role  # noqa: E501153 154        :param rules: The rules of this V1Role.  # noqa: E501155        :type: list[V1PolicyRule]156        """157 158        self._rules = rules159 160    def to_dict(self):161        """Returns the model properties as a dict"""162        result = {}163 164        for attr, _ in six.iteritems(self.openapi_types):165            value = getattr(self, attr)166            if isinstance(value, list):167                result[attr] = list(map(168                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,169                    value170                ))171            elif hasattr(value, "to_dict"):172                result[attr] = value.to_dict()173            elif isinstance(value, dict):174                result[attr] = dict(map(175                    lambda item: (item[0], item[1].to_dict())176                    if hasattr(item[1], "to_dict") else item,177                    value.items()178                ))179            else:180                result[attr] = value181 182        return result183 184    def to_str(self):185        """Returns the string representation of the model"""186        return pprint.pformat(self.to_dict())187 188    def __repr__(self):189        """For `print` and `pprint`"""190        return self.to_str()191 192    def __eq__(self, other):193        """Returns true if both objects are equal"""194        if not isinstance(other, V1Role):195            return False196 197        return self.to_dict() == other.to_dict()198 199    def __ne__(self, other):200        """Returns true if both objects are not equal"""201        if not isinstance(other, V1Role):202            return True203 204        return self.to_dict() != other.to_dict()205 
codekingpro/portable-devtools · Team Ai