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 V1PodFailurePolicyRule(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 'action': 'str',37 'on_exit_codes': 'V1PodFailurePolicyOnExitCodesRequirement',38 'on_pod_conditions': 'list[V1PodFailurePolicyOnPodConditionsPattern]'39 }40 41 attribute_map = {42 'action': 'action',43 'on_exit_codes': 'onExitCodes',44 'on_pod_conditions': 'onPodConditions'45 }46 47 def __init__(self, action=None, on_exit_codes=None, on_pod_conditions=None, local_vars_configuration=None): # noqa: E50148 """V1PodFailurePolicyRule - a model defined in OpenAPI""" # noqa: E50149 if local_vars_configuration is None:50 local_vars_configuration = Configuration()51 self.local_vars_configuration = local_vars_configuration52 53 self._action = None54 self._on_exit_codes = None55 self._on_pod_conditions = None56 self.discriminator = None57 58 self.action = action59 if on_exit_codes is not None:60 self.on_exit_codes = on_exit_codes61 if on_pod_conditions is not None:62 self.on_pod_conditions = on_pod_conditions63 64 @property65 def action(self):66 """Gets the action of this V1PodFailurePolicyRule. # noqa: E50167 68 Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are: - FailJob: indicates that the pod's job is marked as Failed and all running pods are terminated. - FailIndex: indicates that the pod's index is marked as Failed and will not be restarted. - Ignore: indicates that the counter towards the .backoffLimit is not incremented and a replacement pod is created. - Count: indicates that the pod is handled in the default way - the counter towards the .backoffLimit is incremented. Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule. # noqa: E50169 70 :return: The action of this V1PodFailurePolicyRule. # noqa: E50171 :rtype: str72 """73 return self._action74 75 @action.setter76 def action(self, action):77 """Sets the action of this V1PodFailurePolicyRule.78 79 Specifies the action taken on a pod failure when the requirements are satisfied. Possible values are: - FailJob: indicates that the pod's job is marked as Failed and all running pods are terminated. - FailIndex: indicates that the pod's index is marked as Failed and will not be restarted. - Ignore: indicates that the counter towards the .backoffLimit is not incremented and a replacement pod is created. - Count: indicates that the pod is handled in the default way - the counter towards the .backoffLimit is incremented. Additional values are considered to be added in the future. Clients should react to an unknown action by skipping the rule. # noqa: E50180 81 :param action: The action of this V1PodFailurePolicyRule. # noqa: E50182 :type: str83 """84 if self.local_vars_configuration.client_side_validation and action is None: # noqa: E50185 raise ValueError("Invalid value for `action`, must not be `None`") # noqa: E50186 87 self._action = action88 89 @property90 def on_exit_codes(self):91 """Gets the on_exit_codes of this V1PodFailurePolicyRule. # noqa: E50192 93 94 :return: The on_exit_codes of this V1PodFailurePolicyRule. # noqa: E50195 :rtype: V1PodFailurePolicyOnExitCodesRequirement96 """97 return self._on_exit_codes98 99 @on_exit_codes.setter100 def on_exit_codes(self, on_exit_codes):101 """Sets the on_exit_codes of this V1PodFailurePolicyRule.102 103 104 :param on_exit_codes: The on_exit_codes of this V1PodFailurePolicyRule. # noqa: E501105 :type: V1PodFailurePolicyOnExitCodesRequirement106 """107 108 self._on_exit_codes = on_exit_codes109 110 @property111 def on_pod_conditions(self):112 """Gets the on_pod_conditions of this V1PodFailurePolicyRule. # noqa: E501113 114 Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed. # noqa: E501115 116 :return: The on_pod_conditions of this V1PodFailurePolicyRule. # noqa: E501117 :rtype: list[V1PodFailurePolicyOnPodConditionsPattern]118 """119 return self._on_pod_conditions120 121 @on_pod_conditions.setter122 def on_pod_conditions(self, on_pod_conditions):123 """Sets the on_pod_conditions of this V1PodFailurePolicyRule.124 125 Represents the requirement on the pod conditions. The requirement is represented as a list of pod condition patterns. The requirement is satisfied if at least one pattern matches an actual pod condition. At most 20 elements are allowed. # noqa: E501126 127 :param on_pod_conditions: The on_pod_conditions of this V1PodFailurePolicyRule. # noqa: E501128 :type: list[V1PodFailurePolicyOnPodConditionsPattern]129 """130 131 self._on_pod_conditions = on_pod_conditions132 133 def to_dict(self):134 """Returns the model properties as a dict"""135 result = {}136 137 for attr, _ in six.iteritems(self.openapi_types):138 value = getattr(self, attr)139 if isinstance(value, list):140 result[attr] = list(map(141 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,142 value143 ))144 elif hasattr(value, "to_dict"):145 result[attr] = value.to_dict()146 elif isinstance(value, dict):147 result[attr] = dict(map(148 lambda item: (item[0], item[1].to_dict())149 if hasattr(item[1], "to_dict") else item,150 value.items()151 ))152 else:153 result[attr] = value154 155 return result156 157 def to_str(self):158 """Returns the string representation of the model"""159 return pprint.pformat(self.to_dict())160 161 def __repr__(self):162 """For `print` and `pprint`"""163 return self.to_str()164 165 def __eq__(self, other):166 """Returns true if both objects are equal"""167 if not isinstance(other, V1PodFailurePolicyRule):168 return False169 170 return self.to_dict() == other.to_dict()171 172 def __ne__(self, other):173 """Returns true if both objects are not equal"""174 if not isinstance(other, V1PodFailurePolicyRule):175 return True176 177 return self.to_dict() != other.to_dict()178 