# 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 MachineInfo(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 = {
        'machine_id': 'str',
        'hostname': 'str',
        'machine_shape': 'str',
        'num_cpus': 'int',
        'num_gpus': 'int',
        'memory_bytes': 'int',
        'connection_state': 'MachineConnectionState',
        'allocation_state': 'MachineAllocationState',
        'node_id': 'str',
        'cluster_id': 'str',
        'cluster_creator_name': 'str',
        'cluster_name': 'str',
        'anyscale_version': 'str'
    }

    attribute_map = {
        'machine_id': 'machine_id',
        'hostname': 'hostname',
        'machine_shape': 'machine_shape',
        'num_cpus': 'num_cpus',
        'num_gpus': 'num_gpus',
        'memory_bytes': 'memory_bytes',
        'connection_state': 'connection_state',
        'allocation_state': 'allocation_state',
        'node_id': 'node_id',
        'cluster_id': 'cluster_id',
        'cluster_creator_name': 'cluster_creator_name',
        'cluster_name': 'cluster_name',
        'anyscale_version': 'anyscale_version'
    }

    def __init__(self, machine_id=None, hostname=None, machine_shape=None, num_cpus=None, num_gpus=None, memory_bytes=None, connection_state=None, allocation_state=None, node_id=None, cluster_id=None, cluster_creator_name=None, cluster_name=None, anyscale_version=None, local_vars_configuration=None):  # noqa: E501
        """MachineInfo - 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._machine_id = None
        self._hostname = None
        self._machine_shape = None
        self._num_cpus = None
        self._num_gpus = None
        self._memory_bytes = None
        self._connection_state = None
        self._allocation_state = None
        self._node_id = None
        self._cluster_id = None
        self._cluster_creator_name = None
        self._cluster_name = None
        self._anyscale_version = None
        self.discriminator = None

        self.machine_id = machine_id
        self.hostname = hostname
        self.machine_shape = machine_shape
        self.num_cpus = num_cpus
        self.num_gpus = num_gpus
        self.memory_bytes = memory_bytes
        self.connection_state = connection_state
        self.allocation_state = allocation_state
        if node_id is not None:
            self.node_id = node_id
        if cluster_id is not None:
            self.cluster_id = cluster_id
        if cluster_creator_name is not None:
            self.cluster_creator_name = cluster_creator_name
        if cluster_name is not None:
            self.cluster_name = cluster_name
        if anyscale_version is not None:
            self.anyscale_version = anyscale_version

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

        The ID for this machine.  # noqa: E501

        :return: The machine_id of this MachineInfo.  # noqa: E501
        :rtype: str
        """
        return self._machine_id

    @machine_id.setter
    def machine_id(self, machine_id):
        """Sets the machine_id of this MachineInfo.

        The ID for this machine.  # noqa: E501

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

        self._machine_id = machine_id

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

        The hostname for this machine.  # noqa: E501

        :return: The hostname of this MachineInfo.  # noqa: E501
        :rtype: str
        """
        return self._hostname

    @hostname.setter
    def hostname(self, hostname):
        """Sets the hostname of this MachineInfo.

        The hostname for this machine.  # noqa: E501

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

        self._hostname = hostname

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

        The physical shape for this machine.  # noqa: E501

        :return: The machine_shape of this MachineInfo.  # noqa: E501
        :rtype: str
        """
        return self._machine_shape

    @machine_shape.setter
    def machine_shape(self, machine_shape):
        """Sets the machine_shape of this MachineInfo.

        The physical shape for this machine.  # noqa: E501

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

        self._machine_shape = machine_shape

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

        The number of CPUs for this machine.  # noqa: E501

        :return: The num_cpus of this MachineInfo.  # noqa: E501
        :rtype: int
        """
        return self._num_cpus

    @num_cpus.setter
    def num_cpus(self, num_cpus):
        """Sets the num_cpus of this MachineInfo.

        The number of CPUs for this machine.  # noqa: E501

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

        self._num_cpus = num_cpus

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

        The number of GPUs for this machine.  # noqa: E501

        :return: The num_gpus of this MachineInfo.  # noqa: E501
        :rtype: int
        """
        return self._num_gpus

    @num_gpus.setter
    def num_gpus(self, num_gpus):
        """Sets the num_gpus of this MachineInfo.

        The number of GPUs for this machine.  # noqa: E501

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

        self._num_gpus = num_gpus

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

        The amount of memory in bytes for this machine.  # noqa: E501

        :return: The memory_bytes of this MachineInfo.  # noqa: E501
        :rtype: int
        """
        return self._memory_bytes

    @memory_bytes.setter
    def memory_bytes(self, memory_bytes):
        """Sets the memory_bytes of this MachineInfo.

        The amount of memory in bytes for this machine.  # noqa: E501

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

        self._memory_bytes = memory_bytes

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

        The connection state for this machine.  # noqa: E501

        :return: The connection_state of this MachineInfo.  # noqa: E501
        :rtype: MachineConnectionState
        """
        return self._connection_state

    @connection_state.setter
    def connection_state(self, connection_state):
        """Sets the connection_state of this MachineInfo.

        The connection state for this machine.  # noqa: E501

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

        self._connection_state = connection_state

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

        The allocation state for this machine.  # noqa: E501

        :return: The allocation_state of this MachineInfo.  # noqa: E501
        :rtype: MachineAllocationState
        """
        return self._allocation_state

    @allocation_state.setter
    def allocation_state(self, allocation_state):
        """Sets the allocation_state of this MachineInfo.

        The allocation state for this machine.  # noqa: E501

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

        self._allocation_state = allocation_state

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

        The node ID for this machine if it's allocated to a Ray cluster.  # noqa: E501

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

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

        The node ID for this machine if it's allocated to a Ray cluster.  # noqa: E501

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

        self._node_id = node_id

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

        If allocated to a Ray cluster, the ID of the cluster.  # noqa: E501

        :return: The cluster_id of this MachineInfo.  # noqa: E501
        :rtype: str
        """
        return self._cluster_id

    @cluster_id.setter
    def cluster_id(self, cluster_id):
        """Sets the cluster_id of this MachineInfo.

        If allocated to a Ray cluster, the ID of the cluster.  # noqa: E501

        :param cluster_id: The cluster_id of this MachineInfo.  # noqa: E501
        :type: str
        """

        self._cluster_id = cluster_id

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

        If allocated to a Ray cluster, the name of the creator of the cluster.  # noqa: E501

        :return: The cluster_creator_name of this MachineInfo.  # noqa: E501
        :rtype: str
        """
        return self._cluster_creator_name

    @cluster_creator_name.setter
    def cluster_creator_name(self, cluster_creator_name):
        """Sets the cluster_creator_name of this MachineInfo.

        If allocated to a Ray cluster, the name of the creator of the cluster.  # noqa: E501

        :param cluster_creator_name: The cluster_creator_name of this MachineInfo.  # noqa: E501
        :type: str
        """

        self._cluster_creator_name = cluster_creator_name

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

        If allocated to a Ray cluster, the name of the cluster.  # noqa: E501

        :return: The cluster_name of this MachineInfo.  # noqa: E501
        :rtype: str
        """
        return self._cluster_name

    @cluster_name.setter
    def cluster_name(self, cluster_name):
        """Sets the cluster_name of this MachineInfo.

        If allocated to a Ray cluster, the name of the cluster.  # noqa: E501

        :param cluster_name: The cluster_name of this MachineInfo.  # noqa: E501
        :type: str
        """

        self._cluster_name = cluster_name

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

        The version of Anyscale running on this machine.  # noqa: E501

        :return: The anyscale_version of this MachineInfo.  # noqa: E501
        :rtype: str
        """
        return self._anyscale_version

    @anyscale_version.setter
    def anyscale_version(self, anyscale_version):
        """Sets the anyscale_version of this MachineInfo.

        The version of Anyscale running on this machine.  # noqa: E501

        :param anyscale_version: The anyscale_version of this MachineInfo.  # noqa: E501
        :type: str
        """

        self._anyscale_version = anyscale_version

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

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