# 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 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 = {
        'id': 'str',
        'name': 'str',
        'idle_timeout': 'int',
        'created_at': 'datetime',
        'snapshots_history': 'list[AppliedSnapshot]',
        'metrics_dashboard_url': 'str',
        'connect_url': 'str',
        'jupyter_notebook_url': 'str',
        'service_proxy_url': 'str',
        'access_token': 'str',
        'ray_dashboard_url': 'str',
        'webterminal_auth_url': 'str',
        'tensorboard_available': 'bool',
        'project_id': 'str',
        'host_name': 'str',
        'head_node_ip': 'str',
        'state': 'SessionState',
        'pending_state': 'SessionState',
        'state_data': 'SessionStateData',
        'cloud_id': 'str',
        'idle_time_remaining_seconds': 'int',
        'anyscaled_config': 'str',
        'anyscaled_config_generated_at': 'datetime',
        'allow_public_internet_traffic': 'bool'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'idle_timeout': 'idle_timeout',
        'created_at': 'created_at',
        'snapshots_history': 'snapshots_history',
        'metrics_dashboard_url': 'metrics_dashboard_url',
        'connect_url': 'connect_url',
        'jupyter_notebook_url': 'jupyter_notebook_url',
        'service_proxy_url': 'service_proxy_url',
        'access_token': 'access_token',
        'ray_dashboard_url': 'ray_dashboard_url',
        'webterminal_auth_url': 'webterminal_auth_url',
        'tensorboard_available': 'tensorboard_available',
        'project_id': 'project_id',
        'host_name': 'host_name',
        'head_node_ip': 'head_node_ip',
        'state': 'state',
        'pending_state': 'pending_state',
        'state_data': 'state_data',
        'cloud_id': 'cloud_id',
        'idle_time_remaining_seconds': 'idle_time_remaining_seconds',
        'anyscaled_config': 'anyscaled_config',
        'anyscaled_config_generated_at': 'anyscaled_config_generated_at',
        'allow_public_internet_traffic': 'allow_public_internet_traffic'
    }

    def __init__(self, id=None, name=None, idle_timeout=None, created_at=None, snapshots_history=None, metrics_dashboard_url=None, connect_url=None, jupyter_notebook_url=None, service_proxy_url=None, access_token=None, ray_dashboard_url=None, webterminal_auth_url=None, tensorboard_available=None, project_id=None, host_name=None, head_node_ip=None, state=None, pending_state=None, state_data=None, cloud_id=None, idle_time_remaining_seconds=None, anyscaled_config=None, anyscaled_config_generated_at=None, allow_public_internet_traffic=False, 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._id = None
        self._name = None
        self._idle_timeout = None
        self._created_at = None
        self._snapshots_history = None
        self._metrics_dashboard_url = None
        self._connect_url = None
        self._jupyter_notebook_url = None
        self._service_proxy_url = None
        self._access_token = None
        self._ray_dashboard_url = None
        self._webterminal_auth_url = None
        self._tensorboard_available = None
        self._project_id = None
        self._host_name = None
        self._head_node_ip = None
        self._state = None
        self._pending_state = None
        self._state_data = None
        self._cloud_id = None
        self._idle_time_remaining_seconds = None
        self._anyscaled_config = None
        self._anyscaled_config_generated_at = None
        self._allow_public_internet_traffic = None
        self.discriminator = None

        self.id = id
        self.name = name
        if idle_timeout is not None:
            self.idle_timeout = idle_timeout
        self.created_at = created_at
        self.snapshots_history = snapshots_history
        if metrics_dashboard_url is not None:
            self.metrics_dashboard_url = metrics_dashboard_url
        if connect_url is not None:
            self.connect_url = connect_url
        if jupyter_notebook_url is not None:
            self.jupyter_notebook_url = jupyter_notebook_url
        if service_proxy_url is not None:
            self.service_proxy_url = service_proxy_url
        self.access_token = access_token
        if ray_dashboard_url is not None:
            self.ray_dashboard_url = ray_dashboard_url
        if webterminal_auth_url is not None:
            self.webterminal_auth_url = webterminal_auth_url
        self.tensorboard_available = tensorboard_available
        self.project_id = project_id
        if host_name is not None:
            self.host_name = host_name
        if head_node_ip is not None:
            self.head_node_ip = head_node_ip
        self.state = state
        if pending_state is not None:
            self.pending_state = pending_state
        if state_data is not None:
            self.state_data = state_data
        if cloud_id is not None:
            self.cloud_id = cloud_id
        if idle_time_remaining_seconds is not None:
            self.idle_time_remaining_seconds = idle_time_remaining_seconds
        if anyscaled_config is not None:
            self.anyscaled_config = anyscaled_config
        if anyscaled_config_generated_at is not None:
            self.anyscaled_config_generated_at = anyscaled_config_generated_at
        if allow_public_internet_traffic is not None:
            self.allow_public_internet_traffic = allow_public_internet_traffic

    @property
    def id(self):
        """Gets the id of this Session.  # 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.


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


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


        :return: The idle_timeout of this Session.  # noqa: E501
        :rtype: int
        """
        return self._idle_timeout

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


        :param idle_timeout: The idle_timeout of this Session.  # noqa: E501
        :type: int
        """

        self._idle_timeout = idle_timeout

    @property
    def created_at(self):
        """Gets the created_at of this Session.  # 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.


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


        :return: The snapshots_history of this Session.  # noqa: E501
        :rtype: list[AppliedSnapshot]
        """
        return self._snapshots_history

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


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

        self._snapshots_history = snapshots_history

    @property
    def metrics_dashboard_url(self):
        """Gets the metrics_dashboard_url of this Session.  # 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.


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

        self._metrics_dashboard_url = metrics_dashboard_url

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


        :return: The connect_url of this Session.  # noqa: E501
        :rtype: str
        """
        return self._connect_url

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


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

        self._connect_url = connect_url

    @property
    def jupyter_notebook_url(self):
        """Gets the jupyter_notebook_url of this Session.  # 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.


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

        self._jupyter_notebook_url = jupyter_notebook_url

    @property
    def service_proxy_url(self):
        """Gets the service_proxy_url of this Session.  # 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.


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

        self._service_proxy_url = service_proxy_url

    @property
    def access_token(self):
        """Gets the access_token of this Session.  # 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.


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

        self._access_token = access_token

    @property
    def ray_dashboard_url(self):
        """Gets the ray_dashboard_url of this Session.  # 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.


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

        self._ray_dashboard_url = ray_dashboard_url

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


        :return: The webterminal_auth_url of this Session.  # noqa: E501
        :rtype: str
        """
        return self._webterminal_auth_url

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


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

        self._webterminal_auth_url = webterminal_auth_url

    @property
    def tensorboard_available(self):
        """Gets the tensorboard_available of this Session.  # 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.


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


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


        :return: The host_name of this Session.  # noqa: E501
        :rtype: str
        """
        return self._host_name

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


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

        self._host_name = host_name

    @property
    def head_node_ip(self):
        """Gets the head_node_ip of this Session.  # 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.


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

        self._head_node_ip = head_node_ip

    @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

        The requsted state when a state change is requested or None if there is no requested state.  # 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.

        The requsted state when a state change is requested or None if there is no requested state.  # noqa: E501

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

        self._pending_state = pending_state

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


        :return: The state_data of this Session.  # noqa: E501
        :rtype: SessionStateData
        """
        return self._state_data

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


        :param state_data: The state_data of this Session.  # noqa: E501
        :type: SessionStateData
        """

        self._state_data = state_data

    @property
    def cloud_id(self):
        """Gets the cloud_id of this Session.  # 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.


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

        self._cloud_id = cloud_id

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

        The idle-time remaining in seconds before the session is auto-suspended.  # noqa: E501

        :return: The idle_time_remaining_seconds of this Session.  # noqa: E501
        :rtype: int
        """
        return self._idle_time_remaining_seconds

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

        The idle-time remaining in seconds before the session is auto-suspended.  # noqa: E501

        :param idle_time_remaining_seconds: The idle_time_remaining_seconds of this Session.  # noqa: E501
        :type: int
        """

        self._idle_time_remaining_seconds = idle_time_remaining_seconds

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


        :return: The anyscaled_config of this Session.  # noqa: E501
        :rtype: str
        """
        return self._anyscaled_config

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


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

        self._anyscaled_config = anyscaled_config

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


        :return: The anyscaled_config_generated_at of this Session.  # noqa: E501
        :rtype: datetime
        """
        return self._anyscaled_config_generated_at

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


        :param anyscaled_config_generated_at: The anyscaled_config_generated_at of this Session.  # noqa: E501
        :type: datetime
        """

        self._anyscaled_config_generated_at = anyscaled_config_generated_at

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


        :return: The allow_public_internet_traffic of this Session.  # noqa: E501
        :rtype: bool
        """
        return self._allow_public_internet_traffic

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


        :param allow_public_internet_traffic: The allow_public_internet_traffic of this Session.  # noqa: E501
        :type: bool
        """

        self._allow_public_internet_traffic = allow_public_internet_traffic

    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()
