# coding: utf-8

"""
    Cloudera Manager API

    <h1>Cloudera Manager API v50</h1>       <p>Introduced in Cloudera Manager 7.8.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>

    OpenAPI spec version: 7.8.1
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


class ApiHostMaintenanceResponse(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 = {
        'success': 'bool',
        'host_ref': 'ApiHostRef',
        'error_message': 'str'
    }

    attribute_map = {
        'success': 'success',
        'host_ref': 'hostRef',
        'error_message': 'errorMessage'
    }

    def __init__(self, success=None, host_ref=None, error_message=None):
        """
        ApiHostMaintenanceResponse - a model defined in Swagger
        """

        self._success = None
        self._host_ref = None
        self._error_message = None

        self.success = success
        if host_ref is not None:
          self.host_ref = host_ref
        if error_message is not None:
          self.error_message = error_message

    @property
    def success(self):
        """
        Gets the success of this ApiHostMaintenanceResponse.
        success is true if host enters into maintenance and false otherwise

        :return: The success of this ApiHostMaintenanceResponse.
        :rtype: bool
        """
        return self._success

    @success.setter
    def success(self, success):
        """
        Sets the success of this ApiHostMaintenanceResponse.
        success is true if host enters into maintenance and false otherwise

        :param success: The success of this ApiHostMaintenanceResponse.
        :type: bool
        """
        if success is None:
            raise ValueError("Invalid value for `success`, must not be `None`")

        self._success = success

    @property
    def host_ref(self):
        """
        Gets the host_ref of this ApiHostMaintenanceResponse.
        Host ref contains Host Id and Host Name of the host that needs to go into the Maintenance mode

        :return: The host_ref of this ApiHostMaintenanceResponse.
        :rtype: ApiHostRef
        """
        return self._host_ref

    @host_ref.setter
    def host_ref(self, host_ref):
        """
        Sets the host_ref of this ApiHostMaintenanceResponse.
        Host ref contains Host Id and Host Name of the host that needs to go into the Maintenance mode

        :param host_ref: The host_ref of this ApiHostMaintenanceResponse.
        :type: ApiHostRef
        """

        self._host_ref = host_ref

    @property
    def error_message(self):
        """
        Gets the error_message of this ApiHostMaintenanceResponse.
        The error message captures RunTime Exception messages when maintenance mode operation fails to execute on the host.

        :return: The error_message of this ApiHostMaintenanceResponse.
        :rtype: str
        """
        return self._error_message

    @error_message.setter
    def error_message(self, error_message):
        """
        Sets the error_message of this ApiHostMaintenanceResponse.
        The error message captures RunTime Exception messages when maintenance mode operation fails to execute on the host.

        :param error_message: The error_message of this ApiHostMaintenanceResponse.
        :type: str
        """

        self._error_message = error_message

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

        for attr, _ in 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 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, ApiHostMaintenanceResponse):
            return False

        return self.__dict__ == other.__dict__

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