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 V1LeaseSpec(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 'acquire_time': 'datetime',37 'holder_identity': 'str',38 'lease_duration_seconds': 'int',39 'lease_transitions': 'int',40 'preferred_holder': 'str',41 'renew_time': 'datetime',42 'strategy': 'str'43 }44 45 attribute_map = {46 'acquire_time': 'acquireTime',47 'holder_identity': 'holderIdentity',48 'lease_duration_seconds': 'leaseDurationSeconds',49 'lease_transitions': 'leaseTransitions',50 'preferred_holder': 'preferredHolder',51 'renew_time': 'renewTime',52 'strategy': 'strategy'53 }54 55 def __init__(self, acquire_time=None, holder_identity=None, lease_duration_seconds=None, lease_transitions=None, preferred_holder=None, renew_time=None, strategy=None, local_vars_configuration=None): # noqa: E50156 """V1LeaseSpec - a model defined in OpenAPI""" # noqa: E50157 if local_vars_configuration is None:58 local_vars_configuration = Configuration()59 self.local_vars_configuration = local_vars_configuration60 61 self._acquire_time = None62 self._holder_identity = None63 self._lease_duration_seconds = None64 self._lease_transitions = None65 self._preferred_holder = None66 self._renew_time = None67 self._strategy = None68 self.discriminator = None69 70 if acquire_time is not None:71 self.acquire_time = acquire_time72 if holder_identity is not None:73 self.holder_identity = holder_identity74 if lease_duration_seconds is not None:75 self.lease_duration_seconds = lease_duration_seconds76 if lease_transitions is not None:77 self.lease_transitions = lease_transitions78 if preferred_holder is not None:79 self.preferred_holder = preferred_holder80 if renew_time is not None:81 self.renew_time = renew_time82 if strategy is not None:83 self.strategy = strategy84 85 @property86 def acquire_time(self):87 """Gets the acquire_time of this V1LeaseSpec. # noqa: E50188 89 acquireTime is a time when the current lease was acquired. # noqa: E50190 91 :return: The acquire_time of this V1LeaseSpec. # noqa: E50192 :rtype: datetime93 """94 return self._acquire_time95 96 @acquire_time.setter97 def acquire_time(self, acquire_time):98 """Sets the acquire_time of this V1LeaseSpec.99 100 acquireTime is a time when the current lease was acquired. # noqa: E501101 102 :param acquire_time: The acquire_time of this V1LeaseSpec. # noqa: E501103 :type: datetime104 """105 106 self._acquire_time = acquire_time107 108 @property109 def holder_identity(self):110 """Gets the holder_identity of this V1LeaseSpec. # noqa: E501111 112 holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field. # noqa: E501113 114 :return: The holder_identity of this V1LeaseSpec. # noqa: E501115 :rtype: str116 """117 return self._holder_identity118 119 @holder_identity.setter120 def holder_identity(self, holder_identity):121 """Sets the holder_identity of this V1LeaseSpec.122 123 holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field. # noqa: E501124 125 :param holder_identity: The holder_identity of this V1LeaseSpec. # noqa: E501126 :type: str127 """128 129 self._holder_identity = holder_identity130 131 @property132 def lease_duration_seconds(self):133 """Gets the lease_duration_seconds of this V1LeaseSpec. # noqa: E501134 135 leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measured against the time of last observed renewTime. # noqa: E501136 137 :return: The lease_duration_seconds of this V1LeaseSpec. # noqa: E501138 :rtype: int139 """140 return self._lease_duration_seconds141 142 @lease_duration_seconds.setter143 def lease_duration_seconds(self, lease_duration_seconds):144 """Sets the lease_duration_seconds of this V1LeaseSpec.145 146 leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measured against the time of last observed renewTime. # noqa: E501147 148 :param lease_duration_seconds: The lease_duration_seconds of this V1LeaseSpec. # noqa: E501149 :type: int150 """151 152 self._lease_duration_seconds = lease_duration_seconds153 154 @property155 def lease_transitions(self):156 """Gets the lease_transitions of this V1LeaseSpec. # noqa: E501157 158 leaseTransitions is the number of transitions of a lease between holders. # noqa: E501159 160 :return: The lease_transitions of this V1LeaseSpec. # noqa: E501161 :rtype: int162 """163 return self._lease_transitions164 165 @lease_transitions.setter166 def lease_transitions(self, lease_transitions):167 """Sets the lease_transitions of this V1LeaseSpec.168 169 leaseTransitions is the number of transitions of a lease between holders. # noqa: E501170 171 :param lease_transitions: The lease_transitions of this V1LeaseSpec. # noqa: E501172 :type: int173 """174 175 self._lease_transitions = lease_transitions176 177 @property178 def preferred_holder(self):179 """Gets the preferred_holder of this V1LeaseSpec. # noqa: E501180 181 PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set. # noqa: E501182 183 :return: The preferred_holder of this V1LeaseSpec. # noqa: E501184 :rtype: str185 """186 return self._preferred_holder187 188 @preferred_holder.setter189 def preferred_holder(self, preferred_holder):190 """Sets the preferred_holder of this V1LeaseSpec.191 192 PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set. # noqa: E501193 194 :param preferred_holder: The preferred_holder of this V1LeaseSpec. # noqa: E501195 :type: str196 """197 198 self._preferred_holder = preferred_holder199 200 @property201 def renew_time(self):202 """Gets the renew_time of this V1LeaseSpec. # noqa: E501203 204 renewTime is a time when the current holder of a lease has last updated the lease. # noqa: E501205 206 :return: The renew_time of this V1LeaseSpec. # noqa: E501207 :rtype: datetime208 """209 return self._renew_time210 211 @renew_time.setter212 def renew_time(self, renew_time):213 """Sets the renew_time of this V1LeaseSpec.214 215 renewTime is a time when the current holder of a lease has last updated the lease. # noqa: E501216 217 :param renew_time: The renew_time of this V1LeaseSpec. # noqa: E501218 :type: datetime219 """220 221 self._renew_time = renew_time222 223 @property224 def strategy(self):225 """Gets the strategy of this V1LeaseSpec. # noqa: E501226 227 Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. # noqa: E501228 229 :return: The strategy of this V1LeaseSpec. # noqa: E501230 :rtype: str231 """232 return self._strategy233 234 @strategy.setter235 def strategy(self, strategy):236 """Sets the strategy of this V1LeaseSpec.237 238 Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. # noqa: E501239 240 :param strategy: The strategy of this V1LeaseSpec. # noqa: E501241 :type: str242 """243 244 self._strategy = strategy245 246 def to_dict(self):247 """Returns the model properties as a dict"""248 result = {}249 250 for attr, _ in six.iteritems(self.openapi_types):251 value = getattr(self, attr)252 if isinstance(value, list):253 result[attr] = list(map(254 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,255 value256 ))257 elif hasattr(value, "to_dict"):258 result[attr] = value.to_dict()259 elif isinstance(value, dict):260 result[attr] = dict(map(261 lambda item: (item[0], item[1].to_dict())262 if hasattr(item[1], "to_dict") else item,263 value.items()264 ))265 else:266 result[attr] = value267 268 return result269 270 def to_str(self):271 """Returns the string representation of the model"""272 return pprint.pformat(self.to_dict())273 274 def __repr__(self):275 """For `print` and `pprint`"""276 return self.to_str()277 278 def __eq__(self, other):279 """Returns true if both objects are equal"""280 if not isinstance(other, V1LeaseSpec):281 return False282 283 return self.to_dict() == other.to_dict()284 285 def __ne__(self, other):286 """Returns true if both objects are not equal"""287 if not isinstance(other, V1LeaseSpec):288 return True289 290 return self.to_dict() != other.to_dict()291 