Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
v1alpha1_match_condition.py153 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 V1alpha1MatchCondition(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        'expression': 'str',37        'name': 'str'38    }39 40    attribute_map = {41        'expression': 'expression',42        'name': 'name'43    }44 45    def __init__(self, expression=None, name=None, local_vars_configuration=None):  # noqa: E50146        """V1alpha1MatchCondition - a model defined in OpenAPI"""  # noqa: E50147        if local_vars_configuration is None:48            local_vars_configuration = Configuration()49        self.local_vars_configuration = local_vars_configuration50 51        self._expression = None52        self._name = None53        self.discriminator = None54 55        self.expression = expression56        self.name = name57 58    @property59    def expression(self):60        """Gets the expression of this V1alpha1MatchCondition.  # noqa: E50161 62        Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:  'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.   See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the   request resource. Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/  Required.  # noqa: E50163 64        :return: The expression of this V1alpha1MatchCondition.  # noqa: E50165        :rtype: str66        """67        return self._expression68 69    @expression.setter70    def expression(self, expression):71        """Sets the expression of this V1alpha1MatchCondition.72 73        Expression represents the expression which will be evaluated by CEL. Must evaluate to bool. CEL expressions have access to the contents of the AdmissionRequest and Authorizer, organized into CEL variables:  'object' - The object from the incoming request. The value is null for DELETE requests. 'oldObject' - The existing object. The value is null for CREATE requests. 'request' - Attributes of the admission request(/pkg/apis/admission/types.go#AdmissionRequest). 'authorizer' - A CEL Authorizer. May be used to perform authorization checks for the principal (user or service account) of the request.   See https://pkg.go.dev/k8s.io/apiserver/pkg/cel/library#Authz 'authorizer.requestResource' - A CEL ResourceCheck constructed from the 'authorizer' and configured with the   request resource. Documentation on CEL: https://kubernetes.io/docs/reference/using-api/cel/  Required.  # noqa: E50174 75        :param expression: The expression of this V1alpha1MatchCondition.  # noqa: E50176        :type: str77        """78        if self.local_vars_configuration.client_side_validation and expression is None:  # noqa: E50179            raise ValueError("Invalid value for `expression`, must not be `None`")  # noqa: E50180 81        self._expression = expression82 83    @property84    def name(self):85        """Gets the name of this V1alpha1MatchCondition.  # noqa: E50186 87        Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName',  or 'my.name',  or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')  Required.  # noqa: E50188 89        :return: The name of this V1alpha1MatchCondition.  # noqa: E50190        :rtype: str91        """92        return self._name93 94    @name.setter95    def name(self, name):96        """Sets the name of this V1alpha1MatchCondition.97 98        Name is an identifier for this match condition, used for strategic merging of MatchConditions, as well as providing an identifier for logging purposes. A good name should be descriptive of the associated expression. Name must be a qualified name consisting of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName',  or 'my.name',  or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]') with an optional DNS subdomain prefix and '/' (e.g. 'example.com/MyName')  Required.  # noqa: E50199 100        :param name: The name of this V1alpha1MatchCondition.  # noqa: E501101        :type: str102        """103        if self.local_vars_configuration.client_side_validation and name is None:  # noqa: E501104            raise ValueError("Invalid value for `name`, must not be `None`")  # noqa: E501105 106        self._name = name107 108    def to_dict(self):109        """Returns the model properties as a dict"""110        result = {}111 112        for attr, _ in six.iteritems(self.openapi_types):113            value = getattr(self, attr)114            if isinstance(value, list):115                result[attr] = list(map(116                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,117                    value118                ))119            elif hasattr(value, "to_dict"):120                result[attr] = value.to_dict()121            elif isinstance(value, dict):122                result[attr] = dict(map(123                    lambda item: (item[0], item[1].to_dict())124                    if hasattr(item[1], "to_dict") else item,125                    value.items()126                ))127            else:128                result[attr] = value129 130        return result131 132    def to_str(self):133        """Returns the string representation of the model"""134        return pprint.pformat(self.to_dict())135 136    def __repr__(self):137        """For `print` and `pprint`"""138        return self.to_str()139 140    def __eq__(self, other):141        """Returns true if both objects are equal"""142        if not isinstance(other, V1alpha1MatchCondition):143            return False144 145        return self.to_dict() == other.to_dict()146 147    def __ne__(self, other):148        """Returns true if both objects are not equal"""149        if not isinstance(other, V1alpha1MatchCondition):150            return True151 152        return self.to_dict() != other.to_dict()153 
codekingpro/portable-devtools · Team Ai