codekingpro/portable-devtools
114k
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 V1AuditAnnotation(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 'key': 'str',37 'value_expression': 'str'38 }39 40 attribute_map = {41 'key': 'key',42 'value_expression': 'valueExpression'43 }44 45 def __init__(self, key=None, value_expression=None, local_vars_configuration=None): # noqa: E50146 """V1AuditAnnotation - 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._key = None52 self._value_expression = None53 self.discriminator = None54 55 self.key = key56 self.value_expression = value_expression57 58 @property59 def key(self):60 """Gets the key of this V1AuditAnnotation. # noqa: E50161 62 key specifies the audit annotation key. The audit annotation keys of a ValidatingAdmissionPolicy must be unique. The key must be a qualified name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length. The key is combined with the resource name of the ValidatingAdmissionPolicy to construct an audit annotation key: \"{ValidatingAdmissionPolicy name}/{key}\". If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy and the same audit annotation key, the annotation key will be identical. In this case, the first annotation written with the key will be included in the audit event and all subsequent annotations with the same key will be discarded. Required. # noqa: E50163 64 :return: The key of this V1AuditAnnotation. # noqa: E50165 :rtype: str66 """67 return self._key68 69 @key.setter70 def key(self, key):71 """Sets the key of this V1AuditAnnotation.72 73 key specifies the audit annotation key. The audit annotation keys of a ValidatingAdmissionPolicy must be unique. The key must be a qualified name ([A-Za-z0-9][-A-Za-z0-9_.]*) no more than 63 bytes in length. The key is combined with the resource name of the ValidatingAdmissionPolicy to construct an audit annotation key: \"{ValidatingAdmissionPolicy name}/{key}\". If an admission webhook uses the same resource name as this ValidatingAdmissionPolicy and the same audit annotation key, the annotation key will be identical. In this case, the first annotation written with the key will be included in the audit event and all subsequent annotations with the same key will be discarded. Required. # noqa: E50174 75 :param key: The key of this V1AuditAnnotation. # noqa: E50176 :type: str77 """78 if self.local_vars_configuration.client_side_validation and key is None: # noqa: E50179 raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E50180 81 self._key = key82 83 @property84 def value_expression(self):85 """Gets the value_expression of this V1AuditAnnotation. # noqa: E50186 87 valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value. The expression must evaluate to either a string or null value. If the expression evaluates to a string, the audit annotation is included with the string value. If the expression evaluates to null or empty string the audit annotation will be omitted. The valueExpression may be no longer than 5kb in length. If the result of the valueExpression is more than 10kb in length, it will be truncated to 10kb. If multiple ValidatingAdmissionPolicyBinding resources match an API request, then the valueExpression will be evaluated for each binding. All unique values produced by the valueExpressions will be joined together in a comma-separated list. Required. # noqa: E50188 89 :return: The value_expression of this V1AuditAnnotation. # noqa: E50190 :rtype: str91 """92 return self._value_expression93 94 @value_expression.setter95 def value_expression(self, value_expression):96 """Sets the value_expression of this V1AuditAnnotation.97 98 valueExpression represents the expression which is evaluated by CEL to produce an audit annotation value. The expression must evaluate to either a string or null value. If the expression evaluates to a string, the audit annotation is included with the string value. If the expression evaluates to null or empty string the audit annotation will be omitted. The valueExpression may be no longer than 5kb in length. If the result of the valueExpression is more than 10kb in length, it will be truncated to 10kb. If multiple ValidatingAdmissionPolicyBinding resources match an API request, then the valueExpression will be evaluated for each binding. All unique values produced by the valueExpressions will be joined together in a comma-separated list. Required. # noqa: E50199 100 :param value_expression: The value_expression of this V1AuditAnnotation. # noqa: E501101 :type: str102 """103 if self.local_vars_configuration.client_side_validation and value_expression is None: # noqa: E501104 raise ValueError("Invalid value for `value_expression`, must not be `None`") # noqa: E501105 106 self._value_expression = value_expression107 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, V1AuditAnnotation):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, V1AuditAnnotation):150 return True151 152 return self.to_dict() != other.to_dict()153 