1# coding: utf-8
2"""
3    Kubernetes
4
5    No description provided (generated by Swagger Codegen
6    https://github.com/swagger-api/swagger-codegen)
7
8    OpenAPI spec version: v1.14.4
9
10    Generated by: https://github.com/swagger-api/swagger-codegen.git
11"""
12
13from pprint import pformat
14from six import iteritems
15import re
16
17
18class V1WeightedPodAffinityTerm(object):
19  """
20    NOTE: This class is auto generated by the swagger code generator program.
21    Do not edit the class manually.
22    """
23  """
24    Attributes:
25      swagger_types (dict): The key is attribute name and the value is attribute
26        type.
27      attribute_map (dict): The key is attribute name and the value is json key
28        in definition.
29  """
30  swagger_types = {'pod_affinity_term': 'V1PodAffinityTerm', 'weight': 'int'}
31
32  attribute_map = {'pod_affinity_term': 'podAffinityTerm', 'weight': 'weight'}
33
34  def __init__(self, pod_affinity_term=None, weight=None):
35    """
36        V1WeightedPodAffinityTerm - a model defined in Swagger
37        """
38
39    self._pod_affinity_term = None
40    self._weight = None
41    self.discriminator = None
42
43    self.pod_affinity_term = pod_affinity_term
44    self.weight = weight
45
46  @property
47  def pod_affinity_term(self):
48    """
49        Gets the pod_affinity_term of this V1WeightedPodAffinityTerm.
50        Required. A pod affinity term, associated with the corresponding weight.
51
52        :return: The pod_affinity_term of this V1WeightedPodAffinityTerm.
53        :rtype: V1PodAffinityTerm
54        """
55    return self._pod_affinity_term
56
57  @pod_affinity_term.setter
58  def pod_affinity_term(self, pod_affinity_term):
59    """
60        Sets the pod_affinity_term of this V1WeightedPodAffinityTerm.
61        Required. A pod affinity term, associated with the corresponding weight.
62
63        :param pod_affinity_term: The pod_affinity_term of this
64        V1WeightedPodAffinityTerm.
65        :type: V1PodAffinityTerm
66        """
67    if pod_affinity_term is None:
68      raise ValueError(
69          'Invalid value for `pod_affinity_term`, must not be `None`')
70
71    self._pod_affinity_term = pod_affinity_term
72
73  @property
74  def weight(self):
75    """
76        Gets the weight of this V1WeightedPodAffinityTerm.
77        weight associated with matching the corresponding podAffinityTerm, in
78        the range 1-100.
79
80        :return: The weight of this V1WeightedPodAffinityTerm.
81        :rtype: int
82        """
83    return self._weight
84
85  @weight.setter
86  def weight(self, weight):
87    """
88        Sets the weight of this V1WeightedPodAffinityTerm.
89        weight associated with matching the corresponding podAffinityTerm, in
90        the range 1-100.
91
92        :param weight: The weight of this V1WeightedPodAffinityTerm.
93        :type: int
94        """
95    if weight is None:
96      raise ValueError('Invalid value for `weight`, must not be `None`')
97
98    self._weight = weight
99
100  def to_dict(self):
101    """
102        Returns the model properties as a dict
103        """
104    result = {}
105
106    for attr, _ in iteritems(self.swagger_types):
107      value = getattr(self, attr)
108      if isinstance(value, list):
109        result[attr] = list(
110            map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x, value))
111      elif hasattr(value, 'to_dict'):
112        result[attr] = value.to_dict()
113      elif isinstance(value, dict):
114        result[attr] = dict(
115            map(
116                lambda item: (item[0], item[1].to_dict())
117                if hasattr(item[1], 'to_dict') else item, value.items()))
118      else:
119        result[attr] = value
120
121    return result
122
123  def to_str(self):
124    """
125        Returns the string representation of the model
126        """
127    return pformat(self.to_dict())
128
129  def __repr__(self):
130    """
131        For `print` and `pprint`
132        """
133    return self.to_str()
134
135  def __eq__(self, other):
136    """
137        Returns true if both objects are equal
138        """
139    if not isinstance(other, V1WeightedPodAffinityTerm):
140      return False
141
142    return self.__dict__ == other.__dict__
143
144  def __ne__(self, other):
145    """
146        Returns true if both objects are not equal
147        """
148    return not self == other
149