# coding: utf-8

"""
    Managed Ray API

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

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


import pprint
import re  # noqa: F401

import six

from openapi_client.configuration import Configuration


class AutoscalerReport(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 = {
        'active_nodes': 'dict(str, int)',
        'pending_nodes': 'list[list[str]]',
        'pending_launches': 'dict(str, int)',
        'failed_nodes': 'list[list[str]]',
        'node_availability_summary': 'dict(str, object)'
    }

    attribute_map = {
        'active_nodes': 'activeNodes',
        'pending_nodes': 'pendingNodes',
        'pending_launches': 'pendingLaunches',
        'failed_nodes': 'failedNodes',
        'node_availability_summary': 'nodeAvailabilitySummary'
    }

    def __init__(self, active_nodes=None, pending_nodes=[], pending_launches=None, failed_nodes=[], node_availability_summary=None, local_vars_configuration=None):  # noqa: E501
        """AutoscalerReport - 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._active_nodes = None
        self._pending_nodes = None
        self._pending_launches = None
        self._failed_nodes = None
        self._node_availability_summary = None
        self.discriminator = None

        if active_nodes is not None:
            self.active_nodes = active_nodes
        if pending_nodes is not None:
            self.pending_nodes = pending_nodes
        if pending_launches is not None:
            self.pending_launches = pending_launches
        if failed_nodes is not None:
            self.failed_nodes = failed_nodes
        if node_availability_summary is not None:
            self.node_availability_summary = node_availability_summary

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

        A dictionary of active nodes. The key is the node type and the value is the number of nodes of that type that are active.  # noqa: E501

        :return: The active_nodes of this AutoscalerReport.  # noqa: E501
        :rtype: dict(str, int)
        """
        return self._active_nodes

    @active_nodes.setter
    def active_nodes(self, active_nodes):
        """Sets the active_nodes of this AutoscalerReport.

        A dictionary of active nodes. The key is the node type and the value is the number of nodes of that type that are active.  # noqa: E501

        :param active_nodes: The active_nodes of this AutoscalerReport.  # noqa: E501
        :type: dict(str, int)
        """

        self._active_nodes = active_nodes

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

        A list of tuples where the first item is the ip address, the second item is the node type, and the third item is the status.  # noqa: E501

        :return: The pending_nodes of this AutoscalerReport.  # noqa: E501
        :rtype: list[list[str]]
        """
        return self._pending_nodes

    @pending_nodes.setter
    def pending_nodes(self, pending_nodes):
        """Sets the pending_nodes of this AutoscalerReport.

        A list of tuples where the first item is the ip address, the second item is the node type, and the third item is the status.  # noqa: E501

        :param pending_nodes: The pending_nodes of this AutoscalerReport.  # noqa: E501
        :type: list[list[str]]
        """

        self._pending_nodes = pending_nodes

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

        A dictionary of nodes pending to launch. The key is the node type and the value is the number of nodes of that type pending launch.  # noqa: E501

        :return: The pending_launches of this AutoscalerReport.  # noqa: E501
        :rtype: dict(str, int)
        """
        return self._pending_launches

    @pending_launches.setter
    def pending_launches(self, pending_launches):
        """Sets the pending_launches of this AutoscalerReport.

        A dictionary of nodes pending to launch. The key is the node type and the value is the number of nodes of that type pending launch.  # noqa: E501

        :param pending_launches: The pending_launches of this AutoscalerReport.  # noqa: E501
        :type: dict(str, int)
        """

        self._pending_launches = pending_launches

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

        A list of tuples where the first item is the ip address and the second item is the node type.  # noqa: E501

        :return: The failed_nodes of this AutoscalerReport.  # noqa: E501
        :rtype: list[list[str]]
        """
        return self._failed_nodes

    @failed_nodes.setter
    def failed_nodes(self, failed_nodes):
        """Sets the failed_nodes of this AutoscalerReport.

        A list of tuples where the first item is the ip address and the second item is the node type.  # noqa: E501

        :param failed_nodes: The failed_nodes of this AutoscalerReport.  # noqa: E501
        :type: list[list[str]]
        """

        self._failed_nodes = failed_nodes

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

        A mapping from node type to their availability. Introduced in Ray 2.1  # noqa: E501

        :return: The node_availability_summary of this AutoscalerReport.  # noqa: E501
        :rtype: dict(str, object)
        """
        return self._node_availability_summary

    @node_availability_summary.setter
    def node_availability_summary(self, node_availability_summary):
        """Sets the node_availability_summary of this AutoscalerReport.

        A mapping from node type to their availability. Introduced in Ray 2.1  # noqa: E501

        :param node_availability_summary: The node_availability_summary of this AutoscalerReport.  # noqa: E501
        :type: dict(str, object)
        """

        self._node_availability_summary = node_availability_summary

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

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