# coding: utf-8

"""
    Statuspage API

    # Code of Conduct Please don't abuse the API, and please report all feature requests and issues to https://support.atlassian.com/contact  # Rate Limiting Each API token is limited to 1 request / second as measured on a 60 second rolling window. To get this limit increased, please contact us at https://support.atlassian.com/contact  Error codes 420 or 429 indicate that you have exceeded the rate limit and the request has been rejected.  # Basics  ## HTTPS It's required  ## URL Prefix In order to maintain version integrity into the future, the API is versioned. All calls currently begin with the following prefix:    https://api.statuspage.io/v1/  ## RESTful Interface Wherever possible, the API seeks to implement repeatable patterns with logical, representative URLs and descriptive HTTP verbs. Below are some examples and conventions you will see throughout the documentation.  * Collections are buckets: https://api.statuspage.io/v1/pages/asdf123/incidents.json * Elements have unique IDs: https://api.statuspage.io/v1/pages/asdf123/incidents/jklm456.json * GET will retrieve information about a collection/element * POST will create an element in a collection * PATCH will update a single element * PUT will replace a single element in a collection (rarely used) * DELETE will destroy a single element  ## Sending Data Information can be sent in the body as form urlencoded or JSON, but make sure the Content-Type header matches the body structure or the server gremlins will be angry.  All examples are provided in JSON format, however they can easily be converted to form encoding if required.  Some examples of how to convert things are below:      // JSON     {       \"incident\": {         \"name\": \"test incident\",         \"components\": [\"8kbf7d35c070\", \"vtnh60py4yd7\"]       }     }      // Form Encoded (using curl as an example):     curl -X POST https://api.statuspage.io/v1/example \\       -d \"incident[name]=test incident\" \\       -d \"incident[components][]=8kbf7d35c070\" \\       -d \"incident[components][]=vtnh60py4yd7\"  # Authentication  <!-- ReDoc-Inject: <security-definitions> -->  # 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

class ComponentGroupUptime(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 = {
        'range_start': 'datetime',
        'range_end': 'datetime',
        'uptime_percentage': 'float',
        'major_outage': 'int',
        'partial_outage': 'int',
        'warnings': 'str',
        'id': 'str',
        'name': 'str',
        'related_events': 'ComponentGroupUptimeRelatedEvents'
    }

    attribute_map = {
        'range_start': 'range_start',
        'range_end': 'range_end',
        'uptime_percentage': 'uptime_percentage',
        'major_outage': 'major_outage',
        'partial_outage': 'partial_outage',
        'warnings': 'warnings',
        'id': 'id',
        'name': 'name',
        'related_events': 'related_events'
    }

    def __init__(self, range_start=None, range_end=None, uptime_percentage=None, major_outage=None, partial_outage=None, warnings=None, id=None, name=None, related_events=None):  # noqa: E501
        """ComponentGroupUptime - a model defined in Swagger"""  # noqa: E501
        self._range_start = None
        self._range_end = None
        self._uptime_percentage = None
        self._major_outage = None
        self._partial_outage = None
        self._warnings = None
        self._id = None
        self._name = None
        self._related_events = None
        self.discriminator = None
        if range_start is not None:
            self.range_start = range_start
        if range_end is not None:
            self.range_end = range_end
        if uptime_percentage is not None:
            self.uptime_percentage = uptime_percentage
        if major_outage is not None:
            self.major_outage = major_outage
        if partial_outage is not None:
            self.partial_outage = partial_outage
        if warnings is not None:
            self.warnings = warnings
        if id is not None:
            self.id = id
        if name is not None:
            self.name = name
        if related_events is not None:
            self.related_events = related_events

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

        Start date used for uptime calculation (see the warnings field in the response if this value does not match the start parameter you provided).  # noqa: E501

        :return: The range_start of this ComponentGroupUptime.  # noqa: E501
        :rtype: datetime
        """
        return self._range_start

    @range_start.setter
    def range_start(self, range_start):
        """Sets the range_start of this ComponentGroupUptime.

        Start date used for uptime calculation (see the warnings field in the response if this value does not match the start parameter you provided).  # noqa: E501

        :param range_start: The range_start of this ComponentGroupUptime.  # noqa: E501
        :type: datetime
        """

        self._range_start = range_start

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

        End date used for uptime calculation (see the warnings field in the response if this value does not match the end parameter you provided).  # noqa: E501

        :return: The range_end of this ComponentGroupUptime.  # noqa: E501
        :rtype: datetime
        """
        return self._range_end

    @range_end.setter
    def range_end(self, range_end):
        """Sets the range_end of this ComponentGroupUptime.

        End date used for uptime calculation (see the warnings field in the response if this value does not match the end parameter you provided).  # noqa: E501

        :param range_end: The range_end of this ComponentGroupUptime.  # noqa: E501
        :type: datetime
        """

        self._range_end = range_end

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

        Uptime percentage for a component  # noqa: E501

        :return: The uptime_percentage of this ComponentGroupUptime.  # noqa: E501
        :rtype: float
        """
        return self._uptime_percentage

    @uptime_percentage.setter
    def uptime_percentage(self, uptime_percentage):
        """Sets the uptime_percentage of this ComponentGroupUptime.

        Uptime percentage for a component  # noqa: E501

        :param uptime_percentage: The uptime_percentage of this ComponentGroupUptime.  # noqa: E501
        :type: float
        """

        self._uptime_percentage = uptime_percentage

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

        Seconds of major outage  # noqa: E501

        :return: The major_outage of this ComponentGroupUptime.  # noqa: E501
        :rtype: int
        """
        return self._major_outage

    @major_outage.setter
    def major_outage(self, major_outage):
        """Sets the major_outage of this ComponentGroupUptime.

        Seconds of major outage  # noqa: E501

        :param major_outage: The major_outage of this ComponentGroupUptime.  # noqa: E501
        :type: int
        """

        self._major_outage = major_outage

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

        Seconds of partial outage  # noqa: E501

        :return: The partial_outage of this ComponentGroupUptime.  # noqa: E501
        :rtype: int
        """
        return self._partial_outage

    @partial_outage.setter
    def partial_outage(self, partial_outage):
        """Sets the partial_outage of this ComponentGroupUptime.

        Seconds of partial outage  # noqa: E501

        :param partial_outage: The partial_outage of this ComponentGroupUptime.  # noqa: E501
        :type: int
        """

        self._partial_outage = partial_outage

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

        Warning messages related to the uptime query that may occur  # noqa: E501

        :return: The warnings of this ComponentGroupUptime.  # noqa: E501
        :rtype: str
        """
        return self._warnings

    @warnings.setter
    def warnings(self, warnings):
        """Sets the warnings of this ComponentGroupUptime.

        Warning messages related to the uptime query that may occur  # noqa: E501

        :param warnings: The warnings of this ComponentGroupUptime.  # noqa: E501
        :type: str
        """

        self._warnings = warnings

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

        Component group identifier  # noqa: E501

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

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

        Component group identifier  # noqa: E501

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

        self._id = id

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

        Component group display name  # noqa: E501

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

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

        Component group display name  # noqa: E501

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

        self._name = name

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


        :return: The related_events of this ComponentGroupUptime.  # noqa: E501
        :rtype: ComponentGroupUptimeRelatedEvents
        """
        return self._related_events

    @related_events.setter
    def related_events(self, related_events):
        """Sets the related_events of this ComponentGroupUptime.


        :param related_events: The related_events of this ComponentGroupUptime.  # noqa: E501
        :type: ComponentGroupUptimeRelatedEvents
        """

        self._related_events = related_events

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

        return self.__dict__ == other.__dict__

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