# 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 GPUUsage(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 = {
        'gpu_index': 'int',
        'gpu_device_name': 'str',
        'gpu_usage': 'float',
        'gram_usage': 'int',
        'gram_free': 'int'
    }

    attribute_map = {
        'gpu_index': 'gpu_index',
        'gpu_device_name': 'gpu_device_name',
        'gpu_usage': 'gpu_usage',
        'gram_usage': 'gram_usage',
        'gram_free': 'gram_free'
    }

    def __init__(self, gpu_index=None, gpu_device_name=None, gpu_usage=None, gram_usage=None, gram_free=None, local_vars_configuration=None):  # noqa: E501
        """GPUUsage - 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._gpu_index = None
        self._gpu_device_name = None
        self._gpu_usage = None
        self._gram_usage = None
        self._gram_free = None
        self.discriminator = None

        self.gpu_index = gpu_index
        self.gpu_device_name = gpu_device_name
        if gpu_usage is not None:
            self.gpu_usage = gpu_usage
        if gram_usage is not None:
            self.gram_usage = gram_usage
        if gram_free is not None:
            self.gram_free = gram_free

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

        The index of the GPU.  # noqa: E501

        :return: The gpu_index of this GPUUsage.  # noqa: E501
        :rtype: int
        """
        return self._gpu_index

    @gpu_index.setter
    def gpu_index(self, gpu_index):
        """Sets the gpu_index of this GPUUsage.

        The index of the GPU.  # noqa: E501

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

        self._gpu_index = gpu_index

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

        The device name of the GPU.  # noqa: E501

        :return: The gpu_device_name of this GPUUsage.  # noqa: E501
        :rtype: str
        """
        return self._gpu_device_name

    @gpu_device_name.setter
    def gpu_device_name(self, gpu_device_name):
        """Sets the gpu_device_name of this GPUUsage.

        The device name of the GPU.  # noqa: E501

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

        self._gpu_device_name = gpu_device_name

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

        The GPU usage in percentage of this GPU.  # noqa: E501

        :return: The gpu_usage of this GPUUsage.  # noqa: E501
        :rtype: float
        """
        return self._gpu_usage

    @gpu_usage.setter
    def gpu_usage(self, gpu_usage):
        """Sets the gpu_usage of this GPUUsage.

        The GPU usage in percentage of this GPU.  # noqa: E501

        :param gpu_usage: The gpu_usage of this GPUUsage.  # noqa: E501
        :type: float
        """

        self._gpu_usage = gpu_usage

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

        The GRAM usage in bytes of this GPU.  # noqa: E501

        :return: The gram_usage of this GPUUsage.  # noqa: E501
        :rtype: int
        """
        return self._gram_usage

    @gram_usage.setter
    def gram_usage(self, gram_usage):
        """Sets the gram_usage of this GPUUsage.

        The GRAM usage in bytes of this GPU.  # noqa: E501

        :param gram_usage: The gram_usage of this GPUUsage.  # noqa: E501
        :type: int
        """

        self._gram_usage = gram_usage

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

        The GRAM free in bytes of this GPU.  # noqa: E501

        :return: The gram_free of this GPUUsage.  # noqa: E501
        :rtype: int
        """
        return self._gram_free

    @gram_free.setter
    def gram_free(self, gram_free):
        """Sets the gram_free of this GPUUsage.

        The GRAM free in bytes of this GPU.  # noqa: E501

        :param gram_free: The gram_free of this GPUUsage.  # noqa: E501
        :type: int
        """

        self._gram_free = gram_free

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

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