# 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 DecoratedUnifiedJob(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',
        'name': 'str',
        'job_type': 'UnifiedJobType',
        'created_at': 'datetime',
        'finished_at': 'datetime',
        'archived_at': 'datetime',
        'status': 'UnifiedJobStatus',
        'cost': 'float',
        'position_in_job_queue': 'int',
        'last_job_run_id': 'str',
        'project': 'MiniProject',
        'cluster': 'MiniCluster',
        'creator': 'MiniUser'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'job_type': 'job_type',
        'created_at': 'created_at',
        'finished_at': 'finished_at',
        'archived_at': 'archived_at',
        'status': 'status',
        'cost': 'cost',
        'position_in_job_queue': 'position_in_job_queue',
        'last_job_run_id': 'last_job_run_id',
        'project': 'project',
        'cluster': 'cluster',
        'creator': 'creator'
    }

    def __init__(self, id=None, name=None, job_type=None, created_at=None, finished_at=None, archived_at=None, status=None, cost=None, position_in_job_queue=None, last_job_run_id=None, project=None, cluster=None, creator=None, local_vars_configuration=None):  # noqa: E501
        """DecoratedUnifiedJob - 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._name = None
        self._job_type = None
        self._created_at = None
        self._finished_at = None
        self._archived_at = None
        self._status = None
        self._cost = None
        self._position_in_job_queue = None
        self._last_job_run_id = None
        self._project = None
        self._cluster = None
        self._creator = None
        self.discriminator = None

        self.id = id
        self.name = name
        self.job_type = job_type
        self.created_at = created_at
        if finished_at is not None:
            self.finished_at = finished_at
        if archived_at is not None:
            self.archived_at = archived_at
        self.status = status
        self.cost = cost
        if position_in_job_queue is not None:
            self.position_in_job_queue = position_in_job_queue
        if last_job_run_id is not None:
            self.last_job_run_id = last_job_run_id
        self.project = project
        if cluster is not None:
            self.cluster = cluster
        self.creator = creator

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

        Server assigned unique identifier of the Job.  # noqa: E501

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

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

        Server assigned unique identifier of the Job.  # noqa: E501

        :param id: The id of this DecoratedUnifiedJob.  # 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 name(self):
        """Gets the name of this DecoratedUnifiedJob.  # noqa: E501

        Name of the Job.  # noqa: E501

        :return: The name of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this DecoratedUnifiedJob.

        Name of the Job.  # noqa: E501

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

        self._name = name

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

        The type of the Job.  # noqa: E501

        :return: The job_type of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: UnifiedJobType
        """
        return self._job_type

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

        The type of the Job.  # noqa: E501

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

        self._job_type = job_type

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

        Time at which Job was created.  # noqa: E501

        :return: The created_at of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this DecoratedUnifiedJob.

        Time at which Job was created.  # noqa: E501

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

        self._created_at = created_at

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

        Time at which Job ended (completed or errored). If None, the job is still running.  # noqa: E501

        :return: The finished_at of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: datetime
        """
        return self._finished_at

    @finished_at.setter
    def finished_at(self, finished_at):
        """Sets the finished_at of this DecoratedUnifiedJob.

        Time at which Job ended (completed or errored). If None, the job is still running.  # noqa: E501

        :param finished_at: The finished_at of this DecoratedUnifiedJob.  # noqa: E501
        :type: datetime
        """

        self._finished_at = finished_at

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

        Time the job was archived.  # noqa: E501

        :return: The archived_at of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: datetime
        """
        return self._archived_at

    @archived_at.setter
    def archived_at(self, archived_at):
        """Sets the archived_at of this DecoratedUnifiedJob.

        Time the job was archived.  # noqa: E501

        :param archived_at: The archived_at of this DecoratedUnifiedJob.  # noqa: E501
        :type: datetime
        """

        self._archived_at = archived_at

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

        The status of the Job.  # noqa: E501

        :return: The status of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: UnifiedJobStatus
        """
        return self._status

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

        The status of the Job.  # noqa: E501

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

        self._status = status

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

        The cost of the Job.  # noqa: E501

        :return: The cost of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: float
        """
        return self._cost

    @cost.setter
    def cost(self, cost):
        """Sets the cost of this DecoratedUnifiedJob.

        The cost of the Job.  # noqa: E501

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

        self._cost = cost

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

        The position of the job in the job queue. None for jobs not pending in a job queue.  # noqa: E501

        :return: The position_in_job_queue of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: int
        """
        return self._position_in_job_queue

    @position_in_job_queue.setter
    def position_in_job_queue(self, position_in_job_queue):
        """Sets the position_in_job_queue of this DecoratedUnifiedJob.

        The position of the job in the job queue. None for jobs not pending in a job queue.  # noqa: E501

        :param position_in_job_queue: The position_in_job_queue of this DecoratedUnifiedJob.  # noqa: E501
        :type: int
        """

        self._position_in_job_queue = position_in_job_queue

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

        The last job run ID of the job. None for interactive sessions.  # noqa: E501

        :return: The last_job_run_id of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: str
        """
        return self._last_job_run_id

    @last_job_run_id.setter
    def last_job_run_id(self, last_job_run_id):
        """Sets the last_job_run_id of this DecoratedUnifiedJob.

        The last job run ID of the job. None for interactive sessions.  # noqa: E501

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

        self._last_job_run_id = last_job_run_id

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

        The project in which this job lives  # noqa: E501

        :return: The project of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: MiniProject
        """
        return self._project

    @project.setter
    def project(self, project):
        """Sets the project of this DecoratedUnifiedJob.

        The project in which this job lives  # noqa: E501

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

        self._project = project

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

        The cluster this job is running on  # noqa: E501

        :return: The cluster of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: MiniCluster
        """
        return self._cluster

    @cluster.setter
    def cluster(self, cluster):
        """Sets the cluster of this DecoratedUnifiedJob.

        The cluster this job is running on  # noqa: E501

        :param cluster: The cluster of this DecoratedUnifiedJob.  # noqa: E501
        :type: MiniCluster
        """

        self._cluster = cluster

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

        The creator of this job  # noqa: E501

        :return: The creator of this DecoratedUnifiedJob.  # noqa: E501
        :rtype: MiniUser
        """
        return self._creator

    @creator.setter
    def creator(self, creator):
        """Sets the creator of this DecoratedUnifiedJob.

        The creator of this job  # noqa: E501

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

        self._creator = creator

    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, DecoratedUnifiedJob):
            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, DecoratedUnifiedJob):
            return True

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