2020-09-09 08:56:41 +00:00
|
|
|
|
# coding: utf-8
|
|
|
|
|
|
|
|
|
|
import pprint
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
|
|
import six
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-30 13:39:15 +00:00
|
|
|
|
class TrafficInfo:
|
2020-09-09 08:56:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
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.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
sensitive_list = []
|
|
|
|
|
|
|
|
|
|
openapi_types = {
|
2020-11-30 13:39:15 +00:00
|
|
|
|
'traffic': 'int',
|
|
|
|
|
'timestamp': 'datetime'
|
2020-09-09 08:56:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
attribute_map = {
|
2020-11-30 13:39:15 +00:00
|
|
|
|
'traffic': 'traffic',
|
|
|
|
|
'timestamp': 'timestamp'
|
2020-09-09 08:56:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-11-30 13:39:15 +00:00
|
|
|
|
def __init__(self, traffic=None, timestamp=None):
|
|
|
|
|
"""TrafficInfo - a model defined in huaweicloud sdk"""
|
2020-09-09 08:56:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-30 13:39:15 +00:00
|
|
|
|
self._traffic = None
|
|
|
|
|
self._timestamp = None
|
2020-09-09 08:56:41 +00:00
|
|
|
|
self.discriminator = None
|
|
|
|
|
|
2020-11-30 13:39:15 +00:00
|
|
|
|
self.traffic = traffic
|
|
|
|
|
self.timestamp = timestamp
|
2020-09-09 08:56:41 +00:00
|
|
|
|
|
|
|
|
|
@property
|
2020-11-30 13:39:15 +00:00
|
|
|
|
def traffic(self):
|
|
|
|
|
"""Gets the traffic of this TrafficInfo.
|
2020-09-09 08:56:41 +00:00
|
|
|
|
|
2020-11-30 13:39:15 +00:00
|
|
|
|
采样周期内的总流量,单位:byte
|
2020-09-09 08:56:41 +00:00
|
|
|
|
|
2020-11-30 13:39:15 +00:00
|
|
|
|
:return: The traffic of this TrafficInfo.
|
|
|
|
|
:rtype: int
|
2020-09-09 08:56:41 +00:00
|
|
|
|
"""
|
2020-11-30 13:39:15 +00:00
|
|
|
|
return self._traffic
|
2020-09-09 08:56:41 +00:00
|
|
|
|
|
2020-11-30 13:39:15 +00:00
|
|
|
|
@traffic.setter
|
|
|
|
|
def traffic(self, traffic):
|
|
|
|
|
"""Sets the traffic of this TrafficInfo.
|
2020-09-09 08:56:41 +00:00
|
|
|
|
|
2020-11-30 13:39:15 +00:00
|
|
|
|
采样周期内的总流量,单位:byte
|
2020-09-09 08:56:41 +00:00
|
|
|
|
|
2020-11-30 13:39:15 +00:00
|
|
|
|
:param traffic: The traffic of this TrafficInfo.
|
|
|
|
|
:type: int
|
2020-09-09 08:56:41 +00:00
|
|
|
|
"""
|
2020-11-30 13:39:15 +00:00
|
|
|
|
self._traffic = traffic
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def timestamp(self):
|
|
|
|
|
"""Gets the timestamp of this TrafficInfo.
|
|
|
|
|
|
|
|
|
|
流量数据采样周期起始时刻,UTC时间,格式:yyyy-MM-ddTHH:mm:ssZ
|
|
|
|
|
|
|
|
|
|
:return: The timestamp of this TrafficInfo.
|
|
|
|
|
:rtype: datetime
|
|
|
|
|
"""
|
|
|
|
|
return self._timestamp
|
|
|
|
|
|
|
|
|
|
@timestamp.setter
|
|
|
|
|
def timestamp(self, timestamp):
|
|
|
|
|
"""Sets the timestamp of this TrafficInfo.
|
|
|
|
|
|
|
|
|
|
流量数据采样周期起始时刻,UTC时间,格式:yyyy-MM-ddTHH:mm:ssZ
|
|
|
|
|
|
|
|
|
|
:param timestamp: The timestamp of this TrafficInfo.
|
|
|
|
|
:type: datetime
|
|
|
|
|
"""
|
|
|
|
|
self._timestamp = timestamp
|
2020-09-09 08:56:41 +00:00
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
if attr in self.sensitive_list:
|
|
|
|
|
result[attr] = "****"
|
|
|
|
|
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"""
|
2020-11-30 13:39:15 +00:00
|
|
|
|
if not isinstance(other, TrafficInfo):
|
2020-09-09 08:56:41 +00:00
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
return self.__dict__ == other.__dict__
|
|
|
|
|
|
|
|
|
|
def __ne__(self, other):
|
|
|
|
|
"""Returns true if both objects are not equal"""
|
|
|
|
|
return not self == other
|