huaweicloud-sdk-python-v3/huaweicloud-sdk-functiongraph/huaweicloudsdkfunctiongraph/v2/model/obs_trigger_config.py

199 lines
5.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding: utf-8
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class OBSTriggerConfig:
"""
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 = {
'bucket': 'str',
'events': 'list[str]',
'prefix': 'str',
'suffix': 'str'
}
attribute_map = {
'bucket': 'bucket',
'events': 'events',
'prefix': 'prefix',
'suffix': 'suffix'
}
def __init__(self, bucket=None, events=None, prefix=None, suffix=None):
"""OBSTriggerConfig
The model defined in huaweicloud sdk
:param bucket: OBS桶名trigger_type为OBS时配置
:type bucket: str
:param events: OBS事件列表trigger_type为OBS时配置
:type events: list[str]
:param prefix: 对象名前缀trigger_type为OBS时配置
:type prefix: str
:param suffix: 对象名后缀trigger_type为OBS时配置
:type suffix: str
"""
self._bucket = None
self._events = None
self._prefix = None
self._suffix = None
self.discriminator = None
self.bucket = bucket
self.events = events
self.prefix = prefix
self.suffix = suffix
@property
def bucket(self):
"""Gets the bucket of this OBSTriggerConfig.
OBS桶名trigger_type为OBS时配置
:return: The bucket of this OBSTriggerConfig.
:rtype: str
"""
return self._bucket
@bucket.setter
def bucket(self, bucket):
"""Sets the bucket of this OBSTriggerConfig.
OBS桶名trigger_type为OBS时配置
:param bucket: The bucket of this OBSTriggerConfig.
:type bucket: str
"""
self._bucket = bucket
@property
def events(self):
"""Gets the events of this OBSTriggerConfig.
OBS事件列表trigger_type为OBS时配置
:return: The events of this OBSTriggerConfig.
:rtype: list[str]
"""
return self._events
@events.setter
def events(self, events):
"""Sets the events of this OBSTriggerConfig.
OBS事件列表trigger_type为OBS时配置
:param events: The events of this OBSTriggerConfig.
:type events: list[str]
"""
self._events = events
@property
def prefix(self):
"""Gets the prefix of this OBSTriggerConfig.
对象名前缀trigger_type为OBS时配置
:return: The prefix of this OBSTriggerConfig.
:rtype: str
"""
return self._prefix
@prefix.setter
def prefix(self, prefix):
"""Sets the prefix of this OBSTriggerConfig.
对象名前缀trigger_type为OBS时配置
:param prefix: The prefix of this OBSTriggerConfig.
:type prefix: str
"""
self._prefix = prefix
@property
def suffix(self):
"""Gets the suffix of this OBSTriggerConfig.
对象名后缀trigger_type为OBS时配置
:return: The suffix of this OBSTriggerConfig.
:rtype: str
"""
return self._suffix
@suffix.setter
def suffix(self, suffix):
"""Sets the suffix of this OBSTriggerConfig.
对象名后缀trigger_type为OBS时配置
:param suffix: The suffix of this OBSTriggerConfig.
:type suffix: str
"""
self._suffix = suffix
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"""
import simplejson as json
if six.PY2:
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
def __repr__(self):
"""For `print`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, OBSTriggerConfig):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other