# coding: utf-8
try:
    from inspect import getfullargspec
except ImportError:
    from inspect import getargspec as getfullargspec
import pprint
import re  # noqa: F401
import six

from aoc.configuration import Configuration


class Datacenter(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 = {
        'cluster_num': 'int',
        'clusters': 'list[NestedCluster]',
        'failure_data_space': 'int',
        'host_num': 'int',
        'id': 'str',
        'labels': 'list[NestedLabel]',
        'name': 'str',
        'organization': 'NestedOrganization',
        'total_cpu_hz': 'int',
        'total_data_capacity': 'int',
        'total_memory_bytes': 'int',
        'used_cpu_hz': 'float',
        'used_data_space': 'int',
        'used_memory_bytes': 'float',
        'vm_num': 'int'
    }

    attribute_map = {
        'cluster_num': 'cluster_num',
        'clusters': 'clusters',
        'failure_data_space': 'failure_data_space',
        'host_num': 'host_num',
        'id': 'id',
        'labels': 'labels',
        'name': 'name',
        'organization': 'organization',
        'total_cpu_hz': 'total_cpu_hz',
        'total_data_capacity': 'total_data_capacity',
        'total_memory_bytes': 'total_memory_bytes',
        'used_cpu_hz': 'used_cpu_hz',
        'used_data_space': 'used_data_space',
        'used_memory_bytes': 'used_memory_bytes',
        'vm_num': 'vm_num'
    }

    def __init__(self, **kwargs):  # noqa: E501
        """Datacenter - a model defined in OpenAPI"""  # noqa: E501
        self.local_vars_configuration = kwargs.get("local_vars_configuration", Configuration.get_default_copy())

        self._cluster_num = None
        self._clusters = None
        self._failure_data_space = None
        self._host_num = None
        self._id = None
        self._labels = None
        self._name = None
        self._organization = None
        self._total_cpu_hz = None
        self._total_data_capacity = None
        self._total_memory_bytes = None
        self._used_cpu_hz = None
        self._used_data_space = None
        self._used_memory_bytes = None
        self._vm_num = None
        self.discriminator = None

        self.cluster_num = kwargs.get("cluster_num", None)
        self.clusters = kwargs.get("clusters", None)
        self.failure_data_space = kwargs.get("failure_data_space", None)
        self.host_num = kwargs.get("host_num", None)
        if "id" in kwargs:
            self.id = kwargs["id"]
        self.labels = kwargs.get("labels", None)
        if "name" in kwargs:
            self.name = kwargs["name"]
        if "organization" in kwargs:
            self.organization = kwargs["organization"]
        self.total_cpu_hz = kwargs.get("total_cpu_hz", None)
        self.total_data_capacity = kwargs.get("total_data_capacity", None)
        self.total_memory_bytes = kwargs.get("total_memory_bytes", None)
        self.used_cpu_hz = kwargs.get("used_cpu_hz", None)
        self.used_data_space = kwargs.get("used_data_space", None)
        self.used_memory_bytes = kwargs.get("used_memory_bytes", None)
        self.vm_num = kwargs.get("vm_num", None)

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


        :return: The cluster_num of this Datacenter.  # noqa: E501
        :rtype: int
        """
        return self._cluster_num

    @cluster_num.setter
    def cluster_num(self, cluster_num):
        """Sets the cluster_num of this Datacenter.


        :param cluster_num: The cluster_num of this Datacenter.  # noqa: E501
        :type cluster_num: int
        """

        self._cluster_num = cluster_num

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


        :return: The clusters of this Datacenter.  # noqa: E501
        :rtype: list[NestedCluster]
        """
        return self._clusters

    @clusters.setter
    def clusters(self, clusters):
        """Sets the clusters of this Datacenter.


        :param clusters: The clusters of this Datacenter.  # noqa: E501
        :type clusters: list[NestedCluster]
        """

        self._clusters = clusters

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


        :return: The failure_data_space of this Datacenter.  # noqa: E501
        :rtype: int
        """
        return self._failure_data_space

    @failure_data_space.setter
    def failure_data_space(self, failure_data_space):
        """Sets the failure_data_space of this Datacenter.


        :param failure_data_space: The failure_data_space of this Datacenter.  # noqa: E501
        :type failure_data_space: int
        """

        self._failure_data_space = failure_data_space

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


        :return: The host_num of this Datacenter.  # noqa: E501
        :rtype: int
        """
        return self._host_num

    @host_num.setter
    def host_num(self, host_num):
        """Sets the host_num of this Datacenter.


        :param host_num: The host_num of this Datacenter.  # noqa: E501
        :type host_num: int
        """

        self._host_num = host_num

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


        :return: The id of this Datacenter.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Datacenter.


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

        self._id = id

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


        :return: The labels of this Datacenter.  # noqa: E501
        :rtype: list[NestedLabel]
        """
        return self._labels

    @labels.setter
    def labels(self, labels):
        """Sets the labels of this Datacenter.


        :param labels: The labels of this Datacenter.  # noqa: E501
        :type labels: list[NestedLabel]
        """

        self._labels = labels

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


        :return: The name of this Datacenter.  # noqa: E501
        :rtype: str
        """
        return self._name

    @name.setter
    def name(self, name):
        """Sets the name of this Datacenter.


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

        self._name = name

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


        :return: The organization of this Datacenter.  # noqa: E501
        :rtype: NestedOrganization
        """
        return self._organization

    @organization.setter
    def organization(self, organization):
        """Sets the organization of this Datacenter.


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

        self._organization = organization

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


        :return: The total_cpu_hz of this Datacenter.  # noqa: E501
        :rtype: int
        """
        return self._total_cpu_hz

    @total_cpu_hz.setter
    def total_cpu_hz(self, total_cpu_hz):
        """Sets the total_cpu_hz of this Datacenter.


        :param total_cpu_hz: The total_cpu_hz of this Datacenter.  # noqa: E501
        :type total_cpu_hz: int
        """

        self._total_cpu_hz = total_cpu_hz

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


        :return: The total_data_capacity of this Datacenter.  # noqa: E501
        :rtype: int
        """
        return self._total_data_capacity

    @total_data_capacity.setter
    def total_data_capacity(self, total_data_capacity):
        """Sets the total_data_capacity of this Datacenter.


        :param total_data_capacity: The total_data_capacity of this Datacenter.  # noqa: E501
        :type total_data_capacity: int
        """

        self._total_data_capacity = total_data_capacity

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


        :return: The total_memory_bytes of this Datacenter.  # noqa: E501
        :rtype: int
        """
        return self._total_memory_bytes

    @total_memory_bytes.setter
    def total_memory_bytes(self, total_memory_bytes):
        """Sets the total_memory_bytes of this Datacenter.


        :param total_memory_bytes: The total_memory_bytes of this Datacenter.  # noqa: E501
        :type total_memory_bytes: int
        """

        self._total_memory_bytes = total_memory_bytes

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


        :return: The used_cpu_hz of this Datacenter.  # noqa: E501
        :rtype: float
        """
        return self._used_cpu_hz

    @used_cpu_hz.setter
    def used_cpu_hz(self, used_cpu_hz):
        """Sets the used_cpu_hz of this Datacenter.


        :param used_cpu_hz: The used_cpu_hz of this Datacenter.  # noqa: E501
        :type used_cpu_hz: float
        """

        self._used_cpu_hz = used_cpu_hz

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


        :return: The used_data_space of this Datacenter.  # noqa: E501
        :rtype: int
        """
        return self._used_data_space

    @used_data_space.setter
    def used_data_space(self, used_data_space):
        """Sets the used_data_space of this Datacenter.


        :param used_data_space: The used_data_space of this Datacenter.  # noqa: E501
        :type used_data_space: int
        """

        self._used_data_space = used_data_space

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


        :return: The used_memory_bytes of this Datacenter.  # noqa: E501
        :rtype: float
        """
        return self._used_memory_bytes

    @used_memory_bytes.setter
    def used_memory_bytes(self, used_memory_bytes):
        """Sets the used_memory_bytes of this Datacenter.


        :param used_memory_bytes: The used_memory_bytes of this Datacenter.  # noqa: E501
        :type used_memory_bytes: float
        """

        self._used_memory_bytes = used_memory_bytes

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


        :return: The vm_num of this Datacenter.  # noqa: E501
        :rtype: int
        """
        return self._vm_num

    @vm_num.setter
    def vm_num(self, vm_num):
        """Sets the vm_num of this Datacenter.


        :param vm_num: The vm_num of this Datacenter.  # noqa: E501
        :type vm_num: int
        """

        self._vm_num = vm_num

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

        def convert(x):
            if hasattr(x, "to_dict"):
                args = getfullargspec(x.to_dict).args
                if len(args) == 1:
                    return x.to_dict()
                else:
                    return x.to_dict(serialize)
            else:
                return x

        for attr, _ in six.iteritems(self.openapi_types):
            value = getattr(self, attr)
            attr = self.attribute_map.get(attr, attr) if serialize else attr
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: convert(x),
                    value
                ))
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], convert(item[1])),
                    value.items()
                ))
            else:
                result[attr] = convert(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, Datacenter):
            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, Datacenter):
            return True

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