<filename>canopy/openapi/models/compute_node_result.py<gh_stars>0
# coding: utf-8

"""
    Canopy.Api

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: v1
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from canopy.openapi.configuration import Configuration


class ComputeNodeResult(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 = {
        'compute_node_id': 'str',
        'state': 'str',
        'running_tasks': 'int',
        'is_dedicated': 'bool'
    }

    attribute_map = {
        'compute_node_id': 'computeNodeId',
        'state': 'state',
        'running_tasks': 'runningTasks',
        'is_dedicated': 'isDedicated'
    }

    def __init__(self, compute_node_id=None, state=None, running_tasks=None, is_dedicated=None, local_vars_configuration=None):  # noqa: E501
        """ComputeNodeResult - 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._compute_node_id = None
        self._state = None
        self._running_tasks = None
        self._is_dedicated = None
        self.discriminator = None

        if compute_node_id is not None:
            self.compute_node_id = compute_node_id
        if state is not None:
            self.state = state
        if running_tasks is not None:
            self.running_tasks = running_tasks
        if is_dedicated is not None:
            self.is_dedicated = is_dedicated

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


        :return: The compute_node_id of this ComputeNodeResult.  # noqa: E501
        :rtype: str
        """
        return self._compute_node_id

    @compute_node_id.setter
    def compute_node_id(self, compute_node_id):
        """Sets the compute_node_id of this ComputeNodeResult.


        :param compute_node_id: The compute_node_id of this ComputeNodeResult.  # noqa: E501
        :type: str
        """

        self._compute_node_id = compute_node_id

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


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

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


        :param state: The state of this ComputeNodeResult.  # noqa: E501
        :type: str
        """
        allowed_values = ["idle", "rebooting", "reimaging", "running", "unusable", "creating", "starting", "waitingForStartTask", "startTaskFailed", "unknown", "leavingPool", "offline", "preempted"]  # noqa: E501
        if self.local_vars_configuration.client_side_validation and state not in allowed_values:  # noqa: E501
            raise ValueError(
                "Invalid value for `state` ({0}), must be one of {1}"  # noqa: E501
                .format(state, allowed_values)
            )

        self._state = state

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


        :return: The running_tasks of this ComputeNodeResult.  # noqa: E501
        :rtype: int
        """
        return self._running_tasks

    @running_tasks.setter
    def running_tasks(self, running_tasks):
        """Sets the running_tasks of this ComputeNodeResult.


        :param running_tasks: The running_tasks of this ComputeNodeResult.  # noqa: E501
        :type: int
        """

        self._running_tasks = running_tasks

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


        :return: The is_dedicated of this ComputeNodeResult.  # noqa: E501
        :rtype: bool
        """
        return self._is_dedicated

    @is_dedicated.setter
    def is_dedicated(self, is_dedicated):
        """Sets the is_dedicated of this ComputeNodeResult.


        :param is_dedicated: The is_dedicated of this ComputeNodeResult.  # noqa: E501
        :type: bool
        """

        self._is_dedicated = is_dedicated

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

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