# coding: utf-8

"""
    HPC Web API

    Preview  # noqa: E501

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


import pprint
import re  # noqa: F401

import six

from hpc_acm.models.job_type import JobType  # noqa: F401,E501
from hpc_acm.models.task_state import TaskState  # 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 = {
        'id': 'int',
        'job_id': 'int',
        'job_type': 'JobType',
        'state': 'TaskState',
        'command_line': 'str',
        'node': 'str',
        'parent_ids': 'list[int]',
        'child_ids': 'list[int]',
        'remaining_parent_ids': 'list[int]',
        'customized_data': 'str'
    }

    attribute_map = {
        'id': 'id',
        'job_id': 'jobId',
        'job_type': 'jobType',
        'state': 'state',
        'command_line': 'commandLine',
        'node': 'node',
        'parent_ids': 'parentIds',
        'child_ids': 'childIds',
        'remaining_parent_ids': 'remainingParentIds',
        'customized_data': 'customizedData'
    }

    def __init__(self, id=None, job_id=None, job_type=None, state=None, command_line=None, node=None, parent_ids=None, child_ids=None, remaining_parent_ids=None, customized_data=None):  # noqa: E501
        """Task - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._job_id = None
        self._job_type = None
        self._state = None
        self._command_line = None
        self._node = None
        self._parent_ids = None
        self._child_ids = None
        self._remaining_parent_ids = None
        self._customized_data = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if job_id is not None:
            self.job_id = job_id
        if job_type is not None:
            self.job_type = job_type
        if state is not None:
            self.state = state
        if command_line is not None:
            self.command_line = command_line
        if node is not None:
            self.node = node
        if parent_ids is not None:
            self.parent_ids = parent_ids
        if child_ids is not None:
            self.child_ids = child_ids
        if remaining_parent_ids is not None:
            self.remaining_parent_ids = remaining_parent_ids
        if customized_data is not None:
            self.customized_data = customized_data

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

        task id  # 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.

        task id  # noqa: E501

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

        self._id = id

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

        Id of the job the task belongs to  # noqa: E501

        :return: The job_id of this Task.  # noqa: E501
        :rtype: int
        """
        return self._job_id

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

        Id of the job the task belongs to  # noqa: E501

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

        self._job_id = job_id

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

        Type of the job the task belongs to  # noqa: E501

        :return: The job_type of this Task.  # noqa: E501
        :rtype: JobType
        """
        return self._job_type

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

        Type of the job the task belongs to  # noqa: E501

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

        self._job_type = job_type

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

        Task state  # noqa: E501

        :return: The state of this Task.  # noqa: E501
        :rtype: TaskState
        """
        return self._state

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

        Task state  # noqa: E501

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

        self._state = state

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

        Available only when task's job type is ClusRun  # noqa: E501

        :return: The command_line of this Task.  # noqa: E501
        :rtype: str
        """
        return self._command_line

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

        Available only when task's job type is ClusRun  # noqa: E501

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

        self._command_line = command_line

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

        The node on which the task runs  # noqa: E501

        :return: The node of this Task.  # noqa: E501
        :rtype: str
        """
        return self._node

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

        The node on which the task runs  # noqa: E501

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

        self._node = node

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


        :return: The parent_ids of this Task.  # noqa: E501
        :rtype: list[int]
        """
        return self._parent_ids

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


        :param parent_ids: The parent_ids of this Task.  # noqa: E501
        :type: list[int]
        """

        self._parent_ids = parent_ids

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


        :return: The child_ids of this Task.  # noqa: E501
        :rtype: list[int]
        """
        return self._child_ids

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


        :param child_ids: The child_ids of this Task.  # noqa: E501
        :type: list[int]
        """

        self._child_ids = child_ids

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


        :return: The remaining_parent_ids of this Task.  # noqa: E501
        :rtype: list[int]
        """
        return self._remaining_parent_ids

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


        :param remaining_parent_ids: The remaining_parent_ids of this Task.  # noqa: E501
        :type: list[int]
        """

        self._remaining_parent_ids = remaining_parent_ids

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


        :return: The customized_data of this Task.  # noqa: E501
        :rtype: str
        """
        return self._customized_data

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


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

        self._customized_data = customized_data

    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
