Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1_match_resources.py231 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 V1MatchResources(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        'exclude_resource_rules': 'list[V1NamedRuleWithOperations]',37        'match_policy': 'str',38        'namespace_selector': 'V1LabelSelector',39        'object_selector': 'V1LabelSelector',40        'resource_rules': 'list[V1NamedRuleWithOperations]'41    }42 43    attribute_map = {44        'exclude_resource_rules': 'excludeResourceRules',45        'match_policy': 'matchPolicy',46        'namespace_selector': 'namespaceSelector',47        'object_selector': 'objectSelector',48        'resource_rules': 'resourceRules'49    }50 51    def __init__(self, exclude_resource_rules=None, match_policy=None, namespace_selector=None, object_selector=None, resource_rules=None, local_vars_configuration=None):  # noqa: E50152        """V1MatchResources - 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._exclude_resource_rules = None58        self._match_policy = None59        self._namespace_selector = None60        self._object_selector = None61        self._resource_rules = None62        self.discriminator = None63 64        if exclude_resource_rules is not None:65            self.exclude_resource_rules = exclude_resource_rules66        if match_policy is not None:67            self.match_policy = match_policy68        if namespace_selector is not None:69            self.namespace_selector = namespace_selector70        if object_selector is not None:71            self.object_selector = object_selector72        if resource_rules is not None:73            self.resource_rules = resource_rules74 75    @property76    def exclude_resource_rules(self):77        """Gets the exclude_resource_rules of this V1MatchResources.  # noqa: E50178 79        ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)  # noqa: E50180 81        :return: The exclude_resource_rules of this V1MatchResources.  # noqa: E50182        :rtype: list[V1NamedRuleWithOperations]83        """84        return self._exclude_resource_rules85 86    @exclude_resource_rules.setter87    def exclude_resource_rules(self, exclude_resource_rules):88        """Sets the exclude_resource_rules of this V1MatchResources.89 90        ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)  # noqa: E50191 92        :param exclude_resource_rules: The exclude_resource_rules of this V1MatchResources.  # noqa: E50193        :type: list[V1NamedRuleWithOperations]94        """95 96        self._exclude_resource_rules = exclude_resource_rules97 98    @property99    def match_policy(self):100        """Gets the match_policy of this V1MatchResources.  # noqa: E501101 102        matchPolicy defines how the \"MatchResources\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".  - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.  - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.  Defaults to \"Equivalent\"  # noqa: E501103 104        :return: The match_policy of this V1MatchResources.  # noqa: E501105        :rtype: str106        """107        return self._match_policy108 109    @match_policy.setter110    def match_policy(self, match_policy):111        """Sets the match_policy of this V1MatchResources.112 113        matchPolicy defines how the \"MatchResources\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".  - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy.  - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.  Defaults to \"Equivalent\"  # noqa: E501114 115        :param match_policy: The match_policy of this V1MatchResources.  # noqa: E501116        :type: str117        """118 119        self._match_policy = match_policy120 121    @property122    def namespace_selector(self):123        """Gets the namespace_selector of this V1MatchResources.  # noqa: E501124 125 126        :return: The namespace_selector of this V1MatchResources.  # noqa: E501127        :rtype: V1LabelSelector128        """129        return self._namespace_selector130 131    @namespace_selector.setter132    def namespace_selector(self, namespace_selector):133        """Sets the namespace_selector of this V1MatchResources.134 135 136        :param namespace_selector: The namespace_selector of this V1MatchResources.  # noqa: E501137        :type: V1LabelSelector138        """139 140        self._namespace_selector = namespace_selector141 142    @property143    def object_selector(self):144        """Gets the object_selector of this V1MatchResources.  # noqa: E501145 146 147        :return: The object_selector of this V1MatchResources.  # noqa: E501148        :rtype: V1LabelSelector149        """150        return self._object_selector151 152    @object_selector.setter153    def object_selector(self, object_selector):154        """Sets the object_selector of this V1MatchResources.155 156 157        :param object_selector: The object_selector of this V1MatchResources.  # noqa: E501158        :type: V1LabelSelector159        """160 161        self._object_selector = object_selector162 163    @property164    def resource_rules(self):165        """Gets the resource_rules of this V1MatchResources.  # noqa: E501166 167        ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.  # noqa: E501168 169        :return: The resource_rules of this V1MatchResources.  # noqa: E501170        :rtype: list[V1NamedRuleWithOperations]171        """172        return self._resource_rules173 174    @resource_rules.setter175    def resource_rules(self, resource_rules):176        """Sets the resource_rules of this V1MatchResources.177 178        ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.  # noqa: E501179 180        :param resource_rules: The resource_rules of this V1MatchResources.  # noqa: E501181        :type: list[V1NamedRuleWithOperations]182        """183 184        self._resource_rules = resource_rules185 186    def to_dict(self):187        """Returns the model properties as a dict"""188        result = {}189 190        for attr, _ in six.iteritems(self.openapi_types):191            value = getattr(self, attr)192            if isinstance(value, list):193                result[attr] = list(map(194                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,195                    value196                ))197            elif hasattr(value, "to_dict"):198                result[attr] = value.to_dict()199            elif isinstance(value, dict):200                result[attr] = dict(map(201                    lambda item: (item[0], item[1].to_dict())202                    if hasattr(item[1], "to_dict") else item,203                    value.items()204                ))205            else:206                result[attr] = value207 208        return result209 210    def to_str(self):211        """Returns the string representation of the model"""212        return pprint.pformat(self.to_dict())213 214    def __repr__(self):215        """For `print` and `pprint`"""216        return self.to_str()217 218    def __eq__(self, other):219        """Returns true if both objects are equal"""220        if not isinstance(other, V1MatchResources):221            return False222 223        return self.to_dict() == other.to_dict()224 225    def __ne__(self, other):226        """Returns true if both objects are not equal"""227        if not isinstance(other, V1MatchResources):228            return True229 230        return self.to_dict() != other.to_dict()231 
codekingpro/portable-devtools · Team Ai