# 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 Session(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 = {
        'name': 'str',
        'project_id': 'str',
        'cloud_id': 'str',
        'cluster_config': 'str',
        'id': 'str',
        'state': 'SessionState',
        'pending_state': 'SessionState',
        'creator_id': 'str',
        'created_at': 'datetime',
        'metrics_dashboard_url': 'str',
        'jupyter_notebook_url': 'str',
        'ray_dashboard_url': 'str',
        'access_token': 'str',
        'service_proxy_url': 'str',
        'tensorboard_available': 'bool',
        'cluster_config_last_modified_at': 'datetime',
        'head_node_ip': 'str',
        'ssh_authorized_keys': 'list[str]',
        'ssh_private_key': 'str'
    }

    attribute_map = {
        'name': 'name',
        'project_id': 'project_id',
        'cloud_id': 'cloud_id',
        'cluster_config': 'cluster_config',
        'id': 'id',
        'state': 'state',
        'pending_state': 'pending_state',
        'creator_id': 'creator_id',
        'created_at': 'created_at',
        'metrics_dashboard_url': 'metrics_dashboard_url',
        'jupyter_notebook_url': 'jupyter_notebook_url',
        'ray_dashboard_url': 'ray_dashboard_url',
        'access_token': 'access_token',
        'service_proxy_url': 'service_proxy_url',
        'tensorboard_available': 'tensorboard_available',
        'cluster_config_last_modified_at': 'cluster_config_last_modified_at',
        'head_node_ip': 'head_node_ip',
        'ssh_authorized_keys': 'ssh_authorized_keys',
        'ssh_private_key': 'ssh_private_key'
    }

    def __init__(self, name=None, project_id=None, cloud_id=None, cluster_config=None, id=None, state=None, pending_state=None, creator_id=None, created_at=None, metrics_dashboard_url=None, jupyter_notebook_url=None, ray_dashboard_url=None, access_token=None, service_proxy_url=None, tensorboard_available=None, cluster_config_last_modified_at=None, head_node_ip=None, ssh_authorized_keys=None, ssh_private_key=None, local_vars_configuration=None):  # noqa: E501
        """Session - 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._name = None
        self._project_id = None
        self._cloud_id = None
        self._cluster_config = None
        self._id = None
        self._state = None
        self._pending_state = None
        self._creator_id = None
        self._created_at = None
        self._metrics_dashboard_url = None
        self._jupyter_notebook_url = None
        self._ray_dashboard_url = None
        self._access_token = None
        self._service_proxy_url = None
        self._tensorboard_available = None
        self._cluster_config_last_modified_at = None
        self._head_node_ip = None
        self._ssh_authorized_keys = None
        self._ssh_private_key = None
        self.discriminator = None

        self.name = name
        self.project_id = project_id
        self.cloud_id = cloud_id
        self.cluster_config = cluster_config
        self.id = id
        self.state = state
        if pending_state is not None:
            self.pending_state = pending_state
        self.creator_id = creator_id
        self.created_at = created_at
        if metrics_dashboard_url is not None:
            self.metrics_dashboard_url = metrics_dashboard_url
        if jupyter_notebook_url is not None:
            self.jupyter_notebook_url = jupyter_notebook_url
        if ray_dashboard_url is not None:
            self.ray_dashboard_url = ray_dashboard_url
        if access_token is not None:
            self.access_token = access_token
        if service_proxy_url is not None:
            self.service_proxy_url = service_proxy_url
        self.tensorboard_available = tensorboard_available
        self.cluster_config_last_modified_at = cluster_config_last_modified_at
        if head_node_ip is not None:
            self.head_node_ip = head_node_ip
        self.ssh_authorized_keys = ssh_authorized_keys
        self.ssh_private_key = ssh_private_key

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

        Name of the session to be created.  # noqa: E501

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

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

        Name of the session to be created.  # noqa: E501

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

        Project that the session will be created in.  # noqa: E501

        :return: The project_id of this Session.  # noqa: E501
        :rtype: str
        """
        return self._project_id

    @project_id.setter
    def project_id(self, project_id):
        """Sets the project_id of this Session.

        Project that the session will be created in.  # noqa: E501

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

        self._project_id = project_id

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

        Cloud that the session will use.  # noqa: E501

        :return: The cloud_id of this Session.  # noqa: E501
        :rtype: str
        """
        return self._cloud_id

    @cloud_id.setter
    def cloud_id(self, cloud_id):
        """Sets the cloud_id of this Session.

        Cloud that the session will use.  # noqa: E501

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

        self._cloud_id = cloud_id

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

        Cluster config that the session can later be started with.  # noqa: E501

        :return: The cluster_config of this Session.  # noqa: E501
        :rtype: str
        """
        return self._cluster_config

    @cluster_config.setter
    def cluster_config(self, cluster_config):
        """Sets the cluster_config of this Session.

        Cluster config that the session can later be started with.  # noqa: E501

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

        self._cluster_config = cluster_config

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

        Server assigned unique identifier.  # noqa: E501

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

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

        Server assigned unique identifier.  # noqa: E501

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


        :return: The state of this Session.  # noqa: E501
        :rtype: SessionState
        """
        return self._state

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


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

        self._state = state

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


        :return: The pending_state of this Session.  # noqa: E501
        :rtype: SessionState
        """
        return self._pending_state

    @pending_state.setter
    def pending_state(self, pending_state):
        """Sets the pending_state of this Session.


        :param pending_state: The pending_state of this Session.  # noqa: E501
        :type: SessionState
        """

        self._pending_state = pending_state

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

        Identifier of user who created the Session.  # noqa: E501

        :return: The creator_id of this Session.  # noqa: E501
        :rtype: str
        """
        return self._creator_id

    @creator_id.setter
    def creator_id(self, creator_id):
        """Sets the creator_id of this Session.

        Identifier of user who created the Session.  # noqa: E501

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

        self._creator_id = creator_id

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

        Time at which session was created.  # noqa: E501

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

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

        Time at which session was created.  # noqa: E501

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

        URL for Grafana (metrics) dashboard for this Session. This field will only be populated after the Session finishes starting.  # noqa: E501

        :return: The metrics_dashboard_url of this Session.  # noqa: E501
        :rtype: str
        """
        return self._metrics_dashboard_url

    @metrics_dashboard_url.setter
    def metrics_dashboard_url(self, metrics_dashboard_url):
        """Sets the metrics_dashboard_url of this Session.

        URL for Grafana (metrics) dashboard for this Session. This field will only be populated after the Session finishes starting.  # noqa: E501

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

        self._metrics_dashboard_url = metrics_dashboard_url

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

        URL for Jupyter Lab for this Session. This field will only be populated after the Session finishes starting.  # noqa: E501

        :return: The jupyter_notebook_url of this Session.  # noqa: E501
        :rtype: str
        """
        return self._jupyter_notebook_url

    @jupyter_notebook_url.setter
    def jupyter_notebook_url(self, jupyter_notebook_url):
        """Sets the jupyter_notebook_url of this Session.

        URL for Jupyter Lab for this Session. This field will only be populated after the Session finishes starting.  # noqa: E501

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

        self._jupyter_notebook_url = jupyter_notebook_url

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

        URL for Ray dashboard for this Session. This field will only be populated after the Session finishes starting.  # noqa: E501

        :return: The ray_dashboard_url of this Session.  # noqa: E501
        :rtype: str
        """
        return self._ray_dashboard_url

    @ray_dashboard_url.setter
    def ray_dashboard_url(self, ray_dashboard_url):
        """Sets the ray_dashboard_url of this Session.

        URL for Ray dashboard for this Session. This field will only be populated after the Session finishes starting.  # noqa: E501

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

        self._ray_dashboard_url = ray_dashboard_url

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

        Access token for web based services (e.g. jupyter, tensorboard, etc). This field will be populated when the web based services are available after the Session finishes starting.  # noqa: E501

        :return: The access_token of this Session.  # noqa: E501
        :rtype: str
        """
        return self._access_token

    @access_token.setter
    def access_token(self, access_token):
        """Sets the access_token of this Session.

        Access token for web based services (e.g. jupyter, tensorboard, etc). This field will be populated when the web based services are available after the Session finishes starting.  # noqa: E501

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

        self._access_token = access_token

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

        Link to the web services proxy (e.g. jupyter, tensorboard, etc). This field will be populated when the web based services are available after the Session finishes starting.  # noqa: E501

        :return: The service_proxy_url of this Session.  # noqa: E501
        :rtype: str
        """
        return self._service_proxy_url

    @service_proxy_url.setter
    def service_proxy_url(self, service_proxy_url):
        """Sets the service_proxy_url of this Session.

        Link to the web services proxy (e.g. jupyter, tensorboard, etc). This field will be populated when the web based services are available after the Session finishes starting.  # noqa: E501

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

        self._service_proxy_url = service_proxy_url

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

        Represents whether Tensorboard is available.  # noqa: E501

        :return: The tensorboard_available of this Session.  # noqa: E501
        :rtype: bool
        """
        return self._tensorboard_available

    @tensorboard_available.setter
    def tensorboard_available(self, tensorboard_available):
        """Sets the tensorboard_available of this Session.

        Represents whether Tensorboard is available.  # noqa: E501

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

        self._tensorboard_available = tensorboard_available

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

        Time when the cluster config for the Session was last modified.  # noqa: E501

        :return: The cluster_config_last_modified_at of this Session.  # noqa: E501
        :rtype: datetime
        """
        return self._cluster_config_last_modified_at

    @cluster_config_last_modified_at.setter
    def cluster_config_last_modified_at(self, cluster_config_last_modified_at):
        """Sets the cluster_config_last_modified_at of this Session.

        Time when the cluster config for the Session was last modified.  # noqa: E501

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

        self._cluster_config_last_modified_at = cluster_config_last_modified_at

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

        Head IP of the Session. This field will be populated after the cluster finishes starting.  # noqa: E501

        :return: The head_node_ip of this Session.  # noqa: E501
        :rtype: str
        """
        return self._head_node_ip

    @head_node_ip.setter
    def head_node_ip(self, head_node_ip):
        """Sets the head_node_ip of this Session.

        Head IP of the Session. This field will be populated after the cluster finishes starting.  # noqa: E501

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

        self._head_node_ip = head_node_ip

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

        Serialized SSH Public Keys to be placed in the machine's authorized_keys.  # noqa: E501

        :return: The ssh_authorized_keys of this Session.  # noqa: E501
        :rtype: list[str]
        """
        return self._ssh_authorized_keys

    @ssh_authorized_keys.setter
    def ssh_authorized_keys(self, ssh_authorized_keys):
        """Sets the ssh_authorized_keys of this Session.

        Serialized SSH Public Keys to be placed in the machine's authorized_keys.  # noqa: E501

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

        self._ssh_authorized_keys = ssh_authorized_keys

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

        SSH Private key that can be used to access the session's servers.  # noqa: E501

        :return: The ssh_private_key of this Session.  # noqa: E501
        :rtype: str
        """
        return self._ssh_private_key

    @ssh_private_key.setter
    def ssh_private_key(self, ssh_private_key):
        """Sets the ssh_private_key of this Session.

        SSH Private key that can be used to access the session's servers.  # noqa: E501

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

        self._ssh_private_key = ssh_private_key

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

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