huaweicloud-sdk-python-v3/huaweicloud-sdk-ces/huaweicloudsdkces/v1/model/event_data_info.py

175 lines
4.3 KiB
Python
Raw Normal View History

2020-05-18 07:34:40 +00:00
# coding: utf-8
import re
import six
2021-07-26 11:24:08 +00:00
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class EventDataInfo:
2020-05-18 07:34:40 +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 = []
2020-05-18 07:34:40 +00:00
openapi_types = {
'type': 'str',
'timestamp': 'int',
'value': 'str'
}
attribute_map = {
'type': 'type',
'timestamp': 'timestamp',
'value': 'value'
}
def __init__(self, type=None, timestamp=None, value=None):
2022-04-21 12:03:46 +00:00
"""EventDataInfo
The model defined in huaweicloud sdk
:param type: 事件类型例如instance_host_info
:type type: str
:param timestamp: 事件上报时间
:type timestamp: int
:param value: 主机配置信息
:type value: str
"""
2020-05-18 07:34:40 +00:00
self._type = None
self._timestamp = None
self._value = None
self.discriminator = None
self.type = type
self.timestamp = timestamp
self.value = value
@property
def type(self):
"""Gets the type of this EventDataInfo.
事件类型例如instance_host_info
:return: The type of this EventDataInfo.
:rtype: str
"""
return self._type
@type.setter
def type(self, type):
"""Sets the type of this EventDataInfo.
事件类型例如instance_host_info
:param type: The type of this EventDataInfo.
2022-04-21 12:03:46 +00:00
:type type: str
2020-05-18 07:34:40 +00:00
"""
self._type = type
@property
def timestamp(self):
"""Gets the timestamp of this EventDataInfo.
事件上报时间
:return: The timestamp of this EventDataInfo.
:rtype: int
"""
return self._timestamp
@timestamp.setter
def timestamp(self, timestamp):
"""Sets the timestamp of this EventDataInfo.
事件上报时间
:param timestamp: The timestamp of this EventDataInfo.
2022-04-21 12:03:46 +00:00
:type timestamp: int
2020-05-18 07:34:40 +00:00
"""
self._timestamp = timestamp
@property
def value(self):
"""Gets the value of this EventDataInfo.
主机配置信息
:return: The value of this EventDataInfo.
:rtype: str
"""
return self._value
@value.setter
def value(self, value):
"""Sets the value of this EventDataInfo.
主机配置信息
:param value: The value of this EventDataInfo.
2022-04-21 12:03:46 +00:00
:type value: str
2020-05-18 07:34:40 +00:00
"""
self._value = value
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
2020-05-18 07:34:40 +00:00
return result
def to_str(self):
2021-08-10 12:26:18 +00:00
"""Returns the string representation of the model"""
2021-07-09 10:57:08 +00:00
import simplejson as json
2021-08-10 12:26:18 +00:00
if six.PY2:
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
2020-05-18 07:34:40 +00:00
def __repr__(self):
2021-08-10 12:26:18 +00:00
"""For `print`"""
2020-05-18 07:34:40 +00:00
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, EventDataInfo):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other