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 V1ReplicationControllerSpec(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 = {
31      'min_ready_seconds': 'int',
32      'replicas': 'int',
33      'selector': 'dict(str, str)',
34      'template': 'V1PodTemplateSpec'
35  }
36
37  attribute_map = {
38      'min_ready_seconds': 'minReadySeconds',
39      'replicas': 'replicas',
40      'selector': 'selector',
41      'template': 'template'
42  }
43
44  def __init__(self,
45               min_ready_seconds=None,
46               replicas=None,
47               selector=None,
48               template=None):
49    """
50        V1ReplicationControllerSpec - a model defined in Swagger
51        """
52
53    self._min_ready_seconds = None
54    self._replicas = None
55    self._selector = None
56    self._template = None
57    self.discriminator = None
58
59    if min_ready_seconds is not None:
60      self.min_ready_seconds = min_ready_seconds
61    if replicas is not None:
62      self.replicas = replicas
63    if selector is not None:
64      self.selector = selector
65    if template is not None:
66      self.template = template
67
68  @property
69  def min_ready_seconds(self):
70    """
71        Gets the min_ready_seconds of this V1ReplicationControllerSpec.
72        Minimum number of seconds for which a newly created pod should be ready
73        without any of its container crashing, for it to be considered
74        available. Defaults to 0 (pod will be considered available as soon as it
75        is ready)
76
77        :return: The min_ready_seconds of this V1ReplicationControllerSpec.
78        :rtype: int
79        """
80    return self._min_ready_seconds
81
82  @min_ready_seconds.setter
83  def min_ready_seconds(self, min_ready_seconds):
84    """
85        Sets the min_ready_seconds of this V1ReplicationControllerSpec.
86        Minimum number of seconds for which a newly created pod should be ready
87        without any of its container crashing, for it to be considered
88        available. Defaults to 0 (pod will be considered available as soon as it
89        is ready)
90
91        :param min_ready_seconds: The min_ready_seconds of this
92        V1ReplicationControllerSpec.
93        :type: int
94        """
95
96    self._min_ready_seconds = min_ready_seconds
97
98  @property
99  def replicas(self):
100    """
101        Gets the replicas of this V1ReplicationControllerSpec.
102        Replicas is the number of desired replicas. This is a pointer to
103        distinguish between explicit zero and unspecified. Defaults to 1. More
104        info:
105        https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller
106
107        :return: The replicas of this V1ReplicationControllerSpec.
108        :rtype: int
109        """
110    return self._replicas
111
112  @replicas.setter
113  def replicas(self, replicas):
114    """
115        Sets the replicas of this V1ReplicationControllerSpec.
116        Replicas is the number of desired replicas. This is a pointer to
117        distinguish between explicit zero and unspecified. Defaults to 1. More
118        info:
119        https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller
120
121        :param replicas: The replicas of this V1ReplicationControllerSpec.
122        :type: int
123        """
124
125    self._replicas = replicas
126
127  @property
128  def selector(self):
129    """
130        Gets the selector of this V1ReplicationControllerSpec.
131        Selector is a label query over pods that should match the Replicas
132        count. If Selector is empty, it is defaulted to the labels present on
133        the Pod template. Label keys and values that must match in order to be
134        controlled by this replication controller, if empty defaulted to labels
135        on Pod template. More info:
136        https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
137
138        :return: The selector of this V1ReplicationControllerSpec.
139        :rtype: dict(str, str)
140        """
141    return self._selector
142
143  @selector.setter
144  def selector(self, selector):
145    """
146        Sets the selector of this V1ReplicationControllerSpec.
147        Selector is a label query over pods that should match the Replicas
148        count. If Selector is empty, it is defaulted to the labels present on
149        the Pod template. Label keys and values that must match in order to be
150        controlled by this replication controller, if empty defaulted to labels
151        on Pod template. More info:
152        https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
153
154        :param selector: The selector of this V1ReplicationControllerSpec.
155        :type: dict(str, str)
156        """
157
158    self._selector = selector
159
160  @property
161  def template(self):
162    """
163        Gets the template of this V1ReplicationControllerSpec.
164        Template is the object that describes the pod that will be created if
165        insufficient replicas are detected. This takes precedence over a
166        TemplateRef. More info:
167        https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
168
169        :return: The template of this V1ReplicationControllerSpec.
170        :rtype: V1PodTemplateSpec
171        """
172    return self._template
173
174  @template.setter
175  def template(self, template):
176    """
177        Sets the template of this V1ReplicationControllerSpec.
178        Template is the object that describes the pod that will be created if
179        insufficient replicas are detected. This takes precedence over a
180        TemplateRef. More info:
181        https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
182
183        :param template: The template of this V1ReplicationControllerSpec.
184        :type: V1PodTemplateSpec
185        """
186
187    self._template = template
188
189  def to_dict(self):
190    """
191        Returns the model properties as a dict
192        """
193    result = {}
194
195    for attr, _ in iteritems(self.swagger_types):
196      value = getattr(self, attr)
197      if isinstance(value, list):
198        result[attr] = list(
199            map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x, value))
200      elif hasattr(value, 'to_dict'):
201        result[attr] = value.to_dict()
202      elif isinstance(value, dict):
203        result[attr] = dict(
204            map(
205                lambda item: (item[0], item[1].to_dict())
206                if hasattr(item[1], 'to_dict') else item, value.items()))
207      else:
208        result[attr] = value
209
210    return result
211
212  def to_str(self):
213    """
214        Returns the string representation of the model
215        """
216    return pformat(self.to_dict())
217
218  def __repr__(self):
219    """
220        For `print` and `pprint`
221        """
222    return self.to_str()
223
224  def __eq__(self, other):
225    """
226        Returns true if both objects are equal
227        """
228    if not isinstance(other, V1ReplicationControllerSpec):
229      return False
230
231    return self.__dict__ == other.__dict__
232
233  def __ne__(self, other):
234    """
235        Returns true if both objects are not equal
236        """
237    return not self == other
238