huaweicloud-sdk-python-v3/huaweicloud-sdk-bssintl/huaweicloudsdkbssintl/v2/model/discount_item_v2.py

138 lines
5.8 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 pprint
import re
import six
class DiscountItemV2:
"""
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 = {
'discount_type': 'str',
'discount_amount': 'float'
}
attribute_map = {
'discount_type': 'discount_type',
'discount_amount': 'discount_amount'
}
def __init__(self, discount_type=None, discount_amount=None):
"""DiscountItemV2 - a model defined in huaweicloud sdk"""
self._discount_type = None
self._discount_amount = None
self.discriminator = None
if discount_type is not None:
self.discount_type = discount_type
if discount_amount is not None:
self.discount_amount = discount_amount
@property
def discount_type(self):
"""Gets the discount_type of this DiscountItemV2.
|参数名称折扣类型200促销产品折扣300促销折扣券301促销代金券302促销现金券500代理订购指定折扣501代理订购指定减免502代理订购指定一口价600折扣返利合同601渠道框架合同602专款专用合同603线下直签合同604电销授权合同605商务合同折扣606渠道商务合同折扣607合作伙伴授权折扣609订单调价折扣700促销折扣800充值帐户折扣| |参数约束及描述折扣类型200促销产品折扣300促销折扣券301促销代金券302促销现金券500代理订购指定折扣501代理订购指定减免502代理订购指定一口价600折扣返利合同601渠道框架合同602专款专用合同603线下直签合同604电销授权合同605商务合同折扣606渠道商务合同折扣607合作伙伴授权折扣609订单调价折扣700促销折扣800充值帐户折扣|
:return: The discount_type of this DiscountItemV2.
:rtype: str
"""
return self._discount_type
@discount_type.setter
def discount_type(self, discount_type):
"""Sets the discount_type of this DiscountItemV2.
|参数名称折扣类型200促销产品折扣300促销折扣券301促销代金券302促销现金券500代理订购指定折扣501代理订购指定减免502代理订购指定一口价600折扣返利合同601渠道框架合同602专款专用合同603线下直签合同604电销授权合同605商务合同折扣606渠道商务合同折扣607合作伙伴授权折扣609订单调价折扣700促销折扣800充值帐户折扣| |参数约束及描述折扣类型200促销产品折扣300促销折扣券301促销代金券302促销现金券500代理订购指定折扣501代理订购指定减免502代理订购指定一口价600折扣返利合同601渠道框架合同602专款专用合同603线下直签合同604电销授权合同605商务合同折扣606渠道商务合同折扣607合作伙伴授权折扣609订单调价折扣700促销折扣800充值帐户折扣|
:param discount_type: The discount_type of this DiscountItemV2.
:type: str
"""
self._discount_type = discount_type
@property
def discount_amount(self):
"""Gets the discount_amount of this DiscountItemV2.
|参数名称:折扣金额。| |参数的约束及描述:折扣金额。|
:return: The discount_amount of this DiscountItemV2.
:rtype: float
"""
return self._discount_amount
@discount_amount.setter
def discount_amount(self, discount_amount):
"""Sets the discount_amount of this DiscountItemV2.
|参数名称:折扣金额。| |参数的约束及描述:折扣金额。|
:param discount_amount: The discount_amount of this DiscountItemV2.
:type: float
"""
self._discount_amount = discount_amount
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"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, DiscountItemV2):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other