# 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 Resources(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 = {
        'cpu': 'int',
        'gpu': 'int',
        'memory': 'int',
        'object_store_memory': 'int',
        'custom_resources': 'dict(str, int)'
    }

    attribute_map = {
        'cpu': 'cpu',
        'gpu': 'gpu',
        'memory': 'memory',
        'object_store_memory': 'object_store_memory',
        'custom_resources': 'custom_resources'
    }

    def __init__(self, cpu=None, gpu=None, memory=None, object_store_memory=None, custom_resources=None, local_vars_configuration=None):  # noqa: E501
        """Resources - 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._cpu = None
        self._gpu = None
        self._memory = None
        self._object_store_memory = None
        self._custom_resources = None
        self.discriminator = None

        if cpu is not None:
            self.cpu = cpu
        if gpu is not None:
            self.gpu = gpu
        if memory is not None:
            self.memory = memory
        if object_store_memory is not None:
            self.object_store_memory = object_store_memory
        if custom_resources is not None:
            self.custom_resources = custom_resources

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

        Number of CPUs in this node type. If left blank, Ray may automatically detect it for you; see https://docs.ray.io/en/master/cluster/vms/references/ray-cluster-configuration.html#resources for more.  # noqa: E501

        :return: The cpu of this Resources.  # noqa: E501
        :rtype: int
        """
        return self._cpu

    @cpu.setter
    def cpu(self, cpu):
        """Sets the cpu of this Resources.

        Number of CPUs in this node type. If left blank, Ray may automatically detect it for you; see https://docs.ray.io/en/master/cluster/vms/references/ray-cluster-configuration.html#resources for more.  # noqa: E501

        :param cpu: The cpu of this Resources.  # noqa: E501
        :type: int
        """

        self._cpu = cpu

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

        Number of GPUs in this node type. If left blank, Ray may automatically detect it for you; see https://docs.ray.io/en/master/cluster/vms/references/ray-cluster-configuration.html#resources for more.  # noqa: E501

        :return: The gpu of this Resources.  # noqa: E501
        :rtype: int
        """
        return self._gpu

    @gpu.setter
    def gpu(self, gpu):
        """Sets the gpu of this Resources.

        Number of GPUs in this node type. If left blank, Ray may automatically detect it for you; see https://docs.ray.io/en/master/cluster/vms/references/ray-cluster-configuration.html#resources for more.  # noqa: E501

        :param gpu: The gpu of this Resources.  # noqa: E501
        :type: int
        """

        self._gpu = gpu

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

        Amount of memory to allocate to the Python worker. If left blank, Ray will choose an appropriate amount based on available resources; see https://docs.ray.io/en/master/cluster/vms/references/ray-cluster-configuration.html#resources for more.  # noqa: E501

        :return: The memory of this Resources.  # noqa: E501
        :rtype: int
        """
        return self._memory

    @memory.setter
    def memory(self, memory):
        """Sets the memory of this Resources.

        Amount of memory to allocate to the Python worker. If left blank, Ray will choose an appropriate amount based on available resources; see https://docs.ray.io/en/master/cluster/vms/references/ray-cluster-configuration.html#resources for more.  # noqa: E501

        :param memory: The memory of this Resources.  # noqa: E501
        :type: int
        """

        self._memory = memory

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

        The amount of memory in bytes allocated for the Ray object store on this node. If left blank, Ray will choose an appropriate amount; see https://docs.ray.io/en/master/cluster/vms/references/ray-cluster-configuration.html#resources for more.  # noqa: E501

        :return: The object_store_memory of this Resources.  # noqa: E501
        :rtype: int
        """
        return self._object_store_memory

    @object_store_memory.setter
    def object_store_memory(self, object_store_memory):
        """Sets the object_store_memory of this Resources.

        The amount of memory in bytes allocated for the Ray object store on this node. If left blank, Ray will choose an appropriate amount; see https://docs.ray.io/en/master/cluster/vms/references/ray-cluster-configuration.html#resources for more.  # noqa: E501

        :param object_store_memory: The object_store_memory of this Resources.  # noqa: E501
        :type: int
        """

        self._object_store_memory = object_store_memory

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

        Declare custom resources for this node to be used by Ray autoscaler.  # noqa: E501

        :return: The custom_resources of this Resources.  # noqa: E501
        :rtype: dict(str, int)
        """
        return self._custom_resources

    @custom_resources.setter
    def custom_resources(self, custom_resources):
        """Sets the custom_resources of this Resources.

        Declare custom resources for this node to be used by Ray autoscaler.  # noqa: E501

        :param custom_resources: The custom_resources of this Resources.  # noqa: E501
        :type: dict(str, int)
        """

        self._custom_resources = custom_resources

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

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