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

201 lines
6.5 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 EventItem:
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 = {
'event_name': 'str',
'event_source': 'str',
'time': 'int',
'detail': 'EventItemDetail'
}
attribute_map = {
'event_name': 'event_name',
'event_source': 'event_source',
'time': 'time',
'detail': 'detail'
}
def __init__(self, event_name=None, event_source=None, time=None, detail=None):
2022-04-21 12:03:46 +00:00
"""EventItem
The model defined in huaweicloud sdk
:param event_name: 事件名称 必须以字母开头只能包含0-9/a-z/A-Z/_长度最短为1最大为64
:type event_name: str
:param event_source: 事件来源 格式为service.itemservice和item必须是字符串必须以字母开头只能包含0-9/a-z/A-Z/_总长度最短为3最大为32
:type event_source: str
:param time: 事件发生时间UNIX时间戳单位毫秒 说明 因为客户端到服务器端有延时因此插入数据的时间戳应该在[当前时间-1小时+20当前时间+10分钟-20]区间内保证到达服务器时不会因为传输时延造成数据不能插入数据库
:type time: int
:param detail:
:type detail: :class:`huaweicloudsdkces.v1.EventItemDetail`
"""
2020-05-18 07:34:40 +00:00
self._event_name = None
self._event_source = None
self._time = None
self._detail = None
self.discriminator = None
self.event_name = event_name
2022-04-14 11:06:46 +00:00
self.event_source = event_source
2020-05-18 07:34:40 +00:00
self.time = time
self.detail = detail
@property
def event_name(self):
"""Gets the event_name of this EventItem.
事件名称 必须以字母开头只能包含0-9/a-z/A-Z/_长度最短为1最大为64
:return: The event_name of this EventItem.
:rtype: str
"""
return self._event_name
@event_name.setter
def event_name(self, event_name):
"""Sets the event_name of this EventItem.
事件名称 必须以字母开头只能包含0-9/a-z/A-Z/_长度最短为1最大为64
:param event_name: The event_name of this EventItem.
2022-04-21 12:03:46 +00:00
:type event_name: str
2020-05-18 07:34:40 +00:00
"""
self._event_name = event_name
@property
def event_source(self):
"""Gets the event_source of this EventItem.
事件来源 格式为service.itemservice和item必须是字符串必须以字母开头只能包含0-9/a-z/A-Z/_总长度最短为3最大为32
2020-05-18 07:34:40 +00:00
:return: The event_source of this EventItem.
:rtype: str
"""
return self._event_source
@event_source.setter
def event_source(self, event_source):
"""Sets the event_source of this EventItem.
事件来源 格式为service.itemservice和item必须是字符串必须以字母开头只能包含0-9/a-z/A-Z/_总长度最短为3最大为32
2020-05-18 07:34:40 +00:00
:param event_source: The event_source of this EventItem.
2022-04-21 12:03:46 +00:00
:type event_source: str
2020-05-18 07:34:40 +00:00
"""
self._event_source = event_source
@property
def time(self):
"""Gets the time of this EventItem.
事件发生时间UNIX时间戳单位毫秒 说明 因为客户端到服务器端有延时因此插入数据的时间戳应该在[当前时间-1小时+20当前时间+10分钟-20]区间内保证到达服务器时不会因为传输时延造成数据不能插入数据库
:return: The time of this EventItem.
:rtype: int
"""
return self._time
@time.setter
def time(self, time):
"""Sets the time of this EventItem.
事件发生时间UNIX时间戳单位毫秒 说明 因为客户端到服务器端有延时因此插入数据的时间戳应该在[当前时间-1小时+20当前时间+10分钟-20]区间内保证到达服务器时不会因为传输时延造成数据不能插入数据库
:param time: The time of this EventItem.
2022-04-21 12:03:46 +00:00
:type time: int
2020-05-18 07:34:40 +00:00
"""
self._time = time
@property
def detail(self):
"""Gets the detail of this EventItem.
:return: The detail of this EventItem.
2022-04-21 12:03:46 +00:00
:rtype: :class:`huaweicloudsdkces.v1.EventItemDetail`
2020-05-18 07:34:40 +00:00
"""
return self._detail
@detail.setter
def detail(self, detail):
"""Sets the detail of this EventItem.
:param detail: The detail of this EventItem.
2022-04-21 12:03:46 +00:00
:type detail: :class:`huaweicloudsdkces.v1.EventItemDetail`
2020-05-18 07:34:40 +00:00
"""
self._detail = detail
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, EventItem):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other