Skip to content

Commit 0498d1d

Browse files
authored
Merge pull request #63 from alipay/sdk-automation/20260126-0758
Update all services
2 parents f66a6c7 + 292c74c commit 0498d1d

21 files changed

+1470
-22
lines changed

com/alipay/ams/api/model/account_balance.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,16 @@
99
class AccountBalance:
1010
def __init__(self):
1111

12-
self.__account_no = None # type: str
1312
self.__currency = None # type: str
1413
self.__available_balance = None # type: Amount
1514
self.__frozen_balance = None # type: Amount
1615
self.__total_balance = None # type: Amount
1716

1817

19-
@property
20-
def account_no(self):
21-
"""
22-
The balance account number. More information: Maximum length: 32 characters
23-
"""
24-
return self.__account_no
25-
26-
@account_no.setter
27-
def account_no(self, value):
28-
self.__account_no = value
2918
@property
3019
def currency(self):
31-
"""
32-
The currency associated with the balance account. The value of this parameter is a 3-letter currency code that follows the ISO 4217 standard. More information: Maximum length: 3 characters
20+
"""Gets the currency of this AccountBalance.
21+
3322
"""
3423
return self.__currency
3524

@@ -72,8 +61,6 @@ def total_balance(self, value):
7261

7362
def to_ams_dict(self):
7463
params = dict()
75-
if hasattr(self, "account_no") and self.account_no is not None:
76-
params['accountNo'] = self.account_no
7764
if hasattr(self, "currency") and self.currency is not None:
7865
params['currency'] = self.currency
7966
if hasattr(self, "available_balance") and self.available_balance is not None:
@@ -88,8 +75,6 @@ def to_ams_dict(self):
8875
def parse_rsp_body(self, response_body):
8976
if isinstance(response_body, str):
9077
response_body = json.loads(response_body)
91-
if 'accountNo' in response_body:
92-
self.__account_no = response_body['accountNo']
9378
if 'currency' in response_body:
9479
self.__currency = response_body['currency']
9580
if 'availableBalance' in response_body:
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import json
2+
3+
4+
5+
6+
class InquiryRateCondition:
7+
def __init__(self):
8+
9+
self.__buy_currency = None # type: str
10+
self.__sell_currency = None # type: str
11+
12+
13+
@property
14+
def buy_currency(self):
15+
"""Gets the buy_currency of this InquiryRateCondition.
16+
17+
"""
18+
return self.__buy_currency
19+
20+
@buy_currency.setter
21+
def buy_currency(self, value):
22+
self.__buy_currency = value
23+
@property
24+
def sell_currency(self):
25+
"""Gets the sell_currency of this InquiryRateCondition.
26+
27+
"""
28+
return self.__sell_currency
29+
30+
@sell_currency.setter
31+
def sell_currency(self, value):
32+
self.__sell_currency = value
33+
34+
35+
36+
37+
def to_ams_dict(self):
38+
params = dict()
39+
if hasattr(self, "buy_currency") and self.buy_currency is not None:
40+
params['buyCurrency'] = self.buy_currency
41+
if hasattr(self, "sell_currency") and self.sell_currency is not None:
42+
params['sellCurrency'] = self.sell_currency
43+
return params
44+
45+
46+
def parse_rsp_body(self, response_body):
47+
if isinstance(response_body, str):
48+
response_body = json.loads(response_body)
49+
if 'buyCurrency' in response_body:
50+
self.__buy_currency = response_body['buyCurrency']
51+
if 'sellCurrency' in response_body:
52+
self.__sell_currency = response_body['sellCurrency']

com/alipay/ams/api/model/period_rule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self):
1616
@property
1717
def period_type(self):
1818
"""
19-
The subscription period type. Valid values are: YEAR: indicates that the subscription period is measured in years. MONTH: indicates that the subscription period is measured in months. WEEK: indicates that the subscription period is measured in weeks. DAY: indicates that the subscription period is measured in days. More information: Maximum length: 20 characters
19+
The subscription period type. More information: Maximum length: 20 characters
2020
"""
2121
return self.__period_type
2222

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
from enum import Enum, unique
2-
3-
42
@unique
53
class PeriodType(Enum):
6-
DAY = "DAY"
4+
"""The subscription period type. Valid values are: WEEK: indicates that the subscription period is measured in weeks. MONTH: indicates that the subscription period is measured in months. QUARTER: indicates that the subscription period is measured in quarters. HALF_YEAR: indicates that the subscription period is measured in half years. YEAR: indicates that the subscription period is measured in years."""
5+
76
WEEK = "WEEK"
87
MONTH = "MONTH"
8+
QUARTER = "QUARTER"
9+
HALF_YEAR = "HALF_YEAR"
910
YEAR = "YEAR"
1011

11-
def to_ams_dict(self):
12+
def to_ams_dict(self) -> str:
1213
return self.name
14+
15+
@staticmethod
16+
def value_of(value):
17+
if not value:
18+
return None
19+
20+
if PeriodType.WEEK.value == value:
21+
return PeriodType.WEEK
22+
if PeriodType.MONTH.value == value:
23+
return PeriodType.MONTH
24+
if PeriodType.QUARTER.value == value:
25+
return PeriodType.QUARTER
26+
if PeriodType.HALF_YEAR.value == value:
27+
return PeriodType.HALF_YEAR
28+
if PeriodType.YEAR.value == value:
29+
return PeriodType.YEAR
30+
return None
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import json
2+
3+
4+
5+
6+
class RateResult:
7+
def __init__(self):
8+
9+
self.__buy_currency = None # type: str
10+
self.__sell_currency = None # type: str
11+
self.__exchange_rate = None # type: str
12+
13+
14+
@property
15+
def buy_currency(self):
16+
"""Gets the buy_currency of this RateResult.
17+
18+
"""
19+
return self.__buy_currency
20+
21+
@buy_currency.setter
22+
def buy_currency(self, value):
23+
self.__buy_currency = value
24+
@property
25+
def sell_currency(self):
26+
"""Gets the sell_currency of this RateResult.
27+
28+
"""
29+
return self.__sell_currency
30+
31+
@sell_currency.setter
32+
def sell_currency(self, value):
33+
self.__sell_currency = value
34+
@property
35+
def exchange_rate(self):
36+
"""Gets the exchange_rate of this RateResult.
37+
38+
"""
39+
return self.__exchange_rate
40+
41+
@exchange_rate.setter
42+
def exchange_rate(self, value):
43+
self.__exchange_rate = value
44+
45+
46+
47+
48+
def to_ams_dict(self):
49+
params = dict()
50+
if hasattr(self, "buy_currency") and self.buy_currency is not None:
51+
params['buyCurrency'] = self.buy_currency
52+
if hasattr(self, "sell_currency") and self.sell_currency is not None:
53+
params['sellCurrency'] = self.sell_currency
54+
if hasattr(self, "exchange_rate") and self.exchange_rate is not None:
55+
params['exchangeRate'] = self.exchange_rate
56+
return params
57+
58+
59+
def parse_rsp_body(self, response_body):
60+
if isinstance(response_body, str):
61+
response_body = json.loads(response_body)
62+
if 'buyCurrency' in response_body:
63+
self.__buy_currency = response_body['buyCurrency']
64+
if 'sellCurrency' in response_body:
65+
self.__sell_currency = response_body['sellCurrency']
66+
if 'exchangeRate' in response_body:
67+
self.__exchange_rate = response_body['exchangeRate']

com/alipay/ams/api/model/subscription_info.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
from com.alipay.ams.api.model.period_rule import PeriodRule
33
from com.alipay.ams.api.model.trial import Trial
4+
from com.alipay.ams.api.model.amount import Amount
45

56

67

@@ -15,6 +16,8 @@ def __init__(self):
1516
self.__trials = None # type: [Trial]
1617
self.__subscription_notify_url = None # type: str
1718
self.__subscription_expiry_time = None # type: str
19+
self.__allow_retry = None # type: bool
20+
self.__max_amount_floor = None # type: Amount
1821

1922

2023
@property
@@ -87,6 +90,26 @@ def subscription_expiry_time(self):
8790
@subscription_expiry_time.setter
8891
def subscription_expiry_time(self, value):
8992
self.__subscription_expiry_time = value
93+
@property
94+
def allow_retry(self):
95+
"""
96+
Field is used only in the PIX recurrence scenario. Whether to allow a retry in the event that a recurring payment fails due to insufficient balance.
97+
"""
98+
return self.__allow_retry
99+
100+
@allow_retry.setter
101+
def allow_retry(self, value):
102+
self.__allow_retry = value
103+
@property
104+
def max_amount_floor(self):
105+
"""Gets the max_amount_floor of this SubscriptionInfo.
106+
107+
"""
108+
return self.__max_amount_floor
109+
110+
@max_amount_floor.setter
111+
def max_amount_floor(self, value):
112+
self.__max_amount_floor = value
90113

91114

92115

@@ -107,6 +130,10 @@ def to_ams_dict(self):
107130
params['subscriptionNotifyUrl'] = self.subscription_notify_url
108131
if hasattr(self, "subscription_expiry_time") and self.subscription_expiry_time is not None:
109132
params['subscriptionExpiryTime'] = self.subscription_expiry_time
133+
if hasattr(self, "allow_retry") and self.allow_retry is not None:
134+
params['allowRetry'] = self.allow_retry
135+
if hasattr(self, "max_amount_floor") and self.max_amount_floor is not None:
136+
params['maxAmountFloor'] = self.max_amount_floor
110137
return params
111138

112139

@@ -130,3 +157,8 @@ def parse_rsp_body(self, response_body):
130157
self.__subscription_notify_url = response_body['subscriptionNotifyUrl']
131158
if 'subscriptionExpiryTime' in response_body:
132159
self.__subscription_expiry_time = response_body['subscriptionExpiryTime']
160+
if 'allowRetry' in response_body:
161+
self.__allow_retry = response_body['allowRetry']
162+
if 'maxAmountFloor' in response_body:
163+
self.__max_amount_floor = Amount()
164+
self.__max_amount_floor.parse_rsp_body(response_body['maxAmountFloor'])
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
import json
2+
from com.alipay.ams.api.model.amount import Amount
3+
from com.alipay.ams.api.model.amount import Amount
4+
5+
6+
7+
from com.alipay.ams.api.request.alipay_request import AlipayRequest
8+
9+
class AlipayCreateExchangeRequest(AlipayRequest):
10+
def __init__(self):
11+
super(AlipayCreateExchangeRequest, self).__init__("/ams/v1/aba/funds/createExchange")
12+
13+
self.__buy_amount = None # type: Amount
14+
self.__sell_amount = None # type: Amount
15+
self.__exchange_trade_type = None # type: str
16+
self.__exchange_request_id = None # type: str
17+
self.__exchange_mode = None # type: str
18+
19+
20+
@property
21+
def buy_amount(self):
22+
"""Gets the buy_amount of this AlipayCreateExchangeRequest.
23+
24+
"""
25+
return self.__buy_amount
26+
27+
@buy_amount.setter
28+
def buy_amount(self, value):
29+
self.__buy_amount = value
30+
@property
31+
def sell_amount(self):
32+
"""Gets the sell_amount of this AlipayCreateExchangeRequest.
33+
34+
"""
35+
return self.__sell_amount
36+
37+
@sell_amount.setter
38+
def sell_amount(self, value):
39+
self.__sell_amount = value
40+
@property
41+
def exchange_trade_type(self):
42+
"""
43+
Foreign exchange delivery type. Possible value range: SPOT: Real-time exchange rate.
44+
"""
45+
return self.__exchange_trade_type
46+
47+
@exchange_trade_type.setter
48+
def exchange_trade_type(self, value):
49+
self.__exchange_trade_type = value
50+
@property
51+
def exchange_request_id(self):
52+
"""Gets the exchange_request_id of this AlipayCreateExchangeRequest.
53+
54+
"""
55+
return self.__exchange_request_id
56+
57+
@exchange_request_id.setter
58+
def exchange_request_id(self, value):
59+
self.__exchange_request_id = value
60+
@property
61+
def exchange_mode(self):
62+
"""
63+
Foreign exchange delivery model. Possible value range: APPOINTED: indicates an exchange rate at the appointed time.
64+
"""
65+
return self.__exchange_mode
66+
67+
@exchange_mode.setter
68+
def exchange_mode(self, value):
69+
self.__exchange_mode = value
70+
71+
72+
def to_ams_json(self):
73+
json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3)
74+
return json_str
75+
76+
77+
def to_ams_dict(self):
78+
params = dict()
79+
if hasattr(self, "buy_amount") and self.buy_amount is not None:
80+
params['buyAmount'] = self.buy_amount
81+
if hasattr(self, "sell_amount") and self.sell_amount is not None:
82+
params['sellAmount'] = self.sell_amount
83+
if hasattr(self, "exchange_trade_type") and self.exchange_trade_type is not None:
84+
params['exchangeTradeType'] = self.exchange_trade_type
85+
if hasattr(self, "exchange_request_id") and self.exchange_request_id is not None:
86+
params['exchangeRequestId'] = self.exchange_request_id
87+
if hasattr(self, "exchange_mode") and self.exchange_mode is not None:
88+
params['exchangeMode'] = self.exchange_mode
89+
return params
90+
91+
92+
def parse_rsp_body(self, response_body):
93+
if isinstance(response_body, str):
94+
response_body = json.loads(response_body)
95+
if 'buyAmount' in response_body:
96+
self.__buy_amount = Amount()
97+
self.__buy_amount.parse_rsp_body(response_body['buyAmount'])
98+
if 'sellAmount' in response_body:
99+
self.__sell_amount = Amount()
100+
self.__sell_amount.parse_rsp_body(response_body['sellAmount'])
101+
if 'exchangeTradeType' in response_body:
102+
self.__exchange_trade_type = response_body['exchangeTradeType']
103+
if 'exchangeRequestId' in response_body:
104+
self.__exchange_request_id = response_body['exchangeRequestId']
105+
if 'exchangeMode' in response_body:
106+
self.__exchange_mode = response_body['exchangeMode']

0 commit comments

Comments
 (0)