6
6
class Discount (object ):
7
7
8
8
def __init__ (self ):
9
+ self .discountTag = None
9
10
self .discountName = None
10
11
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
11
21
12
22
@property
13
23
def discountName (self ):
@@ -25,22 +35,42 @@ def savingsAmount(self):
25
35
def savingsAmount (self , value ):
26
36
self .__savingsAmount = value
27
37
38
+ @property
39
+ def estimateSavingsAmount (self ):
40
+ return self .__estimateSavingsAmount
41
+
42
+ @estimateSavingsAmount .setter
43
+ def estimateSavingsAmount (self , value ):
44
+ self .__estimateSavingsAmount = value
45
+
28
46
def to_ams_dict (self ):
29
47
params = dict ()
48
+ if self .discountTag is not None :
49
+ params ['discountTag' ] = self .discountTag
30
50
if self .discountName is not None :
31
51
params ['discountName' ] = self .discountName
32
52
if self .savingsAmount is not None :
33
53
params ['savingsAmount' ] = self .savingsAmount .to_ams_dict ()
54
+ if self .estimateSavingsAmount is not None :
55
+ params ['estimateSavingsAmount' ] = self .estimateSavingsAmount .to_ams_dict ()
34
56
return params
35
57
36
58
def parse_rsp_body (self , discount_body ):
37
59
if type (discount_body ) == str :
38
60
discount_body = json .loads (discount_body )
39
61
62
+ if 'discountTag' in discount_body :
63
+ self .discountTag = discount_body ['discountTag' ]
64
+
40
65
if 'discountName' in discount_body :
41
66
self .discountName = discount_body ['discountName' ]
42
67
43
68
if 'savingsAmount' in discount_body :
44
69
payment_amount = Amount ()
45
70
payment_amount .parse_rsp_body (discount_body ['savingsAmount' ])
46
71
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