# 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 NodeMetrics(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 = {
        'node_id': 'str',
        'cpu_usage': 'float',
        'memory_used': 'int',
        'memory_total': 'int',
        'gpus': 'list[GPUUsage]',
        'object_store_usage': 'int',
        'object_store_free': 'int',
        'disk_usage': 'int',
        'disk_free': 'int',
        'network_sent': 'int',
        'network_received': 'int'
    }

    attribute_map = {
        'node_id': 'node_id',
        'cpu_usage': 'cpu_usage',
        'memory_used': 'memory_used',
        'memory_total': 'memory_total',
        'gpus': 'gpus',
        'object_store_usage': 'object_store_usage',
        'object_store_free': 'object_store_free',
        'disk_usage': 'disk_usage',
        'disk_free': 'disk_free',
        'network_sent': 'network_sent',
        'network_received': 'network_received'
    }

    def __init__(self, node_id=None, cpu_usage=None, memory_used=None, memory_total=None, gpus=None, object_store_usage=None, object_store_free=None, disk_usage=None, disk_free=None, network_sent=None, network_received=None, local_vars_configuration=None):  # noqa: E501
        """NodeMetrics - 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._node_id = None
        self._cpu_usage = None
        self._memory_used = None
        self._memory_total = None
        self._gpus = None
        self._object_store_usage = None
        self._object_store_free = None
        self._disk_usage = None
        self._disk_free = None
        self._network_sent = None
        self._network_received = None
        self.discriminator = None

        self.node_id = node_id
        if cpu_usage is not None:
            self.cpu_usage = cpu_usage
        if memory_used is not None:
            self.memory_used = memory_used
        if memory_total is not None:
            self.memory_total = memory_total
        self.gpus = gpus
        if object_store_usage is not None:
            self.object_store_usage = object_store_usage
        if object_store_free is not None:
            self.object_store_free = object_store_free
        if disk_usage is not None:
            self.disk_usage = disk_usage
        if disk_free is not None:
            self.disk_free = disk_free
        if network_sent is not None:
            self.network_sent = network_sent
        if network_received is not None:
            self.network_received = network_received

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

        The ID of the node.  # noqa: E501

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

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

        The ID of the node.  # noqa: E501

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

        self._node_id = node_id

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

        The CPU usage in percentage of the node.  # noqa: E501

        :return: The cpu_usage of this NodeMetrics.  # noqa: E501
        :rtype: float
        """
        return self._cpu_usage

    @cpu_usage.setter
    def cpu_usage(self, cpu_usage):
        """Sets the cpu_usage of this NodeMetrics.

        The CPU usage in percentage of the node.  # noqa: E501

        :param cpu_usage: The cpu_usage of this NodeMetrics.  # noqa: E501
        :type: float
        """

        self._cpu_usage = cpu_usage

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

        The memory used in bytes of the node.  # noqa: E501

        :return: The memory_used of this NodeMetrics.  # noqa: E501
        :rtype: int
        """
        return self._memory_used

    @memory_used.setter
    def memory_used(self, memory_used):
        """Sets the memory_used of this NodeMetrics.

        The memory used in bytes of the node.  # noqa: E501

        :param memory_used: The memory_used of this NodeMetrics.  # noqa: E501
        :type: int
        """

        self._memory_used = memory_used

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

        The memory total in bytes of the node.  # noqa: E501

        :return: The memory_total of this NodeMetrics.  # noqa: E501
        :rtype: int
        """
        return self._memory_total

    @memory_total.setter
    def memory_total(self, memory_total):
        """Sets the memory_total of this NodeMetrics.

        The memory total in bytes of the node.  # noqa: E501

        :param memory_total: The memory_total of this NodeMetrics.  # noqa: E501
        :type: int
        """

        self._memory_total = memory_total

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

        The GPUs used by the node.  # noqa: E501

        :return: The gpus of this NodeMetrics.  # noqa: E501
        :rtype: list[GPUUsage]
        """
        return self._gpus

    @gpus.setter
    def gpus(self, gpus):
        """Sets the gpus of this NodeMetrics.

        The GPUs used by the node.  # noqa: E501

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

        self._gpus = gpus

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

        The object store usage in bytes of the node.  # noqa: E501

        :return: The object_store_usage of this NodeMetrics.  # noqa: E501
        :rtype: int
        """
        return self._object_store_usage

    @object_store_usage.setter
    def object_store_usage(self, object_store_usage):
        """Sets the object_store_usage of this NodeMetrics.

        The object store usage in bytes of the node.  # noqa: E501

        :param object_store_usage: The object_store_usage of this NodeMetrics.  # noqa: E501
        :type: int
        """

        self._object_store_usage = object_store_usage

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

        The object store free in bytes of the node.  # noqa: E501

        :return: The object_store_free of this NodeMetrics.  # noqa: E501
        :rtype: int
        """
        return self._object_store_free

    @object_store_free.setter
    def object_store_free(self, object_store_free):
        """Sets the object_store_free of this NodeMetrics.

        The object store free in bytes of the node.  # noqa: E501

        :param object_store_free: The object_store_free of this NodeMetrics.  # noqa: E501
        :type: int
        """

        self._object_store_free = object_store_free

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

        The disk usage in bytes of the node.  # noqa: E501

        :return: The disk_usage of this NodeMetrics.  # noqa: E501
        :rtype: int
        """
        return self._disk_usage

    @disk_usage.setter
    def disk_usage(self, disk_usage):
        """Sets the disk_usage of this NodeMetrics.

        The disk usage in bytes of the node.  # noqa: E501

        :param disk_usage: The disk_usage of this NodeMetrics.  # noqa: E501
        :type: int
        """

        self._disk_usage = disk_usage

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

        The disk free in bytes of the node.  # noqa: E501

        :return: The disk_free of this NodeMetrics.  # noqa: E501
        :rtype: int
        """
        return self._disk_free

    @disk_free.setter
    def disk_free(self, disk_free):
        """Sets the disk_free of this NodeMetrics.

        The disk free in bytes of the node.  # noqa: E501

        :param disk_free: The disk_free of this NodeMetrics.  # noqa: E501
        :type: int
        """

        self._disk_free = disk_free

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

        The network sent in bytes of the node.  # noqa: E501

        :return: The network_sent of this NodeMetrics.  # noqa: E501
        :rtype: int
        """
        return self._network_sent

    @network_sent.setter
    def network_sent(self, network_sent):
        """Sets the network_sent of this NodeMetrics.

        The network sent in bytes of the node.  # noqa: E501

        :param network_sent: The network_sent of this NodeMetrics.  # noqa: E501
        :type: int
        """

        self._network_sent = network_sent

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

        The network received in bytes of the node.  # noqa: E501

        :return: The network_received of this NodeMetrics.  # noqa: E501
        :rtype: int
        """
        return self._network_received

    @network_received.setter
    def network_received(self, network_received):
        """Sets the network_received of this NodeMetrics.

        The network received in bytes of the node.  # noqa: E501

        :param network_received: The network_received of this NodeMetrics.  # noqa: E501
        :type: int
        """

        self._network_received = network_received

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

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