# coding: utf-8

"""
    Anyscale 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 anyscale_client.configuration import Configuration


class PhysicalResources(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',
        'tpu': 'int',
        'accelerator': 'str',
        'anyscale_tpu_hosts': 'int',
        'cpu_architecture': 'str'
    }

    attribute_map = {
        'cpu': 'cpu',
        'gpu': 'gpu',
        'memory': 'memory',
        'tpu': 'tpu',
        'accelerator': 'accelerator',
        'anyscale_tpu_hosts': 'anyscale/tpu_hosts',
        'cpu_architecture': 'cpu_architecture'
    }

    def __init__(self, cpu=None, gpu=None, memory=None, tpu=None, accelerator=None, anyscale_tpu_hosts=None, cpu_architecture=None, local_vars_configuration=None):  # noqa: E501
        """PhysicalResources - 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._tpu = None
        self._accelerator = None
        self._anyscale_tpu_hosts = None
        self._cpu_architecture = 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 tpu is not None:
            self.tpu = tpu
        if accelerator is not None:
            self.accelerator = accelerator
        if anyscale_tpu_hosts is not None:
            self.anyscale_tpu_hosts = anyscale_tpu_hosts
        if cpu_architecture is not None:
            self.cpu_architecture = cpu_architecture

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

        Number of CPUs to allocate.  # noqa: E501

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

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

        Number of CPUs to allocate.  # noqa: E501

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

        self._cpu = cpu

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

        Number of GPUs to allocate.  # noqa: E501

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

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

        Number of GPUs to allocate.  # noqa: E501

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

        self._gpu = gpu

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

        Amount of memory in bytes to allocate.  # noqa: E501

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

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

        Amount of memory in bytes to allocate.  # noqa: E501

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

        self._memory = memory

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

        Number of TPUs to allocate.  # noqa: E501

        :return: The tpu of this PhysicalResources.  # noqa: E501
        :rtype: int
        """
        return self._tpu

    @tpu.setter
    def tpu(self, tpu):
        """Sets the tpu of this PhysicalResources.

        Number of TPUs to allocate.  # noqa: E501

        :param tpu: The tpu of this PhysicalResources.  # noqa: E501
        :type: int
        """

        self._tpu = tpu

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

        Type of accelerator (e.g., 'T4', 'L4', 'H100').  # noqa: E501

        :return: The accelerator of this PhysicalResources.  # noqa: E501
        :rtype: str
        """
        return self._accelerator

    @accelerator.setter
    def accelerator(self, accelerator):
        """Sets the accelerator of this PhysicalResources.

        Type of accelerator (e.g., 'T4', 'L4', 'H100').  # noqa: E501

        :param accelerator: The accelerator of this PhysicalResources.  # noqa: E501
        :type: str
        """

        self._accelerator = accelerator

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

        Number of TPU hosts (for anyscale/tpu_hosts custom resource).  # noqa: E501

        :return: The anyscale_tpu_hosts of this PhysicalResources.  # noqa: E501
        :rtype: int
        """
        return self._anyscale_tpu_hosts

    @anyscale_tpu_hosts.setter
    def anyscale_tpu_hosts(self, anyscale_tpu_hosts):
        """Sets the anyscale_tpu_hosts of this PhysicalResources.

        Number of TPU hosts (for anyscale/tpu_hosts custom resource).  # noqa: E501

        :param anyscale_tpu_hosts: The anyscale_tpu_hosts of this PhysicalResources.  # noqa: E501
        :type: int
        """

        self._anyscale_tpu_hosts = anyscale_tpu_hosts

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

        CPU architecture type. Valid values: 'x86_64' (default), 'arm64'.  # noqa: E501

        :return: The cpu_architecture of this PhysicalResources.  # noqa: E501
        :rtype: str
        """
        return self._cpu_architecture

    @cpu_architecture.setter
    def cpu_architecture(self, cpu_architecture):
        """Sets the cpu_architecture of this PhysicalResources.

        CPU architecture type. Valid values: 'x86_64' (default), 'arm64'.  # noqa: E501

        :param cpu_architecture: The cpu_architecture of this PhysicalResources.  # noqa: E501
        :type: str
        """

        self._cpu_architecture = cpu_architecture

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

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