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 V1NodeAffinity(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 'preferred_during_scheduling_ignored_during_execution': 'list[V1PreferredSchedulingTerm]',37 'required_during_scheduling_ignored_during_execution': 'V1NodeSelector'38 }39 40 attribute_map = {41 'preferred_during_scheduling_ignored_during_execution': 'preferredDuringSchedulingIgnoredDuringExecution',42 'required_during_scheduling_ignored_during_execution': 'requiredDuringSchedulingIgnoredDuringExecution'43 }44 45 def __init__(self, preferred_during_scheduling_ignored_during_execution=None, required_during_scheduling_ignored_during_execution=None, local_vars_configuration=None): # noqa: E50146 """V1NodeAffinity - 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._preferred_during_scheduling_ignored_during_execution = None52 self._required_during_scheduling_ignored_during_execution = None53 self.discriminator = None54 55 if preferred_during_scheduling_ignored_during_execution is not None:56 self.preferred_during_scheduling_ignored_during_execution = preferred_during_scheduling_ignored_during_execution57 if required_during_scheduling_ignored_during_execution is not None:58 self.required_during_scheduling_ignored_during_execution = required_during_scheduling_ignored_during_execution59 60 @property61 def preferred_during_scheduling_ignored_during_execution(self):62 """Gets the preferred_during_scheduling_ignored_during_execution of this V1NodeAffinity. # noqa: E50163 64 The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. # noqa: E50165 66 :return: The preferred_during_scheduling_ignored_during_execution of this V1NodeAffinity. # noqa: E50167 :rtype: list[V1PreferredSchedulingTerm]68 """69 return self._preferred_during_scheduling_ignored_during_execution70 71 @preferred_during_scheduling_ignored_during_execution.setter72 def preferred_during_scheduling_ignored_during_execution(self, preferred_during_scheduling_ignored_during_execution):73 """Sets the preferred_during_scheduling_ignored_during_execution of this V1NodeAffinity.74 75 The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. # noqa: E50176 77 :param preferred_during_scheduling_ignored_during_execution: The preferred_during_scheduling_ignored_during_execution of this V1NodeAffinity. # noqa: E50178 :type: list[V1PreferredSchedulingTerm]79 """80 81 self._preferred_during_scheduling_ignored_during_execution = preferred_during_scheduling_ignored_during_execution82 83 @property84 def required_during_scheduling_ignored_during_execution(self):85 """Gets the required_during_scheduling_ignored_during_execution of this V1NodeAffinity. # noqa: E50186 87 88 :return: The required_during_scheduling_ignored_during_execution of this V1NodeAffinity. # noqa: E50189 :rtype: V1NodeSelector90 """91 return self._required_during_scheduling_ignored_during_execution92 93 @required_during_scheduling_ignored_during_execution.setter94 def required_during_scheduling_ignored_during_execution(self, required_during_scheduling_ignored_during_execution):95 """Sets the required_during_scheduling_ignored_during_execution of this V1NodeAffinity.96 97 98 :param required_during_scheduling_ignored_during_execution: The required_during_scheduling_ignored_during_execution of this V1NodeAffinity. # noqa: E50199 :type: V1NodeSelector100 """101 102 self._required_during_scheduling_ignored_during_execution = required_during_scheduling_ignored_during_execution103 104 def to_dict(self):105 """Returns the model properties as a dict"""106 result = {}107 108 for attr, _ in six.iteritems(self.openapi_types):109 value = getattr(self, attr)110 if isinstance(value, list):111 result[attr] = list(map(112 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,113 value114 ))115 elif hasattr(value, "to_dict"):116 result[attr] = value.to_dict()117 elif isinstance(value, dict):118 result[attr] = dict(map(119 lambda item: (item[0], item[1].to_dict())120 if hasattr(item[1], "to_dict") else item,121 value.items()122 ))123 else:124 result[attr] = value125 126 return result127 128 def to_str(self):129 """Returns the string representation of the model"""130 return pprint.pformat(self.to_dict())131 132 def __repr__(self):133 """For `print` and `pprint`"""134 return self.to_str()135 136 def __eq__(self, other):137 """Returns true if both objects are equal"""138 if not isinstance(other, V1NodeAffinity):139 return False140 141 return self.to_dict() == other.to_dict()142 143 def __ne__(self, other):144 """Returns true if both objects are not equal"""145 if not isinstance(other, V1NodeAffinity):146 return True147 148 return self.to_dict() != other.to_dict()149 