huaweicloud-sdk-python-v3/huaweicloud-sdk-ief/huaweicloudsdkief/v1/model/excepted.py

141 lines
4.1 KiB
Python
Raw Normal View History

2021-12-25 10:51:01 +00:00
# coding: utf-8
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
2022-06-30 11:16:08 +00:00
class Excepted:
2021-12-25 10:51:01 +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 = {
'value': 'str',
2022-06-30 11:16:08 +00:00
'metadata': 'ExceptedMetadata'
2021-12-25 10:51:01 +00:00
}
attribute_map = {
'value': 'value',
'metadata': 'metadata'
}
def __init__(self, value=None, metadata=None):
2022-06-30 11:16:08 +00:00
"""Excepted
2022-04-21 12:03:46 +00:00
The model defined in huaweicloud sdk
2022-12-01 11:20:06 +00:00
:param value: 动态属性的初始值最大长度512value允许英文字母数字下划线中划线逗号冒号/@+?^=、%、&、~、#、!、*
2022-04-21 12:03:46 +00:00
:type value: str
:param metadata:
2022-06-30 11:16:08 +00:00
:type metadata: :class:`huaweicloudsdkief.v1.ExceptedMetadata`
2022-04-21 12:03:46 +00:00
"""
2021-12-25 10:51:01 +00:00
self._value = None
self._metadata = None
self.discriminator = None
2022-06-30 11:16:08 +00:00
if value is not None:
self.value = value
2021-12-25 10:51:01 +00:00
if metadata is not None:
self.metadata = metadata
@property
def value(self):
2022-06-30 11:16:08 +00:00
"""Gets the value of this Excepted.
2021-12-25 10:51:01 +00:00
2022-12-01 11:20:06 +00:00
动态属性的初始值最大长度512value允许英文字母数字下划线中划线逗号冒号/@+?^=%&~#、!、*
2021-12-25 10:51:01 +00:00
2022-06-30 11:16:08 +00:00
:return: The value of this Excepted.
2021-12-25 10:51:01 +00:00
:rtype: str
"""
return self._value
@value.setter
def value(self, value):
2022-06-30 11:16:08 +00:00
"""Sets the value of this Excepted.
2021-12-25 10:51:01 +00:00
2022-12-01 11:20:06 +00:00
动态属性的初始值最大长度512value允许英文字母数字下划线中划线逗号冒号/@+?^=%&~#、!、*
2021-12-25 10:51:01 +00:00
2022-06-30 11:16:08 +00:00
:param value: The value of this Excepted.
2022-04-21 12:03:46 +00:00
:type value: str
2021-12-25 10:51:01 +00:00
"""
self._value = value
@property
def metadata(self):
2022-06-30 11:16:08 +00:00
"""Gets the metadata of this Excepted.
2021-12-25 10:51:01 +00:00
2022-06-30 11:16:08 +00:00
:return: The metadata of this Excepted.
:rtype: :class:`huaweicloudsdkief.v1.ExceptedMetadata`
2021-12-25 10:51:01 +00:00
"""
return self._metadata
@metadata.setter
def metadata(self, metadata):
2022-06-30 11:16:08 +00:00
"""Sets the metadata of this Excepted.
2021-12-25 10:51:01 +00:00
2022-06-30 11:16:08 +00:00
:param metadata: The metadata of this Excepted.
:type metadata: :class:`huaweicloudsdkief.v1.ExceptedMetadata`
2021-12-25 10:51:01 +00:00
"""
self._metadata = metadata
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"""
2022-06-30 11:16:08 +00:00
if not isinstance(other, Excepted):
2021-12-25 10:51:01 +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