Source code for iottsaggregates.models.aggregates_aggregates

# coding: utf-8

"""
    IoT TS Aggregates API

     The aggregate service enables querying aggregated time series data for performance assets based on pre-calculated aggregate values.  Precalculated aggregates are available in the following aggregate intervals * 2 minute * 1 hour * 1 day  ## Generic Errors The following generic error codes (with status codes) can occur at the operations of this API. Generic error codes are prefixed with 'mdsp.core.generic.'.  - unauthorized (401) - forbidden (403) - tooManyRequests (429) - internalServerError (500)   # noqa: E501
"""


import pprint
import re
import six

from iottsaggregates.models.variable import Variable
from mindsphere_core.exceptions import MindsphereClientError


[docs]class AggregatesAggregates(object): """ Attributes: attribute_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. """ attribute_types = { "starttime": "datetime", "endtime": "datetime", "property1": "Variable", "property2": "Variable", } attribute_map = { "starttime": "starttime", "endtime": "endtime", "property1": "property1", "property2": "property2", } def __init__(self, starttime=None, endtime=None, property1=None, property2=None): self._starttime = starttime self._endtime = endtime self._property1 = property1 self._property2 = property2 self.discriminator = None @property def starttime(self): """Gets the starttime of this AggregatesAggregates. start time of the interval (exclusive) :return: The starttime of this AggregatesAggregates. :rtype: datetime """ return self._starttime @starttime.setter def starttime(self, starttime): """Sets the starttime of this AggregatesAggregates. start time of the interval (exclusive) :param starttime: The starttime of this AggregatesAggregates. :type: datetime """ self._starttime = starttime @property def endtime(self): """Gets the endtime of this AggregatesAggregates. end time of the interval (inclusive) :return: The endtime of this AggregatesAggregates. :rtype: datetime """ return self._endtime @endtime.setter def endtime(self, endtime): """Sets the endtime of this AggregatesAggregates. end time of the interval (inclusive) :param endtime: The endtime of this AggregatesAggregates. :type: datetime """ self._endtime = endtime @property def property1(self): """Gets the property1 of this AggregatesAggregates. :return: The property1 of this AggregatesAggregates. :rtype: Variable """ return self._property1 @property1.setter def property1(self, property1): """Sets the property1 of this AggregatesAggregates. :param property1: The property1 of this AggregatesAggregates. :type: Variable """ self._property1 = property1 @property def property2(self): """Gets the property2 of this AggregatesAggregates. :return: The property2 of this AggregatesAggregates. :rtype: Variable """ return self._property2 @property2.setter def property2(self, property2): """Sets the property2 of this AggregatesAggregates. :param property2: The property2 of this AggregatesAggregates. :type: Variable """ self._property2 = property2
[docs] def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.attribute_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(AggregatesAggregates, dict): for key, value in self.items(): result[key] = value return result
[docs] 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, AggregatesAggregates): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other