# coding: utf-8

"""
    Cudo Compute service

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 1.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from src.cudo_compute.configuration import Configuration


class Cluster(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_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.
    """
    swagger_types = {
        'cpu_model': 'str',
        'create_time': 'datetime',
        'gpu_free': 'int',
        'gpu_model': 'str',
        'gpu_model_pci_types': 'list[str]',
        'gpu_price_hr': 'Decimal',
        'gpu_used': 'int',
        'host_count': 'int',
        'host_problem_count': 'int',
        'machine_type': 'str',
        'max_vcpu_per_gpu': 'float',
        'max_vcpu_per_memory_gib': 'float',
        'memory_gib_free': 'int',
        'memory_gib_price_hr': 'Decimal',
        'memory_gib_used': 'int',
        'min_vcpu_per_gpu': 'float',
        'min_vcpu_per_memory_gib': 'float',
        'update_time': 'datetime',
        'vcpu_free': 'int',
        'vcpu_per_cpu_thread': 'int',
        'vcpu_price_hr': 'Decimal',
        'vcpu_used': 'int',
        'vm_count': 'int'
    }

    attribute_map = {
        'cpu_model': 'cpuModel',
        'create_time': 'createTime',
        'gpu_free': 'gpuFree',
        'gpu_model': 'gpuModel',
        'gpu_model_pci_types': 'gpuModelPciTypes',
        'gpu_price_hr': 'gpuPriceHr',
        'gpu_used': 'gpuUsed',
        'host_count': 'hostCount',
        'host_problem_count': 'hostProblemCount',
        'machine_type': 'machineType',
        'max_vcpu_per_gpu': 'maxVcpuPerGpu',
        'max_vcpu_per_memory_gib': 'maxVcpuPerMemoryGib',
        'memory_gib_free': 'memoryGibFree',
        'memory_gib_price_hr': 'memoryGibPriceHr',
        'memory_gib_used': 'memoryGibUsed',
        'min_vcpu_per_gpu': 'minVcpuPerGpu',
        'min_vcpu_per_memory_gib': 'minVcpuPerMemoryGib',
        'update_time': 'updateTime',
        'vcpu_free': 'vcpuFree',
        'vcpu_per_cpu_thread': 'vcpuPerCpuThread',
        'vcpu_price_hr': 'vcpuPriceHr',
        'vcpu_used': 'vcpuUsed',
        'vm_count': 'vmCount'
    }

    def __init__(self, cpu_model=None, create_time=None, gpu_free=None, gpu_model=None, gpu_model_pci_types=None, gpu_price_hr=None, gpu_used=None, host_count=None, host_problem_count=None, machine_type=None, max_vcpu_per_gpu=None, max_vcpu_per_memory_gib=None, memory_gib_free=None, memory_gib_price_hr=None, memory_gib_used=None, min_vcpu_per_gpu=None, min_vcpu_per_memory_gib=None, update_time=None, vcpu_free=None, vcpu_per_cpu_thread=None, vcpu_price_hr=None, vcpu_used=None, vm_count=None, _configuration=None):  # noqa: E501
        """Cluster - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._cpu_model = None
        self._create_time = None
        self._gpu_free = None
        self._gpu_model = None
        self._gpu_model_pci_types = None
        self._gpu_price_hr = None
        self._gpu_used = None
        self._host_count = None
        self._host_problem_count = None
        self._machine_type = None
        self._max_vcpu_per_gpu = None
        self._max_vcpu_per_memory_gib = None
        self._memory_gib_free = None
        self._memory_gib_price_hr = None
        self._memory_gib_used = None
        self._min_vcpu_per_gpu = None
        self._min_vcpu_per_memory_gib = None
        self._update_time = None
        self._vcpu_free = None
        self._vcpu_per_cpu_thread = None
        self._vcpu_price_hr = None
        self._vcpu_used = None
        self._vm_count = None
        self.discriminator = None

        self.cpu_model = cpu_model
        self.create_time = create_time
        self.gpu_free = gpu_free
        self.gpu_model = gpu_model
        self.gpu_model_pci_types = gpu_model_pci_types
        self.gpu_price_hr = gpu_price_hr
        self.gpu_used = gpu_used
        self.host_count = host_count
        self.host_problem_count = host_problem_count
        self.machine_type = machine_type
        self.max_vcpu_per_gpu = max_vcpu_per_gpu
        self.max_vcpu_per_memory_gib = max_vcpu_per_memory_gib
        self.memory_gib_free = memory_gib_free
        self.memory_gib_price_hr = memory_gib_price_hr
        self.memory_gib_used = memory_gib_used
        self.min_vcpu_per_gpu = min_vcpu_per_gpu
        self.min_vcpu_per_memory_gib = min_vcpu_per_memory_gib
        self.update_time = update_time
        self.vcpu_free = vcpu_free
        self.vcpu_per_cpu_thread = vcpu_per_cpu_thread
        self.vcpu_price_hr = vcpu_price_hr
        self.vcpu_used = vcpu_used
        self.vm_count = vm_count

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


        :return: The cpu_model of this Cluster.  # noqa: E501
        :rtype: str
        """
        return self._cpu_model

    @cpu_model.setter
    def cpu_model(self, cpu_model):
        """Sets the cpu_model of this Cluster.


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

        self._cpu_model = cpu_model

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


        :return: The create_time of this Cluster.  # noqa: E501
        :rtype: datetime
        """
        return self._create_time

    @create_time.setter
    def create_time(self, create_time):
        """Sets the create_time of this Cluster.


        :param create_time: The create_time of this Cluster.  # noqa: E501
        :type: datetime
        """
        if self._configuration.client_side_validation and create_time is None:
            raise ValueError("Invalid value for `create_time`, must not be `None`")  # noqa: E501

        self._create_time = create_time

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


        :return: The gpu_free of this Cluster.  # noqa: E501
        :rtype: int
        """
        return self._gpu_free

    @gpu_free.setter
    def gpu_free(self, gpu_free):
        """Sets the gpu_free of this Cluster.


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

        self._gpu_free = gpu_free

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


        :return: The gpu_model of this Cluster.  # noqa: E501
        :rtype: str
        """
        return self._gpu_model

    @gpu_model.setter
    def gpu_model(self, gpu_model):
        """Sets the gpu_model of this Cluster.


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

        self._gpu_model = gpu_model

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


        :return: The gpu_model_pci_types of this Cluster.  # noqa: E501
        :rtype: list[str]
        """
        return self._gpu_model_pci_types

    @gpu_model_pci_types.setter
    def gpu_model_pci_types(self, gpu_model_pci_types):
        """Sets the gpu_model_pci_types of this Cluster.


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

        self._gpu_model_pci_types = gpu_model_pci_types

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


        :return: The gpu_price_hr of this Cluster.  # noqa: E501
        :rtype: Decimal
        """
        return self._gpu_price_hr

    @gpu_price_hr.setter
    def gpu_price_hr(self, gpu_price_hr):
        """Sets the gpu_price_hr of this Cluster.


        :param gpu_price_hr: The gpu_price_hr of this Cluster.  # noqa: E501
        :type: Decimal
        """
        if self._configuration.client_side_validation and gpu_price_hr is None:
            raise ValueError("Invalid value for `gpu_price_hr`, must not be `None`")  # noqa: E501

        self._gpu_price_hr = gpu_price_hr

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


        :return: The gpu_used of this Cluster.  # noqa: E501
        :rtype: int
        """
        return self._gpu_used

    @gpu_used.setter
    def gpu_used(self, gpu_used):
        """Sets the gpu_used of this Cluster.


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

        self._gpu_used = gpu_used

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


        :return: The host_count of this Cluster.  # noqa: E501
        :rtype: int
        """
        return self._host_count

    @host_count.setter
    def host_count(self, host_count):
        """Sets the host_count of this Cluster.


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

        self._host_count = host_count

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


        :return: The host_problem_count of this Cluster.  # noqa: E501
        :rtype: int
        """
        return self._host_problem_count

    @host_problem_count.setter
    def host_problem_count(self, host_problem_count):
        """Sets the host_problem_count of this Cluster.


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

        self._host_problem_count = host_problem_count

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


        :return: The machine_type of this Cluster.  # noqa: E501
        :rtype: str
        """
        return self._machine_type

    @machine_type.setter
    def machine_type(self, machine_type):
        """Sets the machine_type of this Cluster.


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

        self._machine_type = machine_type

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


        :return: The max_vcpu_per_gpu of this Cluster.  # noqa: E501
        :rtype: float
        """
        return self._max_vcpu_per_gpu

    @max_vcpu_per_gpu.setter
    def max_vcpu_per_gpu(self, max_vcpu_per_gpu):
        """Sets the max_vcpu_per_gpu of this Cluster.


        :param max_vcpu_per_gpu: The max_vcpu_per_gpu of this Cluster.  # noqa: E501
        :type: float
        """
        if self._configuration.client_side_validation and max_vcpu_per_gpu is None:
            raise ValueError("Invalid value for `max_vcpu_per_gpu`, must not be `None`")  # noqa: E501

        self._max_vcpu_per_gpu = max_vcpu_per_gpu

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


        :return: The max_vcpu_per_memory_gib of this Cluster.  # noqa: E501
        :rtype: float
        """
        return self._max_vcpu_per_memory_gib

    @max_vcpu_per_memory_gib.setter
    def max_vcpu_per_memory_gib(self, max_vcpu_per_memory_gib):
        """Sets the max_vcpu_per_memory_gib of this Cluster.


        :param max_vcpu_per_memory_gib: The max_vcpu_per_memory_gib of this Cluster.  # noqa: E501
        :type: float
        """
        if self._configuration.client_side_validation and max_vcpu_per_memory_gib is None:
            raise ValueError("Invalid value for `max_vcpu_per_memory_gib`, must not be `None`")  # noqa: E501

        self._max_vcpu_per_memory_gib = max_vcpu_per_memory_gib

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


        :return: The memory_gib_free of this Cluster.  # noqa: E501
        :rtype: int
        """
        return self._memory_gib_free

    @memory_gib_free.setter
    def memory_gib_free(self, memory_gib_free):
        """Sets the memory_gib_free of this Cluster.


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

        self._memory_gib_free = memory_gib_free

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


        :return: The memory_gib_price_hr of this Cluster.  # noqa: E501
        :rtype: Decimal
        """
        return self._memory_gib_price_hr

    @memory_gib_price_hr.setter
    def memory_gib_price_hr(self, memory_gib_price_hr):
        """Sets the memory_gib_price_hr of this Cluster.


        :param memory_gib_price_hr: The memory_gib_price_hr of this Cluster.  # noqa: E501
        :type: Decimal
        """
        if self._configuration.client_side_validation and memory_gib_price_hr is None:
            raise ValueError("Invalid value for `memory_gib_price_hr`, must not be `None`")  # noqa: E501

        self._memory_gib_price_hr = memory_gib_price_hr

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


        :return: The memory_gib_used of this Cluster.  # noqa: E501
        :rtype: int
        """
        return self._memory_gib_used

    @memory_gib_used.setter
    def memory_gib_used(self, memory_gib_used):
        """Sets the memory_gib_used of this Cluster.


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

        self._memory_gib_used = memory_gib_used

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


        :return: The min_vcpu_per_gpu of this Cluster.  # noqa: E501
        :rtype: float
        """
        return self._min_vcpu_per_gpu

    @min_vcpu_per_gpu.setter
    def min_vcpu_per_gpu(self, min_vcpu_per_gpu):
        """Sets the min_vcpu_per_gpu of this Cluster.


        :param min_vcpu_per_gpu: The min_vcpu_per_gpu of this Cluster.  # noqa: E501
        :type: float
        """
        if self._configuration.client_side_validation and min_vcpu_per_gpu is None:
            raise ValueError("Invalid value for `min_vcpu_per_gpu`, must not be `None`")  # noqa: E501

        self._min_vcpu_per_gpu = min_vcpu_per_gpu

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


        :return: The min_vcpu_per_memory_gib of this Cluster.  # noqa: E501
        :rtype: float
        """
        return self._min_vcpu_per_memory_gib

    @min_vcpu_per_memory_gib.setter
    def min_vcpu_per_memory_gib(self, min_vcpu_per_memory_gib):
        """Sets the min_vcpu_per_memory_gib of this Cluster.


        :param min_vcpu_per_memory_gib: The min_vcpu_per_memory_gib of this Cluster.  # noqa: E501
        :type: float
        """
        if self._configuration.client_side_validation and min_vcpu_per_memory_gib is None:
            raise ValueError("Invalid value for `min_vcpu_per_memory_gib`, must not be `None`")  # noqa: E501

        self._min_vcpu_per_memory_gib = min_vcpu_per_memory_gib

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


        :return: The update_time of this Cluster.  # noqa: E501
        :rtype: datetime
        """
        return self._update_time

    @update_time.setter
    def update_time(self, update_time):
        """Sets the update_time of this Cluster.


        :param update_time: The update_time of this Cluster.  # noqa: E501
        :type: datetime
        """
        if self._configuration.client_side_validation and update_time is None:
            raise ValueError("Invalid value for `update_time`, must not be `None`")  # noqa: E501

        self._update_time = update_time

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


        :return: The vcpu_free of this Cluster.  # noqa: E501
        :rtype: int
        """
        return self._vcpu_free

    @vcpu_free.setter
    def vcpu_free(self, vcpu_free):
        """Sets the vcpu_free of this Cluster.


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

        self._vcpu_free = vcpu_free

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


        :return: The vcpu_per_cpu_thread of this Cluster.  # noqa: E501
        :rtype: int
        """
        return self._vcpu_per_cpu_thread

    @vcpu_per_cpu_thread.setter
    def vcpu_per_cpu_thread(self, vcpu_per_cpu_thread):
        """Sets the vcpu_per_cpu_thread of this Cluster.


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

        self._vcpu_per_cpu_thread = vcpu_per_cpu_thread

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


        :return: The vcpu_price_hr of this Cluster.  # noqa: E501
        :rtype: Decimal
        """
        return self._vcpu_price_hr

    @vcpu_price_hr.setter
    def vcpu_price_hr(self, vcpu_price_hr):
        """Sets the vcpu_price_hr of this Cluster.


        :param vcpu_price_hr: The vcpu_price_hr of this Cluster.  # noqa: E501
        :type: Decimal
        """
        if self._configuration.client_side_validation and vcpu_price_hr is None:
            raise ValueError("Invalid value for `vcpu_price_hr`, must not be `None`")  # noqa: E501

        self._vcpu_price_hr = vcpu_price_hr

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


        :return: The vcpu_used of this Cluster.  # noqa: E501
        :rtype: int
        """
        return self._vcpu_used

    @vcpu_used.setter
    def vcpu_used(self, vcpu_used):
        """Sets the vcpu_used of this Cluster.


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

        self._vcpu_used = vcpu_used

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


        :return: The vm_count of this Cluster.  # noqa: E501
        :rtype: int
        """
        return self._vm_count

    @vm_count.setter
    def vm_count(self, vm_count):
        """Sets the vm_count of this Cluster.


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

        self._vm_count = vm_count

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_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
        if issubclass(Cluster, dict):
            for key, value in self.items():
                result[key] = 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, Cluster):
            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, Cluster):
            return True

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