# coding: utf-8

"""
    Harbor API

    These APIs provide services for manipulating Harbor project.  # noqa: E501

    OpenAPI spec version: 2.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from harbor_client.configuration import Configuration


class Worker(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'id': 'str',
        'pool_id': 'str',
        'job_name': 'str',
        'job_id': 'str',
        'start_at': 'datetime',
        'check_in': 'str',
        'checkin_at': 'datetime'
    }

    attribute_map = {
        'id': 'id',
        'pool_id': 'pool_id',
        'job_name': 'job_name',
        'job_id': 'job_id',
        'start_at': 'start_at',
        'check_in': 'check_in',
        'checkin_at': 'checkin_at'
    }

    def __init__(self, id=None, pool_id=None, job_name=None, job_id=None, start_at=None, check_in=None, checkin_at=None, _configuration=None):  # noqa: E501
        """Worker - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._id = None
        self._pool_id = None
        self._job_name = None
        self._job_id = None
        self._start_at = None
        self._check_in = None
        self._checkin_at = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if pool_id is not None:
            self.pool_id = pool_id
        if job_name is not None:
            self.job_name = job_name
        if job_id is not None:
            self.job_id = job_id
        if start_at is not None:
            self.start_at = start_at
        if check_in is not None:
            self.check_in = check_in
        if checkin_at is not None:
            self.checkin_at = checkin_at

    @property
    def id(self):
        """Gets the id of this Worker.  # noqa: E501

        the id of the worker  # noqa: E501

        :return: The id of this Worker.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Worker.

        the id of the worker  # noqa: E501

        :param id: The id of this Worker.  # noqa: E501
        :type: str
        """

        self._id = id

    @property
    def pool_id(self):
        """Gets the pool_id of this Worker.  # noqa: E501

        the id of the worker pool  # noqa: E501

        :return: The pool_id of this Worker.  # noqa: E501
        :rtype: str
        """
        return self._pool_id

    @pool_id.setter
    def pool_id(self, pool_id):
        """Sets the pool_id of this Worker.

        the id of the worker pool  # noqa: E501

        :param pool_id: The pool_id of this Worker.  # noqa: E501
        :type: str
        """

        self._pool_id = pool_id

    @property
    def job_name(self):
        """Gets the job_name of this Worker.  # noqa: E501

        the name of the running job in the worker  # noqa: E501

        :return: The job_name of this Worker.  # noqa: E501
        :rtype: str
        """
        return self._job_name

    @job_name.setter
    def job_name(self, job_name):
        """Sets the job_name of this Worker.

        the name of the running job in the worker  # noqa: E501

        :param job_name: The job_name of this Worker.  # noqa: E501
        :type: str
        """

        self._job_name = job_name

    @property
    def job_id(self):
        """Gets the job_id of this Worker.  # noqa: E501

        the id of the running job in the worker  # noqa: E501

        :return: The job_id of this Worker.  # noqa: E501
        :rtype: str
        """
        return self._job_id

    @job_id.setter
    def job_id(self, job_id):
        """Sets the job_id of this Worker.

        the id of the running job in the worker  # noqa: E501

        :param job_id: The job_id of this Worker.  # noqa: E501
        :type: str
        """

        self._job_id = job_id

    @property
    def start_at(self):
        """Gets the start_at of this Worker.  # noqa: E501

        The start time of the worker  # noqa: E501

        :return: The start_at of this Worker.  # noqa: E501
        :rtype: datetime
        """
        return self._start_at

    @start_at.setter
    def start_at(self, start_at):
        """Sets the start_at of this Worker.

        The start time of the worker  # noqa: E501

        :param start_at: The start_at of this Worker.  # noqa: E501
        :type: datetime
        """

        self._start_at = start_at

    @property
    def check_in(self):
        """Gets the check_in of this Worker.  # noqa: E501

        the checkin of the running job in the worker  # noqa: E501

        :return: The check_in of this Worker.  # noqa: E501
        :rtype: str
        """
        return self._check_in

    @check_in.setter
    def check_in(self, check_in):
        """Sets the check_in of this Worker.

        the checkin of the running job in the worker  # noqa: E501

        :param check_in: The check_in of this Worker.  # noqa: E501
        :type: str
        """

        self._check_in = check_in

    @property
    def checkin_at(self):
        """Gets the checkin_at of this Worker.  # noqa: E501

        The checkin time of the worker  # noqa: E501

        :return: The checkin_at of this Worker.  # noqa: E501
        :rtype: datetime
        """
        return self._checkin_at

    @checkin_at.setter
    def checkin_at(self, checkin_at):
        """Sets the checkin_at of this Worker.

        The checkin time of the worker  # noqa: E501

        :param checkin_at: The checkin_at of this Worker.  # noqa: E501
        :type: datetime
        """

        self._checkin_at = checkin_at

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value
        if issubclass(Worker, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, Worker):
            return False

        return self.to_dict() == other.to_dict()

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        if not isinstance(other, Worker):
            return True

        return self.to_dict() != other.to_dict()
