# coding: utf-8

"""
    XMS API

    XMS is the controller of distributed storage system  # noqa: E501

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


import pprint
import re  # noqa: F401
import six

# from xms_client.models.host_nestview import HostNestview  # noqa: F401,E501


class Task(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 = {
        'create': 'datetime',
        'data': 'str',
        'error_msg': 'str',
        'execute': 'datetime',
        'finish': 'datetime',
        'host': 'HostNestview',
        'host_role': 'str',
        'id': 'int',
        'priority': 'int',
        'retried': 'bool',
        'retry': 'int',
        'retry_type': 'str',
        'status': 'str',
        'type': 'str',
        'update': 'datetime'
    }

    attribute_map = {
        'create': 'create',
        'data': 'data',
        'error_msg': 'error_msg',
        'execute': 'execute',
        'finish': 'finish',
        'host': 'host',
        'host_role': 'host_role',
        'id': 'id',
        'priority': 'priority',
        'retried': 'retried',
        'retry': 'retry',
        'retry_type': 'retry_type',
        'status': 'status',
        'type': 'type',
        'update': 'update'
    }

    def __init__(self, create=None, data=None, error_msg=None, execute=None, finish=None, host=None, host_role=None, id=None, priority=None, retried=None, retry=None, retry_type=None, status=None, type=None, update=None):  # noqa: E501
        """Task - a model defined in Swagger"""  # noqa: E501

        self._create = None
        self._data = None
        self._error_msg = None
        self._execute = None
        self._finish = None
        self._host = None
        self._host_role = None
        self._id = None
        self._priority = None
        self._retried = None
        self._retry = None
        self._retry_type = None
        self._status = None
        self._type = None
        self._update = None
        self.discriminator = None

        if create is not None:
            self.create = create
        if data is not None:
            self.data = data
        if error_msg is not None:
            self.error_msg = error_msg
        if execute is not None:
            self.execute = execute
        if finish is not None:
            self.finish = finish
        if host is not None:
            self.host = host
        if host_role is not None:
            self.host_role = host_role
        if id is not None:
            self.id = id
        if priority is not None:
            self.priority = priority
        if retried is not None:
            self.retried = retried
        if retry is not None:
            self.retry = retry
        if retry_type is not None:
            self.retry_type = retry_type
        if status is not None:
            self.status = status
        if type is not None:
            self.type = type
        if update is not None:
            self.update = update

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


        :return: The create of this Task.  # noqa: E501
        :rtype: datetime
        """
        return self._create

    @create.setter
    def create(self, create):
        """Sets the create of this Task.


        :param create: The create of this Task.  # noqa: E501
        :type: datetime
        """

        self._create = create

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


        :return: The data of this Task.  # noqa: E501
        :rtype: str
        """
        return self._data

    @data.setter
    def data(self, data):
        """Sets the data of this Task.


        :param data: The data of this Task.  # noqa: E501
        :type: str
        """

        self._data = data

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


        :return: The error_msg of this Task.  # noqa: E501
        :rtype: str
        """
        return self._error_msg

    @error_msg.setter
    def error_msg(self, error_msg):
        """Sets the error_msg of this Task.


        :param error_msg: The error_msg of this Task.  # noqa: E501
        :type: str
        """

        self._error_msg = error_msg

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


        :return: The execute of this Task.  # noqa: E501
        :rtype: datetime
        """
        return self._execute

    @execute.setter
    def execute(self, execute):
        """Sets the execute of this Task.


        :param execute: The execute of this Task.  # noqa: E501
        :type: datetime
        """

        self._execute = execute

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


        :return: The finish of this Task.  # noqa: E501
        :rtype: datetime
        """
        return self._finish

    @finish.setter
    def finish(self, finish):
        """Sets the finish of this Task.


        :param finish: The finish of this Task.  # noqa: E501
        :type: datetime
        """

        self._finish = finish

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


        :return: The host of this Task.  # noqa: E501
        :rtype: HostNestview
        """
        return self._host

    @host.setter
    def host(self, host):
        """Sets the host of this Task.


        :param host: The host of this Task.  # noqa: E501
        :type: HostNestview
        """

        self._host = host

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


        :return: The host_role of this Task.  # noqa: E501
        :rtype: str
        """
        return self._host_role

    @host_role.setter
    def host_role(self, host_role):
        """Sets the host_role of this Task.


        :param host_role: The host_role of this Task.  # noqa: E501
        :type: str
        """

        self._host_role = host_role

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


        :return: The id of this Task.  # noqa: E501
        :rtype: int
        """
        return self._id

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


        :param id: The id of this Task.  # noqa: E501
        :type: int
        """

        self._id = id

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


        :return: The priority of this Task.  # noqa: E501
        :rtype: int
        """
        return self._priority

    @priority.setter
    def priority(self, priority):
        """Sets the priority of this Task.


        :param priority: The priority of this Task.  # noqa: E501
        :type: int
        """

        self._priority = priority

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


        :return: The retried of this Task.  # noqa: E501
        :rtype: bool
        """
        return self._retried

    @retried.setter
    def retried(self, retried):
        """Sets the retried of this Task.


        :param retried: The retried of this Task.  # noqa: E501
        :type: bool
        """

        self._retried = retried

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


        :return: The retry of this Task.  # noqa: E501
        :rtype: int
        """
        return self._retry

    @retry.setter
    def retry(self, retry):
        """Sets the retry of this Task.


        :param retry: The retry of this Task.  # noqa: E501
        :type: int
        """

        self._retry = retry

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


        :return: The retry_type of this Task.  # noqa: E501
        :rtype: str
        """
        return self._retry_type

    @retry_type.setter
    def retry_type(self, retry_type):
        """Sets the retry_type of this Task.


        :param retry_type: The retry_type of this Task.  # noqa: E501
        :type: str
        """

        self._retry_type = retry_type

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


        :return: The status of this Task.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this Task.


        :param status: The status of this Task.  # noqa: E501
        :type: str
        """

        self._status = status

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


        :return: The type of this Task.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this Task.


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

        self._type = type

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


        :return: The update of this Task.  # noqa: E501
        :rtype: datetime
        """
        return self._update

    @update.setter
    def update(self, update):
        """Sets the update of this Task.


        :param update: The update of this Task.  # noqa: E501
        :type: datetime
        """

        self._update = update

    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

        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, Task):
            return False

        return self.__dict__ == other.__dict__

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