# coding: utf-8

"""
    EPIC API

    REST API for interacting with EPIC (https://epic.zenotech.com) services. <br />                             Please note this API is in BETA and does not yet contain                             all EPIC functionality.  # noqa: E501

    The version of the OpenAPI document: v2
    Contact: support@zenotech.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from epiccore.configuration import Configuration


class ClusterNodeConfig(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 = {
        'accelerator': 'AcceleratorConfig',
        'cpus': 'int',
        'cpu_generation': 'str',
        'cores_per_cpu': 'int',
        'threads_per_core': 'int',
        'memory': 'str'
    }

    attribute_map = {
        'accelerator': 'accelerator',
        'cpus': 'cpus',
        'cpu_generation': 'cpu_generation',
        'cores_per_cpu': 'cores_per_cpu',
        'threads_per_core': 'threads_per_core',
        'memory': 'memory'
    }

    def __init__(self, accelerator=None, cpus=None, cpu_generation=None, cores_per_cpu=None, threads_per_core=None, memory=None, local_vars_configuration=None):  # noqa: E501
        """ClusterNodeConfig - 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._accelerator = None
        self._cpus = None
        self._cpu_generation = None
        self._cores_per_cpu = None
        self._threads_per_core = None
        self._memory = None
        self.discriminator = None

        self.accelerator = accelerator
        if cpus is not None:
            self.cpus = cpus
        if cpu_generation is not None:
            self.cpu_generation = cpu_generation
        if cores_per_cpu is not None:
            self.cores_per_cpu = cores_per_cpu
        if threads_per_core is not None:
            self.threads_per_core = threads_per_core
        if memory is not None:
            self.memory = memory

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


        :return: The accelerator of this ClusterNodeConfig.  # noqa: E501
        :rtype: AcceleratorConfig
        """
        return self._accelerator

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


        :param accelerator: The accelerator of this ClusterNodeConfig.  # noqa: E501
        :type accelerator: AcceleratorConfig
        """

        self._accelerator = accelerator

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


        :return: The cpus of this ClusterNodeConfig.  # noqa: E501
        :rtype: int
        """
        return self._cpus

    @cpus.setter
    def cpus(self, cpus):
        """Sets the cpus of this ClusterNodeConfig.


        :param cpus: The cpus of this ClusterNodeConfig.  # noqa: E501
        :type cpus: int
        """
        if (self.local_vars_configuration.client_side_validation and
                cpus is not None and cpus > 2147483647):  # noqa: E501
            raise ValueError("Invalid value for `cpus`, must be a value less than or equal to `2147483647`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                cpus is not None and cpus < 1):  # noqa: E501
            raise ValueError("Invalid value for `cpus`, must be a value greater than or equal to `1`")  # noqa: E501

        self._cpus = cpus

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


        :return: The cpu_generation of this ClusterNodeConfig.  # noqa: E501
        :rtype: str
        """
        return self._cpu_generation

    @cpu_generation.setter
    def cpu_generation(self, cpu_generation):
        """Sets the cpu_generation of this ClusterNodeConfig.


        :param cpu_generation: The cpu_generation of this ClusterNodeConfig.  # noqa: E501
        :type cpu_generation: str
        """
        if (self.local_vars_configuration.client_side_validation and
                cpu_generation is not None and len(cpu_generation) > 255):
            raise ValueError("Invalid value for `cpu_generation`, length must be less than or equal to `255`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                cpu_generation is not None and len(cpu_generation) < 1):
            raise ValueError("Invalid value for `cpu_generation`, length must be greater than or equal to `1`")  # noqa: E501

        self._cpu_generation = cpu_generation

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


        :return: The cores_per_cpu of this ClusterNodeConfig.  # noqa: E501
        :rtype: int
        """
        return self._cores_per_cpu

    @cores_per_cpu.setter
    def cores_per_cpu(self, cores_per_cpu):
        """Sets the cores_per_cpu of this ClusterNodeConfig.


        :param cores_per_cpu: The cores_per_cpu of this ClusterNodeConfig.  # noqa: E501
        :type cores_per_cpu: int
        """
        if (self.local_vars_configuration.client_side_validation and
                cores_per_cpu is not None and cores_per_cpu > 2147483647):  # noqa: E501
            raise ValueError("Invalid value for `cores_per_cpu`, must be a value less than or equal to `2147483647`")  # noqa: E501
        if (self.local_vars_configuration.client_side_validation and
                cores_per_cpu is not None and cores_per_cpu < 1):  # noqa: E501
            raise ValueError("Invalid value for `cores_per_cpu`, must be a value greater than or equal to `1`")  # noqa: E501

        self._cores_per_cpu = cores_per_cpu

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


        :return: The threads_per_core of this ClusterNodeConfig.  # noqa: E501
        :rtype: int
        """
        return self._threads_per_core

    @threads_per_core.setter
    def threads_per_core(self, threads_per_core):
        """Sets the threads_per_core of this ClusterNodeConfig.


        :param threads_per_core: The threads_per_core of this ClusterNodeConfig.  # noqa: E501
        :type threads_per_core: int
        """
        if (self.local_vars_configuration.client_side_validation and
                threads_per_core is not None and threads_per_core < 1):  # noqa: E501
            raise ValueError("Invalid value for `threads_per_core`, must be a value greater than or equal to `1`")  # noqa: E501

        self._threads_per_core = threads_per_core

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


        :return: The memory of this ClusterNodeConfig.  # noqa: E501
        :rtype: str
        """
        return self._memory

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


        :param memory: The memory of this ClusterNodeConfig.  # noqa: E501
        :type memory: str
        """

        self._memory = memory

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

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