66class Discount (object ):
77
88 def __init__ (self ):
9+ self .discountTag = None
910 self .discountName = None
1011 self .savingsAmount = None # type: Amount
12+ self .estimateSavingsAmount = None # type: Amount
13+
14+ @property
15+ def discountTag (self ):
16+ return self .__discountTag
17+
18+ @discountTag .setter
19+ def discountTag (self , value ):
20+ self .__discountTag = value
1121
1222 @property
1323 def discountName (self ):
@@ -25,22 +35,42 @@ def savingsAmount(self):
2535 def savingsAmount (self , value ):
2636 self .__savingsAmount = value
2737
38+ @property
39+ def estimateSavingsAmount (self ):
40+ return self .__estimateSavingsAmount
41+
42+ @estimateSavingsAmount .setter
43+ def estimateSavingsAmount (self , value ):
44+ self .__estimateSavingsAmount = value
45+
2846 def to_ams_dict (self ):
2947 params = dict ()
48+ if self .discountTag is not None :
49+ params ['discountTag' ] = self .discountTag
3050 if self .discountName is not None :
3151 params ['discountName' ] = self .discountName
3252 if self .savingsAmount is not None :
3353 params ['savingsAmount' ] = self .savingsAmount .to_ams_dict ()
54+ if self .estimateSavingsAmount is not None :
55+ params ['estimateSavingsAmount' ] = self .estimateSavingsAmount .to_ams_dict ()
3456 return params
3557
3658 def parse_rsp_body (self , discount_body ):
3759 if type (discount_body ) == str :
3860 discount_body = json .loads (discount_body )
3961
62+ if 'discountTag' in discount_body :
63+ self .discountTag = discount_body ['discountTag' ]
64+
4065 if 'discountName' in discount_body :
4166 self .discountName = discount_body ['discountName' ]
4267
4368 if 'savingsAmount' in discount_body :
4469 payment_amount = Amount ()
4570 payment_amount .parse_rsp_body (discount_body ['savingsAmount' ])
4671 self .__savingsAmount = payment_amount
72+
73+ if 'estimateSavingsAmount' in discount_body :
74+ payment_amount = Amount ()
75+ payment_amount .parse_rsp_body (discount_body ['estimateSavingsAmount' ])
76+ self .__estimateSavingsAmount = payment_amount
0 commit comments