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 V1ValidatingWebhook(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 'admission_review_versions': 'list[str]',37 'client_config': 'AdmissionregistrationV1WebhookClientConfig',38 'failure_policy': 'str',39 'match_conditions': 'list[V1MatchCondition]',40 'match_policy': 'str',41 'name': 'str',42 'namespace_selector': 'V1LabelSelector',43 'object_selector': 'V1LabelSelector',44 'rules': 'list[V1RuleWithOperations]',45 'side_effects': 'str',46 'timeout_seconds': 'int'47 }48 49 attribute_map = {50 'admission_review_versions': 'admissionReviewVersions',51 'client_config': 'clientConfig',52 'failure_policy': 'failurePolicy',53 'match_conditions': 'matchConditions',54 'match_policy': 'matchPolicy',55 'name': 'name',56 'namespace_selector': 'namespaceSelector',57 'object_selector': 'objectSelector',58 'rules': 'rules',59 'side_effects': 'sideEffects',60 'timeout_seconds': 'timeoutSeconds'61 }62 63 def __init__(self, admission_review_versions=None, client_config=None, failure_policy=None, match_conditions=None, match_policy=None, name=None, namespace_selector=None, object_selector=None, rules=None, side_effects=None, timeout_seconds=None, local_vars_configuration=None): # noqa: E50164 """V1ValidatingWebhook - a model defined in OpenAPI""" # noqa: E50165 if local_vars_configuration is None:66 local_vars_configuration = Configuration()67 self.local_vars_configuration = local_vars_configuration68 69 self._admission_review_versions = None70 self._client_config = None71 self._failure_policy = None72 self._match_conditions = None73 self._match_policy = None74 self._name = None75 self._namespace_selector = None76 self._object_selector = None77 self._rules = None78 self._side_effects = None79 self._timeout_seconds = None80 self.discriminator = None81 82 self.admission_review_versions = admission_review_versions83 self.client_config = client_config84 if failure_policy is not None:85 self.failure_policy = failure_policy86 if match_conditions is not None:87 self.match_conditions = match_conditions88 if match_policy is not None:89 self.match_policy = match_policy90 self.name = name91 if namespace_selector is not None:92 self.namespace_selector = namespace_selector93 if object_selector is not None:94 self.object_selector = object_selector95 if rules is not None:96 self.rules = rules97 self.side_effects = side_effects98 if timeout_seconds is not None:99 self.timeout_seconds = timeout_seconds100 101 @property102 def admission_review_versions(self):103 """Gets the admission_review_versions of this V1ValidatingWebhook. # noqa: E501104 105 AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. # noqa: E501106 107 :return: The admission_review_versions of this V1ValidatingWebhook. # noqa: E501108 :rtype: list[str]109 """110 return self._admission_review_versions111 112 @admission_review_versions.setter113 def admission_review_versions(self, admission_review_versions):114 """Sets the admission_review_versions of this V1ValidatingWebhook.115 116 AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy. # noqa: E501117 118 :param admission_review_versions: The admission_review_versions of this V1ValidatingWebhook. # noqa: E501119 :type: list[str]120 """121 if self.local_vars_configuration.client_side_validation and admission_review_versions is None: # noqa: E501122 raise ValueError("Invalid value for `admission_review_versions`, must not be `None`") # noqa: E501123 124 self._admission_review_versions = admission_review_versions125 126 @property127 def client_config(self):128 """Gets the client_config of this V1ValidatingWebhook. # noqa: E501129 130 131 :return: The client_config of this V1ValidatingWebhook. # noqa: E501132 :rtype: AdmissionregistrationV1WebhookClientConfig133 """134 return self._client_config135 136 @client_config.setter137 def client_config(self, client_config):138 """Sets the client_config of this V1ValidatingWebhook.139 140 141 :param client_config: The client_config of this V1ValidatingWebhook. # noqa: E501142 :type: AdmissionregistrationV1WebhookClientConfig143 """144 if self.local_vars_configuration.client_side_validation and client_config is None: # noqa: E501145 raise ValueError("Invalid value for `client_config`, must not be `None`") # noqa: E501146 147 self._client_config = client_config148 149 @property150 def failure_policy(self):151 """Gets the failure_policy of this V1ValidatingWebhook. # noqa: E501152 153 FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail. # noqa: E501154 155 :return: The failure_policy of this V1ValidatingWebhook. # noqa: E501156 :rtype: str157 """158 return self._failure_policy159 160 @failure_policy.setter161 def failure_policy(self, failure_policy):162 """Sets the failure_policy of this V1ValidatingWebhook.163 164 FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail. # noqa: E501165 166 :param failure_policy: The failure_policy of this V1ValidatingWebhook. # noqa: E501167 :type: str168 """169 170 self._failure_policy = failure_policy171 172 @property173 def match_conditions(self):174 """Gets the match_conditions of this V1ValidatingWebhook. # noqa: E501175 176 MatchConditions is a list of conditions that must be met for a request to be sent to this webhook. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed. The exact matching logic is (in order): 1. If ANY matchCondition evaluates to FALSE, the webhook is skipped. 2. If ALL matchConditions evaluate to TRUE, the webhook is called. 3. If any matchCondition evaluates to an error (but none are FALSE): - If failurePolicy=Fail, reject the request - If failurePolicy=Ignore, the error is ignored and the webhook is skipped # noqa: E501177 178 :return: The match_conditions of this V1ValidatingWebhook. # noqa: E501179 :rtype: list[V1MatchCondition]180 """181 return self._match_conditions182 183 @match_conditions.setter184 def match_conditions(self, match_conditions):185 """Sets the match_conditions of this V1ValidatingWebhook.186 187 MatchConditions is a list of conditions that must be met for a request to be sent to this webhook. Match conditions filter requests that have already been matched by the rules, namespaceSelector, and objectSelector. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed. The exact matching logic is (in order): 1. If ANY matchCondition evaluates to FALSE, the webhook is skipped. 2. If ALL matchConditions evaluate to TRUE, the webhook is called. 3. If any matchCondition evaluates to an error (but none are FALSE): - If failurePolicy=Fail, reject the request - If failurePolicy=Ignore, the error is ignored and the webhook is skipped # noqa: E501188 189 :param match_conditions: The match_conditions of this V1ValidatingWebhook. # noqa: E501190 :type: list[V1MatchCondition]191 """192 193 self._match_conditions = match_conditions194 195 @property196 def match_policy(self):197 """Gets the match_policy of this V1ValidatingWebhook. # noqa: E501198 199 matchPolicy defines how the \"rules\" 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 webhook. - 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 webhook. Defaults to \"Equivalent\" # noqa: E501200 201 :return: The match_policy of this V1ValidatingWebhook. # noqa: E501202 :rtype: str203 """204 return self._match_policy205 206 @match_policy.setter207 def match_policy(self, match_policy):208 """Sets the match_policy of this V1ValidatingWebhook.209 210 matchPolicy defines how the \"rules\" 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 webhook. - 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 webhook. Defaults to \"Equivalent\" # noqa: E501211 212 :param match_policy: The match_policy of this V1ValidatingWebhook. # noqa: E501213 :type: str214 """215 216 self._match_policy = match_policy217 218 @property219 def name(self):220 """Gets the name of this V1ValidatingWebhook. # noqa: E501221 222 The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required. # noqa: E501223 224 :return: The name of this V1ValidatingWebhook. # noqa: E501225 :rtype: str226 """227 return self._name228 229 @name.setter230 def name(self, name):231 """Sets the name of this V1ValidatingWebhook.232 233 The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required. # noqa: E501234 235 :param name: The name of this V1ValidatingWebhook. # noqa: E501236 :type: str237 """238 if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501239 raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501240 241 self._name = name242 243 @property244 def namespace_selector(self):245 """Gets the namespace_selector of this V1ValidatingWebhook. # noqa: E501246 247 248 :return: The namespace_selector of this V1ValidatingWebhook. # noqa: E501249 :rtype: V1LabelSelector250 """251 return self._namespace_selector252 253 @namespace_selector.setter254 def namespace_selector(self, namespace_selector):255 """Sets the namespace_selector of this V1ValidatingWebhook.256 257 258 :param namespace_selector: The namespace_selector of this V1ValidatingWebhook. # noqa: E501259 :type: V1LabelSelector260 """261 262 self._namespace_selector = namespace_selector263 264 @property265 def object_selector(self):266 """Gets the object_selector of this V1ValidatingWebhook. # noqa: E501267 268 269 :return: The object_selector of this V1ValidatingWebhook. # noqa: E501270 :rtype: V1LabelSelector271 """272 return self._object_selector273 274 @object_selector.setter275 def object_selector(self, object_selector):276 """Sets the object_selector of this V1ValidatingWebhook.277 278 279 :param object_selector: The object_selector of this V1ValidatingWebhook. # noqa: E501280 :type: V1LabelSelector281 """282 283 self._object_selector = object_selector284 285 @property286 def rules(self):287 """Gets the rules of this V1ValidatingWebhook. # noqa: E501288 289 Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. # noqa: E501290 291 :return: The rules of this V1ValidatingWebhook. # noqa: E501292 :rtype: list[V1RuleWithOperations]293 """294 return self._rules295 296 @rules.setter297 def rules(self, rules):298 """Sets the rules of this V1ValidatingWebhook.299 300 Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects. # noqa: E501301 302 :param rules: The rules of this V1ValidatingWebhook. # noqa: E501303 :type: list[V1RuleWithOperations]304 """305 306 self._rules = rules307 308 @property309 def side_effects(self):310 """Gets the side_effects of this V1ValidatingWebhook. # noqa: E501311 312 SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission chain and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. # noqa: E501313 314 :return: The side_effects of this V1ValidatingWebhook. # noqa: E501315 :rtype: str316 """317 return self._side_effects318 319 @side_effects.setter320 def side_effects(self, side_effects):321 """Sets the side_effects of this V1ValidatingWebhook.322 323 SideEffects states whether this webhook has side effects. Acceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown). Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission chain and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. # noqa: E501324 325 :param side_effects: The side_effects of this V1ValidatingWebhook. # noqa: E501326 :type: str327 """328 if self.local_vars_configuration.client_side_validation and side_effects is None: # noqa: E501329 raise ValueError("Invalid value for `side_effects`, must not be `None`") # noqa: E501330 331 self._side_effects = side_effects332 333 @property334 def timeout_seconds(self):335 """Gets the timeout_seconds of this V1ValidatingWebhook. # noqa: E501336 337 TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. # noqa: E501338 339 :return: The timeout_seconds of this V1ValidatingWebhook. # noqa: E501340 :rtype: int341 """342 return self._timeout_seconds343 344 @timeout_seconds.setter345 def timeout_seconds(self, timeout_seconds):346 """Sets the timeout_seconds of this V1ValidatingWebhook.347 348 TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds. # noqa: E501349 350 :param timeout_seconds: The timeout_seconds of this V1ValidatingWebhook. # noqa: E501351 :type: int352 """353 354 self._timeout_seconds = timeout_seconds355 356 def to_dict(self):357 """Returns the model properties as a dict"""358 result = {}359 360 for attr, _ in six.iteritems(self.openapi_types):361 value = getattr(self, attr)362 if isinstance(value, list):363 result[attr] = list(map(364 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,365 value366 ))367 elif hasattr(value, "to_dict"):368 result[attr] = value.to_dict()369 elif isinstance(value, dict):370 result[attr] = dict(map(371 lambda item: (item[0], item[1].to_dict())372 if hasattr(item[1], "to_dict") else item,373 value.items()374 ))375 else:376 result[attr] = value377 378 return result379 380 def to_str(self):381 """Returns the string representation of the model"""382 return pprint.pformat(self.to_dict())383 384 def __repr__(self):385 """For `print` and `pprint`"""386 return self.to_str()387 388 def __eq__(self, other):389 """Returns true if both objects are equal"""390 if not isinstance(other, V1ValidatingWebhook):391 return False392 393 return self.to_dict() == other.to_dict()394 395 def __ne__(self, other):396 """Returns true if both objects are not equal"""397 if not isinstance(other, V1ValidatingWebhook):398 return True399 400 return self.to_dict() != other.to_dict()401 