huaweicloud-sdk-python-v3/huaweicloud-sdk-dataartsfab.../huaweicloudsdkdataartsfabricep/v1/model/base_demand.py

143 lines
3.5 KiB
Python
Raw Normal View History

2022-11-17 12:13:53 +00:00
# coding: utf-8
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
2024-10-31 08:59:56 +00:00
class BaseDemand:
2022-11-17 12:13:53 +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 = {
2024-10-31 08:59:56 +00:00
'min': 'int',
'max': 'int'
2022-11-17 12:13:53 +00:00
}
attribute_map = {
2024-10-31 08:59:56 +00:00
'min': 'min',
'max': 'max'
2022-11-17 12:13:53 +00:00
}
2024-10-31 08:59:56 +00:00
def __init__(self, min=None, max=None):
"""BaseDemand
2022-11-17 12:13:53 +00:00
The model defined in huaweicloud sdk
2024-10-31 08:59:56 +00:00
:param min: 最小数
:type min: int
:param max: 最大数最小值为1最大值为1000
:type max: int
2022-11-17 12:13:53 +00:00
"""
2024-10-31 08:59:56 +00:00
self._min = None
self._max = None
2022-11-17 12:13:53 +00:00
self.discriminator = None
2024-10-31 08:59:56 +00:00
self.min = min
self.max = max
2022-11-17 12:13:53 +00:00
@property
2024-10-31 08:59:56 +00:00
def min(self):
"""Gets the min of this BaseDemand.
2022-11-17 12:13:53 +00:00
2024-10-31 08:59:56 +00:00
最小数
2022-11-17 12:13:53 +00:00
2024-10-31 08:59:56 +00:00
:return: The min of this BaseDemand.
:rtype: int
2022-11-17 12:13:53 +00:00
"""
2024-10-31 08:59:56 +00:00
return self._min
2022-11-17 12:13:53 +00:00
2024-10-31 08:59:56 +00:00
@min.setter
def min(self, min):
"""Sets the min of this BaseDemand.
2022-11-17 12:13:53 +00:00
2024-10-31 08:59:56 +00:00
最小数
2022-11-17 12:13:53 +00:00
2024-10-31 08:59:56 +00:00
:param min: The min of this BaseDemand.
:type min: int
2022-11-17 12:13:53 +00:00
"""
2024-10-31 08:59:56 +00:00
self._min = min
2022-11-17 12:13:53 +00:00
2024-02-29 07:44:10 +00:00
@property
2024-10-31 08:59:56 +00:00
def max(self):
"""Gets the max of this BaseDemand.
2024-02-29 07:44:10 +00:00
2024-10-31 08:59:56 +00:00
最大数最小值为1最大值为1000
2024-02-29 07:44:10 +00:00
2024-10-31 08:59:56 +00:00
:return: The max of this BaseDemand.
:rtype: int
2024-02-29 07:44:10 +00:00
"""
2024-10-31 08:59:56 +00:00
return self._max
2024-02-29 07:44:10 +00:00
2024-10-31 08:59:56 +00:00
@max.setter
def max(self, max):
"""Sets the max of this BaseDemand.
2024-02-29 07:44:10 +00:00
2024-10-31 08:59:56 +00:00
最大数最小值为1最大值为1000
2024-02-29 07:44:10 +00:00
2024-10-31 08:59:56 +00:00
:param max: The max of this BaseDemand.
:type max: int
2024-02-29 07:44:10 +00:00
"""
2024-10-31 08:59:56 +00:00
self._max = max
2024-02-29 07:44:10 +00:00
2022-11-17 12:13:53 +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"""
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"""
2024-10-31 08:59:56 +00:00
if not isinstance(other, BaseDemand):
2022-11-17 12:13:53 +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