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 V1ContainerStatus(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      'container_id': 'str',
32      'image': 'str',
33      'image_id': 'str',
34      'last_state': 'V1ContainerState',
35      'name': 'str',
36      'ready': 'bool',
37      'restart_count': 'int',
38      'state': 'V1ContainerState'
39  }
40
41  attribute_map = {
42      'container_id': 'containerID',
43      'image': 'image',
44      'image_id': 'imageID',
45      'last_state': 'lastState',
46      'name': 'name',
47      'ready': 'ready',
48      'restart_count': 'restartCount',
49      'state': 'state'
50  }
51
52  def __init__(self,
53               container_id=None,
54               image=None,
55               image_id=None,
56               last_state=None,
57               name=None,
58               ready=None,
59               restart_count=None,
60               state=None):
61    """
62        V1ContainerStatus - a model defined in Swagger
63        """
64
65    self._container_id = None
66    self._image = None
67    self._image_id = None
68    self._last_state = None
69    self._name = None
70    self._ready = None
71    self._restart_count = None
72    self._state = None
73    self.discriminator = None
74
75    if container_id is not None:
76      self.container_id = container_id
77    self.image = image
78    self.image_id = image_id
79    if last_state is not None:
80      self.last_state = last_state
81    self.name = name
82    self.ready = ready
83    self.restart_count = restart_count
84    if state is not None:
85      self.state = state
86
87  @property
88  def container_id(self):
89    """
90        Gets the container_id of this V1ContainerStatus.
91        Container's ID in the format 'docker://<container_id>'.
92
93        :return: The container_id of this V1ContainerStatus.
94        :rtype: str
95        """
96    return self._container_id
97
98  @container_id.setter
99  def container_id(self, container_id):
100    """
101        Sets the container_id of this V1ContainerStatus.
102        Container's ID in the format 'docker://<container_id>'.
103
104        :param container_id: The container_id of this V1ContainerStatus.
105        :type: str
106        """
107
108    self._container_id = container_id
109
110  @property
111  def image(self):
112    """
113        Gets the image of this V1ContainerStatus.
114        The image the container is running. More info:
115        https://kubernetes.io/docs/concepts/containers/images
116
117        :return: The image of this V1ContainerStatus.
118        :rtype: str
119        """
120    return self._image
121
122  @image.setter
123  def image(self, image):
124    """
125        Sets the image of this V1ContainerStatus.
126        The image the container is running. More info:
127        https://kubernetes.io/docs/concepts/containers/images
128
129        :param image: The image of this V1ContainerStatus.
130        :type: str
131        """
132    if image is None:
133      raise ValueError('Invalid value for `image`, must not be `None`')
134
135    self._image = image
136
137  @property
138  def image_id(self):
139    """
140        Gets the image_id of this V1ContainerStatus.
141        ImageID of the container's image.
142
143        :return: The image_id of this V1ContainerStatus.
144        :rtype: str
145        """
146    return self._image_id
147
148  @image_id.setter
149  def image_id(self, image_id):
150    """
151        Sets the image_id of this V1ContainerStatus.
152        ImageID of the container's image.
153
154        :param image_id: The image_id of this V1ContainerStatus.
155        :type: str
156        """
157    if image_id is None:
158      raise ValueError('Invalid value for `image_id`, must not be `None`')
159
160    self._image_id = image_id
161
162  @property
163  def last_state(self):
164    """
165        Gets the last_state of this V1ContainerStatus.
166        Details about the container's last termination condition.
167
168        :return: The last_state of this V1ContainerStatus.
169        :rtype: V1ContainerState
170        """
171    return self._last_state
172
173  @last_state.setter
174  def last_state(self, last_state):
175    """
176        Sets the last_state of this V1ContainerStatus.
177        Details about the container's last termination condition.
178
179        :param last_state: The last_state of this V1ContainerStatus.
180        :type: V1ContainerState
181        """
182
183    self._last_state = last_state
184
185  @property
186  def name(self):
187    """
188        Gets the name of this V1ContainerStatus.
189        This must be a DNS_LABEL. Each container in a pod must have a unique
190        name. Cannot be updated.
191
192        :return: The name of this V1ContainerStatus.
193        :rtype: str
194        """
195    return self._name
196
197  @name.setter
198  def name(self, name):
199    """
200        Sets the name of this V1ContainerStatus.
201        This must be a DNS_LABEL. Each container in a pod must have a unique
202        name. Cannot be updated.
203
204        :param name: The name of this V1ContainerStatus.
205        :type: str
206        """
207    if name is None:
208      raise ValueError('Invalid value for `name`, must not be `None`')
209
210    self._name = name
211
212  @property
213  def ready(self):
214    """
215        Gets the ready of this V1ContainerStatus.
216        Specifies whether the container has passed its readiness probe.
217
218        :return: The ready of this V1ContainerStatus.
219        :rtype: bool
220        """
221    return self._ready
222
223  @ready.setter
224  def ready(self, ready):
225    """
226        Sets the ready of this V1ContainerStatus.
227        Specifies whether the container has passed its readiness probe.
228
229        :param ready: The ready of this V1ContainerStatus.
230        :type: bool
231        """
232    if ready is None:
233      raise ValueError('Invalid value for `ready`, must not be `None`')
234
235    self._ready = ready
236
237  @property
238  def restart_count(self):
239    """
240        Gets the restart_count of this V1ContainerStatus.
241        The number of times the container has been restarted, currently based on
242        the number of dead containers that have not yet been removed. Note that
243        this is calculated from dead containers. But those containers are
244        subject to garbage collection. This value will get capped at 5 by GC.
245
246        :return: The restart_count of this V1ContainerStatus.
247        :rtype: int
248        """
249    return self._restart_count
250
251  @restart_count.setter
252  def restart_count(self, restart_count):
253    """
254        Sets the restart_count of this V1ContainerStatus.
255        The number of times the container has been restarted, currently based on
256        the number of dead containers that have not yet been removed. Note that
257        this is calculated from dead containers. But those containers are
258        subject to garbage collection. This value will get capped at 5 by GC.
259
260        :param restart_count: The restart_count of this V1ContainerStatus.
261        :type: int
262        """
263    if restart_count is None:
264      raise ValueError('Invalid value for `restart_count`, must not be `None`')
265
266    self._restart_count = restart_count
267
268  @property
269  def state(self):
270    """
271        Gets the state of this V1ContainerStatus.
272        Details about the container's current condition.
273
274        :return: The state of this V1ContainerStatus.
275        :rtype: V1ContainerState
276        """
277    return self._state
278
279  @state.setter
280  def state(self, state):
281    """
282        Sets the state of this V1ContainerStatus.
283        Details about the container's current condition.
284
285        :param state: The state of this V1ContainerStatus.
286        :type: V1ContainerState
287        """
288
289    self._state = state
290
291  def to_dict(self):
292    """
293        Returns the model properties as a dict
294        """
295    result = {}
296
297    for attr, _ in iteritems(self.swagger_types):
298      value = getattr(self, attr)
299      if isinstance(value, list):
300        result[attr] = list(
301            map(lambda x: x.to_dict() if hasattr(x, 'to_dict') else x, value))
302      elif hasattr(value, 'to_dict'):
303        result[attr] = value.to_dict()
304      elif isinstance(value, dict):
305        result[attr] = dict(
306            map(
307                lambda item: (item[0], item[1].to_dict())
308                if hasattr(item[1], 'to_dict') else item, value.items()))
309      else:
310        result[attr] = value
311
312    return result
313
314  def to_str(self):
315    """
316        Returns the string representation of the model
317        """
318    return pformat(self.to_dict())
319
320  def __repr__(self):
321    """
322        For `print` and `pprint`
323        """
324    return self.to_str()
325
326  def __eq__(self, other):
327    """
328        Returns true if both objects are equal
329        """
330    if not isinstance(other, V1ContainerStatus):
331      return False
332
333    return self.__dict__ == other.__dict__
334
335  def __ne__(self, other):
336    """
337        Returns true if both objects are not equal
338        """
339    return not self == other
340