# coding: utf-8

"""
    Anyscale 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 anyscale_client.configuration import Configuration


class Actor(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',
        'ray_actor_id': 'str',
        'name': 'str',
        'status': 'ActorStatus',
        'lifetime': 'ActorLifetime',
        'class_name': 'str',
        'task_name': 'str',
        'job_id': 'str',
        'created_at': 'datetime',
        'finished_at': 'datetime',
        'current_worker_id': 'str',
        'runtime_environment_id': 'str'
    }

    attribute_map = {
        'id': 'id',
        'ray_actor_id': 'ray_actor_id',
        'name': 'name',
        'status': 'status',
        'lifetime': 'lifetime',
        'class_name': 'class_name',
        'task_name': 'task_name',
        'job_id': 'job_id',
        'created_at': 'created_at',
        'finished_at': 'finished_at',
        'current_worker_id': 'current_worker_id',
        'runtime_environment_id': 'runtime_environment_id'
    }

    def __init__(self, id=None, ray_actor_id=None, name=None, status=None, lifetime=None, class_name=None, task_name=None, job_id=None, created_at=None, finished_at=None, current_worker_id=None, runtime_environment_id=None, local_vars_configuration=None):  # noqa: E501
        """Actor - 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._ray_actor_id = None
        self._name = None
        self._status = None
        self._lifetime = None
        self._class_name = None
        self._task_name = None
        self._job_id = None
        self._created_at = None
        self._finished_at = None
        self._current_worker_id = None
        self._runtime_environment_id = None
        self.discriminator = None

        self.id = id
        self.ray_actor_id = ray_actor_id
        if name is not None:
            self.name = name
        self.status = status
        self.lifetime = lifetime
        if class_name is not None:
            self.class_name = class_name
        if task_name is not None:
            self.task_name = task_name
        self.job_id = job_id
        self.created_at = created_at
        if finished_at is not None:
            self.finished_at = finished_at
        self.current_worker_id = current_worker_id
        self.runtime_environment_id = runtime_environment_id

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


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

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


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


        :return: The ray_actor_id of this Actor.  # noqa: E501
        :rtype: str
        """
        return self._ray_actor_id

    @ray_actor_id.setter
    def ray_actor_id(self, ray_actor_id):
        """Sets the ray_actor_id of this Actor.


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

        self._ray_actor_id = ray_actor_id

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


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

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


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

        self._name = name

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


        :return: The status of this Actor.  # noqa: E501
        :rtype: ActorStatus
        """
        return self._status

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


        :param status: The status of this Actor.  # noqa: E501
        :type: ActorStatus
        """
        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 lifetime(self):
        """Gets the lifetime of this Actor.  # noqa: E501


        :return: The lifetime of this Actor.  # noqa: E501
        :rtype: ActorLifetime
        """
        return self._lifetime

    @lifetime.setter
    def lifetime(self, lifetime):
        """Sets the lifetime of this Actor.


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

        self._lifetime = lifetime

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


        :return: The class_name of this Actor.  # noqa: E501
        :rtype: str
        """
        return self._class_name

    @class_name.setter
    def class_name(self, class_name):
        """Sets the class_name of this Actor.


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

        self._class_name = class_name

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


        :return: The task_name of this Actor.  # noqa: E501
        :rtype: str
        """
        return self._task_name

    @task_name.setter
    def task_name(self, task_name):
        """Sets the task_name of this Actor.


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

        self._task_name = task_name

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


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

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


        :param job_id: The job_id of this Actor.  # 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 created_at(self):
        """Gets the created_at of this Actor.  # noqa: E501


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

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


        :param created_at: The created_at of this Actor.  # 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 Actor.  # noqa: E501


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

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


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

        self._finished_at = finished_at

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


        :return: The current_worker_id of this Actor.  # noqa: E501
        :rtype: str
        """
        return self._current_worker_id

    @current_worker_id.setter
    def current_worker_id(self, current_worker_id):
        """Sets the current_worker_id of this Actor.


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

        self._current_worker_id = current_worker_id

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


        :return: The runtime_environment_id of this Actor.  # noqa: E501
        :rtype: str
        """
        return self._runtime_environment_id

    @runtime_environment_id.setter
    def runtime_environment_id(self, runtime_environment_id):
        """Sets the runtime_environment_id of this Actor.


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

        self._runtime_environment_id = runtime_environment_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, Actor):
            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, Actor):
            return True

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