1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
|
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.16
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubernetes.client.configuration import Configuration
class V1ValidatingWebhook(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'admission_review_versions': 'list[str]',
'client_config': 'AdmissionregistrationV1WebhookClientConfig',
'failure_policy': 'str',
'match_policy': 'str',
'name': 'str',
'namespace_selector': 'V1LabelSelector',
'object_selector': 'V1LabelSelector',
'rules': 'list[V1RuleWithOperations]',
'side_effects': 'str',
'timeout_seconds': 'int'
}
attribute_map = {
'admission_review_versions': 'admissionReviewVersions',
'client_config': 'clientConfig',
'failure_policy': 'failurePolicy',
'match_policy': 'matchPolicy',
'name': 'name',
'namespace_selector': 'namespaceSelector',
'object_selector': 'objectSelector',
'rules': 'rules',
'side_effects': 'sideEffects',
'timeout_seconds': 'timeoutSeconds'
}
def __init__(self, admission_review_versions=None, client_config=None, failure_policy=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: E501
"""V1ValidatingWebhook - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration
self._admission_review_versions = None
self._client_config = None
self._failure_policy = None
self._match_policy = None
self._name = None
self._namespace_selector = None
self._object_selector = None
self._rules = None
self._side_effects = None
self._timeout_seconds = None
self.discriminator = None
self.admission_review_versions = admission_review_versions
self.client_config = client_config
if failure_policy is not None:
self.failure_policy = failure_policy
if match_policy is not None:
self.match_policy = match_policy
self.name = name
if namespace_selector is not None:
self.namespace_selector = namespace_selector
if object_selector is not None:
self.object_selector = object_selector
if rules is not None:
self.rules = rules
self.side_effects = side_effects
if timeout_seconds is not None:
self.timeout_seconds = timeout_seconds
@property
def admission_review_versions(self):
"""Gets the admission_review_versions of this V1ValidatingWebhook. # noqa: E501
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: E501
:return: The admission_review_versions of this V1ValidatingWebhook. # noqa: E501
:rtype: list[str]
"""
return self._admission_review_versions
@admission_review_versions.setter
def admission_review_versions(self, admission_review_versions):
"""Sets the admission_review_versions of this V1ValidatingWebhook.
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: E501
:param admission_review_versions: The admission_review_versions of this V1ValidatingWebhook. # noqa: E501
:type: list[str]
"""
if self.local_vars_configuration.client_side_validation and admission_review_versions is None: # noqa: E501
raise ValueError("Invalid value for `admission_review_versions`, must not be `None`") # noqa: E501
self._admission_review_versions = admission_review_versions
@property
def client_config(self):
"""Gets the client_config of this V1ValidatingWebhook. # noqa: E501
:return: The client_config of this V1ValidatingWebhook. # noqa: E501
:rtype: AdmissionregistrationV1WebhookClientConfig
"""
return self._client_config
@client_config.setter
def client_config(self, client_config):
"""Sets the client_config of this V1ValidatingWebhook.
:param client_config: The client_config of this V1ValidatingWebhook. # noqa: E501
:type: AdmissionregistrationV1WebhookClientConfig
"""
if self.local_vars_configuration.client_side_validation and client_config is None: # noqa: E501
raise ValueError("Invalid value for `client_config`, must not be `None`") # noqa: E501
self._client_config = client_config
@property
def failure_policy(self):
"""Gets the failure_policy of this V1ValidatingWebhook. # noqa: E501
FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail. # noqa: E501
:return: The failure_policy of this V1ValidatingWebhook. # noqa: E501
:rtype: str
"""
return self._failure_policy
@failure_policy.setter
def failure_policy(self, failure_policy):
"""Sets the failure_policy of this V1ValidatingWebhook.
FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail. # noqa: E501
:param failure_policy: The failure_policy of this V1ValidatingWebhook. # noqa: E501
:type: str
"""
self._failure_policy = failure_policy
@property
def match_policy(self):
"""Gets the match_policy of this V1ValidatingWebhook. # noqa: E501
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: E501
:return: The match_policy of this V1ValidatingWebhook. # noqa: E501
:rtype: str
"""
return self._match_policy
@match_policy.setter
def match_policy(self, match_policy):
"""Sets the match_policy of this V1ValidatingWebhook.
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: E501
:param match_policy: The match_policy of this V1ValidatingWebhook. # noqa: E501
:type: str
"""
self._match_policy = match_policy
@property
def name(self):
"""Gets the name of this V1ValidatingWebhook. # noqa: E501
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: E501
:return: The name of this V1ValidatingWebhook. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this V1ValidatingWebhook.
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: E501
:param name: The name of this V1ValidatingWebhook. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and name is None: # noqa: E501
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501
self._name = name
@property
def namespace_selector(self):
"""Gets the namespace_selector of this V1ValidatingWebhook. # noqa: E501
:return: The namespace_selector of this V1ValidatingWebhook. # noqa: E501
:rtype: V1LabelSelector
"""
return self._namespace_selector
@namespace_selector.setter
def namespace_selector(self, namespace_selector):
"""Sets the namespace_selector of this V1ValidatingWebhook.
:param namespace_selector: The namespace_selector of this V1ValidatingWebhook. # noqa: E501
:type: V1LabelSelector
"""
self._namespace_selector = namespace_selector
@property
def object_selector(self):
"""Gets the object_selector of this V1ValidatingWebhook. # noqa: E501
:return: The object_selector of this V1ValidatingWebhook. # noqa: E501
:rtype: V1LabelSelector
"""
return self._object_selector
@object_selector.setter
def object_selector(self, object_selector):
"""Sets the object_selector of this V1ValidatingWebhook.
:param object_selector: The object_selector of this V1ValidatingWebhook. # noqa: E501
:type: V1LabelSelector
"""
self._object_selector = object_selector
@property
def rules(self):
"""Gets the rules of this V1ValidatingWebhook. # noqa: E501
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: E501
:return: The rules of this V1ValidatingWebhook. # noqa: E501
:rtype: list[V1RuleWithOperations]
"""
return self._rules
@rules.setter
def rules(self, rules):
"""Sets the rules of this V1ValidatingWebhook.
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: E501
:param rules: The rules of this V1ValidatingWebhook. # noqa: E501
:type: list[V1RuleWithOperations]
"""
self._rules = rules
@property
def side_effects(self):
"""Gets the side_effects of this V1ValidatingWebhook. # noqa: E501
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 change 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: E501
:return: The side_effects of this V1ValidatingWebhook. # noqa: E501
:rtype: str
"""
return self._side_effects
@side_effects.setter
def side_effects(self, side_effects):
"""Sets the side_effects of this V1ValidatingWebhook.
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 change 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: E501
:param side_effects: The side_effects of this V1ValidatingWebhook. # noqa: E501
:type: str
"""
if self.local_vars_configuration.client_side_validation and side_effects is None: # noqa: E501
raise ValueError("Invalid value for `side_effects`, must not be `None`") # noqa: E501
self._side_effects = side_effects
@property
def timeout_seconds(self):
"""Gets the timeout_seconds of this V1ValidatingWebhook. # noqa: E501
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: E501
:return: The timeout_seconds of this V1ValidatingWebhook. # noqa: E501
:rtype: int
"""
return self._timeout_seconds
@timeout_seconds.setter
def timeout_seconds(self, timeout_seconds):
"""Sets the timeout_seconds of this V1ValidatingWebhook.
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: E501
:param timeout_seconds: The timeout_seconds of this V1ValidatingWebhook. # noqa: E501
:type: int
"""
self._timeout_seconds = timeout_seconds
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.openapi_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, V1ValidatingWebhook):
return False
return self.to_dict() == other.to_dict()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, V1ValidatingWebhook):
return True
return self.to_dict() != other.to_dict()
|