66class Discount (object ):
77
88 def __init__ (self ):
9- self .discountTag = None
10- self .discountName = None
11- self .savingsAmount = None # type: Amount
12- self .estimateSavingsAmount = None # type: Amount
9+ self .__discount_tag = None
10+ self .__discount_name = None
11+ self .__savings_amount = None # type: Amount
12+ self .__estimate_savings_amount = None # type: Amount
13+ self .__promotion_code = None
1314
1415 @property
15- def discountTag (self ):
16- return self .__discountTag
16+ def discount_tag (self ):
17+ return self .__discount_tag
1718
18- @discountTag .setter
19- def discountTag (self , value ):
20- self .__discountTag = value
19+ @discount_tag .setter
20+ def discount_tag (self , value ):
21+ self .__discount_tag = value
2122
2223 @property
23- def discountName (self ):
24- return self .__discountName
24+ def discount_name (self ):
25+ return self .__discount_name
2526
26- @discountName .setter
27- def discountName (self , value ):
28- self .__discountName = value
27+ @discount_name .setter
28+ def discount_name (self , value ):
29+ self .__discount_name = value
30+
31+ @property
32+ def savings_amount (self ):
33+ return self .__savings_amount
34+
35+ @savings_amount .setter
36+ def savings_amount (self , value ):
37+ self .__savings_amount = value
38+
39+ @property
40+ def estimate_savings_amount (self ):
41+ return self .__estimate_savings_amount
42+
43+ @estimate_savings_amount .setter
44+ def estimate_savings_amount (self , value ):
45+ self .__estimate_savings_amount = value
46+
47+ @property
48+ def promotion_code (self ):
49+ return self .__promotion_code
50+
51+ @promotion_code .setter
52+ def promotion_code (self , value ):
53+ self .__promotion_code = value
2954
3055 @property
3156 def savingsAmount (self ):
32- return self .__savingsAmount
57+ return self .__savings_amount
3358
3459 @savingsAmount .setter
3560 def savingsAmount (self , value ):
36- self .__savingsAmount = value
61+ self .__savings_amount = value
3762
3863 @property
3964 def estimateSavingsAmount (self ):
40- return self .__estimateSavingsAmount
65+ return self .__estimate_savings_amount
4166
4267 @estimateSavingsAmount .setter
4368 def estimateSavingsAmount (self , value ):
44- self .__estimateSavingsAmount = value
69+ self .__estimate_savings_amount = value
70+
71+ @property
72+ def promotionCode (self ):
73+ return self .__promotion_code
74+
75+ @promotionCode .setter
76+ def promotionCode (self , value ):
77+ self .__promotion_code = value
4578
4679 def to_ams_dict (self ):
4780 params = dict ()
4881 if self .discountTag is not None :
49- params ['discountTag' ] = self .discountTag
82+ params ['discountTag' ] = self .discount_tag
5083 if self .discountName is not None :
51- params ['discountName' ] = self .discountName
84+ params ['discountName' ] = self .discount_name
5285 if self .savingsAmount is not None :
53- params ['savingsAmount' ] = self .savingsAmount .to_ams_dict ()
86+ params ['savingsAmount' ] = self .savings_amount .to_ams_dict ()
5487 if self .estimateSavingsAmount is not None :
55- params ['estimateSavingsAmount' ] = self .estimateSavingsAmount .to_ams_dict ()
88+ params ['estimateSavingsAmount' ] = self .estimate_savings_amount .to_ams_dict ()
89+ if self .promotionCode is not None :
90+ params ['promotionCode' ] = self .promotion_code
5691 return params
5792
5893 def parse_rsp_body (self , discount_body ):
5994 if type (discount_body ) == str :
6095 discount_body = json .loads (discount_body )
6196
6297 if 'discountTag' in discount_body :
63- self .discountTag = discount_body ['discountTag' ]
98+ self .discount_tag = discount_body ['discountTag' ]
6499
65100 if 'discountName' in discount_body :
66- self .discountName = discount_body ['discountName' ]
101+ self .discount_name = discount_body ['discountName' ]
67102
68103 if 'savingsAmount' in discount_body :
69104 payment_amount = Amount ()
70105 payment_amount .parse_rsp_body (discount_body ['savingsAmount' ])
71- self .__savingsAmount = payment_amount
106+ self .savings_amount = payment_amount
72107
73108 if 'estimateSavingsAmount' in discount_body :
74109 payment_amount = Amount ()
75110 payment_amount .parse_rsp_body (discount_body ['estimateSavingsAmount' ])
76- self .__estimateSavingsAmount = payment_amount
111+ self .estimate_savings_amount = payment_amount
112+ if 'promotionCode' in discount_body :
113+ self .promotion_code = discount_body ['promotionCode' ]
0 commit comments