# coding: utf-8

"""
    Managed Ray API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 0.1.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from openapi_client.configuration import Configuration


class TaskTableRow(object):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'id': 'str',
        'attempt_number': 'int',
        'total_attempts': 'int',
        'job_id': 'str',
        'function_name': 'str',
        'task_type': 'TaskType',
        'current_state': 'TaskState',
        'error_message': 'str',
        'start_time_ns': 'int',
        'start_running_time_ns': 'int',
        'end_time_ns': 'int',
        'required_resources': 'str',
        'runtime_env': 'str',
        'node_id': 'str',
        'worker_id': 'str',
        'worker_pid': 'str',
        'parent_task_id': 'str',
        'ray_session_name': 'str',
        'exception_type': 'str',
        'data_operator_id': 'str'
    }

    attribute_map = {
        'id': 'id',
        'attempt_number': 'attempt_number',
        'total_attempts': 'total_attempts',
        'job_id': 'job_id',
        'function_name': 'function_name',
        'task_type': 'task_type',
        'current_state': 'current_state',
        'error_message': 'error_message',
        'start_time_ns': 'start_time_ns',
        'start_running_time_ns': 'start_running_time_ns',
        'end_time_ns': 'end_time_ns',
        'required_resources': 'required_resources',
        'runtime_env': 'runtime_env',
        'node_id': 'node_id',
        'worker_id': 'worker_id',
        'worker_pid': 'worker_pid',
        'parent_task_id': 'parent_task_id',
        'ray_session_name': 'ray_session_name',
        'exception_type': 'exception_type',
        'data_operator_id': 'data_operator_id'
    }

    def __init__(self, id=None, attempt_number=None, total_attempts=None, job_id=None, function_name=None, task_type=None, current_state=None, error_message=None, start_time_ns=None, start_running_time_ns=None, end_time_ns=None, required_resources=None, runtime_env=None, node_id=None, worker_id=None, worker_pid=None, parent_task_id=None, ray_session_name=None, exception_type=None, data_operator_id=None, local_vars_configuration=None):  # noqa: E501
        """TaskTableRow - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._id = None
        self._attempt_number = None
        self._total_attempts = None
        self._job_id = None
        self._function_name = None
        self._task_type = None
        self._current_state = None
        self._error_message = None
        self._start_time_ns = None
        self._start_running_time_ns = None
        self._end_time_ns = None
        self._required_resources = None
        self._runtime_env = None
        self._node_id = None
        self._worker_id = None
        self._worker_pid = None
        self._parent_task_id = None
        self._ray_session_name = None
        self._exception_type = None
        self._data_operator_id = None
        self.discriminator = None

        self.id = id
        self.attempt_number = attempt_number
        if total_attempts is not None:
            self.total_attempts = total_attempts
        self.job_id = job_id
        self.function_name = function_name
        self.task_type = task_type
        if current_state is not None:
            self.current_state = current_state
        if error_message is not None:
            self.error_message = error_message
        self.start_time_ns = start_time_ns
        self.start_running_time_ns = start_running_time_ns
        if end_time_ns is not None:
            self.end_time_ns = end_time_ns
        if required_resources is not None:
            self.required_resources = required_resources
        if runtime_env is not None:
            self.runtime_env = runtime_env
        if node_id is not None:
            self.node_id = node_id
        if worker_id is not None:
            self.worker_id = worker_id
        if worker_pid is not None:
            self.worker_pid = worker_pid
        if parent_task_id is not None:
            self.parent_task_id = parent_task_id
        self.ray_session_name = ray_session_name
        if exception_type is not None:
            self.exception_type = exception_type
        if data_operator_id is not None:
            self.data_operator_id = data_operator_id

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


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

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


        :param id: The id of this TaskTableRow.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and id is None:  # noqa: E501
            raise ValueError("Invalid value for `id`, must not be `None`")  # noqa: E501

        self._id = id

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


        :return: The attempt_number of this TaskTableRow.  # noqa: E501
        :rtype: int
        """
        return self._attempt_number

    @attempt_number.setter
    def attempt_number(self, attempt_number):
        """Sets the attempt_number of this TaskTableRow.


        :param attempt_number: The attempt_number of this TaskTableRow.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and attempt_number is None:  # noqa: E501
            raise ValueError("Invalid value for `attempt_number`, must not be `None`")  # noqa: E501

        self._attempt_number = attempt_number

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


        :return: The total_attempts of this TaskTableRow.  # noqa: E501
        :rtype: int
        """
        return self._total_attempts

    @total_attempts.setter
    def total_attempts(self, total_attempts):
        """Sets the total_attempts of this TaskTableRow.


        :param total_attempts: The total_attempts of this TaskTableRow.  # noqa: E501
        :type: int
        """

        self._total_attempts = total_attempts

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


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

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


        :param job_id: The job_id of this TaskTableRow.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and job_id is None:  # noqa: E501
            raise ValueError("Invalid value for `job_id`, must not be `None`")  # noqa: E501

        self._job_id = job_id

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


        :return: The function_name of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._function_name

    @function_name.setter
    def function_name(self, function_name):
        """Sets the function_name of this TaskTableRow.


        :param function_name: The function_name of this TaskTableRow.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and function_name is None:  # noqa: E501
            raise ValueError("Invalid value for `function_name`, must not be `None`")  # noqa: E501

        self._function_name = function_name

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


        :return: The task_type of this TaskTableRow.  # noqa: E501
        :rtype: TaskType
        """
        return self._task_type

    @task_type.setter
    def task_type(self, task_type):
        """Sets the task_type of this TaskTableRow.


        :param task_type: The task_type of this TaskTableRow.  # noqa: E501
        :type: TaskType
        """
        if self.local_vars_configuration.client_side_validation and task_type is None:  # noqa: E501
            raise ValueError("Invalid value for `task_type`, must not be `None`")  # noqa: E501

        self._task_type = task_type

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


        :return: The current_state of this TaskTableRow.  # noqa: E501
        :rtype: TaskState
        """
        return self._current_state

    @current_state.setter
    def current_state(self, current_state):
        """Sets the current_state of this TaskTableRow.


        :param current_state: The current_state of this TaskTableRow.  # noqa: E501
        :type: TaskState
        """

        self._current_state = current_state

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


        :return: The error_message of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._error_message

    @error_message.setter
    def error_message(self, error_message):
        """Sets the error_message of this TaskTableRow.


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

        self._error_message = error_message

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


        :return: The start_time_ns of this TaskTableRow.  # noqa: E501
        :rtype: int
        """
        return self._start_time_ns

    @start_time_ns.setter
    def start_time_ns(self, start_time_ns):
        """Sets the start_time_ns of this TaskTableRow.


        :param start_time_ns: The start_time_ns of this TaskTableRow.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and start_time_ns is None:  # noqa: E501
            raise ValueError("Invalid value for `start_time_ns`, must not be `None`")  # noqa: E501

        self._start_time_ns = start_time_ns

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


        :return: The start_running_time_ns of this TaskTableRow.  # noqa: E501
        :rtype: int
        """
        return self._start_running_time_ns

    @start_running_time_ns.setter
    def start_running_time_ns(self, start_running_time_ns):
        """Sets the start_running_time_ns of this TaskTableRow.


        :param start_running_time_ns: The start_running_time_ns of this TaskTableRow.  # noqa: E501
        :type: int
        """
        if self.local_vars_configuration.client_side_validation and start_running_time_ns is None:  # noqa: E501
            raise ValueError("Invalid value for `start_running_time_ns`, must not be `None`")  # noqa: E501

        self._start_running_time_ns = start_running_time_ns

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


        :return: The end_time_ns of this TaskTableRow.  # noqa: E501
        :rtype: int
        """
        return self._end_time_ns

    @end_time_ns.setter
    def end_time_ns(self, end_time_ns):
        """Sets the end_time_ns of this TaskTableRow.


        :param end_time_ns: The end_time_ns of this TaskTableRow.  # noqa: E501
        :type: int
        """

        self._end_time_ns = end_time_ns

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


        :return: The required_resources of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._required_resources

    @required_resources.setter
    def required_resources(self, required_resources):
        """Sets the required_resources of this TaskTableRow.


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

        self._required_resources = required_resources

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


        :return: The runtime_env of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._runtime_env

    @runtime_env.setter
    def runtime_env(self, runtime_env):
        """Sets the runtime_env of this TaskTableRow.


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

        self._runtime_env = runtime_env

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


        :return: The node_id of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._node_id

    @node_id.setter
    def node_id(self, node_id):
        """Sets the node_id of this TaskTableRow.


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

        self._node_id = node_id

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


        :return: The worker_id of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._worker_id

    @worker_id.setter
    def worker_id(self, worker_id):
        """Sets the worker_id of this TaskTableRow.


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

        self._worker_id = worker_id

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


        :return: The worker_pid of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._worker_pid

    @worker_pid.setter
    def worker_pid(self, worker_pid):
        """Sets the worker_pid of this TaskTableRow.


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

        self._worker_pid = worker_pid

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


        :return: The parent_task_id of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._parent_task_id

    @parent_task_id.setter
    def parent_task_id(self, parent_task_id):
        """Sets the parent_task_id of this TaskTableRow.


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

        self._parent_task_id = parent_task_id

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


        :return: The ray_session_name of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._ray_session_name

    @ray_session_name.setter
    def ray_session_name(self, ray_session_name):
        """Sets the ray_session_name of this TaskTableRow.


        :param ray_session_name: The ray_session_name of this TaskTableRow.  # noqa: E501
        :type: str
        """
        if self.local_vars_configuration.client_side_validation and ray_session_name is None:  # noqa: E501
            raise ValueError("Invalid value for `ray_session_name`, must not be `None`")  # noqa: E501

        self._ray_session_name = ray_session_name

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


        :return: The exception_type of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._exception_type

    @exception_type.setter
    def exception_type(self, exception_type):
        """Sets the exception_type of this TaskTableRow.


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

        self._exception_type = exception_type

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


        :return: The data_operator_id of this TaskTableRow.  # noqa: E501
        :rtype: str
        """
        return self._data_operator_id

    @data_operator_id.setter
    def data_operator_id(self, data_operator_id):
        """Sets the data_operator_id of this TaskTableRow.


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

        self._data_operator_id = data_operator_id

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

        for attr, _ in six.iteritems(self.openapi_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, TaskTableRow):
            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, TaskTableRow):
            return True

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