# coding: utf-8

"""
    HPC Web API

    Preview  # 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 hpc_acm.models.node_registration import NodeRegistration  # noqa: F401,E501


class Node(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 = {
        'id': 'str',
        'name': 'str',
        'state': 'str',
        'health': 'str',
        'running_job_count': 'int',
        'event_count': 'int',
        'node_registration_info': 'NodeRegistration'
    }

    attribute_map = {
        'id': 'id',
        'name': 'name',
        'state': 'state',
        'health': 'health',
        'running_job_count': 'runningJobCount',
        'event_count': 'eventCount',
        'node_registration_info': 'nodeRegistrationInfo'
    }

    def __init__(self, id=None, name=None, state=None, health=None, running_job_count=None, event_count=None, node_registration_info=None):  # noqa: E501
        """Node - a model defined in Swagger"""  # noqa: E501

        self._id = None
        self._name = None
        self._state = None
        self._health = None
        self._running_job_count = None
        self._event_count = None
        self._node_registration_info = None
        self.discriminator = None

        if id is not None:
            self.id = id
        if name is not None:
            self.name = name
        if state is not None:
            self.state = state
        if health is not None:
            self.health = health
        if running_job_count is not None:
            self.running_job_count = running_job_count
        if event_count is not None:
            self.event_count = event_count
        if node_registration_info is not None:
            self.node_registration_info = node_registration_info

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


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

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


        :param id: The id of this Node.  # noqa: E501
        :type: str
        """

        self._id = id

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


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

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


        :param name: The name of this Node.  # noqa: E501
        :type: str
        """

        self._name = name

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


        :return: The state of this Node.  # noqa: E501
        :rtype: str
        """
        return self._state

    @state.setter
    def state(self, state):
        """Sets the state of this Node.


        :param state: The state of this Node.  # noqa: E501
        :type: str
        """
        allowed_values = ["Online", "Offline"]  # noqa: E501
        if state not in allowed_values:
            raise ValueError(
                "Invalid value for `state` ({0}), must be one of {1}"  # noqa: E501
                .format(state, allowed_values)
            )

        self._state = state

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


        :return: The health of this Node.  # noqa: E501
        :rtype: str
        """
        return self._health

    @health.setter
    def health(self, health):
        """Sets the health of this Node.


        :param health: The health of this Node.  # noqa: E501
        :type: str
        """
        allowed_values = ["OK", "Warning", "Error"]  # noqa: E501
        if health not in allowed_values:
            raise ValueError(
                "Invalid value for `health` ({0}), must be one of {1}"  # noqa: E501
                .format(health, allowed_values)
            )

        self._health = health

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


        :return: The running_job_count of this Node.  # noqa: E501
        :rtype: int
        """
        return self._running_job_count

    @running_job_count.setter
    def running_job_count(self, running_job_count):
        """Sets the running_job_count of this Node.


        :param running_job_count: The running_job_count of this Node.  # noqa: E501
        :type: int
        """
        if running_job_count is not None and running_job_count < 0:  # noqa: E501
            raise ValueError("Invalid value for `running_job_count`, must be a value greater than or equal to `0`")  # noqa: E501

        self._running_job_count = running_job_count

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


        :return: The event_count of this Node.  # noqa: E501
        :rtype: int
        """
        return self._event_count

    @event_count.setter
    def event_count(self, event_count):
        """Sets the event_count of this Node.


        :param event_count: The event_count of this Node.  # noqa: E501
        :type: int
        """
        if event_count is not None and event_count < 0:  # noqa: E501
            raise ValueError("Invalid value for `event_count`, must be a value greater than or equal to `0`")  # noqa: E501

        self._event_count = event_count

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


        :return: The node_registration_info of this Node.  # noqa: E501
        :rtype: NodeRegistration
        """
        return self._node_registration_info

    @node_registration_info.setter
    def node_registration_info(self, node_registration_info):
        """Sets the node_registration_info of this Node.


        :param node_registration_info: The node_registration_info of this Node.  # noqa: E501
        :type: NodeRegistration
        """

        self._node_registration_info = node_registration_info

    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

        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, Node):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
