# coding: utf-8

"""
    Cloudera Manager API

    <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>  # noqa: E501

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

import pprint
import re  # noqa: F401

import six

class ApiYarnUtilization(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 = {
        'avg_cpu_utilization': 'float',
        'max_cpu_utilization': 'float',
        'avg_cpu_daily_peak': 'float',
        'max_cpu_utilization_timestamp_ms': 'int',
        'avg_cpu_utilization_percentage': 'float',
        'max_cpu_utilization_percentage': 'float',
        'avg_cpu_daily_peak_percentage': 'float',
        'avg_memory_utilization': 'float',
        'max_memory_utilization': 'float',
        'avg_memory_daily_peak': 'float',
        'max_memory_utilization_timestamp_ms': 'int',
        'avg_memory_utilization_percentage': 'float',
        'max_memory_utilization_percentage': 'float',
        'avg_memory_daily_peak_percentage': 'float',
        'tenant_utilizations': 'ApiYarnTenantUtilizationList',
        'error_message': 'str'
    }

    attribute_map = {
        'avg_cpu_utilization': 'avgCpuUtilization',
        'max_cpu_utilization': 'maxCpuUtilization',
        'avg_cpu_daily_peak': 'avgCpuDailyPeak',
        'max_cpu_utilization_timestamp_ms': 'maxCpuUtilizationTimestampMs',
        'avg_cpu_utilization_percentage': 'avgCpuUtilizationPercentage',
        'max_cpu_utilization_percentage': 'maxCpuUtilizationPercentage',
        'avg_cpu_daily_peak_percentage': 'avgCpuDailyPeakPercentage',
        'avg_memory_utilization': 'avgMemoryUtilization',
        'max_memory_utilization': 'maxMemoryUtilization',
        'avg_memory_daily_peak': 'avgMemoryDailyPeak',
        'max_memory_utilization_timestamp_ms': 'maxMemoryUtilizationTimestampMs',
        'avg_memory_utilization_percentage': 'avgMemoryUtilizationPercentage',
        'max_memory_utilization_percentage': 'maxMemoryUtilizationPercentage',
        'avg_memory_daily_peak_percentage': 'avgMemoryDailyPeakPercentage',
        'tenant_utilizations': 'tenantUtilizations',
        'error_message': 'errorMessage'
    }

    def __init__(self, avg_cpu_utilization=None, max_cpu_utilization=None, avg_cpu_daily_peak=None, max_cpu_utilization_timestamp_ms=None, avg_cpu_utilization_percentage=None, max_cpu_utilization_percentage=None, avg_cpu_daily_peak_percentage=None, avg_memory_utilization=None, max_memory_utilization=None, avg_memory_daily_peak=None, max_memory_utilization_timestamp_ms=None, avg_memory_utilization_percentage=None, max_memory_utilization_percentage=None, avg_memory_daily_peak_percentage=None, tenant_utilizations=None, error_message=None):  # noqa: E501
        """ApiYarnUtilization - a model defined in Swagger"""  # noqa: E501
        self._avg_cpu_utilization = None
        self._max_cpu_utilization = None
        self._avg_cpu_daily_peak = None
        self._max_cpu_utilization_timestamp_ms = None
        self._avg_cpu_utilization_percentage = None
        self._max_cpu_utilization_percentage = None
        self._avg_cpu_daily_peak_percentage = None
        self._avg_memory_utilization = None
        self._max_memory_utilization = None
        self._avg_memory_daily_peak = None
        self._max_memory_utilization_timestamp_ms = None
        self._avg_memory_utilization_percentage = None
        self._max_memory_utilization_percentage = None
        self._avg_memory_daily_peak_percentage = None
        self._tenant_utilizations = None
        self._error_message = None
        self.discriminator = None
        if avg_cpu_utilization is not None:
            self.avg_cpu_utilization = avg_cpu_utilization
        if max_cpu_utilization is not None:
            self.max_cpu_utilization = max_cpu_utilization
        if avg_cpu_daily_peak is not None:
            self.avg_cpu_daily_peak = avg_cpu_daily_peak
        if max_cpu_utilization_timestamp_ms is not None:
            self.max_cpu_utilization_timestamp_ms = max_cpu_utilization_timestamp_ms
        if avg_cpu_utilization_percentage is not None:
            self.avg_cpu_utilization_percentage = avg_cpu_utilization_percentage
        if max_cpu_utilization_percentage is not None:
            self.max_cpu_utilization_percentage = max_cpu_utilization_percentage
        if avg_cpu_daily_peak_percentage is not None:
            self.avg_cpu_daily_peak_percentage = avg_cpu_daily_peak_percentage
        if avg_memory_utilization is not None:
            self.avg_memory_utilization = avg_memory_utilization
        if max_memory_utilization is not None:
            self.max_memory_utilization = max_memory_utilization
        if avg_memory_daily_peak is not None:
            self.avg_memory_daily_peak = avg_memory_daily_peak
        if max_memory_utilization_timestamp_ms is not None:
            self.max_memory_utilization_timestamp_ms = max_memory_utilization_timestamp_ms
        if avg_memory_utilization_percentage is not None:
            self.avg_memory_utilization_percentage = avg_memory_utilization_percentage
        if max_memory_utilization_percentage is not None:
            self.max_memory_utilization_percentage = max_memory_utilization_percentage
        if avg_memory_daily_peak_percentage is not None:
            self.avg_memory_daily_peak_percentage = avg_memory_daily_peak_percentage
        if tenant_utilizations is not None:
            self.tenant_utilizations = tenant_utilizations
        if error_message is not None:
            self.error_message = error_message

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

        Average number of VCores used by YARN applications during the report window.  # noqa: E501

        :return: The avg_cpu_utilization of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._avg_cpu_utilization

    @avg_cpu_utilization.setter
    def avg_cpu_utilization(self, avg_cpu_utilization):
        """Sets the avg_cpu_utilization of this ApiYarnUtilization.

        Average number of VCores used by YARN applications during the report window.  # noqa: E501

        :param avg_cpu_utilization: The avg_cpu_utilization of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._avg_cpu_utilization = avg_cpu_utilization

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

        Maximum number of VCores used by YARN applications during the report window.  # noqa: E501

        :return: The max_cpu_utilization of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._max_cpu_utilization

    @max_cpu_utilization.setter
    def max_cpu_utilization(self, max_cpu_utilization):
        """Sets the max_cpu_utilization of this ApiYarnUtilization.

        Maximum number of VCores used by YARN applications during the report window.  # noqa: E501

        :param max_cpu_utilization: The max_cpu_utilization of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._max_cpu_utilization = max_cpu_utilization

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

        Average daily peak VCores used by YARN applications during the report window. The number is computed by first finding the maximum resource consumption per day and then taking their mean.  # noqa: E501

        :return: The avg_cpu_daily_peak of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._avg_cpu_daily_peak

    @avg_cpu_daily_peak.setter
    def avg_cpu_daily_peak(self, avg_cpu_daily_peak):
        """Sets the avg_cpu_daily_peak of this ApiYarnUtilization.

        Average daily peak VCores used by YARN applications during the report window. The number is computed by first finding the maximum resource consumption per day and then taking their mean.  # noqa: E501

        :param avg_cpu_daily_peak: The avg_cpu_daily_peak of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._avg_cpu_daily_peak = avg_cpu_daily_peak

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

        Timestamp corresponds to maximum number of VCores used by YARN applications during the report window.  # noqa: E501

        :return: The max_cpu_utilization_timestamp_ms of this ApiYarnUtilization.  # noqa: E501
        :rtype: int
        """
        return self._max_cpu_utilization_timestamp_ms

    @max_cpu_utilization_timestamp_ms.setter
    def max_cpu_utilization_timestamp_ms(self, max_cpu_utilization_timestamp_ms):
        """Sets the max_cpu_utilization_timestamp_ms of this ApiYarnUtilization.

        Timestamp corresponds to maximum number of VCores used by YARN applications during the report window.  # noqa: E501

        :param max_cpu_utilization_timestamp_ms: The max_cpu_utilization_timestamp_ms of this ApiYarnUtilization.  # noqa: E501
        :type: int
        """

        self._max_cpu_utilization_timestamp_ms = max_cpu_utilization_timestamp_ms

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

        Average percentage of VCores used by YARN applications during the report window.  # noqa: E501

        :return: The avg_cpu_utilization_percentage of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._avg_cpu_utilization_percentage

    @avg_cpu_utilization_percentage.setter
    def avg_cpu_utilization_percentage(self, avg_cpu_utilization_percentage):
        """Sets the avg_cpu_utilization_percentage of this ApiYarnUtilization.

        Average percentage of VCores used by YARN applications during the report window.  # noqa: E501

        :param avg_cpu_utilization_percentage: The avg_cpu_utilization_percentage of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._avg_cpu_utilization_percentage = avg_cpu_utilization_percentage

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

        Maximum percentage of VCores used by YARN applications during the report window.  # noqa: E501

        :return: The max_cpu_utilization_percentage of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._max_cpu_utilization_percentage

    @max_cpu_utilization_percentage.setter
    def max_cpu_utilization_percentage(self, max_cpu_utilization_percentage):
        """Sets the max_cpu_utilization_percentage of this ApiYarnUtilization.

        Maximum percentage of VCores used by YARN applications during the report window.  # noqa: E501

        :param max_cpu_utilization_percentage: The max_cpu_utilization_percentage of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._max_cpu_utilization_percentage = max_cpu_utilization_percentage

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

        Average daily peak percentage of VCores used by YARN applications during the report window.  # noqa: E501

        :return: The avg_cpu_daily_peak_percentage of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._avg_cpu_daily_peak_percentage

    @avg_cpu_daily_peak_percentage.setter
    def avg_cpu_daily_peak_percentage(self, avg_cpu_daily_peak_percentage):
        """Sets the avg_cpu_daily_peak_percentage of this ApiYarnUtilization.

        Average daily peak percentage of VCores used by YARN applications during the report window.  # noqa: E501

        :param avg_cpu_daily_peak_percentage: The avg_cpu_daily_peak_percentage of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._avg_cpu_daily_peak_percentage = avg_cpu_daily_peak_percentage

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

        Average memory used by YARN applications during the report window.  # noqa: E501

        :return: The avg_memory_utilization of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._avg_memory_utilization

    @avg_memory_utilization.setter
    def avg_memory_utilization(self, avg_memory_utilization):
        """Sets the avg_memory_utilization of this ApiYarnUtilization.

        Average memory used by YARN applications during the report window.  # noqa: E501

        :param avg_memory_utilization: The avg_memory_utilization of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._avg_memory_utilization = avg_memory_utilization

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

        Maximum memory used by YARN applications during the report window.  # noqa: E501

        :return: The max_memory_utilization of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._max_memory_utilization

    @max_memory_utilization.setter
    def max_memory_utilization(self, max_memory_utilization):
        """Sets the max_memory_utilization of this ApiYarnUtilization.

        Maximum memory used by YARN applications during the report window.  # noqa: E501

        :param max_memory_utilization: The max_memory_utilization of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._max_memory_utilization = max_memory_utilization

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

        Average daily peak memory used by YARN applications during the report window. The number is computed by first finding the maximum resource consumption per day and then taking their mean.  # noqa: E501

        :return: The avg_memory_daily_peak of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._avg_memory_daily_peak

    @avg_memory_daily_peak.setter
    def avg_memory_daily_peak(self, avg_memory_daily_peak):
        """Sets the avg_memory_daily_peak of this ApiYarnUtilization.

        Average daily peak memory used by YARN applications during the report window. The number is computed by first finding the maximum resource consumption per day and then taking their mean.  # noqa: E501

        :param avg_memory_daily_peak: The avg_memory_daily_peak of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._avg_memory_daily_peak = avg_memory_daily_peak

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

        Timestamp corresponds to maximum memory used by YARN applications during the report window.  # noqa: E501

        :return: The max_memory_utilization_timestamp_ms of this ApiYarnUtilization.  # noqa: E501
        :rtype: int
        """
        return self._max_memory_utilization_timestamp_ms

    @max_memory_utilization_timestamp_ms.setter
    def max_memory_utilization_timestamp_ms(self, max_memory_utilization_timestamp_ms):
        """Sets the max_memory_utilization_timestamp_ms of this ApiYarnUtilization.

        Timestamp corresponds to maximum memory used by YARN applications during the report window.  # noqa: E501

        :param max_memory_utilization_timestamp_ms: The max_memory_utilization_timestamp_ms of this ApiYarnUtilization.  # noqa: E501
        :type: int
        """

        self._max_memory_utilization_timestamp_ms = max_memory_utilization_timestamp_ms

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

        Average percentage memory used by YARN applications during the report window.  # noqa: E501

        :return: The avg_memory_utilization_percentage of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._avg_memory_utilization_percentage

    @avg_memory_utilization_percentage.setter
    def avg_memory_utilization_percentage(self, avg_memory_utilization_percentage):
        """Sets the avg_memory_utilization_percentage of this ApiYarnUtilization.

        Average percentage memory used by YARN applications during the report window.  # noqa: E501

        :param avg_memory_utilization_percentage: The avg_memory_utilization_percentage of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._avg_memory_utilization_percentage = avg_memory_utilization_percentage

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

        Maximum percentage of memory used by YARN applications during the report window.  # noqa: E501

        :return: The max_memory_utilization_percentage of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._max_memory_utilization_percentage

    @max_memory_utilization_percentage.setter
    def max_memory_utilization_percentage(self, max_memory_utilization_percentage):
        """Sets the max_memory_utilization_percentage of this ApiYarnUtilization.

        Maximum percentage of memory used by YARN applications during the report window.  # noqa: E501

        :param max_memory_utilization_percentage: The max_memory_utilization_percentage of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._max_memory_utilization_percentage = max_memory_utilization_percentage

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

        Average daily peak percentage of memory used by YARN applications during the report window.  # noqa: E501

        :return: The avg_memory_daily_peak_percentage of this ApiYarnUtilization.  # noqa: E501
        :rtype: float
        """
        return self._avg_memory_daily_peak_percentage

    @avg_memory_daily_peak_percentage.setter
    def avg_memory_daily_peak_percentage(self, avg_memory_daily_peak_percentage):
        """Sets the avg_memory_daily_peak_percentage of this ApiYarnUtilization.

        Average daily peak percentage of memory used by YARN applications during the report window.  # noqa: E501

        :param avg_memory_daily_peak_percentage: The avg_memory_daily_peak_percentage of this ApiYarnUtilization.  # noqa: E501
        :type: float
        """

        self._avg_memory_daily_peak_percentage = avg_memory_daily_peak_percentage

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


        :return: The tenant_utilizations of this ApiYarnUtilization.  # noqa: E501
        :rtype: ApiYarnTenantUtilizationList
        """
        return self._tenant_utilizations

    @tenant_utilizations.setter
    def tenant_utilizations(self, tenant_utilizations):
        """Sets the tenant_utilizations of this ApiYarnUtilization.


        :param tenant_utilizations: The tenant_utilizations of this ApiYarnUtilization.  # noqa: E501
        :type: ApiYarnTenantUtilizationList
        """

        self._tenant_utilizations = tenant_utilizations

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

        error message of utilization report.  # noqa: E501

        :return: The error_message of this ApiYarnUtilization.  # noqa: E501
        :rtype: str
        """
        return self._error_message

    @error_message.setter
    def error_message(self, error_message):
        """Sets the error_message of this ApiYarnUtilization.

        error message of utilization report.  # noqa: E501

        :param error_message: The error_message of this ApiYarnUtilization.  # noqa: E501
        :type: str
        """

        self._error_message = error_message

    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
        if issubclass(ApiYarnUtilization, dict):
            for key, value in self.items():
                result[key] = 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, ApiYarnUtilization):
            return False

        return self.__dict__ == other.__dict__

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