diff --git a/com/alipay/ams/api/model/account_balance.py b/com/alipay/ams/api/model/account_balance.py index 94ed68c..0b8c064 100644 --- a/com/alipay/ams/api/model/account_balance.py +++ b/com/alipay/ams/api/model/account_balance.py @@ -4,14 +4,17 @@ from com.alipay.ams.api.model.amount import Amount + + class AccountBalance: def __init__(self): - + self.__account_no = None # type: str self.__currency = None # type: str self.__available_balance = None # type: Amount self.__frozen_balance = None # type: Amount self.__total_balance = None # type: Amount + @property def account_no(self): @@ -23,7 +26,6 @@ def account_no(self): @account_no.setter def account_no(self, value): self.__account_no = value - @property def currency(self): """ @@ -34,61 +36,68 @@ def currency(self): @currency.setter def currency(self, value): self.__currency = value - @property def available_balance(self): - """Gets the available_balance of this AccountBalance.""" + """Gets the available_balance of this AccountBalance. + + """ return self.__available_balance @available_balance.setter def available_balance(self, value): self.__available_balance = value - @property def frozen_balance(self): - """Gets the frozen_balance of this AccountBalance.""" + """Gets the frozen_balance of this AccountBalance. + + """ return self.__frozen_balance @frozen_balance.setter def frozen_balance(self, value): self.__frozen_balance = value - @property def total_balance(self): - """Gets the total_balance of this AccountBalance.""" + """Gets the total_balance of this AccountBalance. + + """ return self.__total_balance @total_balance.setter def total_balance(self, value): self.__total_balance = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "account_no") and self.account_no is not None: - params["accountNo"] = self.account_no + params['accountNo'] = self.account_no if hasattr(self, "currency") and self.currency is not None: - params["currency"] = self.currency + params['currency'] = self.currency if hasattr(self, "available_balance") and self.available_balance is not None: - params["availableBalance"] = self.available_balance + params['availableBalance'] = self.available_balance if hasattr(self, "frozen_balance") and self.frozen_balance is not None: - params["frozenBalance"] = self.frozen_balance + params['frozenBalance'] = self.frozen_balance if hasattr(self, "total_balance") and self.total_balance is not None: - params["totalBalance"] = self.total_balance + params['totalBalance'] = self.total_balance return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "accountNo" in response_body: - self.__account_no = response_body["accountNo"] - if "currency" in response_body: - self.__currency = response_body["currency"] - if "availableBalance" in response_body: + if 'accountNo' in response_body: + self.__account_no = response_body['accountNo'] + if 'currency' in response_body: + self.__currency = response_body['currency'] + if 'availableBalance' in response_body: self.__available_balance = Amount() - self.__available_balance.parse_rsp_body(response_body["availableBalance"]) - if "frozenBalance" in response_body: + self.__available_balance.parse_rsp_body(response_body['availableBalance']) + if 'frozenBalance' in response_body: self.__frozen_balance = Amount() - self.__frozen_balance.parse_rsp_body(response_body["frozenBalance"]) - if "totalBalance" in response_body: + self.__frozen_balance.parse_rsp_body(response_body['frozenBalance']) + if 'totalBalance' in response_body: self.__total_balance = Amount() - self.__total_balance.parse_rsp_body(response_body["totalBalance"]) + self.__total_balance.parse_rsp_body(response_body['totalBalance']) diff --git a/com/alipay/ams/api/model/account_holder_type.py b/com/alipay/ams/api/model/account_holder_type.py index 149529e..65776ed 100644 --- a/com/alipay/ams/api/model/account_holder_type.py +++ b/com/alipay/ams/api/model/account_holder_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class AccountHolderType(Enum): """AccountHolderType枚举类""" diff --git a/com/alipay/ams/api/model/account_type.py b/com/alipay/ams/api/model/account_type.py index dea5cd3..04969ad 100644 --- a/com/alipay/ams/api/model/account_type.py +++ b/com/alipay/ams/api/model/account_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class AccountType(Enum): """AccountType枚举类""" diff --git a/com/alipay/ams/api/model/acquirer_info.py b/com/alipay/ams/api/model/acquirer_info.py index 2a89a1a..80a27ab 100644 --- a/com/alipay/ams/api/model/acquirer_info.py +++ b/com/alipay/ams/api/model/acquirer_info.py @@ -1,9 +1,11 @@ import json + + class AcquirerInfo: def __init__(self): - + self.__acquirer_name = None # type: str self.__reference_request_id = None # type: str self.__acquirer_transaction_id = None # type: str @@ -12,6 +14,7 @@ def __init__(self): self.__acquirer_result_message = None # type: str self.__acquirer_merchant_name = None # type: str self.__acquirer_reason_description = None # type: str + @property def acquirer_name(self): @@ -23,7 +26,6 @@ def acquirer_name(self): @acquirer_name.setter def acquirer_name(self, value): self.__acquirer_name = value - @property def reference_request_id(self): """ @@ -34,7 +36,6 @@ def reference_request_id(self): @reference_request_id.setter def reference_request_id(self, value): self.__reference_request_id = value - @property def acquirer_transaction_id(self): """ @@ -45,18 +46,16 @@ def acquirer_transaction_id(self): @acquirer_transaction_id.setter def acquirer_transaction_id(self, value): self.__acquirer_transaction_id = value - @property def acquirer_merchant_id(self): """ - The unique ID that is assigned by the acquirer to identify a merchant. Note: This parameter is returned if you integrate the APO product. More information: Maximum length: 64 characters + The unique ID that is assigned by the acquirer to identify a merchant. Note: This parameter is returned if you integrate the APO product. More information: Maximum length: 64 characters """ return self.__acquirer_merchant_id @acquirer_merchant_id.setter def acquirer_merchant_id(self, value): self.__acquirer_merchant_id = value - @property def acquirer_result_code(self): """ @@ -67,7 +66,6 @@ def acquirer_result_code(self): @acquirer_result_code.setter def acquirer_result_code(self, value): self.__acquirer_result_code = value - @property def acquirer_result_message(self): """ @@ -78,7 +76,6 @@ def acquirer_result_message(self): @acquirer_result_message.setter def acquirer_result_message(self, value): self.__acquirer_result_message = value - @property def acquirer_merchant_name(self): """ @@ -89,7 +86,6 @@ def acquirer_merchant_name(self): @acquirer_merchant_name.setter def acquirer_merchant_name(self, value): self.__acquirer_merchant_name = value - @property def acquirer_reason_description(self): """ @@ -101,65 +97,46 @@ def acquirer_reason_description(self): def acquirer_reason_description(self, value): self.__acquirer_reason_description = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "acquirer_name") and self.acquirer_name is not None: - params["acquirerName"] = self.acquirer_name - if ( - hasattr(self, "reference_request_id") - and self.reference_request_id is not None - ): - params["referenceRequestId"] = self.reference_request_id - if ( - hasattr(self, "acquirer_transaction_id") - and self.acquirer_transaction_id is not None - ): - params["acquirerTransactionId"] = self.acquirer_transaction_id - if ( - hasattr(self, "acquirer_merchant_id") - and self.acquirer_merchant_id is not None - ): - params["acquirerMerchantId"] = self.acquirer_merchant_id - if ( - hasattr(self, "acquirer_result_code") - and self.acquirer_result_code is not None - ): - params["acquirerResultCode"] = self.acquirer_result_code - if ( - hasattr(self, "acquirer_result_message") - and self.acquirer_result_message is not None - ): - params["acquirerResultMessage"] = self.acquirer_result_message - if ( - hasattr(self, "acquirer_merchant_name") - and self.acquirer_merchant_name is not None - ): - params["acquirerMerchantName"] = self.acquirer_merchant_name - if ( - hasattr(self, "acquirer_reason_description") - and self.acquirer_reason_description is not None - ): - params["acquirerReasonDescription"] = self.acquirer_reason_description + params['acquirerName'] = self.acquirer_name + if hasattr(self, "reference_request_id") and self.reference_request_id is not None: + params['referenceRequestId'] = self.reference_request_id + if hasattr(self, "acquirer_transaction_id") and self.acquirer_transaction_id is not None: + params['acquirerTransactionId'] = self.acquirer_transaction_id + if hasattr(self, "acquirer_merchant_id") and self.acquirer_merchant_id is not None: + params['acquirerMerchantId'] = self.acquirer_merchant_id + if hasattr(self, "acquirer_result_code") and self.acquirer_result_code is not None: + params['acquirerResultCode'] = self.acquirer_result_code + if hasattr(self, "acquirer_result_message") and self.acquirer_result_message is not None: + params['acquirerResultMessage'] = self.acquirer_result_message + if hasattr(self, "acquirer_merchant_name") and self.acquirer_merchant_name is not None: + params['acquirerMerchantName'] = self.acquirer_merchant_name + if hasattr(self, "acquirer_reason_description") and self.acquirer_reason_description is not None: + params['acquirerReasonDescription'] = self.acquirer_reason_description return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "acquirerName" in response_body: - self.__acquirer_name = response_body["acquirerName"] - if "referenceRequestId" in response_body: - self.__reference_request_id = response_body["referenceRequestId"] - if "acquirerTransactionId" in response_body: - self.__acquirer_transaction_id = response_body["acquirerTransactionId"] - if "acquirerMerchantId" in response_body: - self.__acquirer_merchant_id = response_body["acquirerMerchantId"] - if "acquirerResultCode" in response_body: - self.__acquirer_result_code = response_body["acquirerResultCode"] - if "acquirerResultMessage" in response_body: - self.__acquirer_result_message = response_body["acquirerResultMessage"] - if "acquirerMerchantName" in response_body: - self.__acquirer_merchant_name = response_body["acquirerMerchantName"] - if "acquirerReasonDescription" in response_body: - self.__acquirer_reason_description = response_body[ - "acquirerReasonDescription" - ] + if 'acquirerName' in response_body: + self.__acquirer_name = response_body['acquirerName'] + if 'referenceRequestId' in response_body: + self.__reference_request_id = response_body['referenceRequestId'] + if 'acquirerTransactionId' in response_body: + self.__acquirer_transaction_id = response_body['acquirerTransactionId'] + if 'acquirerMerchantId' in response_body: + self.__acquirer_merchant_id = response_body['acquirerMerchantId'] + if 'acquirerResultCode' in response_body: + self.__acquirer_result_code = response_body['acquirerResultCode'] + if 'acquirerResultMessage' in response_body: + self.__acquirer_result_message = response_body['acquirerResultMessage'] + if 'acquirerMerchantName' in response_body: + self.__acquirer_merchant_name = response_body['acquirerMerchantName'] + if 'acquirerReasonDescription' in response_body: + self.__acquirer_reason_description = response_body['acquirerReasonDescription'] diff --git a/com/alipay/ams/api/model/address.py b/com/alipay/ams/api/model/address.py index 93b78cf..f488e32 100644 --- a/com/alipay/ams/api/model/address.py +++ b/com/alipay/ams/api/model/address.py @@ -1,9 +1,11 @@ import json + + class Address: def __init__(self): - + self.__region = None # type: str self.__state = None # type: str self.__city = None # type: str @@ -11,102 +13,115 @@ def __init__(self): self.__address2 = None # type: str self.__zip_code = None # type: str self.__label = None # type: str + @property def region(self): - """Gets the region of this Address.""" + """Gets the region of this Address. + + """ return self.__region @region.setter def region(self, value): self.__region = value - @property def state(self): - """Gets the state of this Address.""" + """Gets the state of this Address. + + """ return self.__state @state.setter def state(self, value): self.__state = value - @property def city(self): - """Gets the city of this Address.""" + """Gets the city of this Address. + + """ return self.__city @city.setter def city(self, value): self.__city = value - @property def address1(self): - """Gets the address1 of this Address.""" + """Gets the address1 of this Address. + + """ return self.__address1 @address1.setter def address1(self, value): self.__address1 = value - @property def address2(self): - """Gets the address2 of this Address.""" + """Gets the address2 of this Address. + + """ return self.__address2 @address2.setter def address2(self, value): self.__address2 = value - @property def zip_code(self): - """Gets the zip_code of this Address.""" + """Gets the zip_code of this Address. + + """ return self.__zip_code @zip_code.setter def zip_code(self, value): self.__zip_code = value - @property def label(self): - """Gets the label of this Address.""" + """Gets the label of this Address. + + """ return self.__label @label.setter def label(self, value): self.__label = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "region") and self.region is not None: - params["region"] = self.region + params['region'] = self.region if hasattr(self, "state") and self.state is not None: - params["state"] = self.state + params['state'] = self.state if hasattr(self, "city") and self.city is not None: - params["city"] = self.city + params['city'] = self.city if hasattr(self, "address1") and self.address1 is not None: - params["address1"] = self.address1 + params['address1'] = self.address1 if hasattr(self, "address2") and self.address2 is not None: - params["address2"] = self.address2 + params['address2'] = self.address2 if hasattr(self, "zip_code") and self.zip_code is not None: - params["zipCode"] = self.zip_code + params['zipCode'] = self.zip_code if hasattr(self, "label") and self.label is not None: - params["label"] = self.label + params['label'] = self.label return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "region" in response_body: - self.__region = response_body["region"] - if "state" in response_body: - self.__state = response_body["state"] - if "city" in response_body: - self.__city = response_body["city"] - if "address1" in response_body: - self.__address1 = response_body["address1"] - if "address2" in response_body: - self.__address2 = response_body["address2"] - if "zipCode" in response_body: - self.__zip_code = response_body["zipCode"] - if "label" in response_body: - self.__label = response_body["label"] + if 'region' in response_body: + self.__region = response_body['region'] + if 'state' in response_body: + self.__state = response_body['state'] + if 'city' in response_body: + self.__city = response_body['city'] + if 'address1' in response_body: + self.__address1 = response_body['address1'] + if 'address2' in response_body: + self.__address2 = response_body['address2'] + if 'zipCode' in response_body: + self.__zip_code = response_body['zipCode'] + if 'label' in response_body: + self.__label = response_body['label'] diff --git a/com/alipay/ams/api/model/agreement_info.py b/com/alipay/ams/api/model/agreement_info.py index ad41203..c0acead 100644 --- a/com/alipay/ams/api/model/agreement_info.py +++ b/com/alipay/ams/api/model/agreement_info.py @@ -1,13 +1,16 @@ import json + + class AgreementInfo: def __init__(self): - + self.__auth_state = None # type: str self.__user_login_id = None # type: str self.__user_login_type = None # type: str self.__display_user_login_id = None # type: str + @property def auth_state(self): @@ -19,7 +22,6 @@ def auth_state(self): @auth_state.setter def auth_state(self, value): self.__auth_state = value - @property def user_login_id(self): """ @@ -30,7 +32,6 @@ def user_login_id(self): @user_login_id.setter def user_login_id(self, value): self.__user_login_id = value - @property def user_login_type(self): """ @@ -41,7 +42,6 @@ def user_login_type(self): @user_login_type.setter def user_login_type(self, value): self.__user_login_type = value - @property def display_user_login_id(self): """ @@ -53,29 +53,30 @@ def display_user_login_id(self): def display_user_login_id(self, value): self.__display_user_login_id = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "auth_state") and self.auth_state is not None: - params["authState"] = self.auth_state + params['authState'] = self.auth_state if hasattr(self, "user_login_id") and self.user_login_id is not None: - params["userLoginId"] = self.user_login_id + params['userLoginId'] = self.user_login_id if hasattr(self, "user_login_type") and self.user_login_type is not None: - params["userLoginType"] = self.user_login_type - if ( - hasattr(self, "display_user_login_id") - and self.display_user_login_id is not None - ): - params["displayUserLoginId"] = self.display_user_login_id + params['userLoginType'] = self.user_login_type + if hasattr(self, "display_user_login_id") and self.display_user_login_id is not None: + params['displayUserLoginId'] = self.display_user_login_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "authState" in response_body: - self.__auth_state = response_body["authState"] - if "userLoginId" in response_body: - self.__user_login_id = response_body["userLoginId"] - if "userLoginType" in response_body: - self.__user_login_type = response_body["userLoginType"] - if "displayUserLoginId" in response_body: - self.__display_user_login_id = response_body["displayUserLoginId"] + if 'authState' in response_body: + self.__auth_state = response_body['authState'] + if 'userLoginId' in response_body: + self.__user_login_id = response_body['userLoginId'] + if 'userLoginType' in response_body: + self.__user_login_type = response_body['userLoginType'] + if 'displayUserLoginId' in response_body: + self.__display_user_login_id = response_body['displayUserLoginId'] diff --git a/com/alipay/ams/api/model/amount.py b/com/alipay/ams/api/model/amount.py index 7b1572b..da42dc0 100644 --- a/com/alipay/ams/api/model/amount.py +++ b/com/alipay/ams/api/model/amount.py @@ -1,42 +1,52 @@ import json + + class Amount: def __init__(self, currency=None, value=None): - + self.__currency = currency # type: str self.__value = value # type: str + @property def currency(self): - """Gets the currency of this Amount.""" + """Gets the currency of this Amount. + + """ return self.__currency @currency.setter def currency(self, value): self.__currency = value - @property def value(self): - """Gets the value of this Amount.""" + """Gets the value of this Amount. + + """ return self.__value @value.setter def value(self, value): self.__value = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "currency") and self.currency is not None: - params["currency"] = self.currency + params['currency'] = self.currency if hasattr(self, "value") and self.value is not None: - params["value"] = self.value + params['value'] = self.value return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "currency" in response_body: - self.__currency = response_body["currency"] - if "value" in response_body: - self.__value = response_body["value"] + if 'currency' in response_body: + self.__currency = response_body['currency'] + if 'value' in response_body: + self.__value = response_body['value'] diff --git a/com/alipay/ams/api/model/amount_limit.py b/com/alipay/ams/api/model/amount_limit.py index 69f3f0d..e14fefc 100644 --- a/com/alipay/ams/api/model/amount_limit.py +++ b/com/alipay/ams/api/model/amount_limit.py @@ -4,59 +4,70 @@ from com.alipay.ams.api.model.amount import Amount + + class AmountLimit: def __init__(self): - + self.__max_amount = None # type: Amount self.__min_amount = None # type: Amount self.__remain_amount = None # type: Amount + @property def max_amount(self): - """Gets the max_amount of this AmountLimit.""" + """Gets the max_amount of this AmountLimit. + + """ return self.__max_amount @max_amount.setter def max_amount(self, value): self.__max_amount = value - @property def min_amount(self): - """Gets the min_amount of this AmountLimit.""" + """Gets the min_amount of this AmountLimit. + + """ return self.__min_amount @min_amount.setter def min_amount(self, value): self.__min_amount = value - @property def remain_amount(self): - """Gets the remain_amount of this AmountLimit.""" + """Gets the remain_amount of this AmountLimit. + + """ return self.__remain_amount @remain_amount.setter def remain_amount(self, value): self.__remain_amount = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "max_amount") and self.max_amount is not None: - params["maxAmount"] = self.max_amount + params['maxAmount'] = self.max_amount if hasattr(self, "min_amount") and self.min_amount is not None: - params["minAmount"] = self.min_amount + params['minAmount'] = self.min_amount if hasattr(self, "remain_amount") and self.remain_amount is not None: - params["remainAmount"] = self.remain_amount + params['remainAmount'] = self.remain_amount return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "maxAmount" in response_body: + if 'maxAmount' in response_body: self.__max_amount = Amount() - self.__max_amount.parse_rsp_body(response_body["maxAmount"]) - if "minAmount" in response_body: + self.__max_amount.parse_rsp_body(response_body['maxAmount']) + if 'minAmount' in response_body: self.__min_amount = Amount() - self.__min_amount.parse_rsp_body(response_body["minAmount"]) - if "remainAmount" in response_body: + self.__min_amount.parse_rsp_body(response_body['minAmount']) + if 'remainAmount' in response_body: self.__remain_amount = Amount() - self.__remain_amount.parse_rsp_body(response_body["remainAmount"]) + self.__remain_amount.parse_rsp_body(response_body['remainAmount']) diff --git a/com/alipay/ams/api/model/amount_limit_info.py b/com/alipay/ams/api/model/amount_limit_info.py index fee6369..7f5e447 100644 --- a/com/alipay/ams/api/model/amount_limit_info.py +++ b/com/alipay/ams/api/model/amount_limit_info.py @@ -4,59 +4,70 @@ from com.alipay.ams.api.model.amount_limit import AmountLimit + + class AmountLimitInfo: def __init__(self): - + self.__single_limit = None # type: AmountLimit self.__day_limit = None # type: AmountLimit self.__month_limit = None # type: AmountLimit + @property def single_limit(self): - """Gets the single_limit of this AmountLimitInfo.""" + """Gets the single_limit of this AmountLimitInfo. + + """ return self.__single_limit @single_limit.setter def single_limit(self, value): self.__single_limit = value - @property def day_limit(self): - """Gets the day_limit of this AmountLimitInfo.""" + """Gets the day_limit of this AmountLimitInfo. + + """ return self.__day_limit @day_limit.setter def day_limit(self, value): self.__day_limit = value - @property def month_limit(self): - """Gets the month_limit of this AmountLimitInfo.""" + """Gets the month_limit of this AmountLimitInfo. + + """ return self.__month_limit @month_limit.setter def month_limit(self, value): self.__month_limit = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "single_limit") and self.single_limit is not None: - params["singleLimit"] = self.single_limit + params['singleLimit'] = self.single_limit if hasattr(self, "day_limit") and self.day_limit is not None: - params["dayLimit"] = self.day_limit + params['dayLimit'] = self.day_limit if hasattr(self, "month_limit") and self.month_limit is not None: - params["monthLimit"] = self.month_limit + params['monthLimit'] = self.month_limit return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "singleLimit" in response_body: + if 'singleLimit' in response_body: self.__single_limit = AmountLimit() - self.__single_limit.parse_rsp_body(response_body["singleLimit"]) - if "dayLimit" in response_body: + self.__single_limit.parse_rsp_body(response_body['singleLimit']) + if 'dayLimit' in response_body: self.__day_limit = AmountLimit() - self.__day_limit.parse_rsp_body(response_body["dayLimit"]) - if "monthLimit" in response_body: + self.__day_limit.parse_rsp_body(response_body['dayLimit']) + if 'monthLimit' in response_body: self.__month_limit = AmountLimit() - self.__month_limit.parse_rsp_body(response_body["monthLimit"]) + self.__month_limit.parse_rsp_body(response_body['monthLimit']) diff --git a/com/alipay/ams/api/model/ancillary_data.py b/com/alipay/ams/api/model/ancillary_data.py index 4fd8636..bfa998e 100644 --- a/com/alipay/ams/api/model/ancillary_data.py +++ b/com/alipay/ams/api/model/ancillary_data.py @@ -2,11 +2,14 @@ from com.alipay.ams.api.model.service import Service + + class AncillaryData: def __init__(self): - + self.__services = None # type: [Service] self.__connected_ticket_number = None # type: str + @property def services(self): @@ -18,7 +21,6 @@ def services(self): @services.setter def services(self, value): self.__services = value - @property def connected_ticket_number(self): """ @@ -30,25 +32,26 @@ def connected_ticket_number(self): def connected_ticket_number(self, value): self.__connected_ticket_number = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "services") and self.services is not None: - params["services"] = self.services - if ( - hasattr(self, "connected_ticket_number") - and self.connected_ticket_number is not None - ): - params["connectedTicketNumber"] = self.connected_ticket_number + params['services'] = self.services + if hasattr(self, "connected_ticket_number") and self.connected_ticket_number is not None: + params['connectedTicketNumber'] = self.connected_ticket_number return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "services" in response_body: + if 'services' in response_body: self.__services = [] - for item in response_body["services"]: + for item in response_body['services']: obj = Service() obj.parse_rsp_body(item) self.__services.append(obj) - if "connectedTicketNumber" in response_body: - self.__connected_ticket_number = response_body["connectedTicketNumber"] + if 'connectedTicketNumber' in response_body: + self.__connected_ticket_number = response_body['connectedTicketNumber'] diff --git a/com/alipay/ams/api/model/association_type.py b/com/alipay/ams/api/model/association_type.py index c9e0ba8..14c617f 100644 --- a/com/alipay/ams/api/model/association_type.py +++ b/com/alipay/ams/api/model/association_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class AssociationType(Enum): """AssociationType枚举类""" diff --git a/com/alipay/ams/api/model/attachment.py b/com/alipay/ams/api/model/attachment.py index d058621..c2f4e08 100644 --- a/com/alipay/ams/api/model/attachment.py +++ b/com/alipay/ams/api/model/attachment.py @@ -1,13 +1,16 @@ import json + + class Attachment: def __init__(self): - + self.__attachment_type = None # type: str self.__file = None # type: str self.__attachment_name = None # type: str self.__file_key = None # type: str + @property def attachment_type(self): @@ -19,31 +22,30 @@ def attachment_type(self): @attachment_type.setter def attachment_type(self, value): self.__attachment_type = value - @property def file(self): - """Gets the file of this Attachment.""" + """Gets the file of this Attachment. + + """ return self.__file @file.setter def file(self, value): self.__file = value - @property def attachment_name(self): """ - The name of the attachment file, including the file extension, such as XXX.jpg or XXX.png. More information: Maximum length: 256 characters + The name of the attachment file, including the file extension, such as XXX.jpg or XXX.png. More information: Maximum length: 256 characters """ return self.__attachment_name @attachment_name.setter def attachment_name(self, value): self.__attachment_name = value - @property def file_key(self): """ - The unique key value of the attachment file. Maximum file size: 32MB. The value of this parameter is obtained from the attachmentKey parameter in the submitAttachment API. Prior attachment submission using the submitAttachment API is required. More information: Maximum length: 256 characters + The unique key value of the attachment file. Maximum file size: 32MB. The value of this parameter is obtained from the attachmentKey parameter in the submitAttachment API. Prior attachment submission using the submitAttachment API is required. More information: Maximum length: 256 characters """ return self.__file_key @@ -51,26 +53,30 @@ def file_key(self): def file_key(self, value): self.__file_key = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "attachment_type") and self.attachment_type is not None: - params["attachmentType"] = self.attachment_type + params['attachmentType'] = self.attachment_type if hasattr(self, "file") and self.file is not None: - params["file"] = self.file + params['file'] = self.file if hasattr(self, "attachment_name") and self.attachment_name is not None: - params["attachmentName"] = self.attachment_name + params['attachmentName'] = self.attachment_name if hasattr(self, "file_key") and self.file_key is not None: - params["fileKey"] = self.file_key + params['fileKey'] = self.file_key return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "attachmentType" in response_body: - self.__attachment_type = response_body["attachmentType"] - if "file" in response_body: - self.__file = response_body["file"] - if "attachmentName" in response_body: - self.__attachment_name = response_body["attachmentName"] - if "fileKey" in response_body: - self.__file_key = response_body["fileKey"] + if 'attachmentType' in response_body: + self.__attachment_type = response_body['attachmentType'] + if 'file' in response_body: + self.__file = response_body['file'] + if 'attachmentName' in response_body: + self.__attachment_name = response_body['attachmentName'] + if 'fileKey' in response_body: + self.__file_key = response_body['fileKey'] diff --git a/com/alipay/ams/api/model/attachment_type.py b/com/alipay/ams/api/model/attachment_type.py index 711e99c..f7b7964 100644 --- a/com/alipay/ams/api/model/attachment_type.py +++ b/com/alipay/ams/api/model/attachment_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class AttachmentType(Enum): """AttachmentType枚举类""" @@ -8,9 +6,7 @@ class AttachmentType(Enum): SIGNATURE_AUTHORIZATION_LETTER = "SIGNATURE_AUTHORIZATION_LETTER" ARTICLES_OF_ASSOCIATION = "ARTICLES_OF_ASSOCIATION" LOGO = "LOGO" - AUTHORIZER_SIGNATURE_CONFIRMATION_LETTER = ( - "AUTHORIZER_SIGNATURE_CONFIRMATION_LETTER" - ) + AUTHORIZER_SIGNATURE_CONFIRMATION_LETTER = "AUTHORIZER_SIGNATURE_CONFIRMATION_LETTER" ASSOCIATION_ARTICLE = "ASSOCIATION_ARTICLE" FINANCIAL_REPORT = "FINANCIAL_REPORT" OWNERSHIP_STRUCTURE_PIC = "OWNERSHIP_STRUCTURE_PIC" diff --git a/com/alipay/ams/api/model/auth_code_form.py b/com/alipay/ams/api/model/auth_code_form.py index e7f608a..d381df8 100644 --- a/com/alipay/ams/api/model/auth_code_form.py +++ b/com/alipay/ams/api/model/auth_code_form.py @@ -2,15 +2,18 @@ from com.alipay.ams.api.model.code_detail import CodeDetail + + class AuthCodeForm: def __init__(self): - + self.__code_details = None # type: [CodeDetail] + @property def code_details(self): """ - A list of QR code information. + A list of QR code information. """ return self.__code_details @@ -18,18 +21,22 @@ def code_details(self): def code_details(self, value): self.__code_details = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "code_details") and self.code_details is not None: - params["codeDetails"] = self.code_details + params['codeDetails'] = self.code_details return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "codeDetails" in response_body: + if 'codeDetails' in response_body: self.__code_details = [] - for item in response_body["codeDetails"]: + for item in response_body['codeDetails']: obj = CodeDetail() obj.parse_rsp_body(item) self.__code_details.append(obj) diff --git a/com/alipay/ams/api/model/auth_meta_data.py b/com/alipay/ams/api/model/auth_meta_data.py index 65b01cb..d7343bd 100644 --- a/com/alipay/ams/api/model/auth_meta_data.py +++ b/com/alipay/ams/api/model/auth_meta_data.py @@ -1,48 +1,52 @@ import json + + class AuthMetaData: def __init__(self): - + self.__account_holder_name = None # type: str self.__account_holder_cert_no = None # type: str + @property def account_holder_name(self): - """Gets the account_holder_name of this AuthMetaData.""" + """Gets the account_holder_name of this AuthMetaData. + + """ return self.__account_holder_name @account_holder_name.setter def account_holder_name(self, value): self.__account_holder_name = value - @property def account_holder_cert_no(self): - """Gets the account_holder_cert_no of this AuthMetaData.""" + """Gets the account_holder_cert_no of this AuthMetaData. + + """ return self.__account_holder_cert_no @account_holder_cert_no.setter def account_holder_cert_no(self, value): self.__account_holder_cert_no = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "account_holder_name") - and self.account_holder_name is not None - ): - params["accountHolderName"] = self.account_holder_name - if ( - hasattr(self, "account_holder_cert_no") - and self.account_holder_cert_no is not None - ): - params["accountHolderCertNo"] = self.account_holder_cert_no + if hasattr(self, "account_holder_name") and self.account_holder_name is not None: + params['accountHolderName'] = self.account_holder_name + if hasattr(self, "account_holder_cert_no") and self.account_holder_cert_no is not None: + params['accountHolderCertNo'] = self.account_holder_cert_no return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "accountHolderName" in response_body: - self.__account_holder_name = response_body["accountHolderName"] - if "accountHolderCertNo" in response_body: - self.__account_holder_cert_no = response_body["accountHolderCertNo"] + if 'accountHolderName' in response_body: + self.__account_holder_name = response_body['accountHolderName'] + if 'accountHolderCertNo' in response_body: + self.__account_holder_cert_no = response_body['accountHolderCertNo'] diff --git a/com/alipay/ams/api/model/available_payment_method.py b/com/alipay/ams/api/model/available_payment_method.py index 9c925ac..878222d 100644 --- a/com/alipay/ams/api/model/available_payment_method.py +++ b/com/alipay/ams/api/model/available_payment_method.py @@ -2,56 +2,56 @@ from com.alipay.ams.api.model.payment_method_type_item import PaymentMethodTypeItem + + class AvailablePaymentMethod: def __init__(self): - - self.__payment_method_meta_data = ( - None - ) # type: {str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)} + + self.__payment_method_meta_data = None # type: {str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)} self.__payment_method_type_list = None # type: [PaymentMethodTypeItem] + @property def payment_method_meta_data(self): """ - Additional information required for some specific payment methods. + Additional information required for some specific payment methods. """ return self.__payment_method_meta_data @payment_method_meta_data.setter def payment_method_meta_data(self, value): self.__payment_method_meta_data = value - @property def payment_method_type_list(self): - """Gets the payment_method_type_list of this AvailablePaymentMethod.""" + """Gets the payment_method_type_list of this AvailablePaymentMethod. + + """ return self.__payment_method_type_list @payment_method_type_list.setter def payment_method_type_list(self, value): self.__payment_method_type_list = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "payment_method_meta_data") - and self.payment_method_meta_data is not None - ): - params["paymentMethodMetaData"] = self.payment_method_meta_data - if ( - hasattr(self, "payment_method_type_list") - and self.payment_method_type_list is not None - ): - params["paymentMethodTypeList"] = self.payment_method_type_list + if hasattr(self, "payment_method_meta_data") and self.payment_method_meta_data is not None: + params['paymentMethodMetaData'] = self.payment_method_meta_data + if hasattr(self, "payment_method_type_list") and self.payment_method_type_list is not None: + params['paymentMethodTypeList'] = self.payment_method_type_list return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "paymentMethodMetaData" in response_body: - self.__payment_method_meta_data = response_body["paymentMethodMetaData"] - if "paymentMethodTypeList" in response_body: + if 'paymentMethodMetaData' in response_body: + self.__payment_method_meta_data = response_body['paymentMethodMetaData'] + if 'paymentMethodTypeList' in response_body: self.__payment_method_type_list = [] - for item in response_body["paymentMethodTypeList"]: + for item in response_body['paymentMethodTypeList']: obj = PaymentMethodTypeItem() obj.parse_rsp_body(item) self.__payment_method_type_list.append(obj) diff --git a/com/alipay/ams/api/model/browser_info.py b/com/alipay/ams/api/model/browser_info.py index 82bada5..d4b7ab2 100644 --- a/com/alipay/ams/api/model/browser_info.py +++ b/com/alipay/ams/api/model/browser_info.py @@ -1,14 +1,17 @@ import json + + class BrowserInfo: def __init__(self): - + self.__accept_header = None # type: str self.__java_enabled = None # type: bool self.__java_script_enabled = None # type: bool self.__language = None # type: str self.__user_agent = None # type: str + @property def accept_header(self): @@ -20,7 +23,6 @@ def accept_header(self): @accept_header.setter def accept_header(self, value): self.__accept_header = value - @property def java_enabled(self): """ @@ -31,7 +33,6 @@ def java_enabled(self): @java_enabled.setter def java_enabled(self, value): self.__java_enabled = value - @property def java_script_enabled(self): """ @@ -42,7 +43,6 @@ def java_script_enabled(self): @java_script_enabled.setter def java_script_enabled(self, value): self.__java_script_enabled = value - @property def language(self): """ @@ -53,7 +53,6 @@ def language(self): @language.setter def language(self, value): self.__language = value - @property def user_agent(self): """ @@ -65,33 +64,34 @@ def user_agent(self): def user_agent(self, value): self.__user_agent = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "accept_header") and self.accept_header is not None: - params["acceptHeader"] = self.accept_header + params['acceptHeader'] = self.accept_header if hasattr(self, "java_enabled") and self.java_enabled is not None: - params["javaEnabled"] = self.java_enabled - if ( - hasattr(self, "java_script_enabled") - and self.java_script_enabled is not None - ): - params["javaScriptEnabled"] = self.java_script_enabled + params['javaEnabled'] = self.java_enabled + if hasattr(self, "java_script_enabled") and self.java_script_enabled is not None: + params['javaScriptEnabled'] = self.java_script_enabled if hasattr(self, "language") and self.language is not None: - params["language"] = self.language + params['language'] = self.language if hasattr(self, "user_agent") and self.user_agent is not None: - params["userAgent"] = self.user_agent + params['userAgent'] = self.user_agent return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "acceptHeader" in response_body: - self.__accept_header = response_body["acceptHeader"] - if "javaEnabled" in response_body: - self.__java_enabled = response_body["javaEnabled"] - if "javaScriptEnabled" in response_body: - self.__java_script_enabled = response_body["javaScriptEnabled"] - if "language" in response_body: - self.__language = response_body["language"] - if "userAgent" in response_body: - self.__user_agent = response_body["userAgent"] + if 'acceptHeader' in response_body: + self.__accept_header = response_body['acceptHeader'] + if 'javaEnabled' in response_body: + self.__java_enabled = response_body['javaEnabled'] + if 'javaScriptEnabled' in response_body: + self.__java_script_enabled = response_body['javaScriptEnabled'] + if 'language' in response_body: + self.__language = response_body['language'] + if 'userAgent' in response_body: + self.__user_agent = response_body['userAgent'] diff --git a/com/alipay/ams/api/model/business_info.py b/com/alipay/ams/api/model/business_info.py index f38370c..769c854 100644 --- a/com/alipay/ams/api/model/business_info.py +++ b/com/alipay/ams/api/model/business_info.py @@ -2,9 +2,11 @@ from com.alipay.ams.api.model.web_site import WebSite + + class BusinessInfo: def __init__(self): - + self.__mcc = None # type: str self.__websites = None # type: [WebSite] self.__english_name = None # type: str @@ -12,6 +14,7 @@ def __init__(self): self.__main_sales_country = None # type: str self.__app_name = None # type: str self.__service_description = None # type: str + @property def mcc(self): @@ -23,29 +26,26 @@ def mcc(self): @mcc.setter def mcc(self, value): self.__mcc = value - @property def websites(self): """ - The list of merchant websites. The information is used to verify the company's legal status and ensure the company complies with regulatory requirements. Specify this parameter when the value of merchantInfo.company.registeredAddress.region is BR. More information: Maximum size: 10 elements + The list of merchant websites. The information is used to verify the company's legal status and ensure the company complies with regulatory requirements. Specify this parameter when the value of merchantInfo.company.registeredAddress.region is BR. More information: Maximum size: 10 elements """ return self.__websites @websites.setter def websites(self, value): self.__websites = value - @property def english_name(self): """ - The English name of the company. Specify this parameter when the value of merchantInfo.company.registeredAddress.region is JP. More information: Maximum length: 256 characters + The English name of the company. Specify this parameter when the value of merchantInfo.company.registeredAddress.region is JP. More information: Maximum length: 256 characters """ return self.__english_name @english_name.setter def english_name(self, value): self.__english_name = value - @property def doing_business_as(self): """ @@ -56,7 +56,6 @@ def doing_business_as(self): @doing_business_as.setter def doing_business_as(self, value): self.__doing_business_as = value - @property def main_sales_country(self): """ @@ -67,7 +66,6 @@ def main_sales_country(self): @main_sales_country.setter def main_sales_country(self, value): self.__main_sales_country = value - @property def app_name(self): """ @@ -78,7 +76,6 @@ def app_name(self): @app_name.setter def app_name(self, value): self.__app_name = value - @property def service_description(self): """ @@ -90,45 +87,46 @@ def service_description(self): def service_description(self, value): self.__service_description = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "mcc") and self.mcc is not None: - params["mcc"] = self.mcc + params['mcc'] = self.mcc if hasattr(self, "websites") and self.websites is not None: - params["websites"] = self.websites + params['websites'] = self.websites if hasattr(self, "english_name") and self.english_name is not None: - params["englishName"] = self.english_name + params['englishName'] = self.english_name if hasattr(self, "doing_business_as") and self.doing_business_as is not None: - params["doingBusinessAs"] = self.doing_business_as + params['doingBusinessAs'] = self.doing_business_as if hasattr(self, "main_sales_country") and self.main_sales_country is not None: - params["mainSalesCountry"] = self.main_sales_country + params['mainSalesCountry'] = self.main_sales_country if hasattr(self, "app_name") and self.app_name is not None: - params["appName"] = self.app_name - if ( - hasattr(self, "service_description") - and self.service_description is not None - ): - params["serviceDescription"] = self.service_description + params['appName'] = self.app_name + if hasattr(self, "service_description") and self.service_description is not None: + params['serviceDescription'] = self.service_description return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "mcc" in response_body: - self.__mcc = response_body["mcc"] - if "websites" in response_body: + if 'mcc' in response_body: + self.__mcc = response_body['mcc'] + if 'websites' in response_body: self.__websites = [] - for item in response_body["websites"]: + for item in response_body['websites']: obj = WebSite() obj.parse_rsp_body(item) self.__websites.append(obj) - if "englishName" in response_body: - self.__english_name = response_body["englishName"] - if "doingBusinessAs" in response_body: - self.__doing_business_as = response_body["doingBusinessAs"] - if "mainSalesCountry" in response_body: - self.__main_sales_country = response_body["mainSalesCountry"] - if "appName" in response_body: - self.__app_name = response_body["appName"] - if "serviceDescription" in response_body: - self.__service_description = response_body["serviceDescription"] + if 'englishName' in response_body: + self.__english_name = response_body['englishName'] + if 'doingBusinessAs' in response_body: + self.__doing_business_as = response_body['doingBusinessAs'] + if 'mainSalesCountry' in response_body: + self.__main_sales_country = response_body['mainSalesCountry'] + if 'appName' in response_body: + self.__app_name = response_body['appName'] + if 'serviceDescription' in response_body: + self.__service_description = response_body['serviceDescription'] diff --git a/com/alipay/ams/api/model/buyer.py b/com/alipay/ams/api/model/buyer.py index 2e60608..168b271 100644 --- a/com/alipay/ams/api/model/buyer.py +++ b/com/alipay/ams/api/model/buyer.py @@ -2,9 +2,11 @@ from com.alipay.ams.api.model.user_name import UserName + + class Buyer: def __init__(self): - + self.__reference_buyer_id = None # type: str self.__buyer_name = None # type: UserName self.__buyer_phone_no = None # type: str @@ -12,38 +14,38 @@ def __init__(self): self.__buyer_registration_time = None # type: str self.__is_account_verified = None # type: bool self.__successful_order_count = None # type: int + @property def reference_buyer_id(self): """ - The unique ID to identify the buyer. Specify this parameter: When you require risk control. When the value of paymentMethodType is CARD. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates. More information: Maximum length: 64 characters + The unique ID to identify the buyer. Specify this parameter: When you require risk control. When the value of paymentMethodType is CARD. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates. More information: Maximum length: 64 characters """ return self.__reference_buyer_id @reference_buyer_id.setter def reference_buyer_id(self, value): self.__reference_buyer_id = value - @property def buyer_name(self): - """Gets the buyer_name of this Buyer.""" + """Gets the buyer_name of this Buyer. + + """ return self.__buyer_name @buyer_name.setter def buyer_name(self, value): self.__buyer_name = value - @property def buyer_phone_no(self): """ - The mobile phone number of the buyer. Specify this parameter when one of the following conditions is met: You require risk control. The value of paymentMethodType is CARD. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates. More information: Maximum length: 24 characters + The mobile phone number of the buyer. Specify this parameter when one of the following conditions is met: You require risk control. The value of paymentMethodType is CARD. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates. More information: Maximum length: 24 characters """ return self.__buyer_phone_no @buyer_phone_no.setter def buyer_phone_no(self, value): self.__buyer_phone_no = value - @property def buyer_email(self): """ @@ -54,78 +56,74 @@ def buyer_email(self): @buyer_email.setter def buyer_email(self, value): self.__buyer_email = value - @property def buyer_registration_time(self): """ - The time when the buyer registered your account. Specify this parameter if you require risk control. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates. More information: Maximum length: 64 characters The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + The time when the buyer registered your account. Specify this parameter if you require risk control. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates. More information: Maximum length: 64 characters The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__buyer_registration_time @buyer_registration_time.setter def buyer_registration_time(self, value): self.__buyer_registration_time = value - @property def is_account_verified(self): - """Gets the is_account_verified of this Buyer.""" + """Gets the is_account_verified of this Buyer. + + """ return self.__is_account_verified @is_account_verified.setter def is_account_verified(self, value): self.__is_account_verified = value - @property def successful_order_count(self): - """Gets the successful_order_count of this Buyer.""" + """Gets the successful_order_count of this Buyer. + + """ return self.__successful_order_count @successful_order_count.setter def successful_order_count(self, value): self.__successful_order_count = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "reference_buyer_id") and self.reference_buyer_id is not None: - params["referenceBuyerId"] = self.reference_buyer_id + params['referenceBuyerId'] = self.reference_buyer_id if hasattr(self, "buyer_name") and self.buyer_name is not None: - params["buyerName"] = self.buyer_name + params['buyerName'] = self.buyer_name if hasattr(self, "buyer_phone_no") and self.buyer_phone_no is not None: - params["buyerPhoneNo"] = self.buyer_phone_no + params['buyerPhoneNo'] = self.buyer_phone_no if hasattr(self, "buyer_email") and self.buyer_email is not None: - params["buyerEmail"] = self.buyer_email - if ( - hasattr(self, "buyer_registration_time") - and self.buyer_registration_time is not None - ): - params["buyerRegistrationTime"] = self.buyer_registration_time - if ( - hasattr(self, "is_account_verified") - and self.is_account_verified is not None - ): - params["isAccountVerified"] = self.is_account_verified - if ( - hasattr(self, "successful_order_count") - and self.successful_order_count is not None - ): - params["successfulOrderCount"] = self.successful_order_count + params['buyerEmail'] = self.buyer_email + if hasattr(self, "buyer_registration_time") and self.buyer_registration_time is not None: + params['buyerRegistrationTime'] = self.buyer_registration_time + if hasattr(self, "is_account_verified") and self.is_account_verified is not None: + params['isAccountVerified'] = self.is_account_verified + if hasattr(self, "successful_order_count") and self.successful_order_count is not None: + params['successfulOrderCount'] = self.successful_order_count return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "referenceBuyerId" in response_body: - self.__reference_buyer_id = response_body["referenceBuyerId"] - if "buyerName" in response_body: + if 'referenceBuyerId' in response_body: + self.__reference_buyer_id = response_body['referenceBuyerId'] + if 'buyerName' in response_body: self.__buyer_name = UserName() - self.__buyer_name.parse_rsp_body(response_body["buyerName"]) - if "buyerPhoneNo" in response_body: - self.__buyer_phone_no = response_body["buyerPhoneNo"] - if "buyerEmail" in response_body: - self.__buyer_email = response_body["buyerEmail"] - if "buyerRegistrationTime" in response_body: - self.__buyer_registration_time = response_body["buyerRegistrationTime"] - if "isAccountVerified" in response_body: - self.__is_account_verified = response_body["isAccountVerified"] - if "successfulOrderCount" in response_body: - self.__successful_order_count = response_body["successfulOrderCount"] + self.__buyer_name.parse_rsp_body(response_body['buyerName']) + if 'buyerPhoneNo' in response_body: + self.__buyer_phone_no = response_body['buyerPhoneNo'] + if 'buyerEmail' in response_body: + self.__buyer_email = response_body['buyerEmail'] + if 'buyerRegistrationTime' in response_body: + self.__buyer_registration_time = response_body['buyerRegistrationTime'] + if 'isAccountVerified' in response_body: + self.__is_account_verified = response_body['isAccountVerified'] + if 'successfulOrderCount' in response_body: + self.__successful_order_count = response_body['successfulOrderCount'] diff --git a/com/alipay/ams/api/model/card.py b/com/alipay/ams/api/model/card.py new file mode 100644 index 0000000..4a26583 --- /dev/null +++ b/com/alipay/ams/api/model/card.py @@ -0,0 +1,99 @@ +import json +from com.alipay.ams.api.model.user_name import UserName + + + + +class Card: + def __init__(self): + + self.__card_no = None # type: str + self.__cvv = None # type: str + self.__expiry_year = None # type: str + self.__expiry_month = None # type: str + self.__cardholder_name = None # type: UserName + + + @property + def card_no(self): + """Gets the card_no of this Card. + + """ + return self.__card_no + + @card_no.setter + def card_no(self, value): + self.__card_no = value + @property + def cvv(self): + """Gets the cvv of this Card. + + """ + return self.__cvv + + @cvv.setter + def cvv(self, value): + self.__cvv = value + @property + def expiry_year(self): + """Gets the expiry_year of this Card. + + """ + return self.__expiry_year + + @expiry_year.setter + def expiry_year(self, value): + self.__expiry_year = value + @property + def expiry_month(self): + """Gets the expiry_month of this Card. + + """ + return self.__expiry_month + + @expiry_month.setter + def expiry_month(self, value): + self.__expiry_month = value + @property + def cardholder_name(self): + """Gets the cardholder_name of this Card. + + """ + return self.__cardholder_name + + @cardholder_name.setter + def cardholder_name(self, value): + self.__cardholder_name = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "card_no") and self.card_no is not None: + params['cardNo'] = self.card_no + if hasattr(self, "cvv") and self.cvv is not None: + params['cvv'] = self.cvv + if hasattr(self, "expiry_year") and self.expiry_year is not None: + params['expiryYear'] = self.expiry_year + if hasattr(self, "expiry_month") and self.expiry_month is not None: + params['expiryMonth'] = self.expiry_month + if hasattr(self, "cardholder_name") and self.cardholder_name is not None: + params['cardholderName'] = self.cardholder_name + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'cardNo' in response_body: + self.__card_no = response_body['cardNo'] + if 'cvv' in response_body: + self.__cvv = response_body['cvv'] + if 'expiryYear' in response_body: + self.__expiry_year = response_body['expiryYear'] + if 'expiryMonth' in response_body: + self.__expiry_month = response_body['expiryMonth'] + if 'cardholderName' in response_body: + self.__cardholder_name = UserName() + self.__cardholder_name.parse_rsp_body(response_body['cardholderName']) diff --git a/com/alipay/ams/api/model/card_brand.py b/com/alipay/ams/api/model/card_brand.py index 24b0654..5a99f98 100644 --- a/com/alipay/ams/api/model/card_brand.py +++ b/com/alipay/ams/api/model/card_brand.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class CardBrand(Enum): """CardBrand枚举类""" diff --git a/com/alipay/ams/api/model/card_info.py b/com/alipay/ams/api/model/card_info.py index fea55b9..b24bd94 100644 --- a/com/alipay/ams/api/model/card_info.py +++ b/com/alipay/ams/api/model/card_info.py @@ -2,9 +2,11 @@ from com.alipay.ams.api.model.three_ds_result import ThreeDSResult + + class CardInfo: def __init__(self): - + self.__card_no = None # type: str self.__card_brand = None # type: str self.__card_token = None # type: str @@ -12,6 +14,7 @@ def __init__(self): self.__funding = None # type: str self.__payment_method_region = None # type: str self.__three_ds_result = None # type: ThreeDSResult + @property def card_no(self): @@ -23,7 +26,6 @@ def card_no(self): @card_no.setter def card_no(self, value): self.__card_no = value - @property def card_brand(self): """ @@ -34,7 +36,6 @@ def card_brand(self): @card_brand.setter def card_brand(self, value): self.__card_brand = value - @property def card_token(self): """ @@ -45,7 +46,6 @@ def card_token(self): @card_token.setter def card_token(self, value): self.__card_token = value - @property def issuing_country(self): """ @@ -56,7 +56,6 @@ def issuing_country(self): @issuing_country.setter def issuing_country(self, value): self.__issuing_country = value - @property def funding(self): """ @@ -67,7 +66,6 @@ def funding(self): @funding.setter def funding(self, value): self.__funding = value - @property def payment_method_region(self): """ @@ -78,52 +76,54 @@ def payment_method_region(self): @payment_method_region.setter def payment_method_region(self, value): self.__payment_method_region = value - @property def three_ds_result(self): - """Gets the three_ds_result of this CardInfo.""" + """Gets the three_ds_result of this CardInfo. + + """ return self.__three_ds_result @three_ds_result.setter def three_ds_result(self, value): self.__three_ds_result = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "card_no") and self.card_no is not None: - params["cardNo"] = self.card_no + params['cardNo'] = self.card_no if hasattr(self, "card_brand") and self.card_brand is not None: - params["cardBrand"] = self.card_brand + params['cardBrand'] = self.card_brand if hasattr(self, "card_token") and self.card_token is not None: - params["cardToken"] = self.card_token + params['cardToken'] = self.card_token if hasattr(self, "issuing_country") and self.issuing_country is not None: - params["issuingCountry"] = self.issuing_country + params['issuingCountry'] = self.issuing_country if hasattr(self, "funding") and self.funding is not None: - params["funding"] = self.funding - if ( - hasattr(self, "payment_method_region") - and self.payment_method_region is not None - ): - params["paymentMethodRegion"] = self.payment_method_region + params['funding'] = self.funding + if hasattr(self, "payment_method_region") and self.payment_method_region is not None: + params['paymentMethodRegion'] = self.payment_method_region if hasattr(self, "three_ds_result") and self.three_ds_result is not None: - params["threeDSResult"] = self.three_ds_result + params['threeDSResult'] = self.three_ds_result return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "cardNo" in response_body: - self.__card_no = response_body["cardNo"] - if "cardBrand" in response_body: - self.__card_brand = response_body["cardBrand"] - if "cardToken" in response_body: - self.__card_token = response_body["cardToken"] - if "issuingCountry" in response_body: - self.__issuing_country = response_body["issuingCountry"] - if "funding" in response_body: - self.__funding = response_body["funding"] - if "paymentMethodRegion" in response_body: - self.__payment_method_region = response_body["paymentMethodRegion"] - if "threeDSResult" in response_body: + if 'cardNo' in response_body: + self.__card_no = response_body['cardNo'] + if 'cardBrand' in response_body: + self.__card_brand = response_body['cardBrand'] + if 'cardToken' in response_body: + self.__card_token = response_body['cardToken'] + if 'issuingCountry' in response_body: + self.__issuing_country = response_body['issuingCountry'] + if 'funding' in response_body: + self.__funding = response_body['funding'] + if 'paymentMethodRegion' in response_body: + self.__payment_method_region = response_body['paymentMethodRegion'] + if 'threeDSResult' in response_body: self.__three_ds_result = ThreeDSResult() - self.__three_ds_result.parse_rsp_body(response_body["threeDSResult"]) + self.__three_ds_result.parse_rsp_body(response_body['threeDSResult']) diff --git a/com/alipay/ams/api/model/card_payment_method_detail.py b/com/alipay/ams/api/model/card_payment_method_detail.py index 0a8c5fc..8dc2872 100644 --- a/com/alipay/ams/api/model/card_payment_method_detail.py +++ b/com/alipay/ams/api/model/card_payment_method_detail.py @@ -7,9 +7,11 @@ from com.alipay.ams.api.model.mpi_data import MpiData + + class CardPaymentMethodDetail: def __init__(self): - + self.__supported_brands = None # type: str self.__card_token = None # type: str self.__card_no = None # type: str @@ -47,6 +49,7 @@ def __init__(self): self.__sca_exemption_indicator = None # type: str self.__enable_authentication_upgrade = None # type: str self.__mpi_data = None # type: MpiData + @property def supported_brands(self): @@ -58,7 +61,6 @@ def supported_brands(self): @supported_brands.setter def supported_brands(self, value): self.__supported_brands = value - @property def card_token(self): """ @@ -69,7 +71,6 @@ def card_token(self): @card_token.setter def card_token(self, value): self.__card_token = value - @property def card_no(self): """ @@ -80,52 +81,56 @@ def card_no(self): @card_no.setter def card_no(self, value): self.__card_no = value - @property def brand(self): - """Gets the brand of this CardPaymentMethodDetail.""" + """Gets the brand of this CardPaymentMethodDetail. + + """ return self.__brand @brand.setter def brand(self, value): self.__brand = value - @property def selected_card_brand(self): - """Gets the selected_card_brand of this CardPaymentMethodDetail.""" + """Gets the selected_card_brand of this CardPaymentMethodDetail. + + """ return self.__selected_card_brand @selected_card_brand.setter def selected_card_brand(self, value): self.__selected_card_brand = value - @property def card_issuer(self): - """Gets the card_issuer of this CardPaymentMethodDetail.""" + """Gets the card_issuer of this CardPaymentMethodDetail. + + """ return self.__card_issuer @card_issuer.setter def card_issuer(self, value): self.__card_issuer = value - @property def country_issue(self): - """Gets the country_issue of this CardPaymentMethodDetail.""" + """Gets the country_issue of this CardPaymentMethodDetail. + + """ return self.__country_issue @country_issue.setter def country_issue(self, value): self.__country_issue = value - @property def inst_user_name(self): - """Gets the inst_user_name of this CardPaymentMethodDetail.""" + """Gets the inst_user_name of this CardPaymentMethodDetail. + + """ return self.__inst_user_name @inst_user_name.setter def inst_user_name(self, value): self.__inst_user_name = value - @property def expiry_year(self): """ @@ -136,7 +141,6 @@ def expiry_year(self): @expiry_year.setter def expiry_year(self, value): self.__expiry_year = value - @property def expiry_month(self): """ @@ -147,43 +151,46 @@ def expiry_month(self): @expiry_month.setter def expiry_month(self, value): self.__expiry_month = value - @property def billing_address(self): - """Gets the billing_address of this CardPaymentMethodDetail.""" + """Gets the billing_address of this CardPaymentMethodDetail. + + """ return self.__billing_address @billing_address.setter def billing_address(self, value): self.__billing_address = value - @property def mask(self): - """Gets the mask of this CardPaymentMethodDetail.""" + """Gets the mask of this CardPaymentMethodDetail. + + """ return self.__mask @mask.setter def mask(self, value): self.__mask = value - @property def last4(self): - """Gets the last4 of this CardPaymentMethodDetail.""" + """Gets the last4 of this CardPaymentMethodDetail. + + """ return self.__last4 @last4.setter def last4(self, value): self.__last4 = value - @property def payment_method_detail_metadata(self): - """Gets the payment_method_detail_metadata of this CardPaymentMethodDetail.""" + """Gets the payment_method_detail_metadata of this CardPaymentMethodDetail. + + """ return self.__payment_method_detail_metadata @payment_method_detail_metadata.setter def payment_method_detail_metadata(self, value): self.__payment_method_detail_metadata = value - @property def masked_card_no(self): """ @@ -194,97 +201,106 @@ def masked_card_no(self): @masked_card_no.setter def masked_card_no(self, value): self.__masked_card_no = value - @property def fingerprint(self): - """Gets the fingerprint of this CardPaymentMethodDetail.""" + """Gets the fingerprint of this CardPaymentMethodDetail. + + """ return self.__fingerprint @fingerprint.setter def fingerprint(self, value): self.__fingerprint = value - @property def authentication_flow(self): - """Gets the authentication_flow of this CardPaymentMethodDetail.""" + """Gets the authentication_flow of this CardPaymentMethodDetail. + + """ return self.__authentication_flow @authentication_flow.setter def authentication_flow(self, value): self.__authentication_flow = value - @property def funding(self): - """Gets the funding of this CardPaymentMethodDetail.""" + """Gets the funding of this CardPaymentMethodDetail. + + """ return self.__funding @funding.setter def funding(self, value): self.__funding = value - @property def avs_result_raw(self): - """Gets the avs_result_raw of this CardPaymentMethodDetail.""" + """Gets the avs_result_raw of this CardPaymentMethodDetail. + + """ return self.__avs_result_raw @avs_result_raw.setter def avs_result_raw(self, value): self.__avs_result_raw = value - @property def cvv_result_raw(self): - """Gets the cvv_result_raw of this CardPaymentMethodDetail.""" + """Gets the cvv_result_raw of this CardPaymentMethodDetail. + + """ return self.__cvv_result_raw @cvv_result_raw.setter def cvv_result_raw(self, value): self.__cvv_result_raw = value - @property def bin(self): - """Gets the bin of this CardPaymentMethodDetail.""" + """Gets the bin of this CardPaymentMethodDetail. + + """ return self.__bin @bin.setter def bin(self, value): self.__bin = value - @property def issuer_name(self): - """Gets the issuer_name of this CardPaymentMethodDetail.""" + """Gets the issuer_name of this CardPaymentMethodDetail. + + """ return self.__issuer_name @issuer_name.setter def issuer_name(self, value): self.__issuer_name = value - @property def issuing_country(self): - """Gets the issuing_country of this CardPaymentMethodDetail.""" + """Gets the issuing_country of this CardPaymentMethodDetail. + + """ return self.__issuing_country @issuing_country.setter def issuing_country(self, value): self.__issuing_country = value - @property def last_four(self): - """Gets the last_four of this CardPaymentMethodDetail.""" + """Gets the last_four of this CardPaymentMethodDetail. + + """ return self.__last_four @last_four.setter def last_four(self, value): self.__last_four = value - @property def cardholder_name(self): - """Gets the cardholder_name of this CardPaymentMethodDetail.""" + """Gets the cardholder_name of this CardPaymentMethodDetail. + + """ return self.__cardholder_name @cardholder_name.setter def cardholder_name(self, value): self.__cardholder_name = value - @property def cvv(self): """ @@ -295,7 +311,6 @@ def cvv(self): @cvv.setter def cvv(self, value): self.__cvv = value - @property def date_of_birth(self): """ @@ -306,29 +321,26 @@ def date_of_birth(self): @date_of_birth.setter def date_of_birth(self, value): self.__date_of_birth = value - @property def business_no(self): """ - The business number of the company that holds the corporate card. The value of this parameter is a 10-digit business number, such as 97XXXXXX11. Specify this parameter when all the following conditions are met: The card issuing bank is in Korea. The card is a corporate card. More information: Maximum length: 10 characters + The business number of the company that holds the corporate card. The value of this parameter is a 10-digit business number, such as 97XXXXXX11. Specify this parameter when all the following conditions are met: The card issuing bank is in Korea. The card is a corporate card. More information: Maximum length: 10 characters """ return self.__business_no @business_no.setter def business_no(self, value): self.__business_no = value - @property def card_password_digest(self): """ - The first two digits of the card payment password. Note: Specify this parameter when the card issuing bank is in Korea. More information: Maximum length: 2 characters + The first two digits of the card payment password. Note: Specify this parameter when the card issuing bank is in Korea. More information: Maximum length: 2 characters """ return self.__card_password_digest @card_password_digest.setter def card_password_digest(self, value): self.__card_password_digest = value - @property def cpf(self): """ @@ -339,18 +351,16 @@ def cpf(self): @cpf.setter def cpf(self, value): self.__cpf = value - @property def payer_email(self): """ - The email address of the payer. Note: Specify this parameter when the card issuing bank is in Brazil, Chile, Mexico, or Peru. More information: Maximum length: 64 characters + The email address of the payer. Note: Specify this parameter when the card issuing bank is in Brazil, Chile, Mexico, or Peru. More information: Maximum length: 64 characters """ return self.__payer_email @payer_email.setter def payer_email(self, value): self.__payer_email = value - @property def network_transaction_id(self): """ @@ -361,242 +371,219 @@ def network_transaction_id(self): @network_transaction_id.setter def network_transaction_id(self, value): self.__network_transaction_id = value - @property def is3_ds_authentication(self): """ - Indicates whether the transaction authentication type is 3D secure. Specify this parameter when the value of paymentMethodType is CARD. + Indicates whether the transaction authentication type is 3D secure. Specify this parameter when the value of paymentMethodType is CARD. """ return self.__is3_ds_authentication @is3_ds_authentication.setter def is3_ds_authentication(self, value): self.__is3_ds_authentication = value - @property def request3_ds(self): - """Gets the request3_ds of this CardPaymentMethodDetail.""" + """Gets the request3_ds of this CardPaymentMethodDetail. + + """ return self.__request3_ds @request3_ds.setter def request3_ds(self, value): self.__request3_ds = value - @property def sca_exemption_indicator(self): - """Gets the sca_exemption_indicator of this CardPaymentMethodDetail.""" + """Gets the sca_exemption_indicator of this CardPaymentMethodDetail. + + """ return self.__sca_exemption_indicator @sca_exemption_indicator.setter def sca_exemption_indicator(self, value): self.__sca_exemption_indicator = value - @property def enable_authentication_upgrade(self): - """Gets the enable_authentication_upgrade of this CardPaymentMethodDetail.""" + """Gets the enable_authentication_upgrade of this CardPaymentMethodDetail. + + """ return self.__enable_authentication_upgrade @enable_authentication_upgrade.setter def enable_authentication_upgrade(self, value): self.__enable_authentication_upgrade = value - @property def mpi_data(self): - """Gets the mpi_data of this CardPaymentMethodDetail.""" + """Gets the mpi_data of this CardPaymentMethodDetail. + + """ return self.__mpi_data @mpi_data.setter def mpi_data(self, value): self.__mpi_data = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "supported_brands") and self.supported_brands is not None: - params["supportedBrands"] = self.supported_brands + params['supportedBrands'] = self.supported_brands if hasattr(self, "card_token") and self.card_token is not None: - params["cardToken"] = self.card_token + params['cardToken'] = self.card_token if hasattr(self, "card_no") and self.card_no is not None: - params["cardNo"] = self.card_no + params['cardNo'] = self.card_no if hasattr(self, "brand") and self.brand is not None: - params["brand"] = self.brand - if ( - hasattr(self, "selected_card_brand") - and self.selected_card_brand is not None - ): - params["selectedCardBrand"] = self.selected_card_brand + params['brand'] = self.brand + if hasattr(self, "selected_card_brand") and self.selected_card_brand is not None: + params['selectedCardBrand'] = self.selected_card_brand if hasattr(self, "card_issuer") and self.card_issuer is not None: - params["cardIssuer"] = self.card_issuer + params['cardIssuer'] = self.card_issuer if hasattr(self, "country_issue") and self.country_issue is not None: - params["countryIssue"] = self.country_issue + params['countryIssue'] = self.country_issue if hasattr(self, "inst_user_name") and self.inst_user_name is not None: - params["instUserName"] = self.inst_user_name + params['instUserName'] = self.inst_user_name if hasattr(self, "expiry_year") and self.expiry_year is not None: - params["expiryYear"] = self.expiry_year + params['expiryYear'] = self.expiry_year if hasattr(self, "expiry_month") and self.expiry_month is not None: - params["expiryMonth"] = self.expiry_month + params['expiryMonth'] = self.expiry_month if hasattr(self, "billing_address") and self.billing_address is not None: - params["billingAddress"] = self.billing_address + params['billingAddress'] = self.billing_address if hasattr(self, "mask") and self.mask is not None: - params["mask"] = self.mask + params['mask'] = self.mask if hasattr(self, "last4") and self.last4 is not None: - params["last4"] = self.last4 - if ( - hasattr(self, "payment_method_detail_metadata") - and self.payment_method_detail_metadata is not None - ): - params["paymentMethodDetailMetadata"] = self.payment_method_detail_metadata + params['last4'] = self.last4 + if hasattr(self, "payment_method_detail_metadata") and self.payment_method_detail_metadata is not None: + params['paymentMethodDetailMetadata'] = self.payment_method_detail_metadata if hasattr(self, "masked_card_no") and self.masked_card_no is not None: - params["maskedCardNo"] = self.masked_card_no + params['maskedCardNo'] = self.masked_card_no if hasattr(self, "fingerprint") and self.fingerprint is not None: - params["fingerprint"] = self.fingerprint - if ( - hasattr(self, "authentication_flow") - and self.authentication_flow is not None - ): - params["authenticationFlow"] = self.authentication_flow + params['fingerprint'] = self.fingerprint + if hasattr(self, "authentication_flow") and self.authentication_flow is not None: + params['authenticationFlow'] = self.authentication_flow if hasattr(self, "funding") and self.funding is not None: - params["funding"] = self.funding + params['funding'] = self.funding if hasattr(self, "avs_result_raw") and self.avs_result_raw is not None: - params["avsResultRaw"] = self.avs_result_raw + params['avsResultRaw'] = self.avs_result_raw if hasattr(self, "cvv_result_raw") and self.cvv_result_raw is not None: - params["cvvResultRaw"] = self.cvv_result_raw + params['cvvResultRaw'] = self.cvv_result_raw if hasattr(self, "bin") and self.bin is not None: - params["bin"] = self.bin + params['bin'] = self.bin if hasattr(self, "issuer_name") and self.issuer_name is not None: - params["issuerName"] = self.issuer_name + params['issuerName'] = self.issuer_name if hasattr(self, "issuing_country") and self.issuing_country is not None: - params["issuingCountry"] = self.issuing_country + params['issuingCountry'] = self.issuing_country if hasattr(self, "last_four") and self.last_four is not None: - params["lastFour"] = self.last_four + params['lastFour'] = self.last_four if hasattr(self, "cardholder_name") and self.cardholder_name is not None: - params["cardholderName"] = self.cardholder_name + params['cardholderName'] = self.cardholder_name if hasattr(self, "cvv") and self.cvv is not None: - params["cvv"] = self.cvv + params['cvv'] = self.cvv if hasattr(self, "date_of_birth") and self.date_of_birth is not None: - params["dateOfBirth"] = self.date_of_birth + params['dateOfBirth'] = self.date_of_birth if hasattr(self, "business_no") and self.business_no is not None: - params["businessNo"] = self.business_no - if ( - hasattr(self, "card_password_digest") - and self.card_password_digest is not None - ): - params["cardPasswordDigest"] = self.card_password_digest + params['businessNo'] = self.business_no + if hasattr(self, "card_password_digest") and self.card_password_digest is not None: + params['cardPasswordDigest'] = self.card_password_digest if hasattr(self, "cpf") and self.cpf is not None: - params["cpf"] = self.cpf + params['cpf'] = self.cpf if hasattr(self, "payer_email") and self.payer_email is not None: - params["payerEmail"] = self.payer_email - if ( - hasattr(self, "network_transaction_id") - and self.network_transaction_id is not None - ): - params["networkTransactionId"] = self.network_transaction_id - if ( - hasattr(self, "is3_ds_authentication") - and self.is3_ds_authentication is not None - ): - params["is3DSAuthentication"] = self.is3_ds_authentication + params['payerEmail'] = self.payer_email + if hasattr(self, "network_transaction_id") and self.network_transaction_id is not None: + params['networkTransactionId'] = self.network_transaction_id + if hasattr(self, "is3_ds_authentication") and self.is3_ds_authentication is not None: + params['is3DSAuthentication'] = self.is3_ds_authentication if hasattr(self, "request3_ds") and self.request3_ds is not None: - params["request3DS"] = self.request3_ds - if ( - hasattr(self, "sca_exemption_indicator") - and self.sca_exemption_indicator is not None - ): - params["scaExemptionIndicator"] = self.sca_exemption_indicator - if ( - hasattr(self, "enable_authentication_upgrade") - and self.enable_authentication_upgrade is not None - ): - params["enableAuthenticationUpgrade"] = self.enable_authentication_upgrade + params['request3DS'] = self.request3_ds + if hasattr(self, "sca_exemption_indicator") and self.sca_exemption_indicator is not None: + params['scaExemptionIndicator'] = self.sca_exemption_indicator + if hasattr(self, "enable_authentication_upgrade") and self.enable_authentication_upgrade is not None: + params['enableAuthenticationUpgrade'] = self.enable_authentication_upgrade if hasattr(self, "mpi_data") and self.mpi_data is not None: - params["mpiData"] = self.mpi_data + params['mpiData'] = self.mpi_data return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "supportedBrands" in response_body: - self.__supported_brands = response_body["supportedBrands"] - if "cardToken" in response_body: - self.__card_token = response_body["cardToken"] - if "cardNo" in response_body: - self.__card_no = response_body["cardNo"] - if "brand" in response_body: - brand_temp = CardBrand.value_of(response_body["brand"]) + if 'supportedBrands' in response_body: + self.__supported_brands = response_body['supportedBrands'] + if 'cardToken' in response_body: + self.__card_token = response_body['cardToken'] + if 'cardNo' in response_body: + self.__card_no = response_body['cardNo'] + if 'brand' in response_body: + brand_temp = CardBrand.value_of(response_body['brand']) self.__brand = brand_temp - if "selectedCardBrand" in response_body: - selected_card_brand_temp = CardBrand.value_of( - response_body["selectedCardBrand"] - ) + if 'selectedCardBrand' in response_body: + selected_card_brand_temp = CardBrand.value_of(response_body['selectedCardBrand']) self.__selected_card_brand = selected_card_brand_temp - if "cardIssuer" in response_body: - self.__card_issuer = response_body["cardIssuer"] - if "countryIssue" in response_body: - self.__country_issue = response_body["countryIssue"] - if "instUserName" in response_body: + if 'cardIssuer' in response_body: + self.__card_issuer = response_body['cardIssuer'] + if 'countryIssue' in response_body: + self.__country_issue = response_body['countryIssue'] + if 'instUserName' in response_body: self.__inst_user_name = UserName() - self.__inst_user_name.parse_rsp_body(response_body["instUserName"]) - if "expiryYear" in response_body: - self.__expiry_year = response_body["expiryYear"] - if "expiryMonth" in response_body: - self.__expiry_month = response_body["expiryMonth"] - if "billingAddress" in response_body: + self.__inst_user_name.parse_rsp_body(response_body['instUserName']) + if 'expiryYear' in response_body: + self.__expiry_year = response_body['expiryYear'] + if 'expiryMonth' in response_body: + self.__expiry_month = response_body['expiryMonth'] + if 'billingAddress' in response_body: self.__billing_address = Address() - self.__billing_address.parse_rsp_body(response_body["billingAddress"]) - if "mask" in response_body: - self.__mask = response_body["mask"] - if "last4" in response_body: - self.__last4 = response_body["last4"] - if "paymentMethodDetailMetadata" in response_body: - self.__payment_method_detail_metadata = response_body[ - "paymentMethodDetailMetadata" - ] - if "maskedCardNo" in response_body: - self.__masked_card_no = response_body["maskedCardNo"] - if "fingerprint" in response_body: - self.__fingerprint = response_body["fingerprint"] - if "authenticationFlow" in response_body: - self.__authentication_flow = response_body["authenticationFlow"] - if "funding" in response_body: - self.__funding = response_body["funding"] - if "avsResultRaw" in response_body: - self.__avs_result_raw = response_body["avsResultRaw"] - if "cvvResultRaw" in response_body: - self.__cvv_result_raw = response_body["cvvResultRaw"] - if "bin" in response_body: - self.__bin = response_body["bin"] - if "issuerName" in response_body: - self.__issuer_name = response_body["issuerName"] - if "issuingCountry" in response_body: - self.__issuing_country = response_body["issuingCountry"] - if "lastFour" in response_body: - self.__last_four = response_body["lastFour"] - if "cardholderName" in response_body: + self.__billing_address.parse_rsp_body(response_body['billingAddress']) + if 'mask' in response_body: + self.__mask = response_body['mask'] + if 'last4' in response_body: + self.__last4 = response_body['last4'] + if 'paymentMethodDetailMetadata' in response_body: + self.__payment_method_detail_metadata = response_body['paymentMethodDetailMetadata'] + if 'maskedCardNo' in response_body: + self.__masked_card_no = response_body['maskedCardNo'] + if 'fingerprint' in response_body: + self.__fingerprint = response_body['fingerprint'] + if 'authenticationFlow' in response_body: + self.__authentication_flow = response_body['authenticationFlow'] + if 'funding' in response_body: + self.__funding = response_body['funding'] + if 'avsResultRaw' in response_body: + self.__avs_result_raw = response_body['avsResultRaw'] + if 'cvvResultRaw' in response_body: + self.__cvv_result_raw = response_body['cvvResultRaw'] + if 'bin' in response_body: + self.__bin = response_body['bin'] + if 'issuerName' in response_body: + self.__issuer_name = response_body['issuerName'] + if 'issuingCountry' in response_body: + self.__issuing_country = response_body['issuingCountry'] + if 'lastFour' in response_body: + self.__last_four = response_body['lastFour'] + if 'cardholderName' in response_body: self.__cardholder_name = UserName() - self.__cardholder_name.parse_rsp_body(response_body["cardholderName"]) - if "cvv" in response_body: - self.__cvv = response_body["cvv"] - if "dateOfBirth" in response_body: - self.__date_of_birth = response_body["dateOfBirth"] - if "businessNo" in response_body: - self.__business_no = response_body["businessNo"] - if "cardPasswordDigest" in response_body: - self.__card_password_digest = response_body["cardPasswordDigest"] - if "cpf" in response_body: - self.__cpf = response_body["cpf"] - if "payerEmail" in response_body: - self.__payer_email = response_body["payerEmail"] - if "networkTransactionId" in response_body: - self.__network_transaction_id = response_body["networkTransactionId"] - if "is3DSAuthentication" in response_body: - self.__is3_ds_authentication = response_body["is3DSAuthentication"] - if "request3DS" in response_body: - self.__request3_ds = response_body["request3DS"] - if "scaExemptionIndicator" in response_body: - self.__sca_exemption_indicator = response_body["scaExemptionIndicator"] - if "enableAuthenticationUpgrade" in response_body: - self.__enable_authentication_upgrade = response_body[ - "enableAuthenticationUpgrade" - ] - if "mpiData" in response_body: + self.__cardholder_name.parse_rsp_body(response_body['cardholderName']) + if 'cvv' in response_body: + self.__cvv = response_body['cvv'] + if 'dateOfBirth' in response_body: + self.__date_of_birth = response_body['dateOfBirth'] + if 'businessNo' in response_body: + self.__business_no = response_body['businessNo'] + if 'cardPasswordDigest' in response_body: + self.__card_password_digest = response_body['cardPasswordDigest'] + if 'cpf' in response_body: + self.__cpf = response_body['cpf'] + if 'payerEmail' in response_body: + self.__payer_email = response_body['payerEmail'] + if 'networkTransactionId' in response_body: + self.__network_transaction_id = response_body['networkTransactionId'] + if 'is3DSAuthentication' in response_body: + self.__is3_ds_authentication = response_body['is3DSAuthentication'] + if 'request3DS' in response_body: + self.__request3_ds = response_body['request3DS'] + if 'scaExemptionIndicator' in response_body: + self.__sca_exemption_indicator = response_body['scaExemptionIndicator'] + if 'enableAuthenticationUpgrade' in response_body: + self.__enable_authentication_upgrade = response_body['enableAuthenticationUpgrade'] + if 'mpiData' in response_body: self.__mpi_data = MpiData() - self.__mpi_data.parse_rsp_body(response_body["mpiData"]) + self.__mpi_data.parse_rsp_body(response_body['mpiData']) diff --git a/com/alipay/ams/api/model/card_verification_result.py b/com/alipay/ams/api/model/card_verification_result.py index 10775bd..8ed5ee6 100644 --- a/com/alipay/ams/api/model/card_verification_result.py +++ b/com/alipay/ams/api/model/card_verification_result.py @@ -2,15 +2,18 @@ from com.alipay.ams.api.model.risk_three_ds_result import RiskThreeDSResult + + class CardVerificationResult: def __init__(self): - + self.__authentication_type = None # type: str self.__authentication_method = None # type: str self.__cvv_result = None # type: str self.__avs_result = None # type: str self.__authorization_code = None # type: str self.__three_ds_result = None # type: RiskThreeDSResult + @property def authentication_type(self): @@ -22,7 +25,6 @@ def authentication_type(self): @authentication_type.setter def authentication_type(self, value): self.__authentication_type = value - @property def authentication_method(self): """ @@ -33,7 +35,6 @@ def authentication_method(self): @authentication_method.setter def authentication_method(self, value): self.__authentication_method = value - @property def cvv_result(self): """ @@ -44,7 +45,6 @@ def cvv_result(self): @cvv_result.setter def cvv_result(self, value): self.__cvv_result = value - @property def avs_result(self): """ @@ -55,7 +55,6 @@ def avs_result(self): @avs_result.setter def avs_result(self, value): self.__avs_result = value - @property def authorization_code(self): """ @@ -66,51 +65,50 @@ def authorization_code(self): @authorization_code.setter def authorization_code(self, value): self.__authorization_code = value - @property def three_ds_result(self): - """Gets the three_ds_result of this CardVerificationResult.""" + """Gets the three_ds_result of this CardVerificationResult. + + """ return self.__three_ds_result @three_ds_result.setter def three_ds_result(self, value): self.__three_ds_result = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "authentication_type") - and self.authentication_type is not None - ): - params["authenticationType"] = self.authentication_type - if ( - hasattr(self, "authentication_method") - and self.authentication_method is not None - ): - params["authenticationMethod"] = self.authentication_method + if hasattr(self, "authentication_type") and self.authentication_type is not None: + params['authenticationType'] = self.authentication_type + if hasattr(self, "authentication_method") and self.authentication_method is not None: + params['authenticationMethod'] = self.authentication_method if hasattr(self, "cvv_result") and self.cvv_result is not None: - params["cvvResult"] = self.cvv_result + params['cvvResult'] = self.cvv_result if hasattr(self, "avs_result") and self.avs_result is not None: - params["avsResult"] = self.avs_result + params['avsResult'] = self.avs_result if hasattr(self, "authorization_code") and self.authorization_code is not None: - params["authorizationCode"] = self.authorization_code + params['authorizationCode'] = self.authorization_code if hasattr(self, "three_ds_result") and self.three_ds_result is not None: - params["threeDSResult"] = self.three_ds_result + params['threeDSResult'] = self.three_ds_result return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "authenticationType" in response_body: - self.__authentication_type = response_body["authenticationType"] - if "authenticationMethod" in response_body: - self.__authentication_method = response_body["authenticationMethod"] - if "cvvResult" in response_body: - self.__cvv_result = response_body["cvvResult"] - if "avsResult" in response_body: - self.__avs_result = response_body["avsResult"] - if "authorizationCode" in response_body: - self.__authorization_code = response_body["authorizationCode"] - if "threeDSResult" in response_body: + if 'authenticationType' in response_body: + self.__authentication_type = response_body['authenticationType'] + if 'authenticationMethod' in response_body: + self.__authentication_method = response_body['authenticationMethod'] + if 'cvvResult' in response_body: + self.__cvv_result = response_body['cvvResult'] + if 'avsResult' in response_body: + self.__avs_result = response_body['avsResult'] + if 'authorizationCode' in response_body: + self.__authorization_code = response_body['authorizationCode'] + if 'threeDSResult' in response_body: self.__three_ds_result = RiskThreeDSResult() - self.__three_ds_result.parse_rsp_body(response_body["threeDSResult"]) + self.__three_ds_result.parse_rsp_body(response_body['threeDSResult']) diff --git a/com/alipay/ams/api/model/certificate.py b/com/alipay/ams/api/model/certificate.py index 24730ff..7b27705 100644 --- a/com/alipay/ams/api/model/certificate.py +++ b/com/alipay/ams/api/model/certificate.py @@ -3,44 +3,48 @@ from com.alipay.ams.api.model.user_name import UserName + + class Certificate: def __init__(self): - + self.__certificate_type = None # type: CertificateType self.__certificate_no = None # type: str self.__holder_name = None # type: UserName self.__file_keys = None # type: [str] self.__certificate_authority = None # type: str + @property def certificate_type(self): - """Gets the certificate_type of this Certificate.""" + """Gets the certificate_type of this Certificate. + + """ return self.__certificate_type @certificate_type.setter def certificate_type(self, value): self.__certificate_type = value - @property def certificate_no(self): """ - The unique identification number of the certificate. More information: Maximum length: 64 characters + The unique identification number of the certificate. More information: Maximum length: 64 characters """ return self.__certificate_no @certificate_no.setter def certificate_no(self, value): self.__certificate_no = value - @property def holder_name(self): - """Gets the holder_name of this Certificate.""" + """Gets the holder_name of this Certificate. + + """ return self.__holder_name @holder_name.setter def holder_name(self, value): self.__holder_name = value - @property def file_keys(self): """ @@ -51,7 +55,6 @@ def file_keys(self): @file_keys.setter def file_keys(self, value): self.__file_keys = value - @property def certificate_authority(self): """ @@ -63,37 +66,36 @@ def certificate_authority(self): def certificate_authority(self, value): self.__certificate_authority = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "certificate_type") and self.certificate_type is not None: - params["certificateType"] = self.certificate_type + params['certificateType'] = self.certificate_type if hasattr(self, "certificate_no") and self.certificate_no is not None: - params["certificateNo"] = self.certificate_no + params['certificateNo'] = self.certificate_no if hasattr(self, "holder_name") and self.holder_name is not None: - params["holderName"] = self.holder_name + params['holderName'] = self.holder_name if hasattr(self, "file_keys") and self.file_keys is not None: - params["fileKeys"] = self.file_keys - if ( - hasattr(self, "certificate_authority") - and self.certificate_authority is not None - ): - params["certificateAuthority"] = self.certificate_authority + params['fileKeys'] = self.file_keys + if hasattr(self, "certificate_authority") and self.certificate_authority is not None: + params['certificateAuthority'] = self.certificate_authority return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "certificateType" in response_body: - certificate_type_temp = CertificateType.value_of( - response_body["certificateType"] - ) + if 'certificateType' in response_body: + certificate_type_temp = CertificateType.value_of(response_body['certificateType']) self.__certificate_type = certificate_type_temp - if "certificateNo" in response_body: - self.__certificate_no = response_body["certificateNo"] - if "holderName" in response_body: + if 'certificateNo' in response_body: + self.__certificate_no = response_body['certificateNo'] + if 'holderName' in response_body: self.__holder_name = UserName() - self.__holder_name.parse_rsp_body(response_body["holderName"]) - if "fileKeys" in response_body: - self.__file_keys = response_body["fileKeys"] - if "certificateAuthority" in response_body: - self.__certificate_authority = response_body["certificateAuthority"] + self.__holder_name.parse_rsp_body(response_body['holderName']) + if 'fileKeys' in response_body: + self.__file_keys = response_body['fileKeys'] + if 'certificateAuthority' in response_body: + self.__certificate_authority = response_body['certificateAuthority'] diff --git a/com/alipay/ams/api/model/certificate_type.py b/com/alipay/ams/api/model/certificate_type.py index b0eb623..db65251 100644 --- a/com/alipay/ams/api/model/certificate_type.py +++ b/com/alipay/ams/api/model/certificate_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class CertificateType(Enum): """CertificateType枚举类""" diff --git a/com/alipay/ams/api/model/challenge_action_form.py b/com/alipay/ams/api/model/challenge_action_form.py index 8b0ff1b..1e28745 100644 --- a/com/alipay/ams/api/model/challenge_action_form.py +++ b/com/alipay/ams/api/model/challenge_action_form.py @@ -1,81 +1,86 @@ import json from com.alipay.ams.api.model.challenge_type import ChallengeType -from com.alipay.ams.api.model.challenge_trigger_source_type import ( - ChallengeTriggerSourceType, -) +from com.alipay.ams.api.model.challenge_trigger_source_type import ChallengeTriggerSourceType + + class ChallengeActionForm: def __init__(self): - + self.__challenge_type = None # type: ChallengeType self.__challenge_render_value = None # type: str self.__trigger_source = None # type: ChallengeTriggerSourceType self.__extend_info = None # type: str + @property def challenge_type(self): - """Gets the challenge_type of this ChallengeActionForm.""" + """Gets the challenge_type of this ChallengeActionForm. + + """ return self.__challenge_type @challenge_type.setter def challenge_type(self, value): self.__challenge_type = value - @property def challenge_render_value(self): - """Gets the challenge_render_value of this ChallengeActionForm.""" + """Gets the challenge_render_value of this ChallengeActionForm. + + """ return self.__challenge_render_value @challenge_render_value.setter def challenge_render_value(self, value): self.__challenge_render_value = value - @property def trigger_source(self): - """Gets the trigger_source of this ChallengeActionForm.""" + """Gets the trigger_source of this ChallengeActionForm. + + """ return self.__trigger_source @trigger_source.setter def trigger_source(self, value): self.__trigger_source = value - @property def extend_info(self): - """Gets the extend_info of this ChallengeActionForm.""" + """Gets the extend_info of this ChallengeActionForm. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "challenge_type") and self.challenge_type is not None: - params["challengeType"] = self.challenge_type - if ( - hasattr(self, "challenge_render_value") - and self.challenge_render_value is not None - ): - params["challengeRenderValue"] = self.challenge_render_value + params['challengeType'] = self.challenge_type + if hasattr(self, "challenge_render_value") and self.challenge_render_value is not None: + params['challengeRenderValue'] = self.challenge_render_value if hasattr(self, "trigger_source") and self.trigger_source is not None: - params["triggerSource"] = self.trigger_source + params['triggerSource'] = self.trigger_source if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "challengeType" in response_body: - challenge_type_temp = ChallengeType.value_of(response_body["challengeType"]) + if 'challengeType' in response_body: + challenge_type_temp = ChallengeType.value_of(response_body['challengeType']) self.__challenge_type = challenge_type_temp - if "challengeRenderValue" in response_body: - self.__challenge_render_value = response_body["challengeRenderValue"] - if "triggerSource" in response_body: - trigger_source_temp = ChallengeTriggerSourceType.value_of( - response_body["triggerSource"] - ) + if 'challengeRenderValue' in response_body: + self.__challenge_render_value = response_body['challengeRenderValue'] + if 'triggerSource' in response_body: + trigger_source_temp = ChallengeTriggerSourceType.value_of(response_body['triggerSource']) self.__trigger_source = trigger_source_temp - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] diff --git a/com/alipay/ams/api/model/challenge_trigger_source_type.py b/com/alipay/ams/api/model/challenge_trigger_source_type.py index dfd6778..f2da30d 100644 --- a/com/alipay/ams/api/model/challenge_trigger_source_type.py +++ b/com/alipay/ams/api/model/challenge_trigger_source_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class ChallengeTriggerSourceType(Enum): """ChallengeTriggerSourceType枚举类""" diff --git a/com/alipay/ams/api/model/challenge_type.py b/com/alipay/ams/api/model/challenge_type.py index d76495b..fedb1a9 100644 --- a/com/alipay/ams/api/model/challenge_type.py +++ b/com/alipay/ams/api/model/challenge_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class ChallengeType(Enum): """ChallengeType枚举类""" diff --git a/com/alipay/ams/api/model/class_type.py b/com/alipay/ams/api/model/class_type.py index 115a482..c444536 100644 --- a/com/alipay/ams/api/model/class_type.py +++ b/com/alipay/ams/api/model/class_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class ClassType(Enum): """ClassType枚举类""" diff --git a/com/alipay/ams/api/model/code_detail.py b/com/alipay/ams/api/model/code_detail.py index 193b581..bcbb237 100644 --- a/com/alipay/ams/api/model/code_detail.py +++ b/com/alipay/ams/api/model/code_detail.py @@ -3,22 +3,26 @@ from com.alipay.ams.api.model.display_type import DisplayType + + class CodeDetail: def __init__(self): - + self.__code_value_type = None # type: CodeValueType self.__code_value = None # type: str self.__display_type = None # type: DisplayType + @property def code_value_type(self): - """Gets the code_value_type of this CodeDetail.""" + """Gets the code_value_type of this CodeDetail. + + """ return self.__code_value_type @code_value_type.setter def code_value_type(self, value): self.__code_value_type = value - @property def code_value(self): """ @@ -29,36 +33,39 @@ def code_value(self): @code_value.setter def code_value(self, value): self.__code_value = value - @property def display_type(self): - """Gets the display_type of this CodeDetail.""" + """Gets the display_type of this CodeDetail. + + """ return self.__display_type @display_type.setter def display_type(self, value): self.__display_type = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "code_value_type") and self.code_value_type is not None: - params["codeValueType"] = self.code_value_type + params['codeValueType'] = self.code_value_type if hasattr(self, "code_value") and self.code_value is not None: - params["codeValue"] = self.code_value + params['codeValue'] = self.code_value if hasattr(self, "display_type") and self.display_type is not None: - params["displayType"] = self.display_type + params['displayType'] = self.display_type return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "codeValueType" in response_body: - code_value_type_temp = CodeValueType.value_of( - response_body["codeValueType"] - ) + if 'codeValueType' in response_body: + code_value_type_temp = CodeValueType.value_of(response_body['codeValueType']) self.__code_value_type = code_value_type_temp - if "codeValue" in response_body: - self.__code_value = response_body["codeValue"] - if "displayType" in response_body: - display_type_temp = DisplayType.value_of(response_body["displayType"]) + if 'codeValue' in response_body: + self.__code_value = response_body['codeValue'] + if 'displayType' in response_body: + display_type_temp = DisplayType.value_of(response_body['displayType']) self.__display_type = display_type_temp diff --git a/com/alipay/ams/api/model/code_value_type.py b/com/alipay/ams/api/model/code_value_type.py index 0d27455..0567bfa 100644 --- a/com/alipay/ams/api/model/code_value_type.py +++ b/com/alipay/ams/api/model/code_value_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class CodeValueType(Enum): """CodeValueType枚举类""" diff --git a/com/alipay/ams/api/model/company.py b/com/alipay/ams/api/model/company.py index 6630b60..1ca5afb 100644 --- a/com/alipay/ams/api/model/company.py +++ b/com/alipay/ams/api/model/company.py @@ -9,9 +9,11 @@ from com.alipay.ams.api.model.contact import Contact + + class Company: def __init__(self): - + self.__legal_name = None # type: str self.__company_type = None # type: CompanyType self.__registered_address = None # type: Address @@ -23,45 +25,48 @@ def __init__(self): self.__company_unit = None # type: CompanyUnitType self.__contacts = None # type: [Contact] self.__vat_no = None # type: str + @property def legal_name(self): """ - The legal name of the company. More information: Maximum size: 256 elements + The legal name of the company. More information: Maximum size: 256 elements """ return self.__legal_name @legal_name.setter def legal_name(self, value): self.__legal_name = value - @property def company_type(self): - """Gets the company_type of this Company.""" + """Gets the company_type of this Company. + + """ return self.__company_type @company_type.setter def company_type(self, value): self.__company_type = value - @property def registered_address(self): - """Gets the registered_address of this Company.""" + """Gets the registered_address of this Company. + + """ return self.__registered_address @registered_address.setter def registered_address(self, value): self.__registered_address = value - @property def operating_address(self): - """Gets the operating_address of this Company.""" + """Gets the operating_address of this Company. + + """ return self.__operating_address @operating_address.setter def operating_address(self, value): self.__operating_address = value - @property def incorporation_date(self): """ @@ -72,25 +77,26 @@ def incorporation_date(self): @incorporation_date.setter def incorporation_date(self, value): self.__incorporation_date = value - @property def stock_info(self): - """Gets the stock_info of this Company.""" + """Gets the stock_info of this Company. + + """ return self.__stock_info @stock_info.setter def stock_info(self, value): self.__stock_info = value - @property def certificates(self): - """Gets the certificates of this Company.""" + """Gets the certificates of this Company. + + """ return self.__certificates @certificates.setter def certificates(self, value): self.__certificates = value - @property def attachments(self): """ @@ -101,31 +107,30 @@ def attachments(self): @attachments.setter def attachments(self, value): self.__attachments = value - @property def company_unit(self): - """Gets the company_unit of this Company.""" + """Gets the company_unit of this Company. + + """ return self.__company_unit @company_unit.setter def company_unit(self, value): self.__company_unit = value - @property def contacts(self): """ - A list of contact information. Specify this parameter when the value of merchantInfo.company.registeredAddress.region is JP. + A list of contact information. Specify this parameter when the value of merchantInfo.company.registeredAddress.region is JP. """ return self.__contacts @contacts.setter def contacts(self, value): self.__contacts = value - @property def vat_no(self): """ - The Value Added Tax (VAT) number of the company. Specify this parameter when the value of merchantInfo.company.registeredAddress.region is GB or the company's registered region belongs to the European Union. More information: Maximum length: 64 characters + The Value Added Tax (VAT) number of the company. Specify this parameter when the value of merchantInfo.company.registeredAddress.region is GB or the company's registered region belongs to the European Union. More information: Maximum length: 64 characters """ return self.__vat_no @@ -133,68 +138,72 @@ def vat_no(self): def vat_no(self, value): self.__vat_no = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "legal_name") and self.legal_name is not None: - params["legalName"] = self.legal_name + params['legalName'] = self.legal_name if hasattr(self, "company_type") and self.company_type is not None: - params["companyType"] = self.company_type + params['companyType'] = self.company_type if hasattr(self, "registered_address") and self.registered_address is not None: - params["registeredAddress"] = self.registered_address + params['registeredAddress'] = self.registered_address if hasattr(self, "operating_address") and self.operating_address is not None: - params["operatingAddress"] = self.operating_address + params['operatingAddress'] = self.operating_address if hasattr(self, "incorporation_date") and self.incorporation_date is not None: - params["incorporationDate"] = self.incorporation_date + params['incorporationDate'] = self.incorporation_date if hasattr(self, "stock_info") and self.stock_info is not None: - params["stockInfo"] = self.stock_info + params['stockInfo'] = self.stock_info if hasattr(self, "certificates") and self.certificates is not None: - params["certificates"] = self.certificates + params['certificates'] = self.certificates if hasattr(self, "attachments") and self.attachments is not None: - params["attachments"] = self.attachments + params['attachments'] = self.attachments if hasattr(self, "company_unit") and self.company_unit is not None: - params["companyUnit"] = self.company_unit + params['companyUnit'] = self.company_unit if hasattr(self, "contacts") and self.contacts is not None: - params["contacts"] = self.contacts + params['contacts'] = self.contacts if hasattr(self, "vat_no") and self.vat_no is not None: - params["vatNo"] = self.vat_no + params['vatNo'] = self.vat_no return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "legalName" in response_body: - self.__legal_name = response_body["legalName"] - if "companyType" in response_body: - company_type_temp = CompanyType.value_of(response_body["companyType"]) + if 'legalName' in response_body: + self.__legal_name = response_body['legalName'] + if 'companyType' in response_body: + company_type_temp = CompanyType.value_of(response_body['companyType']) self.__company_type = company_type_temp - if "registeredAddress" in response_body: + if 'registeredAddress' in response_body: self.__registered_address = Address() - self.__registered_address.parse_rsp_body(response_body["registeredAddress"]) - if "operatingAddress" in response_body: + self.__registered_address.parse_rsp_body(response_body['registeredAddress']) + if 'operatingAddress' in response_body: self.__operating_address = Address() - self.__operating_address.parse_rsp_body(response_body["operatingAddress"]) - if "incorporationDate" in response_body: - self.__incorporation_date = response_body["incorporationDate"] - if "stockInfo" in response_body: + self.__operating_address.parse_rsp_body(response_body['operatingAddress']) + if 'incorporationDate' in response_body: + self.__incorporation_date = response_body['incorporationDate'] + if 'stockInfo' in response_body: self.__stock_info = StockInfo() - self.__stock_info.parse_rsp_body(response_body["stockInfo"]) - if "certificates" in response_body: + self.__stock_info.parse_rsp_body(response_body['stockInfo']) + if 'certificates' in response_body: self.__certificates = Certificate() - self.__certificates.parse_rsp_body(response_body["certificates"]) - if "attachments" in response_body: + self.__certificates.parse_rsp_body(response_body['certificates']) + if 'attachments' in response_body: self.__attachments = [] - for item in response_body["attachments"]: + for item in response_body['attachments']: obj = Attachment() obj.parse_rsp_body(item) self.__attachments.append(obj) - if "companyUnit" in response_body: - company_unit_temp = CompanyUnitType.value_of(response_body["companyUnit"]) + if 'companyUnit' in response_body: + company_unit_temp = CompanyUnitType.value_of(response_body['companyUnit']) self.__company_unit = company_unit_temp - if "contacts" in response_body: + if 'contacts' in response_body: self.__contacts = [] - for item in response_body["contacts"]: + for item in response_body['contacts']: obj = Contact() obj.parse_rsp_body(item) self.__contacts.append(obj) - if "vatNo" in response_body: - self.__vat_no = response_body["vatNo"] + if 'vatNo' in response_body: + self.__vat_no = response_body['vatNo'] diff --git a/com/alipay/ams/api/model/company_type.py b/com/alipay/ams/api/model/company_type.py index 98dc07c..dbda004 100644 --- a/com/alipay/ams/api/model/company_type.py +++ b/com/alipay/ams/api/model/company_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class CompanyType(Enum): """CompanyType枚举类""" diff --git a/com/alipay/ams/api/model/company_unit_type.py b/com/alipay/ams/api/model/company_unit_type.py index 180f673..b9aecb5 100644 --- a/com/alipay/ams/api/model/company_unit_type.py +++ b/com/alipay/ams/api/model/company_unit_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class CompanyUnitType(Enum): """CompanyUnitType枚举类""" diff --git a/com/alipay/ams/api/model/contact.py b/com/alipay/ams/api/model/contact.py index e091726..5b88678 100644 --- a/com/alipay/ams/api/model/contact.py +++ b/com/alipay/ams/api/model/contact.py @@ -2,24 +2,28 @@ from com.alipay.ams.api.model.contact_type import ContactType + + class Contact: def __init__(self): - + self.__type = None # type: ContactType self.__info = None # type: str self.__home = None # type: str self.__work = None # type: str self.__mobile = None # type: str + @property def type(self): - """Gets the type of this Contact.""" + """Gets the type of this Contact. + + """ return self.__type @type.setter def type(self, value): self.__type = value - @property def info(self): """ @@ -30,59 +34,66 @@ def info(self): @info.setter def info(self, value): self.__info = value - @property def home(self): - """Gets the home of this Contact.""" + """Gets the home of this Contact. + + """ return self.__home @home.setter def home(self, value): self.__home = value - @property def work(self): - """Gets the work of this Contact.""" + """Gets the work of this Contact. + + """ return self.__work @work.setter def work(self, value): self.__work = value - @property def mobile(self): - """Gets the mobile of this Contact.""" + """Gets the mobile of this Contact. + + """ return self.__mobile @mobile.setter def mobile(self, value): self.__mobile = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "type") and self.type is not None: - params["type"] = self.type + params['type'] = self.type if hasattr(self, "info") and self.info is not None: - params["info"] = self.info + params['info'] = self.info if hasattr(self, "home") and self.home is not None: - params["home"] = self.home + params['home'] = self.home if hasattr(self, "work") and self.work is not None: - params["work"] = self.work + params['work'] = self.work if hasattr(self, "mobile") and self.mobile is not None: - params["mobile"] = self.mobile + params['mobile'] = self.mobile return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "type" in response_body: - type_temp = ContactType.value_of(response_body["type"]) + if 'type' in response_body: + type_temp = ContactType.value_of(response_body['type']) self.__type = type_temp - if "info" in response_body: - self.__info = response_body["info"] - if "home" in response_body: - self.__home = response_body["home"] - if "work" in response_body: - self.__work = response_body["work"] - if "mobile" in response_body: - self.__mobile = response_body["mobile"] + if 'info' in response_body: + self.__info = response_body['info'] + if 'home' in response_body: + self.__home = response_body['home'] + if 'work' in response_body: + self.__work = response_body['work'] + if 'mobile' in response_body: + self.__mobile = response_body['mobile'] diff --git a/com/alipay/ams/api/model/contact_type.py b/com/alipay/ams/api/model/contact_type.py index b705c1c..aa873a0 100644 --- a/com/alipay/ams/api/model/contact_type.py +++ b/com/alipay/ams/api/model/contact_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class ContactType(Enum): """ContactType枚举类""" diff --git a/com/alipay/ams/api/model/coupon_payment_method_detail.py b/com/alipay/ams/api/model/coupon_payment_method_detail.py index 514ff95..fe4536a 100644 --- a/com/alipay/ams/api/model/coupon_payment_method_detail.py +++ b/com/alipay/ams/api/model/coupon_payment_method_detail.py @@ -2,104 +2,113 @@ from com.alipay.ams.api.model.amount import Amount + + class CouponPaymentMethodDetail: def __init__(self): - + self.__coupon_id = None # type: str self.__available_amount = None # type: Amount self.__coupon_name = None # type: str self.__coupon_description = None # type: str self.__coupon_expire_time = None # type: str self.__payment_method_detail_metadata = None # type: str + @property def coupon_id(self): - """Gets the coupon_id of this CouponPaymentMethodDetail.""" + """Gets the coupon_id of this CouponPaymentMethodDetail. + + """ return self.__coupon_id @coupon_id.setter def coupon_id(self, value): self.__coupon_id = value - @property def available_amount(self): - """Gets the available_amount of this CouponPaymentMethodDetail.""" + """Gets the available_amount of this CouponPaymentMethodDetail. + + """ return self.__available_amount @available_amount.setter def available_amount(self, value): self.__available_amount = value - @property def coupon_name(self): - """Gets the coupon_name of this CouponPaymentMethodDetail.""" + """Gets the coupon_name of this CouponPaymentMethodDetail. + + """ return self.__coupon_name @coupon_name.setter def coupon_name(self, value): self.__coupon_name = value - @property def coupon_description(self): - """Gets the coupon_description of this CouponPaymentMethodDetail.""" + """Gets the coupon_description of this CouponPaymentMethodDetail. + + """ return self.__coupon_description @coupon_description.setter def coupon_description(self, value): self.__coupon_description = value - @property def coupon_expire_time(self): - """Gets the coupon_expire_time of this CouponPaymentMethodDetail.""" + """Gets the coupon_expire_time of this CouponPaymentMethodDetail. + + """ return self.__coupon_expire_time @coupon_expire_time.setter def coupon_expire_time(self, value): self.__coupon_expire_time = value - @property def payment_method_detail_metadata(self): - """Gets the payment_method_detail_metadata of this CouponPaymentMethodDetail.""" + """Gets the payment_method_detail_metadata of this CouponPaymentMethodDetail. + + """ return self.__payment_method_detail_metadata @payment_method_detail_metadata.setter def payment_method_detail_metadata(self, value): self.__payment_method_detail_metadata = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "coupon_id") and self.coupon_id is not None: - params["couponId"] = self.coupon_id + params['couponId'] = self.coupon_id if hasattr(self, "available_amount") and self.available_amount is not None: - params["availableAmount"] = self.available_amount + params['availableAmount'] = self.available_amount if hasattr(self, "coupon_name") and self.coupon_name is not None: - params["couponName"] = self.coupon_name + params['couponName'] = self.coupon_name if hasattr(self, "coupon_description") and self.coupon_description is not None: - params["couponDescription"] = self.coupon_description + params['couponDescription'] = self.coupon_description if hasattr(self, "coupon_expire_time") and self.coupon_expire_time is not None: - params["couponExpireTime"] = self.coupon_expire_time - if ( - hasattr(self, "payment_method_detail_metadata") - and self.payment_method_detail_metadata is not None - ): - params["paymentMethodDetailMetadata"] = self.payment_method_detail_metadata + params['couponExpireTime'] = self.coupon_expire_time + if hasattr(self, "payment_method_detail_metadata") and self.payment_method_detail_metadata is not None: + params['paymentMethodDetailMetadata'] = self.payment_method_detail_metadata return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "couponId" in response_body: - self.__coupon_id = response_body["couponId"] - if "availableAmount" in response_body: + if 'couponId' in response_body: + self.__coupon_id = response_body['couponId'] + if 'availableAmount' in response_body: self.__available_amount = Amount() - self.__available_amount.parse_rsp_body(response_body["availableAmount"]) - if "couponName" in response_body: - self.__coupon_name = response_body["couponName"] - if "couponDescription" in response_body: - self.__coupon_description = response_body["couponDescription"] - if "couponExpireTime" in response_body: - self.__coupon_expire_time = response_body["couponExpireTime"] - if "paymentMethodDetailMetadata" in response_body: - self.__payment_method_detail_metadata = response_body[ - "paymentMethodDetailMetadata" - ] + self.__available_amount.parse_rsp_body(response_body['availableAmount']) + if 'couponName' in response_body: + self.__coupon_name = response_body['couponName'] + if 'couponDescription' in response_body: + self.__coupon_description = response_body['couponDescription'] + if 'couponExpireTime' in response_body: + self.__coupon_expire_time = response_body['couponExpireTime'] + if 'paymentMethodDetailMetadata' in response_body: + self.__payment_method_detail_metadata = response_body['paymentMethodDetailMetadata'] diff --git a/com/alipay/ams/api/model/credit_pay_fee_type.py b/com/alipay/ams/api/model/credit_pay_fee_type.py index 8e36f6e..1d6d522 100644 --- a/com/alipay/ams/api/model/credit_pay_fee_type.py +++ b/com/alipay/ams/api/model/credit_pay_fee_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class CreditPayFeeType(Enum): """CreditPayFeeType枚举类""" diff --git a/com/alipay/ams/api/model/credit_pay_plan.py b/com/alipay/ams/api/model/credit_pay_plan.py index b0278c6..c08329b 100644 --- a/com/alipay/ams/api/model/credit_pay_plan.py +++ b/com/alipay/ams/api/model/credit_pay_plan.py @@ -2,76 +2,83 @@ from com.alipay.ams.api.model.credit_pay_fee_type import CreditPayFeeType + + class CreditPayPlan: def __init__(self): - + self.__installment_num = None # type: int self.__interval = None # type: str self.__credit_pay_fee_type = None # type: CreditPayFeeType self.__fee_percentage = None # type: int + @property def installment_num(self): - """Gets the installment_num of this CreditPayPlan.""" + """Gets the installment_num of this CreditPayPlan. + + """ return self.__installment_num @installment_num.setter def installment_num(self, value): self.__installment_num = value - @property def interval(self): - """Gets the interval of this CreditPayPlan.""" + """Gets the interval of this CreditPayPlan. + + """ return self.__interval @interval.setter def interval(self, value): self.__interval = value - @property def credit_pay_fee_type(self): - """Gets the credit_pay_fee_type of this CreditPayPlan.""" + """Gets the credit_pay_fee_type of this CreditPayPlan. + + """ return self.__credit_pay_fee_type @credit_pay_fee_type.setter def credit_pay_fee_type(self, value): self.__credit_pay_fee_type = value - @property def fee_percentage(self): - """Gets the fee_percentage of this CreditPayPlan.""" + """Gets the fee_percentage of this CreditPayPlan. + + """ return self.__fee_percentage @fee_percentage.setter def fee_percentage(self, value): self.__fee_percentage = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "installment_num") and self.installment_num is not None: - params["installmentNum"] = self.installment_num + params['installmentNum'] = self.installment_num if hasattr(self, "interval") and self.interval is not None: - params["interval"] = self.interval - if ( - hasattr(self, "credit_pay_fee_type") - and self.credit_pay_fee_type is not None - ): - params["creditPayFeeType"] = self.credit_pay_fee_type + params['interval'] = self.interval + if hasattr(self, "credit_pay_fee_type") and self.credit_pay_fee_type is not None: + params['creditPayFeeType'] = self.credit_pay_fee_type if hasattr(self, "fee_percentage") and self.fee_percentage is not None: - params["feePercentage"] = self.fee_percentage + params['feePercentage'] = self.fee_percentage return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "installmentNum" in response_body: - self.__installment_num = response_body["installmentNum"] - if "interval" in response_body: - self.__interval = response_body["interval"] - if "creditPayFeeType" in response_body: - credit_pay_fee_type_temp = CreditPayFeeType.value_of( - response_body["creditPayFeeType"] - ) + if 'installmentNum' in response_body: + self.__installment_num = response_body['installmentNum'] + if 'interval' in response_body: + self.__interval = response_body['interval'] + if 'creditPayFeeType' in response_body: + credit_pay_fee_type_temp = CreditPayFeeType.value_of(response_body['creditPayFeeType']) self.__credit_pay_fee_type = credit_pay_fee_type_temp - if "feePercentage" in response_body: - self.__fee_percentage = response_body["feePercentage"] + if 'feePercentage' in response_body: + self.__fee_percentage = response_body['feePercentage'] diff --git a/com/alipay/ams/api/model/currency_pair.py b/com/alipay/ams/api/model/currency_pair.py index 7b83312..42676db 100644 --- a/com/alipay/ams/api/model/currency_pair.py +++ b/com/alipay/ams/api/model/currency_pair.py @@ -1,42 +1,52 @@ import json + + class CurrencyPair: def __init__(self): - + self.__sell_currency = None # type: str self.__buy_currency = None # type: str + @property def sell_currency(self): - """Gets the sell_currency of this CurrencyPair.""" + """Gets the sell_currency of this CurrencyPair. + + """ return self.__sell_currency @sell_currency.setter def sell_currency(self, value): self.__sell_currency = value - @property def buy_currency(self): - """Gets the buy_currency of this CurrencyPair.""" + """Gets the buy_currency of this CurrencyPair. + + """ return self.__buy_currency @buy_currency.setter def buy_currency(self, value): self.__buy_currency = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "sell_currency") and self.sell_currency is not None: - params["sellCurrency"] = self.sell_currency + params['sellCurrency'] = self.sell_currency if hasattr(self, "buy_currency") and self.buy_currency is not None: - params["buyCurrency"] = self.buy_currency + params['buyCurrency'] = self.buy_currency return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "sellCurrency" in response_body: - self.__sell_currency = response_body["sellCurrency"] - if "buyCurrency" in response_body: - self.__buy_currency = response_body["buyCurrency"] + if 'sellCurrency' in response_body: + self.__sell_currency = response_body['sellCurrency'] + if 'buyCurrency' in response_body: + self.__buy_currency = response_body['buyCurrency'] diff --git a/com/alipay/ams/api/model/customer_belongs_to.py b/com/alipay/ams/api/model/customer_belongs_to.py index a3b61f0..a761902 100644 --- a/com/alipay/ams/api/model/customer_belongs_to.py +++ b/com/alipay/ams/api/model/customer_belongs_to.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class CustomerBelongsTo(Enum): """CustomerBelongsTo枚举类""" diff --git a/com/alipay/ams/api/model/customized_info.py b/com/alipay/ams/api/model/customized_info.py index e477b3a..f1d8285 100644 --- a/com/alipay/ams/api/model/customized_info.py +++ b/com/alipay/ams/api/model/customized_info.py @@ -1,14 +1,17 @@ import json + + class CustomizedInfo: def __init__(self): - + self.__customized_field1 = None # type: str self.__customized_field2 = None # type: str self.__customized_field3 = None # type: str self.__customized_field4 = None # type: str self.__customized_field5 = None # type: str + @property def customized_field1(self): @@ -20,7 +23,6 @@ def customized_field1(self): @customized_field1.setter def customized_field1(self, value): self.__customized_field1 = value - @property def customized_field2(self): """ @@ -31,7 +33,6 @@ def customized_field2(self): @customized_field2.setter def customized_field2(self, value): self.__customized_field2 = value - @property def customized_field3(self): """ @@ -42,7 +43,6 @@ def customized_field3(self): @customized_field3.setter def customized_field3(self, value): self.__customized_field3 = value - @property def customized_field4(self): """ @@ -53,7 +53,6 @@ def customized_field4(self): @customized_field4.setter def customized_field4(self, value): self.__customized_field4 = value - @property def customized_field5(self): """ @@ -65,30 +64,34 @@ def customized_field5(self): def customized_field5(self, value): self.__customized_field5 = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "customized_field1") and self.customized_field1 is not None: - params["customizedField1"] = self.customized_field1 + params['customizedField1'] = self.customized_field1 if hasattr(self, "customized_field2") and self.customized_field2 is not None: - params["customizedField2"] = self.customized_field2 + params['customizedField2'] = self.customized_field2 if hasattr(self, "customized_field3") and self.customized_field3 is not None: - params["customizedField3"] = self.customized_field3 + params['customizedField3'] = self.customized_field3 if hasattr(self, "customized_field4") and self.customized_field4 is not None: - params["customizedField4"] = self.customized_field4 + params['customizedField4'] = self.customized_field4 if hasattr(self, "customized_field5") and self.customized_field5 is not None: - params["customizedField5"] = self.customized_field5 + params['customizedField5'] = self.customized_field5 return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "customizedField1" in response_body: - self.__customized_field1 = response_body["customizedField1"] - if "customizedField2" in response_body: - self.__customized_field2 = response_body["customizedField2"] - if "customizedField3" in response_body: - self.__customized_field3 = response_body["customizedField3"] - if "customizedField4" in response_body: - self.__customized_field4 = response_body["customizedField4"] - if "customizedField5" in response_body: - self.__customized_field5 = response_body["customizedField5"] + if 'customizedField1' in response_body: + self.__customized_field1 = response_body['customizedField1'] + if 'customizedField2' in response_body: + self.__customized_field2 = response_body['customizedField2'] + if 'customizedField3' in response_body: + self.__customized_field3 = response_body['customizedField3'] + if 'customizedField4' in response_body: + self.__customized_field4 = response_body['customizedField4'] + if 'customizedField5' in response_body: + self.__customized_field5 = response_body['customizedField5'] diff --git a/com/alipay/ams/api/model/declaration.py b/com/alipay/ams/api/model/declaration.py index 1188f6e..9f13c21 100644 --- a/com/alipay/ams/api/model/declaration.py +++ b/com/alipay/ams/api/model/declaration.py @@ -2,21 +2,25 @@ from com.alipay.ams.api.model.declaration_biz_scene_type import DeclarationBizSceneType + + class Declaration: def __init__(self): - + self.__declaration_biz_scene = None # type: DeclarationBizSceneType self.__declaration_beneficiary_id = None # type: str + @property def declaration_biz_scene(self): - """Gets the declaration_biz_scene of this Declaration.""" + """Gets the declaration_biz_scene of this Declaration. + + """ return self.__declaration_biz_scene @declaration_biz_scene.setter def declaration_biz_scene(self, value): self.__declaration_biz_scene = value - @property def declaration_beneficiary_id(self): """ @@ -28,29 +32,23 @@ def declaration_beneficiary_id(self): def declaration_beneficiary_id(self, value): self.__declaration_beneficiary_id = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "declaration_biz_scene") - and self.declaration_biz_scene is not None - ): - params["declarationBizScene"] = self.declaration_biz_scene - if ( - hasattr(self, "declaration_beneficiary_id") - and self.declaration_beneficiary_id is not None - ): - params["declarationBeneficiaryId"] = self.declaration_beneficiary_id + if hasattr(self, "declaration_biz_scene") and self.declaration_biz_scene is not None: + params['declarationBizScene'] = self.declaration_biz_scene + if hasattr(self, "declaration_beneficiary_id") and self.declaration_beneficiary_id is not None: + params['declarationBeneficiaryId'] = self.declaration_beneficiary_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "declarationBizScene" in response_body: - declaration_biz_scene_temp = DeclarationBizSceneType.value_of( - response_body["declarationBizScene"] - ) + if 'declarationBizScene' in response_body: + declaration_biz_scene_temp = DeclarationBizSceneType.value_of(response_body['declarationBizScene']) self.__declaration_biz_scene = declaration_biz_scene_temp - if "declarationBeneficiaryId" in response_body: - self.__declaration_beneficiary_id = response_body[ - "declarationBeneficiaryId" - ] + if 'declarationBeneficiaryId' in response_body: + self.__declaration_beneficiary_id = response_body['declarationBeneficiaryId'] diff --git a/com/alipay/ams/api/model/declaration_biz_scene_type.py b/com/alipay/ams/api/model/declaration_biz_scene_type.py index 12abc9d..c6eb140 100644 --- a/com/alipay/ams/api/model/declaration_biz_scene_type.py +++ b/com/alipay/ams/api/model/declaration_biz_scene_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class DeclarationBizSceneType(Enum): """申报时对应的行业分类。非OTA结汇场景不传,OTA场景必传,且与declarationBeneficiaryId需同时存在。""" diff --git a/com/alipay/ams/api/model/delivery_estimate.py b/com/alipay/ams/api/model/delivery_estimate.py index 70bc0a5..cc9785c 100644 --- a/com/alipay/ams/api/model/delivery_estimate.py +++ b/com/alipay/ams/api/model/delivery_estimate.py @@ -3,44 +3,54 @@ from com.alipay.ams.api.model.delivery_estimate_info import DeliveryEstimateInfo + + class DeliveryEstimate: def __init__(self): - + self.__minimum = None # type: DeliveryEstimateInfo self.__maximum = None # type: DeliveryEstimateInfo + @property def minimum(self): - """Gets the minimum of this DeliveryEstimate.""" + """Gets the minimum of this DeliveryEstimate. + + """ return self.__minimum @minimum.setter def minimum(self, value): self.__minimum = value - @property def maximum(self): - """Gets the maximum of this DeliveryEstimate.""" + """Gets the maximum of this DeliveryEstimate. + + """ return self.__maximum @maximum.setter def maximum(self, value): self.__maximum = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "minimum") and self.minimum is not None: - params["minimum"] = self.minimum + params['minimum'] = self.minimum if hasattr(self, "maximum") and self.maximum is not None: - params["maximum"] = self.maximum + params['maximum'] = self.maximum return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "minimum" in response_body: + if 'minimum' in response_body: self.__minimum = DeliveryEstimateInfo() - self.__minimum.parse_rsp_body(response_body["minimum"]) - if "maximum" in response_body: + self.__minimum.parse_rsp_body(response_body['minimum']) + if 'maximum' in response_body: self.__maximum = DeliveryEstimateInfo() - self.__maximum.parse_rsp_body(response_body["maximum"]) + self.__maximum.parse_rsp_body(response_body['maximum']) diff --git a/com/alipay/ams/api/model/delivery_estimate_info.py b/com/alipay/ams/api/model/delivery_estimate_info.py index 77559fe..a666200 100644 --- a/com/alipay/ams/api/model/delivery_estimate_info.py +++ b/com/alipay/ams/api/model/delivery_estimate_info.py @@ -1,23 +1,25 @@ import json + + class DeliveryEstimateInfo: def __init__(self): - + self.__unit = None # type: str self.__value = None # type: int + @property def unit(self): """ - Units for the longest shipping time of logistics services. The valid values include: YEAR: Indicates that the shortest shipping time unit for logistics services is in years. MONTH: Indicates that the shortest shipping time unit for logistics services is in months. DAY: Indicates that the shortest shipping time unit for logistics services is in days. HOUR: Indicates that the shortest shipping time unit for logistics services is in hours. MINUTE: Indicates that the shortest shipping time unit for logistics services is in minutes. SECOND: Indicates that the shortest shipping time unit for logistics services is in seconds. More information: Maximum length: 16 characters + Units for the longest shipping time of logistics services. The valid values include: YEAR: Indicates that the shortest shipping time unit for logistics services is in years. MONTH: Indicates that the shortest shipping time unit for logistics services is in months. DAY: Indicates that the shortest shipping time unit for logistics services is in days. HOUR: Indicates that the shortest shipping time unit for logistics services is in hours. MINUTE: Indicates that the shortest shipping time unit for logistics services is in minutes. SECOND: Indicates that the shortest shipping time unit for logistics services is in seconds. More information: Maximum length: 16 characters """ return self.__unit @unit.setter def unit(self, value): self.__unit = value - @property def value(self): """ @@ -29,18 +31,22 @@ def value(self): def value(self, value): self.__value = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "unit") and self.unit is not None: - params["unit"] = self.unit + params['unit'] = self.unit if hasattr(self, "value") and self.value is not None: - params["value"] = self.value + params['value'] = self.value return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "unit" in response_body: - self.__unit = response_body["unit"] - if "value" in response_body: - self.__value = response_body["value"] + if 'unit' in response_body: + self.__unit = response_body['unit'] + if 'value' in response_body: + self.__value = response_body['value'] diff --git a/com/alipay/ams/api/model/discount.py b/com/alipay/ams/api/model/discount.py index 4ddab88..76a0223 100644 --- a/com/alipay/ams/api/model/discount.py +++ b/com/alipay/ams/api/model/discount.py @@ -3,23 +3,27 @@ from com.alipay.ams.api.model.amount import Amount + + class Discount: def __init__(self): - + self.__discount_tag = None # type: str self.__discount_name = None # type: str self.__savings_amount = None # type: Amount self.__estimate_savings_amount = None # type: Amount + @property def discount_tag(self): - """Gets the discount_tag of this Discount.""" + """Gets the discount_tag of this Discount. + + """ return self.__discount_tag @discount_tag.setter def discount_tag(self, value): self.__discount_tag = value - @property def discount_name(self): """ @@ -30,52 +34,53 @@ def discount_name(self): @discount_name.setter def discount_name(self, value): self.__discount_name = value - @property def savings_amount(self): - """Gets the savings_amount of this Discount.""" + """Gets the savings_amount of this Discount. + + """ return self.__savings_amount @savings_amount.setter def savings_amount(self, value): self.__savings_amount = value - @property def estimate_savings_amount(self): - """Gets the estimate_savings_amount of this Discount.""" + """Gets the estimate_savings_amount of this Discount. + + """ return self.__estimate_savings_amount @estimate_savings_amount.setter def estimate_savings_amount(self, value): self.__estimate_savings_amount = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "discount_tag") and self.discount_tag is not None: - params["discountTag"] = self.discount_tag + params['discountTag'] = self.discount_tag if hasattr(self, "discount_name") and self.discount_name is not None: - params["discountName"] = self.discount_name + params['discountName'] = self.discount_name if hasattr(self, "savings_amount") and self.savings_amount is not None: - params["savingsAmount"] = self.savings_amount - if ( - hasattr(self, "estimate_savings_amount") - and self.estimate_savings_amount is not None - ): - params["estimateSavingsAmount"] = self.estimate_savings_amount + params['savingsAmount'] = self.savings_amount + if hasattr(self, "estimate_savings_amount") and self.estimate_savings_amount is not None: + params['estimateSavingsAmount'] = self.estimate_savings_amount return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "discountTag" in response_body: - self.__discount_tag = response_body["discountTag"] - if "discountName" in response_body: - self.__discount_name = response_body["discountName"] - if "savingsAmount" in response_body: + if 'discountTag' in response_body: + self.__discount_tag = response_body['discountTag'] + if 'discountName' in response_body: + self.__discount_name = response_body['discountName'] + if 'savingsAmount' in response_body: self.__savings_amount = Amount() - self.__savings_amount.parse_rsp_body(response_body["savingsAmount"]) - if "estimateSavingsAmount" in response_body: + self.__savings_amount.parse_rsp_body(response_body['savingsAmount']) + if 'estimateSavingsAmount' in response_body: self.__estimate_savings_amount = Amount() - self.__estimate_savings_amount.parse_rsp_body( - response_body["estimateSavingsAmount"] - ) + self.__estimate_savings_amount.parse_rsp_body(response_body['estimateSavingsAmount']) diff --git a/com/alipay/ams/api/model/discount_payment_method_detail.py b/com/alipay/ams/api/model/discount_payment_method_detail.py index 4b8c69d..f2ee819 100644 --- a/com/alipay/ams/api/model/discount_payment_method_detail.py +++ b/com/alipay/ams/api/model/discount_payment_method_detail.py @@ -2,93 +2,98 @@ from com.alipay.ams.api.model.amount import Amount + + class DiscountPaymentMethodDetail: def __init__(self): - + self.__discount_id = None # type: str self.__available_amount = None # type: Amount self.__discount_name = None # type: str self.__discount_description = None # type: str self.__payment_method_detail_metadata = None # type: str + @property def discount_id(self): - """Gets the discount_id of this DiscountPaymentMethodDetail.""" + """Gets the discount_id of this DiscountPaymentMethodDetail. + + """ return self.__discount_id @discount_id.setter def discount_id(self, value): self.__discount_id = value - @property def available_amount(self): - """Gets the available_amount of this DiscountPaymentMethodDetail.""" + """Gets the available_amount of this DiscountPaymentMethodDetail. + + """ return self.__available_amount @available_amount.setter def available_amount(self, value): self.__available_amount = value - @property def discount_name(self): - """Gets the discount_name of this DiscountPaymentMethodDetail.""" + """Gets the discount_name of this DiscountPaymentMethodDetail. + + """ return self.__discount_name @discount_name.setter def discount_name(self, value): self.__discount_name = value - @property def discount_description(self): - """Gets the discount_description of this DiscountPaymentMethodDetail.""" + """Gets the discount_description of this DiscountPaymentMethodDetail. + + """ return self.__discount_description @discount_description.setter def discount_description(self, value): self.__discount_description = value - @property def payment_method_detail_metadata(self): - """Gets the payment_method_detail_metadata of this DiscountPaymentMethodDetail.""" + """Gets the payment_method_detail_metadata of this DiscountPaymentMethodDetail. + + """ return self.__payment_method_detail_metadata @payment_method_detail_metadata.setter def payment_method_detail_metadata(self, value): self.__payment_method_detail_metadata = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "discount_id") and self.discount_id is not None: - params["discountId"] = self.discount_id + params['discountId'] = self.discount_id if hasattr(self, "available_amount") and self.available_amount is not None: - params["availableAmount"] = self.available_amount + params['availableAmount'] = self.available_amount if hasattr(self, "discount_name") and self.discount_name is not None: - params["discountName"] = self.discount_name - if ( - hasattr(self, "discount_description") - and self.discount_description is not None - ): - params["discountDescription"] = self.discount_description - if ( - hasattr(self, "payment_method_detail_metadata") - and self.payment_method_detail_metadata is not None - ): - params["paymentMethodDetailMetadata"] = self.payment_method_detail_metadata + params['discountName'] = self.discount_name + if hasattr(self, "discount_description") and self.discount_description is not None: + params['discountDescription'] = self.discount_description + if hasattr(self, "payment_method_detail_metadata") and self.payment_method_detail_metadata is not None: + params['paymentMethodDetailMetadata'] = self.payment_method_detail_metadata return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "discountId" in response_body: - self.__discount_id = response_body["discountId"] - if "availableAmount" in response_body: + if 'discountId' in response_body: + self.__discount_id = response_body['discountId'] + if 'availableAmount' in response_body: self.__available_amount = Amount() - self.__available_amount.parse_rsp_body(response_body["availableAmount"]) - if "discountName" in response_body: - self.__discount_name = response_body["discountName"] - if "discountDescription" in response_body: - self.__discount_description = response_body["discountDescription"] - if "paymentMethodDetailMetadata" in response_body: - self.__payment_method_detail_metadata = response_body[ - "paymentMethodDetailMetadata" - ] + self.__available_amount.parse_rsp_body(response_body['availableAmount']) + if 'discountName' in response_body: + self.__discount_name = response_body['discountName'] + if 'discountDescription' in response_body: + self.__discount_description = response_body['discountDescription'] + if 'paymentMethodDetailMetadata' in response_body: + self.__payment_method_detail_metadata = response_body['paymentMethodDetailMetadata'] diff --git a/com/alipay/ams/api/model/display_type.py b/com/alipay/ams/api/model/display_type.py index a37a389..56828e8 100644 --- a/com/alipay/ams/api/model/display_type.py +++ b/com/alipay/ams/api/model/display_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class DisplayType(Enum): """DisplayType枚举类""" diff --git a/com/alipay/ams/api/model/dispute_evidence_format_type.py b/com/alipay/ams/api/model/dispute_evidence_format_type.py index fe86c32..592ad43 100644 --- a/com/alipay/ams/api/model/dispute_evidence_format_type.py +++ b/com/alipay/ams/api/model/dispute_evidence_format_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class DisputeEvidenceFormatType(Enum): """DisputeEvidenceFormatType枚举类""" diff --git a/com/alipay/ams/api/model/dispute_evidence_type.py b/com/alipay/ams/api/model/dispute_evidence_type.py index 9346cb2..33c5a69 100644 --- a/com/alipay/ams/api/model/dispute_evidence_type.py +++ b/com/alipay/ams/api/model/dispute_evidence_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class DisputeEvidenceType(Enum): """DisputeEvidenceType枚举类""" diff --git a/com/alipay/ams/api/model/entity_associations.py b/com/alipay/ams/api/model/entity_associations.py index 30b2d07..441d8ec 100644 --- a/com/alipay/ams/api/model/entity_associations.py +++ b/com/alipay/ams/api/model/entity_associations.py @@ -5,51 +5,58 @@ from com.alipay.ams.api.model.individual import Individual + + class EntityAssociations: def __init__(self): - + self.__association_type = None # type: AssociationType self.__legal_entity_type = None # type: LegalEntityType self.__company = None # type: Company self.__individual = None # type: Individual self.__shareholding_ratio = None # type: str + @property def association_type(self): - """Gets the association_type of this EntityAssociations.""" + """Gets the association_type of this EntityAssociations. + + """ return self.__association_type @association_type.setter def association_type(self, value): self.__association_type = value - @property def legal_entity_type(self): - """Gets the legal_entity_type of this EntityAssociations.""" + """Gets the legal_entity_type of this EntityAssociations. + + """ return self.__legal_entity_type @legal_entity_type.setter def legal_entity_type(self, value): self.__legal_entity_type = value - @property def company(self): - """Gets the company of this EntityAssociations.""" + """Gets the company of this EntityAssociations. + + """ return self.__company @company.setter def company(self, value): self.__company = value - @property def individual(self): - """Gets the individual of this EntityAssociations.""" + """Gets the individual of this EntityAssociations. + + """ return self.__individual @individual.setter def individual(self, value): self.__individual = value - @property def shareholding_ratio(self): """ @@ -61,38 +68,38 @@ def shareholding_ratio(self): def shareholding_ratio(self, value): self.__shareholding_ratio = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "association_type") and self.association_type is not None: - params["associationType"] = self.association_type + params['associationType'] = self.association_type if hasattr(self, "legal_entity_type") and self.legal_entity_type is not None: - params["legalEntityType"] = self.legal_entity_type + params['legalEntityType'] = self.legal_entity_type if hasattr(self, "company") and self.company is not None: - params["company"] = self.company + params['company'] = self.company if hasattr(self, "individual") and self.individual is not None: - params["individual"] = self.individual + params['individual'] = self.individual if hasattr(self, "shareholding_ratio") and self.shareholding_ratio is not None: - params["shareholdingRatio"] = self.shareholding_ratio + params['shareholdingRatio'] = self.shareholding_ratio return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "associationType" in response_body: - association_type_temp = AssociationType.value_of( - response_body["associationType"] - ) + if 'associationType' in response_body: + association_type_temp = AssociationType.value_of(response_body['associationType']) self.__association_type = association_type_temp - if "legalEntityType" in response_body: - legal_entity_type_temp = LegalEntityType.value_of( - response_body["legalEntityType"] - ) + if 'legalEntityType' in response_body: + legal_entity_type_temp = LegalEntityType.value_of(response_body['legalEntityType']) self.__legal_entity_type = legal_entity_type_temp - if "company" in response_body: + if 'company' in response_body: self.__company = Company() - self.__company.parse_rsp_body(response_body["company"]) - if "individual" in response_body: + self.__company.parse_rsp_body(response_body['company']) + if 'individual' in response_body: self.__individual = Individual() - self.__individual.parse_rsp_body(response_body["individual"]) - if "shareholdingRatio" in response_body: - self.__shareholding_ratio = response_body["shareholdingRatio"] + self.__individual.parse_rsp_body(response_body['individual']) + if 'shareholdingRatio' in response_body: + self.__shareholding_ratio = response_body['shareholdingRatio'] diff --git a/com/alipay/ams/api/model/env.py b/com/alipay/ams/api/model/env.py index c366e65..ed34874 100644 --- a/com/alipay/ams/api/model/env.py +++ b/com/alipay/ams/api/model/env.py @@ -4,9 +4,11 @@ from com.alipay.ams.api.model.browser_info import BrowserInfo + + class Env: def __init__(self): - + self.__terminal_type = None # type: TerminalType self.__os_type = None # type: OsType self.__user_agent = None # type: str @@ -26,34 +28,38 @@ def __init__(self): self.__device_language = None # type: str self.__device_id = None # type: str self.__os_version = None # type: str + @property def terminal_type(self): - """Gets the terminal_type of this Env.""" + """Gets the terminal_type of this Env. + + """ return self.__terminal_type @terminal_type.setter def terminal_type(self, value): self.__terminal_type = value - @property def os_type(self): - """Gets the os_type of this Env.""" + """Gets the os_type of this Env. + + """ return self.__os_type @os_type.setter def os_type(self, value): self.__os_type = value - @property def user_agent(self): - """Gets the user_agent of this Env.""" + """Gets the user_agent of this Env. + + """ return self.__user_agent @user_agent.setter def user_agent(self, value): self.__user_agent = value - @property def device_token_id(self): """ @@ -64,7 +70,6 @@ def device_token_id(self): @device_token_id.setter def device_token_id(self, value): self.__device_token_id = value - @property def client_ip(self): """ @@ -75,16 +80,16 @@ def client_ip(self): @client_ip.setter def client_ip(self, value): self.__client_ip = value - @property def cookie_id(self): - """Gets the cookie_id of this Env.""" + """Gets the cookie_id of this Env. + + """ return self.__cookie_id @cookie_id.setter def cookie_id(self, value): self.__cookie_id = value - @property def extend_info(self): """ @@ -95,34 +100,36 @@ def extend_info(self): @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def store_terminal_id(self): - """Gets the store_terminal_id of this Env.""" + """Gets the store_terminal_id of this Env. + + """ return self.__store_terminal_id @store_terminal_id.setter def store_terminal_id(self, value): self.__store_terminal_id = value - @property def store_terminal_request_time(self): - """Gets the store_terminal_request_time of this Env.""" + """Gets the store_terminal_request_time of this Env. + + """ return self.__store_terminal_request_time @store_terminal_request_time.setter def store_terminal_request_time(self, value): self.__store_terminal_request_time = value - @property def browser_info(self): - """Gets the browser_info of this Env.""" + """Gets the browser_info of this Env. + + """ return self.__browser_info @browser_info.setter def browser_info(self, value): self.__browser_info = value - @property def color_depth(self): """ @@ -133,7 +140,6 @@ def color_depth(self): @color_depth.setter def color_depth(self, value): self.__color_depth = value - @property def screen_height(self): """ @@ -144,7 +150,6 @@ def screen_height(self): @screen_height.setter def screen_height(self, value): self.__screen_height = value - @property def screen_width(self): """ @@ -155,7 +160,6 @@ def screen_width(self): @screen_width.setter def screen_width(self, value): self.__screen_width = value - @property def time_zone_offset(self): """ @@ -166,7 +170,6 @@ def time_zone_offset(self): @time_zone_offset.setter def time_zone_offset(self, value): self.__time_zone_offset = value - @property def device_brand(self): """ @@ -177,7 +180,6 @@ def device_brand(self): @device_brand.setter def device_brand(self, value): self.__device_brand = value - @property def device_model(self): """ @@ -188,7 +190,6 @@ def device_model(self): @device_model.setter def device_model(self, value): self.__device_model = value - @property def device_language(self): """ @@ -199,7 +200,6 @@ def device_language(self): @device_language.setter def device_language(self, value): self.__device_language = value - @property def device_id(self): """ @@ -210,7 +210,6 @@ def device_id(self): @device_id.setter def device_id(self, value): self.__device_id = value - @property def os_version(self): """ @@ -222,94 +221,93 @@ def os_version(self): def os_version(self, value): self.__os_version = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "terminal_type") and self.terminal_type is not None: - params["terminalType"] = self.terminal_type + params['terminalType'] = self.terminal_type if hasattr(self, "os_type") and self.os_type is not None: - params["osType"] = self.os_type + params['osType'] = self.os_type if hasattr(self, "user_agent") and self.user_agent is not None: - params["userAgent"] = self.user_agent + params['userAgent'] = self.user_agent if hasattr(self, "device_token_id") and self.device_token_id is not None: - params["deviceTokenId"] = self.device_token_id + params['deviceTokenId'] = self.device_token_id if hasattr(self, "client_ip") and self.client_ip is not None: - params["clientIp"] = self.client_ip + params['clientIp'] = self.client_ip if hasattr(self, "cookie_id") and self.cookie_id is not None: - params["cookieId"] = self.cookie_id + params['cookieId'] = self.cookie_id if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "store_terminal_id") and self.store_terminal_id is not None: - params["storeTerminalId"] = self.store_terminal_id - if ( - hasattr(self, "store_terminal_request_time") - and self.store_terminal_request_time is not None - ): - params["storeTerminalRequestTime"] = self.store_terminal_request_time + params['storeTerminalId'] = self.store_terminal_id + if hasattr(self, "store_terminal_request_time") and self.store_terminal_request_time is not None: + params['storeTerminalRequestTime'] = self.store_terminal_request_time if hasattr(self, "browser_info") and self.browser_info is not None: - params["browserInfo"] = self.browser_info + params['browserInfo'] = self.browser_info if hasattr(self, "color_depth") and self.color_depth is not None: - params["colorDepth"] = self.color_depth + params['colorDepth'] = self.color_depth if hasattr(self, "screen_height") and self.screen_height is not None: - params["screenHeight"] = self.screen_height + params['screenHeight'] = self.screen_height if hasattr(self, "screen_width") and self.screen_width is not None: - params["screenWidth"] = self.screen_width + params['screenWidth'] = self.screen_width if hasattr(self, "time_zone_offset") and self.time_zone_offset is not None: - params["timeZoneOffset"] = self.time_zone_offset + params['timeZoneOffset'] = self.time_zone_offset if hasattr(self, "device_brand") and self.device_brand is not None: - params["deviceBrand"] = self.device_brand + params['deviceBrand'] = self.device_brand if hasattr(self, "device_model") and self.device_model is not None: - params["deviceModel"] = self.device_model + params['deviceModel'] = self.device_model if hasattr(self, "device_language") and self.device_language is not None: - params["deviceLanguage"] = self.device_language + params['deviceLanguage'] = self.device_language if hasattr(self, "device_id") and self.device_id is not None: - params["deviceId"] = self.device_id + params['deviceId'] = self.device_id if hasattr(self, "os_version") and self.os_version is not None: - params["osVersion"] = self.os_version + params['osVersion'] = self.os_version return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "terminalType" in response_body: - terminal_type_temp = TerminalType.value_of(response_body["terminalType"]) + if 'terminalType' in response_body: + terminal_type_temp = TerminalType.value_of(response_body['terminalType']) self.__terminal_type = terminal_type_temp - if "osType" in response_body: - os_type_temp = OsType.value_of(response_body["osType"]) + if 'osType' in response_body: + os_type_temp = OsType.value_of(response_body['osType']) self.__os_type = os_type_temp - if "userAgent" in response_body: - self.__user_agent = response_body["userAgent"] - if "deviceTokenId" in response_body: - self.__device_token_id = response_body["deviceTokenId"] - if "clientIp" in response_body: - self.__client_ip = response_body["clientIp"] - if "cookieId" in response_body: - self.__cookie_id = response_body["cookieId"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "storeTerminalId" in response_body: - self.__store_terminal_id = response_body["storeTerminalId"] - if "storeTerminalRequestTime" in response_body: - self.__store_terminal_request_time = response_body[ - "storeTerminalRequestTime" - ] - if "browserInfo" in response_body: + if 'userAgent' in response_body: + self.__user_agent = response_body['userAgent'] + if 'deviceTokenId' in response_body: + self.__device_token_id = response_body['deviceTokenId'] + if 'clientIp' in response_body: + self.__client_ip = response_body['clientIp'] + if 'cookieId' in response_body: + self.__cookie_id = response_body['cookieId'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'storeTerminalId' in response_body: + self.__store_terminal_id = response_body['storeTerminalId'] + if 'storeTerminalRequestTime' in response_body: + self.__store_terminal_request_time = response_body['storeTerminalRequestTime'] + if 'browserInfo' in response_body: self.__browser_info = BrowserInfo() - self.__browser_info.parse_rsp_body(response_body["browserInfo"]) - if "colorDepth" in response_body: - self.__color_depth = response_body["colorDepth"] - if "screenHeight" in response_body: - self.__screen_height = response_body["screenHeight"] - if "screenWidth" in response_body: - self.__screen_width = response_body["screenWidth"] - if "timeZoneOffset" in response_body: - self.__time_zone_offset = response_body["timeZoneOffset"] - if "deviceBrand" in response_body: - self.__device_brand = response_body["deviceBrand"] - if "deviceModel" in response_body: - self.__device_model = response_body["deviceModel"] - if "deviceLanguage" in response_body: - self.__device_language = response_body["deviceLanguage"] - if "deviceId" in response_body: - self.__device_id = response_body["deviceId"] - if "osVersion" in response_body: - self.__os_version = response_body["osVersion"] + self.__browser_info.parse_rsp_body(response_body['browserInfo']) + if 'colorDepth' in response_body: + self.__color_depth = response_body['colorDepth'] + if 'screenHeight' in response_body: + self.__screen_height = response_body['screenHeight'] + if 'screenWidth' in response_body: + self.__screen_width = response_body['screenWidth'] + if 'timeZoneOffset' in response_body: + self.__time_zone_offset = response_body['timeZoneOffset'] + if 'deviceBrand' in response_body: + self.__device_brand = response_body['deviceBrand'] + if 'deviceModel' in response_body: + self.__device_model = response_body['deviceModel'] + if 'deviceLanguage' in response_body: + self.__device_language = response_body['deviceLanguage'] + if 'deviceId' in response_body: + self.__device_id = response_body['deviceId'] + if 'osVersion' in response_body: + self.__os_version = response_body['osVersion'] diff --git a/com/alipay/ams/api/model/external_payment_method_detail.py b/com/alipay/ams/api/model/external_payment_method_detail.py index dd54442..73187f6 100644 --- a/com/alipay/ams/api/model/external_payment_method_detail.py +++ b/com/alipay/ams/api/model/external_payment_method_detail.py @@ -1,78 +1,82 @@ import json + + class ExternalPaymentMethodDetail: def __init__(self): - + self.__asset_token = None # type: str self.__account_display_name = None # type: str self.__disable_reason = None # type: str self.__payment_method_detail_metadata = None # type: str + @property def asset_token(self): - """Gets the asset_token of this ExternalPaymentMethodDetail.""" + """Gets the asset_token of this ExternalPaymentMethodDetail. + + """ return self.__asset_token @asset_token.setter def asset_token(self, value): self.__asset_token = value - @property def account_display_name(self): - """Gets the account_display_name of this ExternalPaymentMethodDetail.""" + """Gets the account_display_name of this ExternalPaymentMethodDetail. + + """ return self.__account_display_name @account_display_name.setter def account_display_name(self, value): self.__account_display_name = value - @property def disable_reason(self): - """Gets the disable_reason of this ExternalPaymentMethodDetail.""" + """Gets the disable_reason of this ExternalPaymentMethodDetail. + + """ return self.__disable_reason @disable_reason.setter def disable_reason(self, value): self.__disable_reason = value - @property def payment_method_detail_metadata(self): - """Gets the payment_method_detail_metadata of this ExternalPaymentMethodDetail.""" + """Gets the payment_method_detail_metadata of this ExternalPaymentMethodDetail. + + """ return self.__payment_method_detail_metadata @payment_method_detail_metadata.setter def payment_method_detail_metadata(self, value): self.__payment_method_detail_metadata = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "asset_token") and self.asset_token is not None: - params["assetToken"] = self.asset_token - if ( - hasattr(self, "account_display_name") - and self.account_display_name is not None - ): - params["accountDisplayName"] = self.account_display_name + params['assetToken'] = self.asset_token + if hasattr(self, "account_display_name") and self.account_display_name is not None: + params['accountDisplayName'] = self.account_display_name if hasattr(self, "disable_reason") and self.disable_reason is not None: - params["disableReason"] = self.disable_reason - if ( - hasattr(self, "payment_method_detail_metadata") - and self.payment_method_detail_metadata is not None - ): - params["paymentMethodDetailMetadata"] = self.payment_method_detail_metadata + params['disableReason'] = self.disable_reason + if hasattr(self, "payment_method_detail_metadata") and self.payment_method_detail_metadata is not None: + params['paymentMethodDetailMetadata'] = self.payment_method_detail_metadata return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "assetToken" in response_body: - self.__asset_token = response_body["assetToken"] - if "accountDisplayName" in response_body: - self.__account_display_name = response_body["accountDisplayName"] - if "disableReason" in response_body: - self.__disable_reason = response_body["disableReason"] - if "paymentMethodDetailMetadata" in response_body: - self.__payment_method_detail_metadata = response_body[ - "paymentMethodDetailMetadata" - ] + if 'assetToken' in response_body: + self.__asset_token = response_body['assetToken'] + if 'accountDisplayName' in response_body: + self.__account_display_name = response_body['accountDisplayName'] + if 'disableReason' in response_body: + self.__disable_reason = response_body['disableReason'] + if 'paymentMethodDetailMetadata' in response_body: + self.__payment_method_detail_metadata = response_body['paymentMethodDetailMetadata'] diff --git a/com/alipay/ams/api/model/fund_move_detail.py b/com/alipay/ams/api/model/fund_move_detail.py index 2bfef74..1c5ca8f 100644 --- a/com/alipay/ams/api/model/fund_move_detail.py +++ b/com/alipay/ams/api/model/fund_move_detail.py @@ -1,45 +1,52 @@ import json + + class FundMoveDetail: def __init__(self): - + self.__memo = None # type: str self.__reference_transaction_id = None # type: str + @property def memo(self): - """Gets the memo of this FundMoveDetail.""" + """Gets the memo of this FundMoveDetail. + + """ return self.__memo @memo.setter def memo(self, value): self.__memo = value - @property def reference_transaction_id(self): - """Gets the reference_transaction_id of this FundMoveDetail.""" + """Gets the reference_transaction_id of this FundMoveDetail. + + """ return self.__reference_transaction_id @reference_transaction_id.setter def reference_transaction_id(self, value): self.__reference_transaction_id = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "memo") and self.memo is not None: - params["memo"] = self.memo - if ( - hasattr(self, "reference_transaction_id") - and self.reference_transaction_id is not None - ): - params["referenceTransactionId"] = self.reference_transaction_id + params['memo'] = self.memo + if hasattr(self, "reference_transaction_id") and self.reference_transaction_id is not None: + params['referenceTransactionId'] = self.reference_transaction_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "memo" in response_body: - self.__memo = response_body["memo"] - if "referenceTransactionId" in response_body: - self.__reference_transaction_id = response_body["referenceTransactionId"] + if 'memo' in response_body: + self.__memo = response_body['memo'] + if 'referenceTransactionId' in response_body: + self.__reference_transaction_id = response_body['referenceTransactionId'] diff --git a/com/alipay/ams/api/model/funding_type.py b/com/alipay/ams/api/model/funding_type.py index d8781eb..221d465 100644 --- a/com/alipay/ams/api/model/funding_type.py +++ b/com/alipay/ams/api/model/funding_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class FundingType(Enum): """The funding source type for the payment method""" diff --git a/com/alipay/ams/api/model/gaming.py b/com/alipay/ams/api/model/gaming.py index 0e06ef5..bf0efc3 100644 --- a/com/alipay/ams/api/model/gaming.py +++ b/com/alipay/ams/api/model/gaming.py @@ -1,13 +1,16 @@ import json + + class Gaming: def __init__(self): - + self.__game_name = None # type: str self.__topped_up_user = None # type: str self.__topped_up_email = None # type: str self.__topped_up_phone_no = None # type: str + @property def game_name(self): @@ -19,7 +22,6 @@ def game_name(self): @game_name.setter def game_name(self, value): self.__game_name = value - @property def topped_up_user(self): """ @@ -30,7 +32,6 @@ def topped_up_user(self): @topped_up_user.setter def topped_up_user(self, value): self.__topped_up_user = value - @property def topped_up_email(self): """ @@ -41,7 +42,6 @@ def topped_up_email(self): @topped_up_email.setter def topped_up_email(self, value): self.__topped_up_email = value - @property def topped_up_phone_no(self): """ @@ -53,26 +53,30 @@ def topped_up_phone_no(self): def topped_up_phone_no(self, value): self.__topped_up_phone_no = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "game_name") and self.game_name is not None: - params["gameName"] = self.game_name + params['gameName'] = self.game_name if hasattr(self, "topped_up_user") and self.topped_up_user is not None: - params["toppedUpUser"] = self.topped_up_user + params['toppedUpUser'] = self.topped_up_user if hasattr(self, "topped_up_email") and self.topped_up_email is not None: - params["toppedUpEmail"] = self.topped_up_email + params['toppedUpEmail'] = self.topped_up_email if hasattr(self, "topped_up_phone_no") and self.topped_up_phone_no is not None: - params["toppedUpPhoneNo"] = self.topped_up_phone_no + params['toppedUpPhoneNo'] = self.topped_up_phone_no return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "gameName" in response_body: - self.__game_name = response_body["gameName"] - if "toppedUpUser" in response_body: - self.__topped_up_user = response_body["toppedUpUser"] - if "toppedUpEmail" in response_body: - self.__topped_up_email = response_body["toppedUpEmail"] - if "toppedUpPhoneNo" in response_body: - self.__topped_up_phone_no = response_body["toppedUpPhoneNo"] + if 'gameName' in response_body: + self.__game_name = response_body['gameName'] + if 'toppedUpUser' in response_body: + self.__topped_up_user = response_body['toppedUpUser'] + if 'toppedUpEmail' in response_body: + self.__topped_up_email = response_body['toppedUpEmail'] + if 'toppedUpPhoneNo' in response_body: + self.__topped_up_phone_no = response_body['toppedUpPhoneNo'] diff --git a/com/alipay/ams/api/model/goods.py b/com/alipay/ams/api/model/goods.py index 5f85cb2..b987fe1 100644 --- a/com/alipay/ams/api/model/goods.py +++ b/com/alipay/ams/api/model/goods.py @@ -3,9 +3,11 @@ from com.alipay.ams.api.model.amount import Amount + + class Goods: def __init__(self): - + self.__reference_goods_id = None # type: str self.__goods_name = None # type: str self.__goods_category = None # type: str @@ -19,6 +21,7 @@ def __init__(self): self.__price_id = None # type: str self.__goods_discount_amount = None # type: Amount self.__cross_sell = None # type: Goods + @property def reference_goods_id(self): @@ -30,18 +33,16 @@ def reference_goods_id(self): @reference_goods_id.setter def reference_goods_id(self, value): self.__reference_goods_id = value - @property def goods_name(self): """ - Goods name. More information: Maximum length: 256 characters + Goods name. More information: Maximum length: 256 characters """ return self.__goods_name @goods_name.setter def goods_name(self, value): self.__goods_name = value - @property def goods_category(self): """ @@ -52,25 +53,26 @@ def goods_category(self): @goods_category.setter def goods_category(self, value): self.__goods_category = value - @property def goods_brand(self): - """Gets the goods_brand of this Goods.""" + """Gets the goods_brand of this Goods. + + """ return self.__goods_brand @goods_brand.setter def goods_brand(self, value): self.__goods_brand = value - @property def goods_unit_amount(self): - """Gets the goods_unit_amount of this Goods.""" + """Gets the goods_unit_amount of this Goods. + + """ return self.__goods_unit_amount @goods_unit_amount.setter def goods_unit_amount(self, value): self.__goods_unit_amount = value - @property def goods_quantity(self): """ @@ -81,16 +83,16 @@ def goods_quantity(self): @goods_quantity.setter def goods_quantity(self, value): self.__goods_quantity = value - @property def goods_sku_name(self): - """Gets the goods_sku_name of this Goods.""" + """Gets the goods_sku_name of this Goods. + + """ return self.__goods_sku_name @goods_sku_name.setter def goods_sku_name(self, value): self.__goods_sku_name = value - @property def goods_url(self): """ @@ -101,27 +103,26 @@ def goods_url(self): @goods_url.setter def goods_url(self, value): self.__goods_url = value - @property def delivery_method_type(self): """ - The delivery method of the goods. Valid values are: PHYSICAL: indicates that the delivery method is physical delivery. DIGITAL: indicates that the delivery method is digital delivery. Specify this parameter if you require risk control. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates. More information: Maximum length: 32 characters + The delivery method of the goods. Valid values are: PHYSICAL: indicates that the delivery method is physical delivery. DIGITAL: indicates that the delivery method is digital delivery. Specify this parameter if you require risk control. Providing this information helps to increase the accuracy of anti-money laundering and fraud detection, and increase payment success rates. More information: Maximum length: 32 characters """ return self.__delivery_method_type @delivery_method_type.setter def delivery_method_type(self, value): self.__delivery_method_type = value - @property def goods_image_url(self): - """Gets the goods_image_url of this Goods.""" + """Gets the goods_image_url of this Goods. + + """ return self.__goods_image_url @goods_image_url.setter def goods_image_url(self, value): self.__goods_image_url = value - @property def price_id(self): """ @@ -132,92 +133,90 @@ def price_id(self): @price_id.setter def price_id(self, value): self.__price_id = value - @property def goods_discount_amount(self): - """Gets the goods_discount_amount of this Goods.""" + """Gets the goods_discount_amount of this Goods. + + """ return self.__goods_discount_amount @goods_discount_amount.setter def goods_discount_amount(self, value): self.__goods_discount_amount = value - @property def cross_sell(self): - """Gets the cross_sell of this Goods.""" + """Gets the cross_sell of this Goods. + + """ return self.__cross_sell @cross_sell.setter def cross_sell(self, value): self.__cross_sell = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "reference_goods_id") and self.reference_goods_id is not None: - params["referenceGoodsId"] = self.reference_goods_id + params['referenceGoodsId'] = self.reference_goods_id if hasattr(self, "goods_name") and self.goods_name is not None: - params["goodsName"] = self.goods_name + params['goodsName'] = self.goods_name if hasattr(self, "goods_category") and self.goods_category is not None: - params["goodsCategory"] = self.goods_category + params['goodsCategory'] = self.goods_category if hasattr(self, "goods_brand") and self.goods_brand is not None: - params["goodsBrand"] = self.goods_brand + params['goodsBrand'] = self.goods_brand if hasattr(self, "goods_unit_amount") and self.goods_unit_amount is not None: - params["goodsUnitAmount"] = self.goods_unit_amount + params['goodsUnitAmount'] = self.goods_unit_amount if hasattr(self, "goods_quantity") and self.goods_quantity is not None: - params["goodsQuantity"] = self.goods_quantity + params['goodsQuantity'] = self.goods_quantity if hasattr(self, "goods_sku_name") and self.goods_sku_name is not None: - params["goodsSkuName"] = self.goods_sku_name + params['goodsSkuName'] = self.goods_sku_name if hasattr(self, "goods_url") and self.goods_url is not None: - params["goodsUrl"] = self.goods_url - if ( - hasattr(self, "delivery_method_type") - and self.delivery_method_type is not None - ): - params["deliveryMethodType"] = self.delivery_method_type + params['goodsUrl'] = self.goods_url + if hasattr(self, "delivery_method_type") and self.delivery_method_type is not None: + params['deliveryMethodType'] = self.delivery_method_type if hasattr(self, "goods_image_url") and self.goods_image_url is not None: - params["goodsImageUrl"] = self.goods_image_url + params['goodsImageUrl'] = self.goods_image_url if hasattr(self, "price_id") and self.price_id is not None: - params["priceId"] = self.price_id - if ( - hasattr(self, "goods_discount_amount") - and self.goods_discount_amount is not None - ): - params["goodsDiscountAmount"] = self.goods_discount_amount + params['priceId'] = self.price_id + if hasattr(self, "goods_discount_amount") and self.goods_discount_amount is not None: + params['goodsDiscountAmount'] = self.goods_discount_amount if hasattr(self, "cross_sell") and self.cross_sell is not None: - params["crossSell"] = self.cross_sell + params['crossSell'] = self.cross_sell return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "referenceGoodsId" in response_body: - self.__reference_goods_id = response_body["referenceGoodsId"] - if "goodsName" in response_body: - self.__goods_name = response_body["goodsName"] - if "goodsCategory" in response_body: - self.__goods_category = response_body["goodsCategory"] - if "goodsBrand" in response_body: - self.__goods_brand = response_body["goodsBrand"] - if "goodsUnitAmount" in response_body: + if 'referenceGoodsId' in response_body: + self.__reference_goods_id = response_body['referenceGoodsId'] + if 'goodsName' in response_body: + self.__goods_name = response_body['goodsName'] + if 'goodsCategory' in response_body: + self.__goods_category = response_body['goodsCategory'] + if 'goodsBrand' in response_body: + self.__goods_brand = response_body['goodsBrand'] + if 'goodsUnitAmount' in response_body: self.__goods_unit_amount = Amount() - self.__goods_unit_amount.parse_rsp_body(response_body["goodsUnitAmount"]) - if "goodsQuantity" in response_body: - self.__goods_quantity = response_body["goodsQuantity"] - if "goodsSkuName" in response_body: - self.__goods_sku_name = response_body["goodsSkuName"] - if "goodsUrl" in response_body: - self.__goods_url = response_body["goodsUrl"] - if "deliveryMethodType" in response_body: - self.__delivery_method_type = response_body["deliveryMethodType"] - if "goodsImageUrl" in response_body: - self.__goods_image_url = response_body["goodsImageUrl"] - if "priceId" in response_body: - self.__price_id = response_body["priceId"] - if "goodsDiscountAmount" in response_body: + self.__goods_unit_amount.parse_rsp_body(response_body['goodsUnitAmount']) + if 'goodsQuantity' in response_body: + self.__goods_quantity = response_body['goodsQuantity'] + if 'goodsSkuName' in response_body: + self.__goods_sku_name = response_body['goodsSkuName'] + if 'goodsUrl' in response_body: + self.__goods_url = response_body['goodsUrl'] + if 'deliveryMethodType' in response_body: + self.__delivery_method_type = response_body['deliveryMethodType'] + if 'goodsImageUrl' in response_body: + self.__goods_image_url = response_body['goodsImageUrl'] + if 'priceId' in response_body: + self.__price_id = response_body['priceId'] + if 'goodsDiscountAmount' in response_body: self.__goods_discount_amount = Amount() - self.__goods_discount_amount.parse_rsp_body( - response_body["goodsDiscountAmount"] - ) - if "crossSell" in response_body: + self.__goods_discount_amount.parse_rsp_body(response_body['goodsDiscountAmount']) + if 'crossSell' in response_body: self.__cross_sell = Goods() - self.__cross_sell.parse_rsp_body(response_body["crossSell"]) + self.__cross_sell.parse_rsp_body(response_body['crossSell']) diff --git a/com/alipay/ams/api/model/grant_type.py b/com/alipay/ams/api/model/grant_type.py index b519834..932a4b8 100644 --- a/com/alipay/ams/api/model/grant_type.py +++ b/com/alipay/ams/api/model/grant_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class GrantType(Enum): """GrantType枚举类""" diff --git a/com/alipay/ams/api/model/in_store_payment_scenario.py b/com/alipay/ams/api/model/in_store_payment_scenario.py index 2156f17..eb26d57 100644 --- a/com/alipay/ams/api/model/in_store_payment_scenario.py +++ b/com/alipay/ams/api/model/in_store_payment_scenario.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class InStorePaymentScenario(Enum): """InStorePaymentScenario枚举类""" diff --git a/com/alipay/ams/api/model/individual.py b/com/alipay/ams/api/model/individual.py index 7441eab..e2a4863 100644 --- a/com/alipay/ams/api/model/individual.py +++ b/com/alipay/ams/api/model/individual.py @@ -6,9 +6,11 @@ from com.alipay.ams.api.model.contact import Contact + + class Individual: def __init__(self): - + self.__name = None # type: UserName self.__english_name = None # type: UserName self.__date_of_birth = None # type: str @@ -16,54 +18,58 @@ def __init__(self): self.__certificates = None # type: Certificate self.__nationality = None # type: str self.__contacts = None # type: [Contact] + @property def name(self): - """Gets the name of this Individual.""" + """Gets the name of this Individual. + + """ return self.__name @name.setter def name(self, value): self.__name = value - @property def english_name(self): - """Gets the english_name of this Individual.""" + """Gets the english_name of this Individual. + + """ return self.__english_name @english_name.setter def english_name(self, value): self.__english_name = value - @property def date_of_birth(self): """ - The individual's date of birth. The information is used to verify the company's legal status and ensure the company complies with regulatory requirements. Specify this parameter when the value of merchantInfo.company.registeredAddress.region is BR. More information: Maximum length: 32 characters + The individual's date of birth. The information is used to verify the company's legal status and ensure the company complies with regulatory requirements. Specify this parameter when the value of merchantInfo.company.registeredAddress.region is BR. More information: Maximum length: 32 characters """ return self.__date_of_birth @date_of_birth.setter def date_of_birth(self, value): self.__date_of_birth = value - @property def place_of_birth(self): - """Gets the place_of_birth of this Individual.""" + """Gets the place_of_birth of this Individual. + + """ return self.__place_of_birth @place_of_birth.setter def place_of_birth(self, value): self.__place_of_birth = value - @property def certificates(self): - """Gets the certificates of this Individual.""" + """Gets the certificates of this Individual. + + """ return self.__certificates @certificates.setter def certificates(self, value): self.__certificates = value - @property def nationality(self): """ @@ -74,7 +80,6 @@ def nationality(self): @nationality.setter def nationality(self, value): self.__nationality = value - @property def contacts(self): """ @@ -86,46 +91,50 @@ def contacts(self): def contacts(self, value): self.__contacts = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "name") and self.name is not None: - params["name"] = self.name + params['name'] = self.name if hasattr(self, "english_name") and self.english_name is not None: - params["englishName"] = self.english_name + params['englishName'] = self.english_name if hasattr(self, "date_of_birth") and self.date_of_birth is not None: - params["dateOfBirth"] = self.date_of_birth + params['dateOfBirth'] = self.date_of_birth if hasattr(self, "place_of_birth") and self.place_of_birth is not None: - params["placeOfBirth"] = self.place_of_birth + params['placeOfBirth'] = self.place_of_birth if hasattr(self, "certificates") and self.certificates is not None: - params["certificates"] = self.certificates + params['certificates'] = self.certificates if hasattr(self, "nationality") and self.nationality is not None: - params["nationality"] = self.nationality + params['nationality'] = self.nationality if hasattr(self, "contacts") and self.contacts is not None: - params["contacts"] = self.contacts + params['contacts'] = self.contacts return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "name" in response_body: + if 'name' in response_body: self.__name = UserName() - self.__name.parse_rsp_body(response_body["name"]) - if "englishName" in response_body: + self.__name.parse_rsp_body(response_body['name']) + if 'englishName' in response_body: self.__english_name = UserName() - self.__english_name.parse_rsp_body(response_body["englishName"]) - if "dateOfBirth" in response_body: - self.__date_of_birth = response_body["dateOfBirth"] - if "placeOfBirth" in response_body: + self.__english_name.parse_rsp_body(response_body['englishName']) + if 'dateOfBirth' in response_body: + self.__date_of_birth = response_body['dateOfBirth'] + if 'placeOfBirth' in response_body: self.__place_of_birth = Address() - self.__place_of_birth.parse_rsp_body(response_body["placeOfBirth"]) - if "certificates" in response_body: + self.__place_of_birth.parse_rsp_body(response_body['placeOfBirth']) + if 'certificates' in response_body: self.__certificates = Certificate() - self.__certificates.parse_rsp_body(response_body["certificates"]) - if "nationality" in response_body: - self.__nationality = response_body["nationality"] - if "contacts" in response_body: + self.__certificates.parse_rsp_body(response_body['certificates']) + if 'nationality' in response_body: + self.__nationality = response_body['nationality'] + if 'contacts' in response_body: self.__contacts = [] - for item in response_body["contacts"]: + for item in response_body['contacts']: obj = Contact() obj.parse_rsp_body(item) self.__contacts.append(obj) diff --git a/com/alipay/ams/api/model/installment.py b/com/alipay/ams/api/model/installment.py index 5119dc0..0e2130b 100644 --- a/com/alipay/ams/api/model/installment.py +++ b/com/alipay/ams/api/model/installment.py @@ -3,27 +3,29 @@ from com.alipay.ams.api.model.plan import Plan + + class Installment: def __init__(self): - + self.__support_card_brands = None # type: [SupportCardBrand] self.__plans = None # type: [Plan] + @property def support_card_brands(self): """ - The list of card brands that support the installment plans. This parameter is returned when the value of paymentMethodType is CARD. + The list of card brands that support the installment plans. This parameter is returned when the value of paymentMethodType is CARD. """ return self.__support_card_brands @support_card_brands.setter def support_card_brands(self, value): self.__support_card_brands = value - @property def plans(self): """ - The list of installment plans for payment methods that support installments. + The list of installment plans for payment methods that support installments. """ return self.__plans @@ -31,29 +33,30 @@ def plans(self): def plans(self, value): self.__plans = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "support_card_brands") - and self.support_card_brands is not None - ): - params["supportCardBrands"] = self.support_card_brands + if hasattr(self, "support_card_brands") and self.support_card_brands is not None: + params['supportCardBrands'] = self.support_card_brands if hasattr(self, "plans") and self.plans is not None: - params["plans"] = self.plans + params['plans'] = self.plans return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "supportCardBrands" in response_body: + if 'supportCardBrands' in response_body: self.__support_card_brands = [] - for item in response_body["supportCardBrands"]: + for item in response_body['supportCardBrands']: obj = SupportCardBrand() obj.parse_rsp_body(item) self.__support_card_brands.append(obj) - if "plans" in response_body: + if 'plans' in response_body: self.__plans = [] - for item in response_body["plans"]: + for item in response_body['plans']: obj = Plan() obj.parse_rsp_body(item) self.__plans.append(obj) diff --git a/com/alipay/ams/api/model/interaction_type.py b/com/alipay/ams/api/model/interaction_type.py index bdae416..c0d701d 100644 --- a/com/alipay/ams/api/model/interaction_type.py +++ b/com/alipay/ams/api/model/interaction_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class InteractionType(Enum): """The interaction type for the payment method.""" diff --git a/com/alipay/ams/api/model/interest_free.py b/com/alipay/ams/api/model/interest_free.py index 3af09fd..d9744ba 100644 --- a/com/alipay/ams/api/model/interest_free.py +++ b/com/alipay/ams/api/model/interest_free.py @@ -3,15 +3,18 @@ from com.alipay.ams.api.model.amount import Amount + + class InterestFree: def __init__(self): - + self.__provider = None # type: str self.__expire_time = None # type: str self.__installment_free_nums = None # type: [int] self.__min_payment_amount = None # type: Amount self.__max_payment_amount = None # type: Amount self.__free_percentage = None # type: int + @property def provider(self): @@ -23,7 +26,6 @@ def provider(self): @provider.setter def provider(self, value): self.__provider = value - @property def expire_time(self): """ @@ -34,7 +36,6 @@ def expire_time(self): @expire_time.setter def expire_time(self, value): self.__expire_time = value - @property def installment_free_nums(self): """ @@ -45,25 +46,26 @@ def installment_free_nums(self): @installment_free_nums.setter def installment_free_nums(self, value): self.__installment_free_nums = value - @property def min_payment_amount(self): - """Gets the min_payment_amount of this InterestFree.""" + """Gets the min_payment_amount of this InterestFree. + + """ return self.__min_payment_amount @min_payment_amount.setter def min_payment_amount(self, value): self.__min_payment_amount = value - @property def max_payment_amount(self): - """Gets the max_payment_amount of this InterestFree.""" + """Gets the max_payment_amount of this InterestFree. + + """ return self.__max_payment_amount @max_payment_amount.setter def max_payment_amount(self, value): self.__max_payment_amount = value - @property def free_percentage(self): """ @@ -75,39 +77,40 @@ def free_percentage(self): def free_percentage(self, value): self.__free_percentage = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "provider") and self.provider is not None: - params["provider"] = self.provider + params['provider'] = self.provider if hasattr(self, "expire_time") and self.expire_time is not None: - params["expireTime"] = self.expire_time - if ( - hasattr(self, "installment_free_nums") - and self.installment_free_nums is not None - ): - params["installmentFreeNums"] = self.installment_free_nums + params['expireTime'] = self.expire_time + if hasattr(self, "installment_free_nums") and self.installment_free_nums is not None: + params['installmentFreeNums'] = self.installment_free_nums if hasattr(self, "min_payment_amount") and self.min_payment_amount is not None: - params["minPaymentAmount"] = self.min_payment_amount + params['minPaymentAmount'] = self.min_payment_amount if hasattr(self, "max_payment_amount") and self.max_payment_amount is not None: - params["maxPaymentAmount"] = self.max_payment_amount + params['maxPaymentAmount'] = self.max_payment_amount if hasattr(self, "free_percentage") and self.free_percentage is not None: - params["freePercentage"] = self.free_percentage + params['freePercentage'] = self.free_percentage return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "provider" in response_body: - self.__provider = response_body["provider"] - if "expireTime" in response_body: - self.__expire_time = response_body["expireTime"] - if "installmentFreeNums" in response_body: - self.__installment_free_nums = response_body["installmentFreeNums"] - if "minPaymentAmount" in response_body: + if 'provider' in response_body: + self.__provider = response_body['provider'] + if 'expireTime' in response_body: + self.__expire_time = response_body['expireTime'] + if 'installmentFreeNums' in response_body: + self.__installment_free_nums = response_body['installmentFreeNums'] + if 'minPaymentAmount' in response_body: self.__min_payment_amount = Amount() - self.__min_payment_amount.parse_rsp_body(response_body["minPaymentAmount"]) - if "maxPaymentAmount" in response_body: + self.__min_payment_amount.parse_rsp_body(response_body['minPaymentAmount']) + if 'maxPaymentAmount' in response_body: self.__max_payment_amount = Amount() - self.__max_payment_amount.parse_rsp_body(response_body["maxPaymentAmount"]) - if "freePercentage" in response_body: - self.__free_percentage = response_body["freePercentage"] + self.__max_payment_amount.parse_rsp_body(response_body['maxPaymentAmount']) + if 'freePercentage' in response_body: + self.__free_percentage = response_body['freePercentage'] diff --git a/com/alipay/ams/api/model/leg.py b/com/alipay/ams/api/model/leg.py index ee21179..2d76e72 100644 --- a/com/alipay/ams/api/model/leg.py +++ b/com/alipay/ams/api/model/leg.py @@ -4,9 +4,11 @@ from com.alipay.ams.api.model.class_type import ClassType + + class Leg: def __init__(self): - + self.__departure_time = None # type: str self.__arrival_time = None # type: str self.__departure_address = None # type: Address @@ -19,6 +21,7 @@ def __init__(self): self.__fare_basis = None # type: str self.__coupon_number = None # type: str self.__flight_number = None # type: str + @property def departure_time(self): @@ -30,36 +33,36 @@ def departure_time(self): @departure_time.setter def departure_time(self, value): self.__departure_time = value - @property def arrival_time(self): """ - Time of arrival for this leg of the trip. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + Time of arrival for this leg of the trip. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__arrival_time @arrival_time.setter def arrival_time(self, value): self.__arrival_time = value - @property def departure_address(self): - """Gets the departure_address of this Leg.""" + """Gets the departure_address of this Leg. + + """ return self.__departure_address @departure_address.setter def departure_address(self, value): self.__departure_address = value - @property def arrival_address(self): - """Gets the arrival_address of this Leg.""" + """Gets the arrival_address of this Leg. + + """ return self.__arrival_address @arrival_address.setter def arrival_address(self, value): self.__arrival_address = value - @property def carrier_name(self): """ @@ -70,7 +73,6 @@ def carrier_name(self): @carrier_name.setter def carrier_name(self, value): self.__carrier_name = value - @property def carrier_no(self): """ @@ -81,38 +83,36 @@ def carrier_no(self): @carrier_no.setter def carrier_no(self, value): self.__carrier_no = value - @property def class_type(self): - """Gets the class_type of this Leg.""" + """Gets the class_type of this Leg. + + """ return self.__class_type @class_type.setter def class_type(self, value): self.__class_type = value - @property def departure_airport_code(self): """ - IATA code for the originating airport for this leg of the trip. More information: Maximum length: 8 characters + IATA code for the originating airport for this leg of the trip. More information: Maximum length: 8 characters """ return self.__departure_airport_code @departure_airport_code.setter def departure_airport_code(self, value): self.__departure_airport_code = value - @property def arrival_airport_code(self): """ - IATA code for the destination airport for this leg of the trip. More information: Maximum length: 8 characters + IATA code for the destination airport for this leg of the trip. More information: Maximum length: 8 characters """ return self.__arrival_airport_code @arrival_airport_code.setter def arrival_airport_code(self, value): self.__arrival_airport_code = value - @property def fare_basis(self): """ @@ -123,7 +123,6 @@ def fare_basis(self): @fare_basis.setter def fare_basis(self, value): self.__fare_basis = value - @property def coupon_number(self): """ @@ -134,7 +133,6 @@ def coupon_number(self): @coupon_number.setter def coupon_number(self, value): self.__coupon_number = value - @property def flight_number(self): """ @@ -146,67 +144,65 @@ def flight_number(self): def flight_number(self, value): self.__flight_number = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "departure_time") and self.departure_time is not None: - params["departureTime"] = self.departure_time + params['departureTime'] = self.departure_time if hasattr(self, "arrival_time") and self.arrival_time is not None: - params["arrivalTime"] = self.arrival_time + params['arrivalTime'] = self.arrival_time if hasattr(self, "departure_address") and self.departure_address is not None: - params["departureAddress"] = self.departure_address + params['departureAddress'] = self.departure_address if hasattr(self, "arrival_address") and self.arrival_address is not None: - params["arrivalAddress"] = self.arrival_address + params['arrivalAddress'] = self.arrival_address if hasattr(self, "carrier_name") and self.carrier_name is not None: - params["carrierName"] = self.carrier_name + params['carrierName'] = self.carrier_name if hasattr(self, "carrier_no") and self.carrier_no is not None: - params["carrierNo"] = self.carrier_no + params['carrierNo'] = self.carrier_no if hasattr(self, "class_type") and self.class_type is not None: - params["classType"] = self.class_type - if ( - hasattr(self, "departure_airport_code") - and self.departure_airport_code is not None - ): - params["departureAirportCode"] = self.departure_airport_code - if ( - hasattr(self, "arrival_airport_code") - and self.arrival_airport_code is not None - ): - params["arrivalAirportCode"] = self.arrival_airport_code + params['classType'] = self.class_type + if hasattr(self, "departure_airport_code") and self.departure_airport_code is not None: + params['departureAirportCode'] = self.departure_airport_code + if hasattr(self, "arrival_airport_code") and self.arrival_airport_code is not None: + params['arrivalAirportCode'] = self.arrival_airport_code if hasattr(self, "fare_basis") and self.fare_basis is not None: - params["fareBasis"] = self.fare_basis + params['fareBasis'] = self.fare_basis if hasattr(self, "coupon_number") and self.coupon_number is not None: - params["couponNumber"] = self.coupon_number + params['couponNumber'] = self.coupon_number if hasattr(self, "flight_number") and self.flight_number is not None: - params["flightNumber"] = self.flight_number + params['flightNumber'] = self.flight_number return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "departureTime" in response_body: - self.__departure_time = response_body["departureTime"] - if "arrivalTime" in response_body: - self.__arrival_time = response_body["arrivalTime"] - if "departureAddress" in response_body: + if 'departureTime' in response_body: + self.__departure_time = response_body['departureTime'] + if 'arrivalTime' in response_body: + self.__arrival_time = response_body['arrivalTime'] + if 'departureAddress' in response_body: self.__departure_address = Address() - self.__departure_address.parse_rsp_body(response_body["departureAddress"]) - if "arrivalAddress" in response_body: + self.__departure_address.parse_rsp_body(response_body['departureAddress']) + if 'arrivalAddress' in response_body: self.__arrival_address = Address() - self.__arrival_address.parse_rsp_body(response_body["arrivalAddress"]) - if "carrierName" in response_body: - self.__carrier_name = response_body["carrierName"] - if "carrierNo" in response_body: - self.__carrier_no = response_body["carrierNo"] - if "classType" in response_body: - class_type_temp = ClassType.value_of(response_body["classType"]) + self.__arrival_address.parse_rsp_body(response_body['arrivalAddress']) + if 'carrierName' in response_body: + self.__carrier_name = response_body['carrierName'] + if 'carrierNo' in response_body: + self.__carrier_no = response_body['carrierNo'] + if 'classType' in response_body: + class_type_temp = ClassType.value_of(response_body['classType']) self.__class_type = class_type_temp - if "departureAirportCode" in response_body: - self.__departure_airport_code = response_body["departureAirportCode"] - if "arrivalAirportCode" in response_body: - self.__arrival_airport_code = response_body["arrivalAirportCode"] - if "fareBasis" in response_body: - self.__fare_basis = response_body["fareBasis"] - if "couponNumber" in response_body: - self.__coupon_number = response_body["couponNumber"] - if "flightNumber" in response_body: - self.__flight_number = response_body["flightNumber"] + if 'departureAirportCode' in response_body: + self.__departure_airport_code = response_body['departureAirportCode'] + if 'arrivalAirportCode' in response_body: + self.__arrival_airport_code = response_body['arrivalAirportCode'] + if 'fareBasis' in response_body: + self.__fare_basis = response_body['fareBasis'] + if 'couponNumber' in response_body: + self.__coupon_number = response_body['couponNumber'] + if 'flightNumber' in response_body: + self.__flight_number = response_body['flightNumber'] diff --git a/com/alipay/ams/api/model/legal_entity_type.py b/com/alipay/ams/api/model/legal_entity_type.py index 0202087..312801b 100644 --- a/com/alipay/ams/api/model/legal_entity_type.py +++ b/com/alipay/ams/api/model/legal_entity_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class LegalEntityType(Enum): """LegalEntityType枚举类""" diff --git a/com/alipay/ams/api/model/lodging.py b/com/alipay/ams/api/model/lodging.py index 72dcb56..0c3b2b8 100644 --- a/com/alipay/ams/api/model/lodging.py +++ b/com/alipay/ams/api/model/lodging.py @@ -3,9 +3,11 @@ from com.alipay.ams.api.model.user_name import UserName + + class Lodging: def __init__(self): - + self.__hotel_name = None # type: str self.__hotel_address = None # type: Address self.__check_in_date = None # type: str @@ -13,6 +15,7 @@ def __init__(self): self.__number_of_nights = None # type: int self.__number_of_rooms = None # type: int self.__guest_names = None # type: [UserName] + @property def hotel_name(self): @@ -24,27 +27,26 @@ def hotel_name(self): @hotel_name.setter def hotel_name(self, value): self.__hotel_name = value - @property def hotel_address(self): - """Gets the hotel_address of this Lodging.""" + """Gets the hotel_address of this Lodging. + + """ return self.__hotel_address @hotel_address.setter def hotel_address(self, value): self.__hotel_address = value - @property def check_in_date(self): """ - Date on which the guest checked in. In the case of a no-show or a reservation, the scheduled arrival date. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + Date on which the guest checked in. In the case of a no-show or a reservation, the scheduled arrival date. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__check_in_date @check_in_date.setter def check_in_date(self, value): self.__check_in_date = value - @property def check_out_date(self): """ @@ -55,7 +57,6 @@ def check_out_date(self): @check_out_date.setter def check_out_date(self, value): self.__check_out_date = value - @property def number_of_nights(self): """ @@ -66,7 +67,6 @@ def number_of_nights(self): @number_of_nights.setter def number_of_nights(self, value): self.__number_of_nights = value - @property def number_of_rooms(self): """ @@ -77,7 +77,6 @@ def number_of_rooms(self): @number_of_rooms.setter def number_of_rooms(self, value): self.__number_of_rooms = value - @property def guest_names(self): """ @@ -89,43 +88,47 @@ def guest_names(self): def guest_names(self, value): self.__guest_names = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "hotel_name") and self.hotel_name is not None: - params["hotelName"] = self.hotel_name + params['hotelName'] = self.hotel_name if hasattr(self, "hotel_address") and self.hotel_address is not None: - params["hotelAddress"] = self.hotel_address + params['hotelAddress'] = self.hotel_address if hasattr(self, "check_in_date") and self.check_in_date is not None: - params["checkInDate"] = self.check_in_date + params['checkInDate'] = self.check_in_date if hasattr(self, "check_out_date") and self.check_out_date is not None: - params["checkOutDate"] = self.check_out_date + params['checkOutDate'] = self.check_out_date if hasattr(self, "number_of_nights") and self.number_of_nights is not None: - params["numberOfNights"] = self.number_of_nights + params['numberOfNights'] = self.number_of_nights if hasattr(self, "number_of_rooms") and self.number_of_rooms is not None: - params["numberOfRooms"] = self.number_of_rooms + params['numberOfRooms'] = self.number_of_rooms if hasattr(self, "guest_names") and self.guest_names is not None: - params["guestNames"] = self.guest_names + params['guestNames'] = self.guest_names return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "hotelName" in response_body: - self.__hotel_name = response_body["hotelName"] - if "hotelAddress" in response_body: + if 'hotelName' in response_body: + self.__hotel_name = response_body['hotelName'] + if 'hotelAddress' in response_body: self.__hotel_address = Address() - self.__hotel_address.parse_rsp_body(response_body["hotelAddress"]) - if "checkInDate" in response_body: - self.__check_in_date = response_body["checkInDate"] - if "checkOutDate" in response_body: - self.__check_out_date = response_body["checkOutDate"] - if "numberOfNights" in response_body: - self.__number_of_nights = response_body["numberOfNights"] - if "numberOfRooms" in response_body: - self.__number_of_rooms = response_body["numberOfRooms"] - if "guestNames" in response_body: + self.__hotel_address.parse_rsp_body(response_body['hotelAddress']) + if 'checkInDate' in response_body: + self.__check_in_date = response_body['checkInDate'] + if 'checkOutDate' in response_body: + self.__check_out_date = response_body['checkOutDate'] + if 'numberOfNights' in response_body: + self.__number_of_nights = response_body['numberOfNights'] + if 'numberOfRooms' in response_body: + self.__number_of_rooms = response_body['numberOfRooms'] + if 'guestNames' in response_body: self.__guest_names = [] - for item in response_body["guestNames"]: + for item in response_body['guestNames']: obj = UserName() obj.parse_rsp_body(item) self.__guest_names.append(obj) diff --git a/com/alipay/ams/api/model/logo.py b/com/alipay/ams/api/model/logo.py index 90ce315..90bdc4c 100644 --- a/com/alipay/ams/api/model/logo.py +++ b/com/alipay/ams/api/model/logo.py @@ -1,11 +1,14 @@ import json + + class Logo: def __init__(self): - + self.__logo_name = None # type: str self.__logo_url = None # type: str + @property def logo_name(self): @@ -17,7 +20,6 @@ def logo_name(self): @logo_name.setter def logo_name(self, value): self.__logo_name = value - @property def logo_url(self): """ @@ -29,18 +31,22 @@ def logo_url(self): def logo_url(self, value): self.__logo_url = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "logo_name") and self.logo_name is not None: - params["logoName"] = self.logo_name + params['logoName'] = self.logo_name if hasattr(self, "logo_url") and self.logo_url is not None: - params["logoUrl"] = self.logo_url + params['logoUrl'] = self.logo_url return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "logoName" in response_body: - self.__logo_name = response_body["logoName"] - if "logoUrl" in response_body: - self.__logo_url = response_body["logoUrl"] + if 'logoName' in response_body: + self.__logo_name = response_body['logoName'] + if 'logoUrl' in response_body: + self.__logo_url = response_body['logoUrl'] diff --git a/com/alipay/ams/api/model/merchant.py b/com/alipay/ams/api/model/merchant.py index 464fcd2..07353d4 100644 --- a/com/alipay/ams/api/model/merchant.py +++ b/com/alipay/ams/api/model/merchant.py @@ -4,9 +4,11 @@ from com.alipay.ams.api.model.merchant_type import MerchantType + + class Merchant: def __init__(self): - + self.__reference_merchant_id = None # type: str self.__merchant_mcc = None # type: str self.__merchant_name = None # type: str @@ -15,127 +17,132 @@ def __init__(self): self.__merchant_register_date = None # type: str self.__store = None # type: Store self.__merchant_type = None # type: MerchantType + @property def reference_merchant_id(self): - """Gets the reference_merchant_id of this Merchant.""" + """Gets the reference_merchant_id of this Merchant. + + """ return self.__reference_merchant_id @reference_merchant_id.setter def reference_merchant_id(self, value): self.__reference_merchant_id = value - @property def merchant_mcc(self): - """Gets the merchant_mcc of this Merchant.""" + """Gets the merchant_mcc of this Merchant. + + """ return self.__merchant_mcc @merchant_mcc.setter def merchant_mcc(self, value): self.__merchant_mcc = value - @property def merchant_name(self): - """Gets the merchant_name of this Merchant.""" + """Gets the merchant_name of this Merchant. + + """ return self.__merchant_name @merchant_name.setter def merchant_name(self, value): self.__merchant_name = value - @property def merchant_display_name(self): - """Gets the merchant_display_name of this Merchant.""" + """Gets the merchant_display_name of this Merchant. + + """ return self.__merchant_display_name @merchant_display_name.setter def merchant_display_name(self, value): self.__merchant_display_name = value - @property def merchant_address(self): - """Gets the merchant_address of this Merchant.""" + """Gets the merchant_address of this Merchant. + + """ return self.__merchant_address @merchant_address.setter def merchant_address(self, value): self.__merchant_address = value - @property def merchant_register_date(self): - """Gets the merchant_register_date of this Merchant.""" + """Gets the merchant_register_date of this Merchant. + + """ return self.__merchant_register_date @merchant_register_date.setter def merchant_register_date(self, value): self.__merchant_register_date = value - @property def store(self): - """Gets the store of this Merchant.""" + """Gets the store of this Merchant. + + """ return self.__store @store.setter def store(self, value): self.__store = value - @property def merchant_type(self): - """Gets the merchant_type of this Merchant.""" + """Gets the merchant_type of this Merchant. + + """ return self.__merchant_type @merchant_type.setter def merchant_type(self, value): self.__merchant_type = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "reference_merchant_id") - and self.reference_merchant_id is not None - ): - params["referenceMerchantId"] = self.reference_merchant_id + if hasattr(self, "reference_merchant_id") and self.reference_merchant_id is not None: + params['referenceMerchantId'] = self.reference_merchant_id if hasattr(self, "merchant_mcc") and self.merchant_mcc is not None: - params["merchantMCC"] = self.merchant_mcc + params['merchantMCC'] = self.merchant_mcc if hasattr(self, "merchant_name") and self.merchant_name is not None: - params["merchantName"] = self.merchant_name - if ( - hasattr(self, "merchant_display_name") - and self.merchant_display_name is not None - ): - params["merchantDisplayName"] = self.merchant_display_name + params['merchantName'] = self.merchant_name + if hasattr(self, "merchant_display_name") and self.merchant_display_name is not None: + params['merchantDisplayName'] = self.merchant_display_name if hasattr(self, "merchant_address") and self.merchant_address is not None: - params["merchantAddress"] = self.merchant_address - if ( - hasattr(self, "merchant_register_date") - and self.merchant_register_date is not None - ): - params["merchantRegisterDate"] = self.merchant_register_date + params['merchantAddress'] = self.merchant_address + if hasattr(self, "merchant_register_date") and self.merchant_register_date is not None: + params['merchantRegisterDate'] = self.merchant_register_date if hasattr(self, "store") and self.store is not None: - params["store"] = self.store + params['store'] = self.store if hasattr(self, "merchant_type") and self.merchant_type is not None: - params["merchantType"] = self.merchant_type + params['merchantType'] = self.merchant_type return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "referenceMerchantId" in response_body: - self.__reference_merchant_id = response_body["referenceMerchantId"] - if "merchantMCC" in response_body: - self.__merchant_mcc = response_body["merchantMCC"] - if "merchantName" in response_body: - self.__merchant_name = response_body["merchantName"] - if "merchantDisplayName" in response_body: - self.__merchant_display_name = response_body["merchantDisplayName"] - if "merchantAddress" in response_body: + if 'referenceMerchantId' in response_body: + self.__reference_merchant_id = response_body['referenceMerchantId'] + if 'merchantMCC' in response_body: + self.__merchant_mcc = response_body['merchantMCC'] + if 'merchantName' in response_body: + self.__merchant_name = response_body['merchantName'] + if 'merchantDisplayName' in response_body: + self.__merchant_display_name = response_body['merchantDisplayName'] + if 'merchantAddress' in response_body: self.__merchant_address = Address() - self.__merchant_address.parse_rsp_body(response_body["merchantAddress"]) - if "merchantRegisterDate" in response_body: - self.__merchant_register_date = response_body["merchantRegisterDate"] - if "store" in response_body: + self.__merchant_address.parse_rsp_body(response_body['merchantAddress']) + if 'merchantRegisterDate' in response_body: + self.__merchant_register_date = response_body['merchantRegisterDate'] + if 'store' in response_body: self.__store = Store() - self.__store.parse_rsp_body(response_body["store"]) - if "merchantType" in response_body: - merchant_type_temp = MerchantType.value_of(response_body["merchantType"]) + self.__store.parse_rsp_body(response_body['store']) + if 'merchantType' in response_body: + merchant_type_temp = MerchantType.value_of(response_body['merchantType']) self.__merchant_type = merchant_type_temp diff --git a/com/alipay/ams/api/model/merchant_info.py b/com/alipay/ams/api/model/merchant_info.py index da976d8..9f124f2 100644 --- a/com/alipay/ams/api/model/merchant_info.py +++ b/com/alipay/ams/api/model/merchant_info.py @@ -5,27 +5,29 @@ from com.alipay.ams.api.model.entity_associations import EntityAssociations + + class MerchantInfo: def __init__(self): - + self.__reference_merchant_id = None # type: str self.__login_id = None # type: str self.__legal_entity_type = None # type: LegalEntityType self.__company = None # type: Company self.__business_info = None # type: BusinessInfo self.__entity_associations = None # type: [EntityAssociations] + @property def reference_merchant_id(self): """ - The unique ID that is assigned by the marketplace to identify the sub-merchant. referenceMerchantId that fails to register the sub-merchant can be used again. More information: Maximum length: 64 characters + The unique ID that is assigned by the marketplace to identify the sub-merchant. referenceMerchantId that fails to register the sub-merchant can be used again. More information: Maximum length: 64 characters """ return self.__reference_merchant_id @reference_merchant_id.setter def reference_merchant_id(self, value): self.__reference_merchant_id = value - @property def login_id(self): """ @@ -36,34 +38,36 @@ def login_id(self): @login_id.setter def login_id(self, value): self.__login_id = value - @property def legal_entity_type(self): - """Gets the legal_entity_type of this MerchantInfo.""" + """Gets the legal_entity_type of this MerchantInfo. + + """ return self.__legal_entity_type @legal_entity_type.setter def legal_entity_type(self, value): self.__legal_entity_type = value - @property def company(self): - """Gets the company of this MerchantInfo.""" + """Gets the company of this MerchantInfo. + + """ return self.__company @company.setter def company(self, value): self.__company = value - @property def business_info(self): - """Gets the business_info of this MerchantInfo.""" + """Gets the business_info of this MerchantInfo. + + """ return self.__business_info @business_info.setter def business_info(self, value): self.__business_info = value - @property def entity_associations(self): """ @@ -75,49 +79,45 @@ def entity_associations(self): def entity_associations(self, value): self.__entity_associations = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "reference_merchant_id") - and self.reference_merchant_id is not None - ): - params["referenceMerchantId"] = self.reference_merchant_id + if hasattr(self, "reference_merchant_id") and self.reference_merchant_id is not None: + params['referenceMerchantId'] = self.reference_merchant_id if hasattr(self, "login_id") and self.login_id is not None: - params["loginId"] = self.login_id + params['loginId'] = self.login_id if hasattr(self, "legal_entity_type") and self.legal_entity_type is not None: - params["legalEntityType"] = self.legal_entity_type + params['legalEntityType'] = self.legal_entity_type if hasattr(self, "company") and self.company is not None: - params["company"] = self.company + params['company'] = self.company if hasattr(self, "business_info") and self.business_info is not None: - params["businessInfo"] = self.business_info - if ( - hasattr(self, "entity_associations") - and self.entity_associations is not None - ): - params["entityAssociations"] = self.entity_associations + params['businessInfo'] = self.business_info + if hasattr(self, "entity_associations") and self.entity_associations is not None: + params['entityAssociations'] = self.entity_associations return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "referenceMerchantId" in response_body: - self.__reference_merchant_id = response_body["referenceMerchantId"] - if "loginId" in response_body: - self.__login_id = response_body["loginId"] - if "legalEntityType" in response_body: - legal_entity_type_temp = LegalEntityType.value_of( - response_body["legalEntityType"] - ) + if 'referenceMerchantId' in response_body: + self.__reference_merchant_id = response_body['referenceMerchantId'] + if 'loginId' in response_body: + self.__login_id = response_body['loginId'] + if 'legalEntityType' in response_body: + legal_entity_type_temp = LegalEntityType.value_of(response_body['legalEntityType']) self.__legal_entity_type = legal_entity_type_temp - if "company" in response_body: + if 'company' in response_body: self.__company = Company() - self.__company.parse_rsp_body(response_body["company"]) - if "businessInfo" in response_body: + self.__company.parse_rsp_body(response_body['company']) + if 'businessInfo' in response_body: self.__business_info = BusinessInfo() - self.__business_info.parse_rsp_body(response_body["businessInfo"]) - if "entityAssociations" in response_body: + self.__business_info.parse_rsp_body(response_body['businessInfo']) + if 'entityAssociations' in response_body: self.__entity_associations = [] - for item in response_body["entityAssociations"]: + for item in response_body['entityAssociations']: obj = EntityAssociations() obj.parse_rsp_body(item) self.__entity_associations.append(obj) diff --git a/com/alipay/ams/api/model/merchant_type.py b/com/alipay/ams/api/model/merchant_type.py index 5bfeaab..216677c 100644 --- a/com/alipay/ams/api/model/merchant_type.py +++ b/com/alipay/ams/api/model/merchant_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class MerchantType(Enum): """MerchantType枚举类""" diff --git a/com/alipay/ams/api/model/mpi_data.py b/com/alipay/ams/api/model/mpi_data.py index 2c0a27d..92fe723 100644 --- a/com/alipay/ams/api/model/mpi_data.py +++ b/com/alipay/ams/api/model/mpi_data.py @@ -1,84 +1,97 @@ import json + + class MpiData: def __init__(self): - + self.__three_ds_version = None # type: str self.__eci = None # type: str self.__cavv = None # type: str self.__ds_transaction_id = None # type: str self.__credential_type = None # type: str + @property def three_ds_version(self): - """Gets the three_ds_version of this MpiData.""" + """Gets the three_ds_version of this MpiData. + + """ return self.__three_ds_version @three_ds_version.setter def three_ds_version(self, value): self.__three_ds_version = value - @property def eci(self): - """Gets the eci of this MpiData.""" + """Gets the eci of this MpiData. + + """ return self.__eci @eci.setter def eci(self, value): self.__eci = value - @property def cavv(self): - """Gets the cavv of this MpiData.""" + """Gets the cavv of this MpiData. + + """ return self.__cavv @cavv.setter def cavv(self, value): self.__cavv = value - @property def ds_transaction_id(self): - """Gets the ds_transaction_id of this MpiData.""" + """Gets the ds_transaction_id of this MpiData. + + """ return self.__ds_transaction_id @ds_transaction_id.setter def ds_transaction_id(self, value): self.__ds_transaction_id = value - @property def credential_type(self): - """Gets the credential_type of this MpiData.""" + """Gets the credential_type of this MpiData. + + """ return self.__credential_type @credential_type.setter def credential_type(self, value): self.__credential_type = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "three_ds_version") and self.three_ds_version is not None: - params["threeDSVersion"] = self.three_ds_version + params['threeDSVersion'] = self.three_ds_version if hasattr(self, "eci") and self.eci is not None: - params["eci"] = self.eci + params['eci'] = self.eci if hasattr(self, "cavv") and self.cavv is not None: - params["cavv"] = self.cavv + params['cavv'] = self.cavv if hasattr(self, "ds_transaction_id") and self.ds_transaction_id is not None: - params["dsTransactionId"] = self.ds_transaction_id + params['dsTransactionId'] = self.ds_transaction_id if hasattr(self, "credential_type") and self.credential_type is not None: - params["credentialType"] = self.credential_type + params['credentialType'] = self.credential_type return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "threeDSVersion" in response_body: - self.__three_ds_version = response_body["threeDSVersion"] - if "eci" in response_body: - self.__eci = response_body["eci"] - if "cavv" in response_body: - self.__cavv = response_body["cavv"] - if "dsTransactionId" in response_body: - self.__ds_transaction_id = response_body["dsTransactionId"] - if "credentialType" in response_body: - self.__credential_type = response_body["credentialType"] + if 'threeDSVersion' in response_body: + self.__three_ds_version = response_body['threeDSVersion'] + if 'eci' in response_body: + self.__eci = response_body['eci'] + if 'cavv' in response_body: + self.__cavv = response_body['cavv'] + if 'dsTransactionId' in response_body: + self.__ds_transaction_id = response_body['dsTransactionId'] + if 'credentialType' in response_body: + self.__credential_type = response_body['credentialType'] diff --git a/com/alipay/ams/api/model/order.py b/com/alipay/ams/api/model/order.py index f26030f..9320316 100644 --- a/com/alipay/ams/api/model/order.py +++ b/com/alipay/ams/api/model/order.py @@ -13,9 +13,11 @@ from com.alipay.ams.api.model.declaration import Declaration + + class Order: def __init__(self): - + self.__reference_order_id = None # type: str self.__order_description = None # type: str self.__order_amount = None # type: Amount @@ -33,6 +35,7 @@ def __init__(self): self.__need_declaration = None # type: bool self.__declaration = None # type: Declaration self.__order_type = None # type: str + @property def reference_order_id(self): @@ -44,7 +47,6 @@ def reference_order_id(self): @reference_order_id.setter def reference_order_id(self, value): self.__reference_order_id = value - @property def order_description(self): """ @@ -55,43 +57,46 @@ def order_description(self): @order_description.setter def order_description(self, value): self.__order_description = value - @property def order_amount(self): - """Gets the order_amount of this Order.""" + """Gets the order_amount of this Order. + + """ return self.__order_amount @order_amount.setter def order_amount(self, value): self.__order_amount = value - @property def order_discount_amount(self): - """Gets the order_discount_amount of this Order.""" + """Gets the order_discount_amount of this Order. + + """ return self.__order_discount_amount @order_discount_amount.setter def order_discount_amount(self, value): self.__order_discount_amount = value - @property def sub_total_order_amount(self): - """Gets the sub_total_order_amount of this Order.""" + """Gets the sub_total_order_amount of this Order. + + """ return self.__sub_total_order_amount @sub_total_order_amount.setter def sub_total_order_amount(self, value): self.__sub_total_order_amount = value - @property def merchant(self): - """Gets the merchant of this Order.""" + """Gets the merchant of this Order. + + """ return self.__merchant @merchant.setter def merchant(self, value): self.__merchant = value - @property def goods(self): """ @@ -102,94 +107,100 @@ def goods(self): @goods.setter def goods(self, value): self.__goods = value - @property def shipping(self): - """Gets the shipping of this Order.""" + """Gets the shipping of this Order. + + """ return self.__shipping @shipping.setter def shipping(self, value): self.__shipping = value - @property def buyer(self): - """Gets the buyer of this Order.""" + """Gets the buyer of this Order. + + """ return self.__buyer @buyer.setter def buyer(self, value): self.__buyer = value - @property def env(self): - """Gets the env of this Order.""" + """Gets the env of this Order. + + """ return self.__env @env.setter def env(self, value): self.__env = value - @property def extend_info(self): """ - Extended information data, including information for special use cases. Note: Specify this field when you need to use the extended information. + Extended information data, including information for special use cases. Note: Specify this field when you need to use the extended information. """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def transit(self): - """Gets the transit of this Order.""" + """Gets the transit of this Order. + + """ return self.__transit @transit.setter def transit(self, value): self.__transit = value - @property def lodging(self): - """Gets the lodging of this Order.""" + """Gets the lodging of this Order. + + """ return self.__lodging @lodging.setter def lodging(self, value): self.__lodging = value - @property def gaming(self): - """Gets the gaming of this Order.""" + """Gets the gaming of this Order. + + """ return self.__gaming @gaming.setter def gaming(self, value): self.__gaming = value - @property def need_declaration(self): - """Gets the need_declaration of this Order.""" + """Gets the need_declaration of this Order. + + """ return self.__need_declaration @need_declaration.setter def need_declaration(self, value): self.__need_declaration = value - @property def declaration(self): - """Gets the declaration of this Order.""" + """Gets the declaration of this Order. + + """ return self.__declaration @declaration.setter def declaration(self, value): self.__declaration = value - @property def order_type(self): """ - test + test """ return self.__order_type @@ -197,103 +208,97 @@ def order_type(self): def order_type(self, value): self.__order_type = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "reference_order_id") and self.reference_order_id is not None: - params["referenceOrderId"] = self.reference_order_id + params['referenceOrderId'] = self.reference_order_id if hasattr(self, "order_description") and self.order_description is not None: - params["orderDescription"] = self.order_description + params['orderDescription'] = self.order_description if hasattr(self, "order_amount") and self.order_amount is not None: - params["orderAmount"] = self.order_amount - if ( - hasattr(self, "order_discount_amount") - and self.order_discount_amount is not None - ): - params["orderDiscountAmount"] = self.order_discount_amount - if ( - hasattr(self, "sub_total_order_amount") - and self.sub_total_order_amount is not None - ): - params["subTotalOrderAmount"] = self.sub_total_order_amount + params['orderAmount'] = self.order_amount + if hasattr(self, "order_discount_amount") and self.order_discount_amount is not None: + params['orderDiscountAmount'] = self.order_discount_amount + if hasattr(self, "sub_total_order_amount") and self.sub_total_order_amount is not None: + params['subTotalOrderAmount'] = self.sub_total_order_amount if hasattr(self, "merchant") and self.merchant is not None: - params["merchant"] = self.merchant + params['merchant'] = self.merchant if hasattr(self, "goods") and self.goods is not None: - params["goods"] = self.goods + params['goods'] = self.goods if hasattr(self, "shipping") and self.shipping is not None: - params["shipping"] = self.shipping + params['shipping'] = self.shipping if hasattr(self, "buyer") and self.buyer is not None: - params["buyer"] = self.buyer + params['buyer'] = self.buyer if hasattr(self, "env") and self.env is not None: - params["env"] = self.env + params['env'] = self.env if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "transit") and self.transit is not None: - params["transit"] = self.transit + params['transit'] = self.transit if hasattr(self, "lodging") and self.lodging is not None: - params["lodging"] = self.lodging + params['lodging'] = self.lodging if hasattr(self, "gaming") and self.gaming is not None: - params["gaming"] = self.gaming + params['gaming'] = self.gaming if hasattr(self, "need_declaration") and self.need_declaration is not None: - params["needDeclaration"] = self.need_declaration + params['needDeclaration'] = self.need_declaration if hasattr(self, "declaration") and self.declaration is not None: - params["declaration"] = self.declaration + params['declaration'] = self.declaration if hasattr(self, "order_type") and self.order_type is not None: - params["orderType"] = self.order_type + params['orderType'] = self.order_type return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "referenceOrderId" in response_body: - self.__reference_order_id = response_body["referenceOrderId"] - if "orderDescription" in response_body: - self.__order_description = response_body["orderDescription"] - if "orderAmount" in response_body: + if 'referenceOrderId' in response_body: + self.__reference_order_id = response_body['referenceOrderId'] + if 'orderDescription' in response_body: + self.__order_description = response_body['orderDescription'] + if 'orderAmount' in response_body: self.__order_amount = Amount() - self.__order_amount.parse_rsp_body(response_body["orderAmount"]) - if "orderDiscountAmount" in response_body: + self.__order_amount.parse_rsp_body(response_body['orderAmount']) + if 'orderDiscountAmount' in response_body: self.__order_discount_amount = Amount() - self.__order_discount_amount.parse_rsp_body( - response_body["orderDiscountAmount"] - ) - if "subTotalOrderAmount" in response_body: + self.__order_discount_amount.parse_rsp_body(response_body['orderDiscountAmount']) + if 'subTotalOrderAmount' in response_body: self.__sub_total_order_amount = Amount() - self.__sub_total_order_amount.parse_rsp_body( - response_body["subTotalOrderAmount"] - ) - if "merchant" in response_body: + self.__sub_total_order_amount.parse_rsp_body(response_body['subTotalOrderAmount']) + if 'merchant' in response_body: self.__merchant = Merchant() - self.__merchant.parse_rsp_body(response_body["merchant"]) - if "goods" in response_body: + self.__merchant.parse_rsp_body(response_body['merchant']) + if 'goods' in response_body: self.__goods = [] - for item in response_body["goods"]: + for item in response_body['goods']: obj = Goods() obj.parse_rsp_body(item) self.__goods.append(obj) - if "shipping" in response_body: + if 'shipping' in response_body: self.__shipping = Shipping() - self.__shipping.parse_rsp_body(response_body["shipping"]) - if "buyer" in response_body: + self.__shipping.parse_rsp_body(response_body['shipping']) + if 'buyer' in response_body: self.__buyer = Buyer() - self.__buyer.parse_rsp_body(response_body["buyer"]) - if "env" in response_body: + self.__buyer.parse_rsp_body(response_body['buyer']) + if 'env' in response_body: self.__env = Env() - self.__env.parse_rsp_body(response_body["env"]) - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "transit" in response_body: + self.__env.parse_rsp_body(response_body['env']) + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'transit' in response_body: self.__transit = Transit() - self.__transit.parse_rsp_body(response_body["transit"]) - if "lodging" in response_body: + self.__transit.parse_rsp_body(response_body['transit']) + if 'lodging' in response_body: self.__lodging = Lodging() - self.__lodging.parse_rsp_body(response_body["lodging"]) - if "gaming" in response_body: + self.__lodging.parse_rsp_body(response_body['lodging']) + if 'gaming' in response_body: self.__gaming = Gaming() - self.__gaming.parse_rsp_body(response_body["gaming"]) - if "needDeclaration" in response_body: - self.__need_declaration = response_body["needDeclaration"] - if "declaration" in response_body: + self.__gaming.parse_rsp_body(response_body['gaming']) + if 'needDeclaration' in response_body: + self.__need_declaration = response_body['needDeclaration'] + if 'declaration' in response_body: self.__declaration = Declaration() - self.__declaration.parse_rsp_body(response_body["declaration"]) - if "orderType" in response_body: - self.__order_type = response_body["orderType"] + self.__declaration.parse_rsp_body(response_body['declaration']) + if 'orderType' in response_body: + self.__order_type = response_body['orderType'] diff --git a/com/alipay/ams/api/model/order_code_form.py b/com/alipay/ams/api/model/order_code_form.py index 8776a62..6016085 100644 --- a/com/alipay/ams/api/model/order_code_form.py +++ b/com/alipay/ams/api/model/order_code_form.py @@ -2,23 +2,27 @@ from com.alipay.ams.api.model.code_detail import CodeDetail + + class OrderCodeForm: def __init__(self): - + self.__payment_method_type = None # type: str self.__expire_time = None # type: str self.__code_details = None # type: [CodeDetail] self.__extend_info = None # type: str + @property def payment_method_type(self): - """Gets the payment_method_type of this OrderCodeForm.""" + """Gets the payment_method_type of this OrderCodeForm. + + """ return self.__payment_method_type @payment_method_type.setter def payment_method_type(self, value): self.__payment_method_type = value - @property def expire_time(self): """ @@ -29,7 +33,6 @@ def expire_time(self): @expire_time.setter def expire_time(self, value): self.__expire_time = value - @property def code_details(self): """ @@ -40,7 +43,6 @@ def code_details(self): @code_details.setter def code_details(self, value): self.__code_details = value - @property def extend_info(self): """ @@ -52,33 +54,34 @@ def extend_info(self): def extend_info(self, value): self.__extend_info = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "payment_method_type") - and self.payment_method_type is not None - ): - params["paymentMethodType"] = self.payment_method_type + if hasattr(self, "payment_method_type") and self.payment_method_type is not None: + params['paymentMethodType'] = self.payment_method_type if hasattr(self, "expire_time") and self.expire_time is not None: - params["expireTime"] = self.expire_time + params['expireTime'] = self.expire_time if hasattr(self, "code_details") and self.code_details is not None: - params["codeDetails"] = self.code_details + params['codeDetails'] = self.code_details if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "paymentMethodType" in response_body: - self.__payment_method_type = response_body["paymentMethodType"] - if "expireTime" in response_body: - self.__expire_time = response_body["expireTime"] - if "codeDetails" in response_body: + if 'paymentMethodType' in response_body: + self.__payment_method_type = response_body['paymentMethodType'] + if 'expireTime' in response_body: + self.__expire_time = response_body['expireTime'] + if 'codeDetails' in response_body: self.__code_details = [] - for item in response_body["codeDetails"]: + for item in response_body['codeDetails']: obj = CodeDetail() obj.parse_rsp_body(item) self.__code_details.append(obj) - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] diff --git a/com/alipay/ams/api/model/order_info.py b/com/alipay/ams/api/model/order_info.py index d3175cf..ed8f07b 100644 --- a/com/alipay/ams/api/model/order_info.py +++ b/com/alipay/ams/api/model/order_info.py @@ -2,29 +2,38 @@ from com.alipay.ams.api.model.amount import Amount + + class OrderInfo: def __init__(self): - + self.__order_amount = None # type: Amount + @property def order_amount(self): - """Gets the order_amount of this OrderInfo.""" + """Gets the order_amount of this OrderInfo. + + """ return self.__order_amount @order_amount.setter def order_amount(self, value): self.__order_amount = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "order_amount") and self.order_amount is not None: - params["orderAmount"] = self.order_amount + params['orderAmount'] = self.order_amount return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "orderAmount" in response_body: + if 'orderAmount' in response_body: self.__order_amount = Amount() - self.__order_amount.parse_rsp_body(response_body["orderAmount"]) + self.__order_amount.parse_rsp_body(response_body['orderAmount']) diff --git a/com/alipay/ams/api/model/os_type.py b/com/alipay/ams/api/model/os_type.py index 59aa942..aa00832 100644 --- a/com/alipay/ams/api/model/os_type.py +++ b/com/alipay/ams/api/model/os_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class OsType(Enum): """OsType枚举类""" diff --git a/com/alipay/ams/api/model/passenger.py b/com/alipay/ams/api/model/passenger.py index 3bffba6..f1a1245 100644 --- a/com/alipay/ams/api/model/passenger.py +++ b/com/alipay/ams/api/model/passenger.py @@ -3,25 +3,29 @@ from com.alipay.ams.api.model.passenger_id_type import PassengerIdType + + class Passenger: def __init__(self): - + self.__passenger_name = None # type: UserName self.__passenger_email = None # type: str self.__passenger_phone_no = None # type: str self.__passenger_id = None # type: str self.__passenger_id_type = None # type: PassengerIdType self.__passenger_code = None # type: str + @property def passenger_name(self): - """Gets the passenger_name of this Passenger.""" + """Gets the passenger_name of this Passenger. + + """ return self.__passenger_name @passenger_name.setter def passenger_name(self, value): self.__passenger_name = value - @property def passenger_email(self): """ @@ -32,7 +36,6 @@ def passenger_email(self): @passenger_email.setter def passenger_email(self, value): self.__passenger_email = value - @property def passenger_phone_no(self): """ @@ -43,7 +46,6 @@ def passenger_phone_no(self): @passenger_phone_no.setter def passenger_phone_no(self, value): self.__passenger_phone_no = value - @property def passenger_id(self): """ @@ -54,16 +56,16 @@ def passenger_id(self): @passenger_id.setter def passenger_id(self, value): self.__passenger_id = value - @property def passenger_id_type(self): - """Gets the passenger_id_type of this Passenger.""" + """Gets the passenger_id_type of this Passenger. + + """ return self.__passenger_id_type @passenger_id_type.setter def passenger_id_type(self, value): self.__passenger_id_type = value - @property def passenger_code(self): """ @@ -75,38 +77,40 @@ def passenger_code(self): def passenger_code(self, value): self.__passenger_code = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "passenger_name") and self.passenger_name is not None: - params["passengerName"] = self.passenger_name + params['passengerName'] = self.passenger_name if hasattr(self, "passenger_email") and self.passenger_email is not None: - params["passengerEmail"] = self.passenger_email + params['passengerEmail'] = self.passenger_email if hasattr(self, "passenger_phone_no") and self.passenger_phone_no is not None: - params["passengerPhoneNo"] = self.passenger_phone_no + params['passengerPhoneNo'] = self.passenger_phone_no if hasattr(self, "passenger_id") and self.passenger_id is not None: - params["passengerId"] = self.passenger_id + params['passengerId'] = self.passenger_id if hasattr(self, "passenger_id_type") and self.passenger_id_type is not None: - params["passengerIdType"] = self.passenger_id_type + params['passengerIdType'] = self.passenger_id_type if hasattr(self, "passenger_code") and self.passenger_code is not None: - params["passengerCode"] = self.passenger_code + params['passengerCode'] = self.passenger_code return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "passengerName" in response_body: + if 'passengerName' in response_body: self.__passenger_name = UserName() - self.__passenger_name.parse_rsp_body(response_body["passengerName"]) - if "passengerEmail" in response_body: - self.__passenger_email = response_body["passengerEmail"] - if "passengerPhoneNo" in response_body: - self.__passenger_phone_no = response_body["passengerPhoneNo"] - if "passengerId" in response_body: - self.__passenger_id = response_body["passengerId"] - if "passengerIdType" in response_body: - passenger_id_type_temp = PassengerIdType.value_of( - response_body["passengerIdType"] - ) + self.__passenger_name.parse_rsp_body(response_body['passengerName']) + if 'passengerEmail' in response_body: + self.__passenger_email = response_body['passengerEmail'] + if 'passengerPhoneNo' in response_body: + self.__passenger_phone_no = response_body['passengerPhoneNo'] + if 'passengerId' in response_body: + self.__passenger_id = response_body['passengerId'] + if 'passengerIdType' in response_body: + passenger_id_type_temp = PassengerIdType.value_of(response_body['passengerIdType']) self.__passenger_id_type = passenger_id_type_temp - if "passengerCode" in response_body: - self.__passenger_code = response_body["passengerCode"] + if 'passengerCode' in response_body: + self.__passenger_code = response_body['passengerCode'] diff --git a/com/alipay/ams/api/model/passenger_id_type.py b/com/alipay/ams/api/model/passenger_id_type.py index 1460434..1b2eca8 100644 --- a/com/alipay/ams/api/model/passenger_id_type.py +++ b/com/alipay/ams/api/model/passenger_id_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class PassengerIdType(Enum): """Type of passenger identification""" diff --git a/com/alipay/ams/api/model/payment_factor.py b/com/alipay/ams/api/model/payment_factor.py index a557447..0a6d627 100644 --- a/com/alipay/ams/api/model/payment_factor.py +++ b/com/alipay/ams/api/model/payment_factor.py @@ -3,57 +3,62 @@ from com.alipay.ams.api.model.presentment_mode import PresentmentMode + + class PaymentFactor: def __init__(self): - + self.__is_payment_evaluation = None # type: bool self.__in_store_payment_scenario = None # type: InStorePaymentScenario self.__presentment_mode = None # type: PresentmentMode self.__capture_mode = None # type: str self.__is_authorization = None # type: bool + @property def is_payment_evaluation(self): - """Gets the is_payment_evaluation of this PaymentFactor.""" + """Gets the is_payment_evaluation of this PaymentFactor. + + """ return self.__is_payment_evaluation @is_payment_evaluation.setter def is_payment_evaluation(self, value): self.__is_payment_evaluation = value - @property def in_store_payment_scenario(self): - """Gets the in_store_payment_scenario of this PaymentFactor.""" + """Gets the in_store_payment_scenario of this PaymentFactor. + + """ return self.__in_store_payment_scenario @in_store_payment_scenario.setter def in_store_payment_scenario(self, value): self.__in_store_payment_scenario = value - @property def presentment_mode(self): - """Gets the presentment_mode of this PaymentFactor.""" + """Gets the presentment_mode of this PaymentFactor. + + """ return self.__presentment_mode @presentment_mode.setter def presentment_mode(self, value): self.__presentment_mode = value - @property def capture_mode(self): """ - Indicates the method for capturing funds after the user authorizes the payment. Valid values are: AUTOMATIC: indicates that Antom automatically captures the funds after the authorization. The same applies when the value is empty or you do not pass in this parameter. MANUAL: indicates that you manually capture the funds by calling the capture (Checkout Payment) API. Specify this parameter if you want to designate the capture mode of the payment. More information: Maximum length: 64 characters + Indicates the method for capturing funds after the user authorizes the payment. Valid values are: AUTOMATIC: indicates that Antom automatically captures the funds after the authorization. The same applies when the value is empty or you do not pass in this parameter. MANUAL: indicates that you manually capture the funds by calling the capture (Checkout Payment) API. Specify this parameter if you want to designate the capture mode of the payment. More information: Maximum length: 64 characters """ return self.__capture_mode @capture_mode.setter def capture_mode(self, value): self.__capture_mode = value - @property def is_authorization(self): """ - Indicates whether the payment scenario is authorization. Specify this parameter when the value of paymentMethodType is CARD and you integrate the client-side SDK. Valid values of this parameter are: true: indicates that the payment scenario is authorization. false: indicates that the payment scenario is a regular payment without authorization. Under the authorization scenario, the payment funds are guaranteed and held on the payment method side. You can use the capture (Checkout Payment) API to deduct the payment funds. + Indicates whether the payment scenario is authorization. Specify this parameter when the value of paymentMethodType is CARD and you integrate the client-side SDK. Valid values of this parameter are: true: indicates that the payment scenario is authorization. false: indicates that the payment scenario is a regular payment without authorization. Under the authorization scenario, the payment funds are guaranteed and held on the payment method side. You can use the capture (Checkout Payment) API to deduct the payment funds. """ return self.__is_authorization @@ -61,42 +66,36 @@ def is_authorization(self): def is_authorization(self, value): self.__is_authorization = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "is_payment_evaluation") - and self.is_payment_evaluation is not None - ): - params["isPaymentEvaluation"] = self.is_payment_evaluation - if ( - hasattr(self, "in_store_payment_scenario") - and self.in_store_payment_scenario is not None - ): - params["inStorePaymentScenario"] = self.in_store_payment_scenario + if hasattr(self, "is_payment_evaluation") and self.is_payment_evaluation is not None: + params['isPaymentEvaluation'] = self.is_payment_evaluation + if hasattr(self, "in_store_payment_scenario") and self.in_store_payment_scenario is not None: + params['inStorePaymentScenario'] = self.in_store_payment_scenario if hasattr(self, "presentment_mode") and self.presentment_mode is not None: - params["presentmentMode"] = self.presentment_mode + params['presentmentMode'] = self.presentment_mode if hasattr(self, "capture_mode") and self.capture_mode is not None: - params["captureMode"] = self.capture_mode + params['captureMode'] = self.capture_mode if hasattr(self, "is_authorization") and self.is_authorization is not None: - params["isAuthorization"] = self.is_authorization + params['isAuthorization'] = self.is_authorization return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "isPaymentEvaluation" in response_body: - self.__is_payment_evaluation = response_body["isPaymentEvaluation"] - if "inStorePaymentScenario" in response_body: - in_store_payment_scenario_temp = InStorePaymentScenario.value_of( - response_body["inStorePaymentScenario"] - ) + if 'isPaymentEvaluation' in response_body: + self.__is_payment_evaluation = response_body['isPaymentEvaluation'] + if 'inStorePaymentScenario' in response_body: + in_store_payment_scenario_temp = InStorePaymentScenario.value_of(response_body['inStorePaymentScenario']) self.__in_store_payment_scenario = in_store_payment_scenario_temp - if "presentmentMode" in response_body: - presentment_mode_temp = PresentmentMode.value_of( - response_body["presentmentMode"] - ) + if 'presentmentMode' in response_body: + presentment_mode_temp = PresentmentMode.value_of(response_body['presentmentMode']) self.__presentment_mode = presentment_mode_temp - if "captureMode" in response_body: - self.__capture_mode = response_body["captureMode"] - if "isAuthorization" in response_body: - self.__is_authorization = response_body["isAuthorization"] + if 'captureMode' in response_body: + self.__capture_mode = response_body['captureMode'] + if 'isAuthorization' in response_body: + self.__is_authorization = response_body['isAuthorization'] diff --git a/com/alipay/ams/api/model/payment_method.py b/com/alipay/ams/api/model/payment_method.py index 5582256..79b8243 100644 --- a/com/alipay/ams/api/model/payment_method.py +++ b/com/alipay/ams/api/model/payment_method.py @@ -2,18 +2,19 @@ from com.alipay.ams.api.model.funding_type import FundingType + + class PaymentMethod: def __init__(self): - + self.__payment_method_type = None # type: str self.__payment_method_id = None # type: str self.__funding = None # type: FundingType self.__customer_id = None # type: str self.__extend_info = None # type: str self.__require_issuer_authentication = None # type: bool - self.__payment_method_meta_data = ( - None - ) # type: {str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)} + self.__payment_method_meta_data = None # type: {str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)} + @property def payment_method_type(self): @@ -25,7 +26,6 @@ def payment_method_type(self): @payment_method_type.setter def payment_method_type(self, value): self.__payment_method_type = value - @property def payment_method_id(self): """ @@ -36,16 +36,16 @@ def payment_method_id(self): @payment_method_id.setter def payment_method_id(self, value): self.__payment_method_id = value - @property def funding(self): - """Gets the funding of this PaymentMethod.""" + """Gets the funding of this PaymentMethod. + + """ return self.__funding @funding.setter def funding(self, value): self.__funding = value - @property def customer_id(self): """ @@ -56,7 +56,6 @@ def customer_id(self): @customer_id.setter def customer_id(self, value): self.__customer_id = value - @property def extend_info(self): """ @@ -67,7 +66,6 @@ def extend_info(self): @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def require_issuer_authentication(self): """ @@ -78,11 +76,10 @@ def require_issuer_authentication(self): @require_issuer_authentication.setter def require_issuer_authentication(self, value): self.__require_issuer_authentication = value - @property def payment_method_meta_data(self): """ - Additional information required for some specific payment methods. + Additional information required for some specific payment methods. """ return self.__payment_method_meta_data @@ -90,50 +87,43 @@ def payment_method_meta_data(self): def payment_method_meta_data(self, value): self.__payment_method_meta_data = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "payment_method_type") - and self.payment_method_type is not None - ): - params["paymentMethodType"] = self.payment_method_type + if hasattr(self, "payment_method_type") and self.payment_method_type is not None: + params['paymentMethodType'] = self.payment_method_type if hasattr(self, "payment_method_id") and self.payment_method_id is not None: - params["paymentMethodId"] = self.payment_method_id + params['paymentMethodId'] = self.payment_method_id if hasattr(self, "funding") and self.funding is not None: - params["funding"] = self.funding + params['funding'] = self.funding if hasattr(self, "customer_id") and self.customer_id is not None: - params["customerId"] = self.customer_id + params['customerId'] = self.customer_id if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info - if ( - hasattr(self, "require_issuer_authentication") - and self.require_issuer_authentication is not None - ): - params["requireIssuerAuthentication"] = self.require_issuer_authentication - if ( - hasattr(self, "payment_method_meta_data") - and self.payment_method_meta_data is not None - ): - params["paymentMethodMetaData"] = self.payment_method_meta_data + params['extendInfo'] = self.extend_info + if hasattr(self, "require_issuer_authentication") and self.require_issuer_authentication is not None: + params['requireIssuerAuthentication'] = self.require_issuer_authentication + if hasattr(self, "payment_method_meta_data") and self.payment_method_meta_data is not None: + params['paymentMethodMetaData'] = self.payment_method_meta_data return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "paymentMethodType" in response_body: - self.__payment_method_type = response_body["paymentMethodType"] - if "paymentMethodId" in response_body: - self.__payment_method_id = response_body["paymentMethodId"] - if "funding" in response_body: - funding_temp = FundingType.value_of(response_body["funding"]) + if 'paymentMethodType' in response_body: + self.__payment_method_type = response_body['paymentMethodType'] + if 'paymentMethodId' in response_body: + self.__payment_method_id = response_body['paymentMethodId'] + if 'funding' in response_body: + funding_temp = FundingType.value_of(response_body['funding']) self.__funding = funding_temp - if "customerId" in response_body: - self.__customer_id = response_body["customerId"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "requireIssuerAuthentication" in response_body: - self.__require_issuer_authentication = response_body[ - "requireIssuerAuthentication" - ] - if "paymentMethodMetaData" in response_body: - self.__payment_method_meta_data = response_body["paymentMethodMetaData"] + if 'customerId' in response_body: + self.__customer_id = response_body['customerId'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'requireIssuerAuthentication' in response_body: + self.__require_issuer_authentication = response_body['requireIssuerAuthentication'] + if 'paymentMethodMetaData' in response_body: + self.__payment_method_meta_data = response_body['paymentMethodMetaData'] diff --git a/com/alipay/ams/api/model/payment_method_category_type.py b/com/alipay/ams/api/model/payment_method_category_type.py index 93661b4..52337c8 100644 --- a/com/alipay/ams/api/model/payment_method_category_type.py +++ b/com/alipay/ams/api/model/payment_method_category_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class PaymentMethodCategoryType(Enum): """PaymentMethodCategoryType枚举类""" diff --git a/com/alipay/ams/api/model/payment_method_detail.py b/com/alipay/ams/api/model/payment_method_detail.py index 1704c1b..a0dde6f 100644 --- a/com/alipay/ams/api/model/payment_method_detail.py +++ b/com/alipay/ams/api/model/payment_method_detail.py @@ -1,21 +1,17 @@ import json from com.alipay.ams.api.model.payment_method_detail_type import PaymentMethodDetailType from com.alipay.ams.api.model.card_payment_method_detail import CardPaymentMethodDetail -from com.alipay.ams.api.model.external_payment_method_detail import ( - ExternalPaymentMethodDetail, -) -from com.alipay.ams.api.model.discount_payment_method_detail import ( - DiscountPaymentMethodDetail, -) -from com.alipay.ams.api.model.coupon_payment_method_detail import ( - CouponPaymentMethodDetail, -) +from com.alipay.ams.api.model.external_payment_method_detail import ExternalPaymentMethodDetail +from com.alipay.ams.api.model.discount_payment_method_detail import DiscountPaymentMethodDetail +from com.alipay.ams.api.model.coupon_payment_method_detail import CouponPaymentMethodDetail from com.alipay.ams.api.model.wallet import Wallet + + class PaymentMethodDetail: def __init__(self): - + self.__payment_method_detail_type = None # type: PaymentMethodDetailType self.__card = None # type: CardPaymentMethodDetail self.__external_account = None # type: ExternalPaymentMethodDetail @@ -25,144 +21,149 @@ def __init__(self): self.__extend_info = None # type: str self.__wallet = None # type: Wallet self.__interaction_type = None # type: str + @property def payment_method_detail_type(self): - """Gets the payment_method_detail_type of this PaymentMethodDetail.""" + """Gets the payment_method_detail_type of this PaymentMethodDetail. + + """ return self.__payment_method_detail_type @payment_method_detail_type.setter def payment_method_detail_type(self, value): self.__payment_method_detail_type = value - @property def card(self): - """Gets the card of this PaymentMethodDetail.""" + """Gets the card of this PaymentMethodDetail. + + """ return self.__card @card.setter def card(self, value): self.__card = value - @property def external_account(self): - """Gets the external_account of this PaymentMethodDetail.""" + """Gets the external_account of this PaymentMethodDetail. + + """ return self.__external_account @external_account.setter def external_account(self, value): self.__external_account = value - @property def discount(self): - """Gets the discount of this PaymentMethodDetail.""" + """Gets the discount of this PaymentMethodDetail. + + """ return self.__discount @discount.setter def discount(self, value): self.__discount = value - @property def coupon(self): - """Gets the coupon of this PaymentMethodDetail.""" + """Gets the coupon of this PaymentMethodDetail. + + """ return self.__coupon @coupon.setter def coupon(self, value): self.__coupon = value - @property def payment_method_type(self): """ - The type of payment method to be vaulted. The value of this parameter is fixed to CARD. More information: Maximum length: 64 characters + The type of payment method to be vaulted. The value of this parameter is fixed to CARD. More information: Maximum length: 64 characters """ return self.__payment_method_type @payment_method_type.setter def payment_method_type(self, value): self.__payment_method_type = value - @property def extend_info(self): - """Gets the extend_info of this PaymentMethodDetail.""" + """Gets the extend_info of this PaymentMethodDetail. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def wallet(self): - """Gets the wallet of this PaymentMethodDetail.""" + """Gets the wallet of this PaymentMethodDetail. + + """ return self.__wallet @wallet.setter def wallet(self, value): self.__wallet = value - @property def interaction_type(self): - """Gets the interaction_type of this PaymentMethodDetail.""" + """Gets the interaction_type of this PaymentMethodDetail. + + """ return self.__interaction_type @interaction_type.setter def interaction_type(self, value): self.__interaction_type = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "payment_method_detail_type") - and self.payment_method_detail_type is not None - ): - params["paymentMethodDetailType"] = self.payment_method_detail_type + if hasattr(self, "payment_method_detail_type") and self.payment_method_detail_type is not None: + params['paymentMethodDetailType'] = self.payment_method_detail_type if hasattr(self, "card") and self.card is not None: - params["card"] = self.card + params['card'] = self.card if hasattr(self, "external_account") and self.external_account is not None: - params["externalAccount"] = self.external_account + params['externalAccount'] = self.external_account if hasattr(self, "discount") and self.discount is not None: - params["discount"] = self.discount + params['discount'] = self.discount if hasattr(self, "coupon") and self.coupon is not None: - params["coupon"] = self.coupon - if ( - hasattr(self, "payment_method_type") - and self.payment_method_type is not None - ): - params["paymentMethodType"] = self.payment_method_type + params['coupon'] = self.coupon + if hasattr(self, "payment_method_type") and self.payment_method_type is not None: + params['paymentMethodType'] = self.payment_method_type if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "wallet") and self.wallet is not None: - params["wallet"] = self.wallet + params['wallet'] = self.wallet if hasattr(self, "interaction_type") and self.interaction_type is not None: - params["interactionType"] = self.interaction_type + params['interactionType'] = self.interaction_type return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "paymentMethodDetailType" in response_body: - payment_method_detail_type_temp = PaymentMethodDetailType.value_of( - response_body["paymentMethodDetailType"] - ) + if 'paymentMethodDetailType' in response_body: + payment_method_detail_type_temp = PaymentMethodDetailType.value_of(response_body['paymentMethodDetailType']) self.__payment_method_detail_type = payment_method_detail_type_temp - if "card" in response_body: + if 'card' in response_body: self.__card = CardPaymentMethodDetail() - self.__card.parse_rsp_body(response_body["card"]) - if "externalAccount" in response_body: + self.__card.parse_rsp_body(response_body['card']) + if 'externalAccount' in response_body: self.__external_account = ExternalPaymentMethodDetail() - self.__external_account.parse_rsp_body(response_body["externalAccount"]) - if "discount" in response_body: + self.__external_account.parse_rsp_body(response_body['externalAccount']) + if 'discount' in response_body: self.__discount = DiscountPaymentMethodDetail() - self.__discount.parse_rsp_body(response_body["discount"]) - if "coupon" in response_body: + self.__discount.parse_rsp_body(response_body['discount']) + if 'coupon' in response_body: self.__coupon = CouponPaymentMethodDetail() - self.__coupon.parse_rsp_body(response_body["coupon"]) - if "paymentMethodType" in response_body: - self.__payment_method_type = response_body["paymentMethodType"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "wallet" in response_body: + self.__coupon.parse_rsp_body(response_body['coupon']) + if 'paymentMethodType' in response_body: + self.__payment_method_type = response_body['paymentMethodType'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'wallet' in response_body: self.__wallet = Wallet() - self.__wallet.parse_rsp_body(response_body["wallet"]) - if "interactionType" in response_body: - self.__interaction_type = response_body["interactionType"] + self.__wallet.parse_rsp_body(response_body['wallet']) + if 'interactionType' in response_body: + self.__interaction_type = response_body['interactionType'] diff --git a/com/alipay/ams/api/model/payment_method_detail_type.py b/com/alipay/ams/api/model/payment_method_detail_type.py index 0205c1a..5e21168 100644 --- a/com/alipay/ams/api/model/payment_method_detail_type.py +++ b/com/alipay/ams/api/model/payment_method_detail_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class PaymentMethodDetailType(Enum): """PaymentMethodDetailType枚举类""" diff --git a/com/alipay/ams/api/model/payment_method_info.py b/com/alipay/ams/api/model/payment_method_info.py index 09b6fe5..854c606 100644 --- a/com/alipay/ams/api/model/payment_method_info.py +++ b/com/alipay/ams/api/model/payment_method_info.py @@ -1,90 +1,97 @@ import json + + class PaymentMethodInfo: def __init__(self): - + self.__payment_method_type = None # type: str self.__payment_method_detail = None # type: str self.__enabled = None # type: bool self.__preferred = None # type: bool self.__extend_info = None # type: str + @property def payment_method_type(self): - """Gets the payment_method_type of this PaymentMethodInfo.""" + """Gets the payment_method_type of this PaymentMethodInfo. + + """ return self.__payment_method_type @payment_method_type.setter def payment_method_type(self, value): self.__payment_method_type = value - @property def payment_method_detail(self): - """Gets the payment_method_detail of this PaymentMethodInfo.""" + """Gets the payment_method_detail of this PaymentMethodInfo. + + """ return self.__payment_method_detail @payment_method_detail.setter def payment_method_detail(self, value): self.__payment_method_detail = value - @property def enabled(self): - """Gets the enabled of this PaymentMethodInfo.""" + """Gets the enabled of this PaymentMethodInfo. + + """ return self.__enabled @enabled.setter def enabled(self, value): self.__enabled = value - @property def preferred(self): - """Gets the preferred of this PaymentMethodInfo.""" + """Gets the preferred of this PaymentMethodInfo. + + """ return self.__preferred @preferred.setter def preferred(self, value): self.__preferred = value - @property def extend_info(self): - """Gets the extend_info of this PaymentMethodInfo.""" + """Gets the extend_info of this PaymentMethodInfo. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "payment_method_type") - and self.payment_method_type is not None - ): - params["paymentMethodType"] = self.payment_method_type - if ( - hasattr(self, "payment_method_detail") - and self.payment_method_detail is not None - ): - params["paymentMethodDetail"] = self.payment_method_detail + if hasattr(self, "payment_method_type") and self.payment_method_type is not None: + params['paymentMethodType'] = self.payment_method_type + if hasattr(self, "payment_method_detail") and self.payment_method_detail is not None: + params['paymentMethodDetail'] = self.payment_method_detail if hasattr(self, "enabled") and self.enabled is not None: - params["enabled"] = self.enabled + params['enabled'] = self.enabled if hasattr(self, "preferred") and self.preferred is not None: - params["preferred"] = self.preferred + params['preferred'] = self.preferred if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "paymentMethodType" in response_body: - self.__payment_method_type = response_body["paymentMethodType"] - if "paymentMethodDetail" in response_body: - self.__payment_method_detail = response_body["paymentMethodDetail"] - if "enabled" in response_body: - self.__enabled = response_body["enabled"] - if "preferred" in response_body: - self.__preferred = response_body["preferred"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] + if 'paymentMethodType' in response_body: + self.__payment_method_type = response_body['paymentMethodType'] + if 'paymentMethodDetail' in response_body: + self.__payment_method_detail = response_body['paymentMethodDetail'] + if 'enabled' in response_body: + self.__enabled = response_body['enabled'] + if 'preferred' in response_body: + self.__preferred = response_body['preferred'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] diff --git a/com/alipay/ams/api/model/payment_method_type_item.py b/com/alipay/ams/api/model/payment_method_type_item.py index 2be778d..48bc2fe 100644 --- a/com/alipay/ams/api/model/payment_method_type_item.py +++ b/com/alipay/ams/api/model/payment_method_type_item.py @@ -1,12 +1,15 @@ import json + + class PaymentMethodTypeItem: def __init__(self): - + self.__payment_method_type = None # type: str self.__payment_method_order = None # type: int self.__express_checkout = None # type: bool + @property def payment_method_type(self): @@ -18,7 +21,6 @@ def payment_method_type(self): @payment_method_type.setter def payment_method_type(self, value): self.__payment_method_type = value - @property def payment_method_order(self): """ @@ -29,11 +31,10 @@ def payment_method_order(self): @payment_method_order.setter def payment_method_order(self, value): self.__payment_method_order = value - @property def express_checkout(self): """ - Indicates whether the payment method selected by the user is displayed as a quick payment method. The currently supported quick payment methods include ALIPAY_CN, APPLEPAY, and GOOGLAPAY. The valid values include: true: The payment method selected by the user is displayed as a quick payment method. false: The payment method selected by the user is not displayed as a quick payment method. + Indicates whether the payment method selected by the user is displayed as a quick payment method. The currently supported quick payment methods include ALIPAY_CN, APPLEPAY, and GOOGLAPAY. The valid values include: true: The payment method selected by the user is displayed as a quick payment method. false: The payment method selected by the user is not displayed as a quick payment method. """ return self.__express_checkout @@ -41,28 +42,26 @@ def express_checkout(self): def express_checkout(self, value): self.__express_checkout = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "payment_method_type") - and self.payment_method_type is not None - ): - params["paymentMethodType"] = self.payment_method_type - if ( - hasattr(self, "payment_method_order") - and self.payment_method_order is not None - ): - params["paymentMethodOrder"] = self.payment_method_order + if hasattr(self, "payment_method_type") and self.payment_method_type is not None: + params['paymentMethodType'] = self.payment_method_type + if hasattr(self, "payment_method_order") and self.payment_method_order is not None: + params['paymentMethodOrder'] = self.payment_method_order if hasattr(self, "express_checkout") and self.express_checkout is not None: - params["expressCheckout"] = self.express_checkout + params['expressCheckout'] = self.express_checkout return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "paymentMethodType" in response_body: - self.__payment_method_type = response_body["paymentMethodType"] - if "paymentMethodOrder" in response_body: - self.__payment_method_order = response_body["paymentMethodOrder"] - if "expressCheckout" in response_body: - self.__express_checkout = response_body["expressCheckout"] + if 'paymentMethodType' in response_body: + self.__payment_method_type = response_body['paymentMethodType'] + if 'paymentMethodOrder' in response_body: + self.__payment_method_order = response_body['paymentMethodOrder'] + if 'expressCheckout' in response_body: + self.__express_checkout = response_body['expressCheckout'] diff --git a/com/alipay/ams/api/model/payment_option.py b/com/alipay/ams/api/model/payment_option.py index f67ec00..77596a6 100644 --- a/com/alipay/ams/api/model/payment_option.py +++ b/com/alipay/ams/api/model/payment_option.py @@ -1,18 +1,18 @@ import json -from com.alipay.ams.api.model.payment_method_category_type import ( - PaymentMethodCategoryType, -) +from com.alipay.ams.api.model.payment_method_category_type import PaymentMethodCategoryType from com.alipay.ams.api.model.payment_option_detail import PaymentOptionDetail from com.alipay.ams.api.model.logo import Logo from com.alipay.ams.api.model.installment import Installment from com.alipay.ams.api.model.promotion_info import PromotionInfo from com.alipay.ams.api.model.interaction_type import InteractionType -from com.alipay.ams.api.model.amount_limit_info import AmountLimitInfo +from com.alipay.ams.api.model. amount_limit_info import AmountLimitInfo + + class PaymentOption: def __init__(self): - + self.__payment_method_type = None # type: str self.__payment_method_category = None # type: PaymentMethodCategoryType self.__payment_method_region = None # type: [str] @@ -29,6 +29,7 @@ def __init__(self): self.__interaction_type = None # type: InteractionType self.__bank_identifier_code = None # type: str self.__amount_limit_info_map = None # type: {str: (AmountLimitInfo,)} + @property def payment_method_type(self): @@ -40,16 +41,16 @@ def payment_method_type(self): @payment_method_type.setter def payment_method_type(self, value): self.__payment_method_type = value - @property def payment_method_category(self): - """Gets the payment_method_category of this PaymentOption.""" + """Gets the payment_method_category of this PaymentOption. + + """ return self.__payment_method_category @payment_method_category.setter def payment_method_category(self, value): self.__payment_method_category = value - @property def payment_method_region(self): """ @@ -60,7 +61,6 @@ def payment_method_region(self): @payment_method_region.setter def payment_method_region(self, value): self.__payment_method_region = value - @property def enabled(self): """ @@ -71,63 +71,66 @@ def enabled(self): @enabled.setter def enabled(self, value): self.__enabled = value - @property def preferred(self): - """Gets the preferred of this PaymentOption.""" + """Gets the preferred of this PaymentOption. + + """ return self.__preferred @preferred.setter def preferred(self, value): self.__preferred = value - @property def disable_reason(self): """ - The reason why the payment method is not available. Valid values are: PAYMENT_ACCOUNT_NOT_AVAILABLE EXCEED_CHANNEL_LIMIT_RULE SERVICE_DEGRADE CHANNEL_NOT_SUPPORT_CURRENCY CHANNEL_DISABLE CHANNEL_NOT_IN_SERVICE_TIME QUERY_IPP_INFO_FAILED LIMIT_CENTER_ACCESS_FAIL CURRENT_CHANNEL_NOT_EXIST + The reason why the payment method is not available. Valid values are: PAYMENT_ACCOUNT_NOT_AVAILABLE EXCEED_CHANNEL_LIMIT_RULE SERVICE_DEGRADE CHANNEL_NOT_SUPPORT_CURRENCY CHANNEL_DISABLE CHANNEL_NOT_IN_SERVICE_TIME QUERY_IPP_INFO_FAILED LIMIT_CENTER_ACCESS_FAIL CURRENT_CHANNEL_NOT_EXIST """ return self.__disable_reason @disable_reason.setter def disable_reason(self, value): self.__disable_reason = value - @property def supported_currencies(self): - """Gets the supported_currencies of this PaymentOption.""" + """Gets the supported_currencies of this PaymentOption. + + """ return self.__supported_currencies @supported_currencies.setter def supported_currencies(self, value): self.__supported_currencies = value - @property def payment_option_detail(self): - """Gets the payment_option_detail of this PaymentOption.""" + """Gets the payment_option_detail of this PaymentOption. + + """ return self.__payment_option_detail @payment_option_detail.setter def payment_option_detail(self, value): self.__payment_option_detail = value - @property def extend_info(self): - """Gets the extend_info of this PaymentOption.""" + """Gets the extend_info of this PaymentOption. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def logo(self): - """Gets the logo of this PaymentOption.""" + """Gets the logo of this PaymentOption. + + """ return self.__logo @logo.setter def logo(self, value): self.__logo = value - @property def promo_names(self): """ @@ -138,16 +141,16 @@ def promo_names(self): @promo_names.setter def promo_names(self, value): self.__promo_names = value - @property def installment(self): - """Gets the installment of this PaymentOption.""" + """Gets the installment of this PaymentOption. + + """ return self.__installment @installment.setter def installment(self, value): self.__installment = value - @property def promotion_infos(self): """ @@ -158,16 +161,16 @@ def promotion_infos(self): @promotion_infos.setter def promotion_infos(self, value): self.__promotion_infos = value - @property def interaction_type(self): - """Gets the interaction_type of this PaymentOption.""" + """Gets the interaction_type of this PaymentOption. + + """ return self.__interaction_type @interaction_type.setter def interaction_type(self, value): self.__interaction_type = value - @property def bank_identifier_code(self): """ @@ -178,122 +181,100 @@ def bank_identifier_code(self): @bank_identifier_code.setter def bank_identifier_code(self, value): self.__bank_identifier_code = value - @property def amount_limit_info_map(self): - """Gets the amount_limit_info_map of this PaymentOption.""" + """Gets the amount_limit_info_map of this PaymentOption. + + """ return self.__amount_limit_info_map @amount_limit_info_map.setter def amount_limit_info_map(self, value): self.__amount_limit_info_map = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "payment_method_type") - and self.payment_method_type is not None - ): - params["paymentMethodType"] = self.payment_method_type - if ( - hasattr(self, "payment_method_category") - and self.payment_method_category is not None - ): - params["paymentMethodCategory"] = self.payment_method_category - if ( - hasattr(self, "payment_method_region") - and self.payment_method_region is not None - ): - params["paymentMethodRegion"] = self.payment_method_region + if hasattr(self, "payment_method_type") and self.payment_method_type is not None: + params['paymentMethodType'] = self.payment_method_type + if hasattr(self, "payment_method_category") and self.payment_method_category is not None: + params['paymentMethodCategory'] = self.payment_method_category + if hasattr(self, "payment_method_region") and self.payment_method_region is not None: + params['paymentMethodRegion'] = self.payment_method_region if hasattr(self, "enabled") and self.enabled is not None: - params["enabled"] = self.enabled + params['enabled'] = self.enabled if hasattr(self, "preferred") and self.preferred is not None: - params["preferred"] = self.preferred + params['preferred'] = self.preferred if hasattr(self, "disable_reason") and self.disable_reason is not None: - params["disableReason"] = self.disable_reason - if ( - hasattr(self, "supported_currencies") - and self.supported_currencies is not None - ): - params["supportedCurrencies"] = self.supported_currencies - if ( - hasattr(self, "payment_option_detail") - and self.payment_option_detail is not None - ): - params["paymentOptionDetail"] = self.payment_option_detail + params['disableReason'] = self.disable_reason + if hasattr(self, "supported_currencies") and self.supported_currencies is not None: + params['supportedCurrencies'] = self.supported_currencies + if hasattr(self, "payment_option_detail") and self.payment_option_detail is not None: + params['paymentOptionDetail'] = self.payment_option_detail if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "logo") and self.logo is not None: - params["logo"] = self.logo + params['logo'] = self.logo if hasattr(self, "promo_names") and self.promo_names is not None: - params["promoNames"] = self.promo_names + params['promoNames'] = self.promo_names if hasattr(self, "installment") and self.installment is not None: - params["installment"] = self.installment + params['installment'] = self.installment if hasattr(self, "promotion_infos") and self.promotion_infos is not None: - params["promotionInfos"] = self.promotion_infos + params['promotionInfos'] = self.promotion_infos if hasattr(self, "interaction_type") and self.interaction_type is not None: - params["interactionType"] = self.interaction_type - if ( - hasattr(self, "bank_identifier_code") - and self.bank_identifier_code is not None - ): - params["bankIdentifierCode"] = self.bank_identifier_code - if ( - hasattr(self, "amount_limit_info_map") - and self.amount_limit_info_map is not None - ): - params["amountLimitInfoMap"] = self.amount_limit_info_map + params['interactionType'] = self.interaction_type + if hasattr(self, "bank_identifier_code") and self.bank_identifier_code is not None: + params['bankIdentifierCode'] = self.bank_identifier_code + if hasattr(self, "amount_limit_info_map") and self.amount_limit_info_map is not None: + params['amountLimitInfoMap'] = self.amount_limit_info_map return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "paymentMethodType" in response_body: - self.__payment_method_type = response_body["paymentMethodType"] - if "paymentMethodCategory" in response_body: - payment_method_category_temp = PaymentMethodCategoryType.value_of( - response_body["paymentMethodCategory"] - ) + if 'paymentMethodType' in response_body: + self.__payment_method_type = response_body['paymentMethodType'] + if 'paymentMethodCategory' in response_body: + payment_method_category_temp = PaymentMethodCategoryType.value_of(response_body['paymentMethodCategory']) self.__payment_method_category = payment_method_category_temp - if "paymentMethodRegion" in response_body: - self.__payment_method_region = response_body["paymentMethodRegion"] - if "enabled" in response_body: - self.__enabled = response_body["enabled"] - if "preferred" in response_body: - self.__preferred = response_body["preferred"] - if "disableReason" in response_body: - self.__disable_reason = response_body["disableReason"] - if "supportedCurrencies" in response_body: - self.__supported_currencies = response_body["supportedCurrencies"] - if "paymentOptionDetail" in response_body: + if 'paymentMethodRegion' in response_body: + self.__payment_method_region = response_body['paymentMethodRegion'] + if 'enabled' in response_body: + self.__enabled = response_body['enabled'] + if 'preferred' in response_body: + self.__preferred = response_body['preferred'] + if 'disableReason' in response_body: + self.__disable_reason = response_body['disableReason'] + if 'supportedCurrencies' in response_body: + self.__supported_currencies = response_body['supportedCurrencies'] + if 'paymentOptionDetail' in response_body: self.__payment_option_detail = PaymentOptionDetail() - self.__payment_option_detail.parse_rsp_body( - response_body["paymentOptionDetail"] - ) - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "logo" in response_body: + self.__payment_option_detail.parse_rsp_body(response_body['paymentOptionDetail']) + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'logo' in response_body: self.__logo = Logo() - self.__logo.parse_rsp_body(response_body["logo"]) - if "promoNames" in response_body: - self.__promo_names = response_body["promoNames"] - if "installment" in response_body: + self.__logo.parse_rsp_body(response_body['logo']) + if 'promoNames' in response_body: + self.__promo_names = response_body['promoNames'] + if 'installment' in response_body: self.__installment = Installment() - self.__installment.parse_rsp_body(response_body["installment"]) - if "promotionInfos" in response_body: + self.__installment.parse_rsp_body(response_body['installment']) + if 'promotionInfos' in response_body: self.__promotion_infos = [] - for item in response_body["promotionInfos"]: + for item in response_body['promotionInfos']: obj = PromotionInfo() obj.parse_rsp_body(item) self.__promotion_infos.append(obj) - if "interactionType" in response_body: - interaction_type_temp = InteractionType.value_of( - response_body["interactionType"] - ) + if 'interactionType' in response_body: + interaction_type_temp = InteractionType.value_of(response_body['interactionType']) self.__interaction_type = interaction_type_temp - if "bankIdentifierCode" in response_body: - self.__bank_identifier_code = response_body["bankIdentifierCode"] - if "amountLimitInfoMap" in response_body: + if 'bankIdentifierCode' in response_body: + self.__bank_identifier_code = response_body['bankIdentifierCode'] + if 'amountLimitInfoMap' in response_body: self.__amount_limit_info_map = {} - for key, value in response_body["amountLimitInfoMap"].items(): + for key, value in response_body['amountLimitInfoMap'].items(): self.__amount_limit_info_map[key] = value diff --git a/com/alipay/ams/api/model/payment_option_detail.py b/com/alipay/ams/api/model/payment_option_detail.py index 9ec168f..494a6b8 100644 --- a/com/alipay/ams/api/model/payment_option_detail.py +++ b/com/alipay/ams/api/model/payment_option_detail.py @@ -3,13 +3,16 @@ from com.alipay.ams.api.model.support_bank import SupportBank + + class PaymentOptionDetail: def __init__(self): - + self.__support_card_brands = None # type: [SupportCardBrand] self.__funding = None # type: [str] self.__support_banks = None # type: [SupportBank] self.__interaction_types = None # type: [str] + @property def support_card_brands(self): @@ -21,7 +24,6 @@ def support_card_brands(self): @support_card_brands.setter def support_card_brands(self, value): self.__support_card_brands = value - @property def funding(self): """ @@ -32,18 +34,16 @@ def funding(self): @funding.setter def funding(self, value): self.__funding = value - @property def support_banks(self): """ - The list of supported banks. This parameter is returned when the value of paymentMethodType is ​P24​ or ONLINEBANKING_FPX. + The list of supported banks. This parameter is returned when the value of paymentMethodType is ​P24​ or ONLINEBANKING_FPX. """ return self.__support_banks @support_banks.setter def support_banks(self, value): self.__support_banks = value - @property def interaction_types(self): """ @@ -55,37 +55,38 @@ def interaction_types(self): def interaction_types(self, value): self.__interaction_types = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "support_card_brands") - and self.support_card_brands is not None - ): - params["supportCardBrands"] = self.support_card_brands + if hasattr(self, "support_card_brands") and self.support_card_brands is not None: + params['supportCardBrands'] = self.support_card_brands if hasattr(self, "funding") and self.funding is not None: - params["funding"] = self.funding + params['funding'] = self.funding if hasattr(self, "support_banks") and self.support_banks is not None: - params["supportBanks"] = self.support_banks + params['supportBanks'] = self.support_banks if hasattr(self, "interaction_types") and self.interaction_types is not None: - params["interactionTypes"] = self.interaction_types + params['interactionTypes'] = self.interaction_types return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "supportCardBrands" in response_body: + if 'supportCardBrands' in response_body: self.__support_card_brands = [] - for item in response_body["supportCardBrands"]: + for item in response_body['supportCardBrands']: obj = SupportCardBrand() obj.parse_rsp_body(item) self.__support_card_brands.append(obj) - if "funding" in response_body: - self.__funding = response_body["funding"] - if "supportBanks" in response_body: + if 'funding' in response_body: + self.__funding = response_body['funding'] + if 'supportBanks' in response_body: self.__support_banks = [] - for item in response_body["supportBanks"]: + for item in response_body['supportBanks']: obj = SupportBank() obj.parse_rsp_body(item) self.__support_banks.append(obj) - if "interactionTypes" in response_body: - self.__interaction_types = response_body["interactionTypes"] + if 'interactionTypes' in response_body: + self.__interaction_types = response_body['interactionTypes'] diff --git a/com/alipay/ams/api/model/payment_result_info.py b/com/alipay/ams/api/model/payment_result_info.py index 50cb608..561f13b 100644 --- a/com/alipay/ams/api/model/payment_result_info.py +++ b/com/alipay/ams/api/model/payment_result_info.py @@ -4,9 +4,11 @@ from com.alipay.ams.api.model.credit_pay_plan import CreditPayPlan + + class PaymentResultInfo: def __init__(self): - + self.__issuer_name = None # type: str self.__refusal_code_raw = None # type: str self.__refusal_reason_raw = None # type: str @@ -33,6 +35,7 @@ def __init__(self): self.__exemption_requested = None # type: str self.__credential_type_used = None # type: str self.__rrn = None # type: str + @property def issuer_name(self): @@ -44,7 +47,6 @@ def issuer_name(self): @issuer_name.setter def issuer_name(self, value): self.__issuer_name = value - @property def refusal_code_raw(self): """ @@ -55,7 +57,6 @@ def refusal_code_raw(self): @refusal_code_raw.setter def refusal_code_raw(self, value): self.__refusal_code_raw = value - @property def refusal_reason_raw(self): """ @@ -66,7 +67,6 @@ def refusal_reason_raw(self): @refusal_reason_raw.setter def refusal_reason_raw(self, value): self.__refusal_reason_raw = value - @property def merchant_advice_code(self): """ @@ -77,16 +77,16 @@ def merchant_advice_code(self): @merchant_advice_code.setter def merchant_advice_code(self, value): self.__merchant_advice_code = value - @property def acquirer_info(self): - """Gets the acquirer_info of this PaymentResultInfo.""" + """Gets the acquirer_info of this PaymentResultInfo. + + """ return self.__acquirer_info @acquirer_info.setter def acquirer_info(self, value): self.__acquirer_info = value - @property def card_no(self): """ @@ -97,7 +97,6 @@ def card_no(self): @card_no.setter def card_no(self, value): self.__card_no = value - @property def card_brand(self): """ @@ -108,7 +107,6 @@ def card_brand(self): @card_brand.setter def card_brand(self, value): self.__card_brand = value - @property def card_token(self): """ @@ -119,7 +117,6 @@ def card_token(self): @card_token.setter def card_token(self, value): self.__card_token = value - @property def issuing_country(self): """ @@ -130,7 +127,6 @@ def issuing_country(self): @issuing_country.setter def issuing_country(self, value): self.__issuing_country = value - @property def funding(self): """ @@ -141,7 +137,6 @@ def funding(self): @funding.setter def funding(self, value): self.__funding = value - @property def payment_method_region(self): """ @@ -152,16 +147,16 @@ def payment_method_region(self): @payment_method_region.setter def payment_method_region(self, value): self.__payment_method_region = value - @property def three_ds_result(self): - """Gets the three_ds_result of this PaymentResultInfo.""" + """Gets the three_ds_result of this PaymentResultInfo. + + """ return self.__three_ds_result @three_ds_result.setter def three_ds_result(self, value): self.__three_ds_result = value - @property def avs_result_raw(self): """ @@ -172,7 +167,6 @@ def avs_result_raw(self): @avs_result_raw.setter def avs_result_raw(self, value): self.__avs_result_raw = value - @property def cvv_result_raw(self): """ @@ -183,7 +177,6 @@ def cvv_result_raw(self): @cvv_result_raw.setter def cvv_result_raw(self, value): self.__cvv_result_raw = value - @property def network_transaction_id(self): """ @@ -194,16 +187,16 @@ def network_transaction_id(self): @network_transaction_id.setter def network_transaction_id(self, value): self.__network_transaction_id = value - @property def credit_pay_plan(self): - """Gets the credit_pay_plan of this PaymentResultInfo.""" + """Gets the credit_pay_plan of this PaymentResultInfo. + + """ return self.__credit_pay_plan @credit_pay_plan.setter def credit_pay_plan(self, value): self.__credit_pay_plan = value - @property def cardholder_name(self): """ @@ -214,7 +207,6 @@ def cardholder_name(self): @cardholder_name.setter def cardholder_name(self, value): self.__cardholder_name = value - @property def card_bin(self): """ @@ -225,18 +217,16 @@ def card_bin(self): @card_bin.setter def card_bin(self, value): self.__card_bin = value - @property def last_four(self): """ - Last 4 digits of the card number. Note: This parameter is returned when the value of paymentMethodType in the pay (Checkout Payment) API is CARD for specific merchants in specific regions. More information: Maximum length: 4 characters + Last 4 digits of the card number. Note: This parameter is returned when the value of paymentMethodType in the pay (Checkout Payment) API is CARD for specific merchants in specific regions. More information: Maximum length: 4 characters """ return self.__last_four @last_four.setter def last_four(self, value): self.__last_four = value - @property def expiry_month(self): """ @@ -247,7 +237,6 @@ def expiry_month(self): @expiry_month.setter def expiry_month(self, value): self.__expiry_month = value - @property def expiry_year(self): """ @@ -258,7 +247,6 @@ def expiry_year(self): @expiry_year.setter def expiry_year(self, value): self.__expiry_year = value - @property def card_category(self): """ @@ -269,7 +257,6 @@ def card_category(self): @card_category.setter def card_category(self, value): self.__card_category = value - @property def account_no(self): """ @@ -280,7 +267,6 @@ def account_no(self): @account_no.setter def account_no(self, value): self.__account_no = value - @property def exemption_requested(self): """ @@ -291,7 +277,6 @@ def exemption_requested(self): @exemption_requested.setter def exemption_requested(self, value): self.__exemption_requested = value - @property def credential_type_used(self): """ @@ -302,7 +287,6 @@ def credential_type_used(self): @credential_type_used.setter def credential_type_used(self, value): self.__credential_type_used = value - @property def rrn(self): """ @@ -314,132 +298,121 @@ def rrn(self): def rrn(self, value): self.__rrn = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "issuer_name") and self.issuer_name is not None: - params["issuerName"] = self.issuer_name + params['issuerName'] = self.issuer_name if hasattr(self, "refusal_code_raw") and self.refusal_code_raw is not None: - params["refusalCodeRaw"] = self.refusal_code_raw + params['refusalCodeRaw'] = self.refusal_code_raw if hasattr(self, "refusal_reason_raw") and self.refusal_reason_raw is not None: - params["refusalReasonRaw"] = self.refusal_reason_raw - if ( - hasattr(self, "merchant_advice_code") - and self.merchant_advice_code is not None - ): - params["merchantAdviceCode"] = self.merchant_advice_code + params['refusalReasonRaw'] = self.refusal_reason_raw + if hasattr(self, "merchant_advice_code") and self.merchant_advice_code is not None: + params['merchantAdviceCode'] = self.merchant_advice_code if hasattr(self, "acquirer_info") and self.acquirer_info is not None: - params["acquirerInfo"] = self.acquirer_info + params['acquirerInfo'] = self.acquirer_info if hasattr(self, "card_no") and self.card_no is not None: - params["cardNo"] = self.card_no + params['cardNo'] = self.card_no if hasattr(self, "card_brand") and self.card_brand is not None: - params["cardBrand"] = self.card_brand + params['cardBrand'] = self.card_brand if hasattr(self, "card_token") and self.card_token is not None: - params["cardToken"] = self.card_token + params['cardToken'] = self.card_token if hasattr(self, "issuing_country") and self.issuing_country is not None: - params["issuingCountry"] = self.issuing_country + params['issuingCountry'] = self.issuing_country if hasattr(self, "funding") and self.funding is not None: - params["funding"] = self.funding - if ( - hasattr(self, "payment_method_region") - and self.payment_method_region is not None - ): - params["paymentMethodRegion"] = self.payment_method_region + params['funding'] = self.funding + if hasattr(self, "payment_method_region") and self.payment_method_region is not None: + params['paymentMethodRegion'] = self.payment_method_region if hasattr(self, "three_ds_result") and self.three_ds_result is not None: - params["threeDSResult"] = self.three_ds_result + params['threeDSResult'] = self.three_ds_result if hasattr(self, "avs_result_raw") and self.avs_result_raw is not None: - params["avsResultRaw"] = self.avs_result_raw + params['avsResultRaw'] = self.avs_result_raw if hasattr(self, "cvv_result_raw") and self.cvv_result_raw is not None: - params["cvvResultRaw"] = self.cvv_result_raw - if ( - hasattr(self, "network_transaction_id") - and self.network_transaction_id is not None - ): - params["networkTransactionId"] = self.network_transaction_id + params['cvvResultRaw'] = self.cvv_result_raw + if hasattr(self, "network_transaction_id") and self.network_transaction_id is not None: + params['networkTransactionId'] = self.network_transaction_id if hasattr(self, "credit_pay_plan") and self.credit_pay_plan is not None: - params["creditPayPlan"] = self.credit_pay_plan + params['creditPayPlan'] = self.credit_pay_plan if hasattr(self, "cardholder_name") and self.cardholder_name is not None: - params["cardholderName"] = self.cardholder_name + params['cardholderName'] = self.cardholder_name if hasattr(self, "card_bin") and self.card_bin is not None: - params["cardBin"] = self.card_bin + params['cardBin'] = self.card_bin if hasattr(self, "last_four") and self.last_four is not None: - params["lastFour"] = self.last_four + params['lastFour'] = self.last_four if hasattr(self, "expiry_month") and self.expiry_month is not None: - params["expiryMonth"] = self.expiry_month + params['expiryMonth'] = self.expiry_month if hasattr(self, "expiry_year") and self.expiry_year is not None: - params["expiryYear"] = self.expiry_year + params['expiryYear'] = self.expiry_year if hasattr(self, "card_category") and self.card_category is not None: - params["cardCategory"] = self.card_category + params['cardCategory'] = self.card_category if hasattr(self, "account_no") and self.account_no is not None: - params["accountNo"] = self.account_no - if ( - hasattr(self, "exemption_requested") - and self.exemption_requested is not None - ): - params["exemptionRequested"] = self.exemption_requested - if ( - hasattr(self, "credential_type_used") - and self.credential_type_used is not None - ): - params["credentialTypeUsed"] = self.credential_type_used + params['accountNo'] = self.account_no + if hasattr(self, "exemption_requested") and self.exemption_requested is not None: + params['exemptionRequested'] = self.exemption_requested + if hasattr(self, "credential_type_used") and self.credential_type_used is not None: + params['credentialTypeUsed'] = self.credential_type_used if hasattr(self, "rrn") and self.rrn is not None: - params["rrn"] = self.rrn + params['rrn'] = self.rrn return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "issuerName" in response_body: - self.__issuer_name = response_body["issuerName"] - if "refusalCodeRaw" in response_body: - self.__refusal_code_raw = response_body["refusalCodeRaw"] - if "refusalReasonRaw" in response_body: - self.__refusal_reason_raw = response_body["refusalReasonRaw"] - if "merchantAdviceCode" in response_body: - self.__merchant_advice_code = response_body["merchantAdviceCode"] - if "acquirerInfo" in response_body: + if 'issuerName' in response_body: + self.__issuer_name = response_body['issuerName'] + if 'refusalCodeRaw' in response_body: + self.__refusal_code_raw = response_body['refusalCodeRaw'] + if 'refusalReasonRaw' in response_body: + self.__refusal_reason_raw = response_body['refusalReasonRaw'] + if 'merchantAdviceCode' in response_body: + self.__merchant_advice_code = response_body['merchantAdviceCode'] + if 'acquirerInfo' in response_body: self.__acquirer_info = AcquirerInfo() - self.__acquirer_info.parse_rsp_body(response_body["acquirerInfo"]) - if "cardNo" in response_body: - self.__card_no = response_body["cardNo"] - if "cardBrand" in response_body: - self.__card_brand = response_body["cardBrand"] - if "cardToken" in response_body: - self.__card_token = response_body["cardToken"] - if "issuingCountry" in response_body: - self.__issuing_country = response_body["issuingCountry"] - if "funding" in response_body: - self.__funding = response_body["funding"] - if "paymentMethodRegion" in response_body: - self.__payment_method_region = response_body["paymentMethodRegion"] - if "threeDSResult" in response_body: + self.__acquirer_info.parse_rsp_body(response_body['acquirerInfo']) + if 'cardNo' in response_body: + self.__card_no = response_body['cardNo'] + if 'cardBrand' in response_body: + self.__card_brand = response_body['cardBrand'] + if 'cardToken' in response_body: + self.__card_token = response_body['cardToken'] + if 'issuingCountry' in response_body: + self.__issuing_country = response_body['issuingCountry'] + if 'funding' in response_body: + self.__funding = response_body['funding'] + if 'paymentMethodRegion' in response_body: + self.__payment_method_region = response_body['paymentMethodRegion'] + if 'threeDSResult' in response_body: self.__three_ds_result = ThreeDSResult() - self.__three_ds_result.parse_rsp_body(response_body["threeDSResult"]) - if "avsResultRaw" in response_body: - self.__avs_result_raw = response_body["avsResultRaw"] - if "cvvResultRaw" in response_body: - self.__cvv_result_raw = response_body["cvvResultRaw"] - if "networkTransactionId" in response_body: - self.__network_transaction_id = response_body["networkTransactionId"] - if "creditPayPlan" in response_body: + self.__three_ds_result.parse_rsp_body(response_body['threeDSResult']) + if 'avsResultRaw' in response_body: + self.__avs_result_raw = response_body['avsResultRaw'] + if 'cvvResultRaw' in response_body: + self.__cvv_result_raw = response_body['cvvResultRaw'] + if 'networkTransactionId' in response_body: + self.__network_transaction_id = response_body['networkTransactionId'] + if 'creditPayPlan' in response_body: self.__credit_pay_plan = CreditPayPlan() - self.__credit_pay_plan.parse_rsp_body(response_body["creditPayPlan"]) - if "cardholderName" in response_body: - self.__cardholder_name = response_body["cardholderName"] - if "cardBin" in response_body: - self.__card_bin = response_body["cardBin"] - if "lastFour" in response_body: - self.__last_four = response_body["lastFour"] - if "expiryMonth" in response_body: - self.__expiry_month = response_body["expiryMonth"] - if "expiryYear" in response_body: - self.__expiry_year = response_body["expiryYear"] - if "cardCategory" in response_body: - self.__card_category = response_body["cardCategory"] - if "accountNo" in response_body: - self.__account_no = response_body["accountNo"] - if "exemptionRequested" in response_body: - self.__exemption_requested = response_body["exemptionRequested"] - if "credentialTypeUsed" in response_body: - self.__credential_type_used = response_body["credentialTypeUsed"] - if "rrn" in response_body: - self.__rrn = response_body["rrn"] + self.__credit_pay_plan.parse_rsp_body(response_body['creditPayPlan']) + if 'cardholderName' in response_body: + self.__cardholder_name = response_body['cardholderName'] + if 'cardBin' in response_body: + self.__card_bin = response_body['cardBin'] + if 'lastFour' in response_body: + self.__last_four = response_body['lastFour'] + if 'expiryMonth' in response_body: + self.__expiry_month = response_body['expiryMonth'] + if 'expiryYear' in response_body: + self.__expiry_year = response_body['expiryYear'] + if 'cardCategory' in response_body: + self.__card_category = response_body['cardCategory'] + if 'accountNo' in response_body: + self.__account_no = response_body['accountNo'] + if 'exemptionRequested' in response_body: + self.__exemption_requested = response_body['exemptionRequested'] + if 'credentialTypeUsed' in response_body: + self.__credential_type_used = response_body['credentialTypeUsed'] + if 'rrn' in response_body: + self.__rrn = response_body['rrn'] diff --git a/com/alipay/ams/api/model/payment_verification_data.py b/com/alipay/ams/api/model/payment_verification_data.py index 2fb426f..351c661 100644 --- a/com/alipay/ams/api/model/payment_verification_data.py +++ b/com/alipay/ams/api/model/payment_verification_data.py @@ -1,45 +1,52 @@ import json + + class PaymentVerificationData: def __init__(self): - + self.__verify_request_id = None # type: str self.__authentication_code = None # type: str + @property def verify_request_id(self): - """Gets the verify_request_id of this PaymentVerificationData.""" + """Gets the verify_request_id of this PaymentVerificationData. + + """ return self.__verify_request_id @verify_request_id.setter def verify_request_id(self, value): self.__verify_request_id = value - @property def authentication_code(self): - """Gets the authentication_code of this PaymentVerificationData.""" + """Gets the authentication_code of this PaymentVerificationData. + + """ return self.__authentication_code @authentication_code.setter def authentication_code(self, value): self.__authentication_code = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "verify_request_id") and self.verify_request_id is not None: - params["verifyRequestId"] = self.verify_request_id - if ( - hasattr(self, "authentication_code") - and self.authentication_code is not None - ): - params["authenticationCode"] = self.authentication_code + params['verifyRequestId'] = self.verify_request_id + if hasattr(self, "authentication_code") and self.authentication_code is not None: + params['authenticationCode'] = self.authentication_code return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "verifyRequestId" in response_body: - self.__verify_request_id = response_body["verifyRequestId"] - if "authenticationCode" in response_body: - self.__authentication_code = response_body["authenticationCode"] + if 'verifyRequestId' in response_body: + self.__verify_request_id = response_body['verifyRequestId'] + if 'authenticationCode' in response_body: + self.__authentication_code = response_body['authenticationCode'] diff --git a/com/alipay/ams/api/model/period_rule.py b/com/alipay/ams/api/model/period_rule.py index a0fecba..840282e 100644 --- a/com/alipay/ams/api/model/period_rule.py +++ b/com/alipay/ams/api/model/period_rule.py @@ -2,13 +2,16 @@ from com.alipay.ams.api.model.amount import Amount + + class PeriodRule: def __init__(self): - + self.__period_type = None # type: str self.__period = None # type: int self.__price = None # type: Amount self.__period_count = None # type: int + @property def period_type(self): @@ -20,7 +23,6 @@ def period_type(self): @period_type.setter def period_type(self, value): self.__period_type = value - @property def period(self): """ @@ -31,16 +33,16 @@ def period(self): @period.setter def period(self, value): self.__period = value - @property def price(self): - """Gets the price of this PeriodRule.""" + """Gets the price of this PeriodRule. + + """ return self.__price @price.setter def price(self, value): self.__price = value - @property def period_count(self): """ @@ -52,27 +54,31 @@ def period_count(self): def period_count(self, value): self.__period_count = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "period_type") and self.period_type is not None: - params["periodType"] = self.period_type + params['periodType'] = self.period_type if hasattr(self, "period") and self.period is not None: - params["period"] = self.period + params['period'] = self.period if hasattr(self, "price") and self.price is not None: - params["price"] = self.price + params['price'] = self.price if hasattr(self, "period_count") and self.period_count is not None: - params["periodCount"] = self.period_count + params['periodCount'] = self.period_count return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "periodType" in response_body: - self.__period_type = response_body["periodType"] - if "period" in response_body: - self.__period = response_body["period"] - if "price" in response_body: + if 'periodType' in response_body: + self.__period_type = response_body['periodType'] + if 'period' in response_body: + self.__period = response_body['period'] + if 'price' in response_body: self.__price = Amount() - self.__price.parse_rsp_body(response_body["price"]) - if "periodCount" in response_body: - self.__period_count = response_body["periodCount"] + self.__price.parse_rsp_body(response_body['price']) + if 'periodCount' in response_body: + self.__period_count = response_body['periodCount'] diff --git a/com/alipay/ams/api/model/plan.py b/com/alipay/ams/api/model/plan.py index 95b28ed..b157259 100644 --- a/com/alipay/ams/api/model/plan.py +++ b/com/alipay/ams/api/model/plan.py @@ -3,15 +3,18 @@ from com.alipay.ams.api.model.amount import Amount + + class Plan: def __init__(self): - + self.__interest_rate = None # type: str self.__min_installment_amount = None # type: Amount self.__max_installment_amount = None # type: Amount self.__installment_num = None # type: str self.__interval = None # type: str self.__enabled = None # type: bool + @property def interest_rate(self): @@ -23,25 +26,26 @@ def interest_rate(self): @interest_rate.setter def interest_rate(self, value): self.__interest_rate = value - @property def min_installment_amount(self): - """Gets the min_installment_amount of this Plan.""" + """Gets the min_installment_amount of this Plan. + + """ return self.__min_installment_amount @min_installment_amount.setter def min_installment_amount(self, value): self.__min_installment_amount = value - @property def max_installment_amount(self): - """Gets the max_installment_amount of this Plan.""" + """Gets the max_installment_amount of this Plan. + + """ return self.__max_installment_amount @max_installment_amount.setter def max_installment_amount(self, value): self.__max_installment_amount = value - @property def installment_num(self): """ @@ -52,7 +56,6 @@ def installment_num(self): @installment_num.setter def installment_num(self, value): self.__installment_num = value - @property def interval(self): """ @@ -63,11 +66,10 @@ def interval(self): @interval.setter def interval(self, value): self.__interval = value - @property def enabled(self): """ - Indicates whether the installment payment is available. + Indicates whether the installment payment is available. """ return self.__enabled @@ -75,46 +77,40 @@ def enabled(self): def enabled(self, value): self.__enabled = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "interest_rate") and self.interest_rate is not None: - params["interestRate"] = self.interest_rate - if ( - hasattr(self, "min_installment_amount") - and self.min_installment_amount is not None - ): - params["minInstallmentAmount"] = self.min_installment_amount - if ( - hasattr(self, "max_installment_amount") - and self.max_installment_amount is not None - ): - params["maxInstallmentAmount"] = self.max_installment_amount + params['interestRate'] = self.interest_rate + if hasattr(self, "min_installment_amount") and self.min_installment_amount is not None: + params['minInstallmentAmount'] = self.min_installment_amount + if hasattr(self, "max_installment_amount") and self.max_installment_amount is not None: + params['maxInstallmentAmount'] = self.max_installment_amount if hasattr(self, "installment_num") and self.installment_num is not None: - params["installmentNum"] = self.installment_num + params['installmentNum'] = self.installment_num if hasattr(self, "interval") and self.interval is not None: - params["interval"] = self.interval + params['interval'] = self.interval if hasattr(self, "enabled") and self.enabled is not None: - params["enabled"] = self.enabled + params['enabled'] = self.enabled return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "interestRate" in response_body: - self.__interest_rate = response_body["interestRate"] - if "minInstallmentAmount" in response_body: + if 'interestRate' in response_body: + self.__interest_rate = response_body['interestRate'] + if 'minInstallmentAmount' in response_body: self.__min_installment_amount = Amount() - self.__min_installment_amount.parse_rsp_body( - response_body["minInstallmentAmount"] - ) - if "maxInstallmentAmount" in response_body: + self.__min_installment_amount.parse_rsp_body(response_body['minInstallmentAmount']) + if 'maxInstallmentAmount' in response_body: self.__max_installment_amount = Amount() - self.__max_installment_amount.parse_rsp_body( - response_body["maxInstallmentAmount"] - ) - if "installmentNum" in response_body: - self.__installment_num = response_body["installmentNum"] - if "interval" in response_body: - self.__interval = response_body["interval"] - if "enabled" in response_body: - self.__enabled = response_body["enabled"] + self.__max_installment_amount.parse_rsp_body(response_body['maxInstallmentAmount']) + if 'installmentNum' in response_body: + self.__installment_num = response_body['installmentNum'] + if 'interval' in response_body: + self.__interval = response_body['interval'] + if 'enabled' in response_body: + self.__enabled = response_body['enabled'] diff --git a/com/alipay/ams/api/model/presentment_mode.py b/com/alipay/ams/api/model/presentment_mode.py index 44ba3e4..a8080ca 100644 --- a/com/alipay/ams/api/model/presentment_mode.py +++ b/com/alipay/ams/api/model/presentment_mode.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class PresentmentMode(Enum): """PresentmentMode枚举类""" diff --git a/com/alipay/ams/api/model/product_code_type.py b/com/alipay/ams/api/model/product_code_type.py index 1ca3cfe..f0a28ba 100644 --- a/com/alipay/ams/api/model/product_code_type.py +++ b/com/alipay/ams/api/model/product_code_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class ProductCodeType(Enum): """ProductCodeType枚举类""" diff --git a/com/alipay/ams/api/model/promotion_info.py b/com/alipay/ams/api/model/promotion_info.py index e6c98a9..b26cee5 100644 --- a/com/alipay/ams/api/model/promotion_info.py +++ b/com/alipay/ams/api/model/promotion_info.py @@ -4,59 +4,70 @@ from com.alipay.ams.api.model.interest_free import InterestFree + + class PromotionInfo: def __init__(self): - + self.__promotion_type = None # type: PromotionType self.__discount = None # type: Discount self.__interest_free = None # type: InterestFree + @property def promotion_type(self): - """Gets the promotion_type of this PromotionInfo.""" + """Gets the promotion_type of this PromotionInfo. + + """ return self.__promotion_type @promotion_type.setter def promotion_type(self, value): self.__promotion_type = value - @property def discount(self): - """Gets the discount of this PromotionInfo.""" + """Gets the discount of this PromotionInfo. + + """ return self.__discount @discount.setter def discount(self, value): self.__discount = value - @property def interest_free(self): - """Gets the interest_free of this PromotionInfo.""" + """Gets the interest_free of this PromotionInfo. + + """ return self.__interest_free @interest_free.setter def interest_free(self, value): self.__interest_free = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "promotion_type") and self.promotion_type is not None: - params["promotionType"] = self.promotion_type + params['promotionType'] = self.promotion_type if hasattr(self, "discount") and self.discount is not None: - params["discount"] = self.discount + params['discount'] = self.discount if hasattr(self, "interest_free") and self.interest_free is not None: - params["interestFree"] = self.interest_free + params['interestFree'] = self.interest_free return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "promotionType" in response_body: - promotion_type_temp = PromotionType.value_of(response_body["promotionType"]) + if 'promotionType' in response_body: + promotion_type_temp = PromotionType.value_of(response_body['promotionType']) self.__promotion_type = promotion_type_temp - if "discount" in response_body: + if 'discount' in response_body: self.__discount = Discount() - self.__discount.parse_rsp_body(response_body["discount"]) - if "interestFree" in response_body: + self.__discount.parse_rsp_body(response_body['discount']) + if 'interestFree' in response_body: self.__interest_free = InterestFree() - self.__interest_free.parse_rsp_body(response_body["interestFree"]) + self.__interest_free.parse_rsp_body(response_body['interestFree']) diff --git a/com/alipay/ams/api/model/promotion_result.py b/com/alipay/ams/api/model/promotion_result.py index 57e9207..ee60037 100644 --- a/com/alipay/ams/api/model/promotion_result.py +++ b/com/alipay/ams/api/model/promotion_result.py @@ -3,44 +3,54 @@ from com.alipay.ams.api.model.discount import Discount + + class PromotionResult: def __init__(self): - + self.__promotion_type = None # type: PromotionType self.__discount = None # type: Discount + @property def promotion_type(self): - """Gets the promotion_type of this PromotionResult.""" + """Gets the promotion_type of this PromotionResult. + + """ return self.__promotion_type @promotion_type.setter def promotion_type(self, value): self.__promotion_type = value - @property def discount(self): - """Gets the discount of this PromotionResult.""" + """Gets the discount of this PromotionResult. + + """ return self.__discount @discount.setter def discount(self, value): self.__discount = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "promotion_type") and self.promotion_type is not None: - params["promotionType"] = self.promotion_type + params['promotionType'] = self.promotion_type if hasattr(self, "discount") and self.discount is not None: - params["discount"] = self.discount + params['discount'] = self.discount return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "promotionType" in response_body: - promotion_type_temp = PromotionType.value_of(response_body["promotionType"]) + if 'promotionType' in response_body: + promotion_type_temp = PromotionType.value_of(response_body['promotionType']) self.__promotion_type = promotion_type_temp - if "discount" in response_body: + if 'discount' in response_body: self.__discount = Discount() - self.__discount.parse_rsp_body(response_body["discount"]) + self.__discount.parse_rsp_body(response_body['discount']) diff --git a/com/alipay/ams/api/model/promotion_type.py b/com/alipay/ams/api/model/promotion_type.py index 70aa120..7d90340 100644 --- a/com/alipay/ams/api/model/promotion_type.py +++ b/com/alipay/ams/api/model/promotion_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class PromotionType(Enum): """PromotionType枚举类""" diff --git a/com/alipay/ams/api/model/psp_customer_info.py b/com/alipay/ams/api/model/psp_customer_info.py index 126dc98..2fa52e8 100644 --- a/com/alipay/ams/api/model/psp_customer_info.py +++ b/com/alipay/ams/api/model/psp_customer_info.py @@ -1,15 +1,18 @@ import json + + class PspCustomerInfo: def __init__(self): - + self.__psp_name = None # type: str self.__psp_customer_id = None # type: str self.__display_customer_id = None # type: str self.__display_customer_name = None # type: str self.__customer2088_id = None # type: str self.__extend_info = None # type: str + @property def psp_name(self): @@ -21,7 +24,6 @@ def psp_name(self): @psp_name.setter def psp_name(self, value): self.__psp_name = value - @property def psp_customer_id(self): """ @@ -32,7 +34,6 @@ def psp_customer_id(self): @psp_customer_id.setter def psp_customer_id(self, value): self.__psp_customer_id = value - @property def display_customer_id(self): """ @@ -43,68 +44,69 @@ def display_customer_id(self): @display_customer_id.setter def display_customer_id(self, value): self.__display_customer_id = value - @property def display_customer_name(self): - """Gets the display_customer_name of this PspCustomerInfo.""" + """Gets the display_customer_name of this PspCustomerInfo. + + """ return self.__display_customer_name @display_customer_name.setter def display_customer_name(self, value): self.__display_customer_name = value - @property def customer2088_id(self): - """Gets the customer2088_id of this PspCustomerInfo.""" + """Gets the customer2088_id of this PspCustomerInfo. + + """ return self.__customer2088_id @customer2088_id.setter def customer2088_id(self, value): self.__customer2088_id = value - @property def extend_info(self): - """Gets the extend_info of this PspCustomerInfo.""" + """Gets the extend_info of this PspCustomerInfo. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "psp_name") and self.psp_name is not None: - params["pspName"] = self.psp_name + params['pspName'] = self.psp_name if hasattr(self, "psp_customer_id") and self.psp_customer_id is not None: - params["pspCustomerId"] = self.psp_customer_id - if ( - hasattr(self, "display_customer_id") - and self.display_customer_id is not None - ): - params["displayCustomerId"] = self.display_customer_id - if ( - hasattr(self, "display_customer_name") - and self.display_customer_name is not None - ): - params["displayCustomerName"] = self.display_customer_name + params['pspCustomerId'] = self.psp_customer_id + if hasattr(self, "display_customer_id") and self.display_customer_id is not None: + params['displayCustomerId'] = self.display_customer_id + if hasattr(self, "display_customer_name") and self.display_customer_name is not None: + params['displayCustomerName'] = self.display_customer_name if hasattr(self, "customer2088_id") and self.customer2088_id is not None: - params["customer2088Id"] = self.customer2088_id + params['customer2088Id'] = self.customer2088_id if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "pspName" in response_body: - self.__psp_name = response_body["pspName"] - if "pspCustomerId" in response_body: - self.__psp_customer_id = response_body["pspCustomerId"] - if "displayCustomerId" in response_body: - self.__display_customer_id = response_body["displayCustomerId"] - if "displayCustomerName" in response_body: - self.__display_customer_name = response_body["displayCustomerName"] - if "customer2088Id" in response_body: - self.__customer2088_id = response_body["customer2088Id"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] + if 'pspName' in response_body: + self.__psp_name = response_body['pspName'] + if 'pspCustomerId' in response_body: + self.__psp_customer_id = response_body['pspCustomerId'] + if 'displayCustomerId' in response_body: + self.__display_customer_id = response_body['displayCustomerId'] + if 'displayCustomerName' in response_body: + self.__display_customer_name = response_body['displayCustomerName'] + if 'customer2088Id' in response_body: + self.__customer2088_id = response_body['customer2088Id'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] diff --git a/com/alipay/ams/api/model/quote.py b/com/alipay/ams/api/model/quote.py index cecf613..4700cbf 100644 --- a/com/alipay/ams/api/model/quote.py +++ b/com/alipay/ams/api/model/quote.py @@ -2,9 +2,11 @@ from com.alipay.ams.api.model.amount import Amount + + class Quote: def __init__(self): - + self.__quote_id = None # type: str self.__quote_currency_pair = None # type: str self.__quote_price = None # type: float @@ -12,6 +14,7 @@ def __init__(self): self.__quote_expiry_time = None # type: str self.__guaranteed = None # type: bool self.__exchange_amount = None # type: Amount + @property def quote_id(self): @@ -23,7 +26,6 @@ def quote_id(self): @quote_id.setter def quote_id(self, value): self.__quote_id = value - @property def quote_currency_pair(self): """ @@ -34,7 +36,6 @@ def quote_currency_pair(self): @quote_currency_pair.setter def quote_currency_pair(self, value): self.__quote_currency_pair = value - @property def quote_price(self): """ @@ -45,85 +46,84 @@ def quote_price(self): @quote_price.setter def quote_price(self, value): self.__quote_price = value - @property def quote_start_time(self): """ - Effective time of the exchange rate. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + Effective time of the exchange rate. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__quote_start_time @quote_start_time.setter def quote_start_time(self, value): self.__quote_start_time = value - @property def quote_expiry_time(self): """ - Expiration time of the exchange rate. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + Expiration time of the exchange rate. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__quote_expiry_time @quote_expiry_time.setter def quote_expiry_time(self, value): self.__quote_expiry_time = value - @property def guaranteed(self): """ - Guaranteed exchange rate available for payment. + Guaranteed exchange rate available for payment. """ return self.__guaranteed @guaranteed.setter def guaranteed(self, value): self.__guaranteed = value - @property def exchange_amount(self): - """Gets the exchange_amount of this Quote.""" + """Gets the exchange_amount of this Quote. + + """ return self.__exchange_amount @exchange_amount.setter def exchange_amount(self, value): self.__exchange_amount = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "quote_id") and self.quote_id is not None: - params["quoteId"] = self.quote_id - if ( - hasattr(self, "quote_currency_pair") - and self.quote_currency_pair is not None - ): - params["quoteCurrencyPair"] = self.quote_currency_pair + params['quoteId'] = self.quote_id + if hasattr(self, "quote_currency_pair") and self.quote_currency_pair is not None: + params['quoteCurrencyPair'] = self.quote_currency_pair if hasattr(self, "quote_price") and self.quote_price is not None: - params["quotePrice"] = self.quote_price + params['quotePrice'] = self.quote_price if hasattr(self, "quote_start_time") and self.quote_start_time is not None: - params["quoteStartTime"] = self.quote_start_time + params['quoteStartTime'] = self.quote_start_time if hasattr(self, "quote_expiry_time") and self.quote_expiry_time is not None: - params["quoteExpiryTime"] = self.quote_expiry_time + params['quoteExpiryTime'] = self.quote_expiry_time if hasattr(self, "guaranteed") and self.guaranteed is not None: - params["guaranteed"] = self.guaranteed + params['guaranteed'] = self.guaranteed if hasattr(self, "exchange_amount") and self.exchange_amount is not None: - params["exchangeAmount"] = self.exchange_amount + params['exchangeAmount'] = self.exchange_amount return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "quoteId" in response_body: - self.__quote_id = response_body["quoteId"] - if "quoteCurrencyPair" in response_body: - self.__quote_currency_pair = response_body["quoteCurrencyPair"] - if "quotePrice" in response_body: - self.__quote_price = response_body["quotePrice"] - if "quoteStartTime" in response_body: - self.__quote_start_time = response_body["quoteStartTime"] - if "quoteExpiryTime" in response_body: - self.__quote_expiry_time = response_body["quoteExpiryTime"] - if "guaranteed" in response_body: - self.__guaranteed = response_body["guaranteed"] - if "exchangeAmount" in response_body: + if 'quoteId' in response_body: + self.__quote_id = response_body['quoteId'] + if 'quoteCurrencyPair' in response_body: + self.__quote_currency_pair = response_body['quoteCurrencyPair'] + if 'quotePrice' in response_body: + self.__quote_price = response_body['quotePrice'] + if 'quoteStartTime' in response_body: + self.__quote_start_time = response_body['quoteStartTime'] + if 'quoteExpiryTime' in response_body: + self.__quote_expiry_time = response_body['quoteExpiryTime'] + if 'guaranteed' in response_body: + self.__guaranteed = response_body['guaranteed'] + if 'exchangeAmount' in response_body: self.__exchange_amount = Amount() - self.__exchange_amount.parse_rsp_body(response_body["exchangeAmount"]) + self.__exchange_amount.parse_rsp_body(response_body['exchangeAmount']) diff --git a/com/alipay/ams/api/model/redirect_action_form.py b/com/alipay/ams/api/model/redirect_action_form.py index 59db05d..c955803 100644 --- a/com/alipay/ams/api/model/redirect_action_form.py +++ b/com/alipay/ams/api/model/redirect_action_form.py @@ -1,25 +1,27 @@ import json + + class RedirectActionForm: def __init__(self): - + self.__method = None # type: str self.__parameters = None # type: str self.__redirect_url = None # type: str self.__action_form_type = None # type: str + @property def method(self): """ - The HTTP method to be used when the merchant initiates a redirection to the redirection URL. Valid values are: POST: Indicates that the request that is sent to the redirection address needs to be a POST request. GET: Indicates that the request that is sent to the redirection address needs to be a GET request. + The HTTP method to be used when the merchant initiates a redirection to the redirection URL. Valid values are: POST: Indicates that the request that is sent to the redirection address needs to be a POST request. GET: Indicates that the request that is sent to the redirection address needs to be a GET request. """ return self.__method @method.setter def method(self, value): self.__method = value - @property def parameters(self): """ @@ -30,18 +32,16 @@ def parameters(self): @parameters.setter def parameters(self, value): self.__parameters = value - @property def redirect_url(self): """ - The URL where the user is redirected to. More information: Maximum length: 2048 characters + The URL where the user is redirected to. More information: Maximum length: 2048 characters """ return self.__redirect_url @redirect_url.setter def redirect_url(self, value): self.__redirect_url = value - @property def action_form_type(self): """ @@ -53,26 +53,30 @@ def action_form_type(self): def action_form_type(self, value): self.__action_form_type = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "method") and self.method is not None: - params["method"] = self.method + params['method'] = self.method if hasattr(self, "parameters") and self.parameters is not None: - params["parameters"] = self.parameters + params['parameters'] = self.parameters if hasattr(self, "redirect_url") and self.redirect_url is not None: - params["redirectUrl"] = self.redirect_url + params['redirectUrl'] = self.redirect_url if hasattr(self, "action_form_type") and self.action_form_type is not None: - params["actionFormType"] = self.action_form_type + params['actionFormType'] = self.action_form_type return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "method" in response_body: - self.__method = response_body["method"] - if "parameters" in response_body: - self.__parameters = response_body["parameters"] - if "redirectUrl" in response_body: - self.__redirect_url = response_body["redirectUrl"] - if "actionFormType" in response_body: - self.__action_form_type = response_body["actionFormType"] + if 'method' in response_body: + self.__method = response_body['method'] + if 'parameters' in response_body: + self.__parameters = response_body['parameters'] + if 'redirectUrl' in response_body: + self.__redirect_url = response_body['redirectUrl'] + if 'actionFormType' in response_body: + self.__action_form_type = response_body['actionFormType'] diff --git a/com/alipay/ams/api/model/refund_detail.py b/com/alipay/ams/api/model/refund_detail.py index db62fec..dd8fcb7 100644 --- a/com/alipay/ams/api/model/refund_detail.py +++ b/com/alipay/ams/api/model/refund_detail.py @@ -3,44 +3,54 @@ from com.alipay.ams.api.model.refund_from_type import RefundFromType + + class RefundDetail: def __init__(self): - + self.__refund_amount = None # type: Amount self.__refund_from = None # type: RefundFromType + @property def refund_amount(self): - """Gets the refund_amount of this RefundDetail.""" + """Gets the refund_amount of this RefundDetail. + + """ return self.__refund_amount @refund_amount.setter def refund_amount(self, value): self.__refund_amount = value - @property def refund_from(self): - """Gets the refund_from of this RefundDetail.""" + """Gets the refund_from of this RefundDetail. + + """ return self.__refund_from @refund_from.setter def refund_from(self, value): self.__refund_from = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "refund_amount") and self.refund_amount is not None: - params["refundAmount"] = self.refund_amount + params['refundAmount'] = self.refund_amount if hasattr(self, "refund_from") and self.refund_from is not None: - params["refundFrom"] = self.refund_from + params['refundFrom'] = self.refund_from return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "refundAmount" in response_body: + if 'refundAmount' in response_body: self.__refund_amount = Amount() - self.__refund_amount.parse_rsp_body(response_body["refundAmount"]) - if "refundFrom" in response_body: - refund_from_temp = RefundFromType.value_of(response_body["refundFrom"]) + self.__refund_amount.parse_rsp_body(response_body['refundAmount']) + if 'refundFrom' in response_body: + refund_from_temp = RefundFromType.value_of(response_body['refundFrom']) self.__refund_from = refund_from_temp diff --git a/com/alipay/ams/api/model/refund_from_type.py b/com/alipay/ams/api/model/refund_from_type.py index b67ffcb..1884ab7 100644 --- a/com/alipay/ams/api/model/refund_from_type.py +++ b/com/alipay/ams/api/model/refund_from_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class RefundFromType(Enum): """RefundFromType枚举类""" diff --git a/com/alipay/ams/api/model/refund_to_bank_info.py b/com/alipay/ams/api/model/refund_to_bank_info.py index c396ae4..22d3ce1 100644 --- a/com/alipay/ams/api/model/refund_to_bank_info.py +++ b/com/alipay/ams/api/model/refund_to_bank_info.py @@ -2,62 +2,68 @@ from com.alipay.ams.api.model.user_name import UserName + + class RefundToBankInfo: def __init__(self): - + self.__bank_code = None # type: str self.__account_holder_name = None # type: UserName self.__account_no = None # type: str + @property def bank_code(self): - """Gets the bank_code of this RefundToBankInfo.""" + """Gets the bank_code of this RefundToBankInfo. + + """ return self.__bank_code @bank_code.setter def bank_code(self, value): self.__bank_code = value - @property def account_holder_name(self): - """Gets the account_holder_name of this RefundToBankInfo.""" + """Gets the account_holder_name of this RefundToBankInfo. + + """ return self.__account_holder_name @account_holder_name.setter def account_holder_name(self, value): self.__account_holder_name = value - @property def account_no(self): - """Gets the account_no of this RefundToBankInfo.""" + """Gets the account_no of this RefundToBankInfo. + + """ return self.__account_no @account_no.setter def account_no(self, value): self.__account_no = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "bank_code") and self.bank_code is not None: - params["bankCode"] = self.bank_code - if ( - hasattr(self, "account_holder_name") - and self.account_holder_name is not None - ): - params["accountHolderName"] = self.account_holder_name + params['bankCode'] = self.bank_code + if hasattr(self, "account_holder_name") and self.account_holder_name is not None: + params['accountHolderName'] = self.account_holder_name if hasattr(self, "account_no") and self.account_no is not None: - params["accountNo"] = self.account_no + params['accountNo'] = self.account_no return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "bankCode" in response_body: - self.__bank_code = response_body["bankCode"] - if "accountHolderName" in response_body: + if 'bankCode' in response_body: + self.__bank_code = response_body['bankCode'] + if 'accountHolderName' in response_body: self.__account_holder_name = UserName() - self.__account_holder_name.parse_rsp_body( - response_body["accountHolderName"] - ) - if "accountNo" in response_body: - self.__account_no = response_body["accountNo"] + self.__account_holder_name.parse_rsp_body(response_body['accountHolderName']) + if 'accountNo' in response_body: + self.__account_no = response_body['accountNo'] diff --git a/com/alipay/ams/api/model/result.py b/com/alipay/ams/api/model/result.py index 48d133a..d3b43be 100644 --- a/com/alipay/ams/api/model/result.py +++ b/com/alipay/ams/api/model/result.py @@ -1,13 +1,15 @@ import json -from com.alipay.ams.api.model.result_status_type import ResultStatusType + + class Result: def __init__(self): - + self.__result_code = None # type: str - self.__result_status = None # type: ResultStatusType + self.__result_status = None # type: {str: (bool, date, datetime, dict, float, int, list, str, none_type)} self.__result_message = None # type: str + @property def result_code(self): @@ -19,16 +21,16 @@ def result_code(self): @result_code.setter def result_code(self, value): self.__result_code = value - @property def result_status(self): - """Gets the result_status of this Result.""" + """ + The result status. Valid values are: S: indicates that the result status is successful. F: indicates that the result status is failed. U: indicates that the result status is unknown. + """ return self.__result_status @result_status.setter def result_status(self, value): self.__result_status = value - @property def result_message(self): """ @@ -40,25 +42,25 @@ def result_message(self): def result_message(self, value): self.__result_message = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result_code") and self.result_code is not None: - params["resultCode"] = self.result_code + params['resultCode'] = self.result_code if hasattr(self, "result_status") and self.result_status is not None: - params["resultStatus"] = self.result_status + params['resultStatus'] = self.result_status if hasattr(self, "result_message") and self.result_message is not None: - params["resultMessage"] = self.result_message + params['resultMessage'] = self.result_message return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "resultCode" in response_body: - self.__result_code = response_body["resultCode"] - if "resultStatus" in response_body: - result_status_temp = ResultStatusType.value_of( - response_body["resultStatus"] - ) - self.__result_status = result_status_temp - if "resultMessage" in response_body: - self.__result_message = response_body["resultMessage"] + if 'resultCode' in response_body: + self.__result_code = response_body['resultCode'] + if 'resultStatus' in response_body: + if 'resultMessage' in response_body: + self.__result_message = response_body['resultMessage'] diff --git a/com/alipay/ams/api/model/result_properties.py b/com/alipay/ams/api/model/result_properties.py index 2244dae..c6d125e 100644 --- a/com/alipay/ams/api/model/result_properties.py +++ b/com/alipay/ams/api/model/result_properties.py @@ -1,68 +1,73 @@ import json -from com.alipay.ams.api.model.result_properties_result_code import ( - ResultPropertiesResultCode, -) -from com.alipay.ams.api.model.result_properties_result_status import ( - ResultPropertiesResultStatus, -) -from com.alipay.ams.api.model.result_properties_result_code import ( - ResultPropertiesResultCode, -) +from com.alipay.ams.api.model.result_properties_result_code import ResultPropertiesResultCode +from com.alipay.ams.api.model.result_properties_result_status import ResultPropertiesResultStatus +from com.alipay.ams.api.model.result_properties_result_code import ResultPropertiesResultCode + + class ResultProperties: def __init__(self): - + self.__result_code = None # type: ResultPropertiesResultCode self.__result_status = None # type: ResultPropertiesResultStatus self.__result_message = None # type: ResultPropertiesResultCode + @property def result_code(self): - """Gets the result_code of this ResultProperties.""" + """Gets the result_code of this ResultProperties. + + """ return self.__result_code @result_code.setter def result_code(self, value): self.__result_code = value - @property def result_status(self): - """Gets the result_status of this ResultProperties.""" + """Gets the result_status of this ResultProperties. + + """ return self.__result_status @result_status.setter def result_status(self, value): self.__result_status = value - @property def result_message(self): - """Gets the result_message of this ResultProperties.""" + """Gets the result_message of this ResultProperties. + + """ return self.__result_message @result_message.setter def result_message(self, value): self.__result_message = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result_code") and self.result_code is not None: - params["resultCode"] = self.result_code + params['resultCode'] = self.result_code if hasattr(self, "result_status") and self.result_status is not None: - params["resultStatus"] = self.result_status + params['resultStatus'] = self.result_status if hasattr(self, "result_message") and self.result_message is not None: - params["resultMessage"] = self.result_message + params['resultMessage'] = self.result_message return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "resultCode" in response_body: + if 'resultCode' in response_body: self.__result_code = ResultPropertiesResultCode() - self.__result_code.parse_rsp_body(response_body["resultCode"]) - if "resultStatus" in response_body: + self.__result_code.parse_rsp_body(response_body['resultCode']) + if 'resultStatus' in response_body: self.__result_status = ResultPropertiesResultStatus() - self.__result_status.parse_rsp_body(response_body["resultStatus"]) - if "resultMessage" in response_body: + self.__result_status.parse_rsp_body(response_body['resultStatus']) + if 'resultMessage' in response_body: self.__result_message = ResultPropertiesResultCode() - self.__result_message.parse_rsp_body(response_body["resultMessage"]) + self.__result_message.parse_rsp_body(response_body['resultMessage']) diff --git a/com/alipay/ams/api/model/result_properties_result_code.py b/com/alipay/ams/api/model/result_properties_result_code.py index fa62bc7..e3342dc 100644 --- a/com/alipay/ams/api/model/result_properties_result_code.py +++ b/com/alipay/ams/api/model/result_properties_result_code.py @@ -1,42 +1,52 @@ import json + + class ResultPropertiesResultCode: def __init__(self): - + self.__type = None # type: str self.__description = None # type: str + @property def type(self): - """Gets the type of this ResultPropertiesResultCode.""" + """Gets the type of this ResultPropertiesResultCode. + + """ return self.__type @type.setter def type(self, value): self.__type = value - @property def description(self): - """Gets the description of this ResultPropertiesResultCode.""" + """Gets the description of this ResultPropertiesResultCode. + + """ return self.__description @description.setter def description(self, value): self.__description = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "type") and self.type is not None: - params["type"] = self.type + params['type'] = self.type if hasattr(self, "description") and self.description is not None: - params["description"] = self.description + params['description'] = self.description return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "type" in response_body: - self.__type = response_body["type"] - if "description" in response_body: - self.__description = response_body["description"] + if 'type' in response_body: + self.__type = response_body['type'] + if 'description' in response_body: + self.__description = response_body['description'] diff --git a/com/alipay/ams/api/model/result_properties_result_status.py b/com/alipay/ams/api/model/result_properties_result_status.py index ff361cc..d991a0e 100644 --- a/com/alipay/ams/api/model/result_properties_result_status.py +++ b/com/alipay/ams/api/model/result_properties_result_status.py @@ -1,42 +1,52 @@ import json + + class ResultPropertiesResultStatus: def __init__(self): - + self.__description = None # type: str self.__ref = None # type: str + @property def description(self): - """Gets the description of this ResultPropertiesResultStatus.""" + """Gets the description of this ResultPropertiesResultStatus. + + """ return self.__description @description.setter def description(self, value): self.__description = value - @property def ref(self): - """Gets the ref of this ResultPropertiesResultStatus.""" + """Gets the ref of this ResultPropertiesResultStatus. + + """ return self.__ref @ref.setter def ref(self, value): self.__ref = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "description") and self.description is not None: - params["description"] = self.description + params['description'] = self.description if hasattr(self, "ref") and self.ref is not None: - params["$ref"] = self.ref + params['$ref'] = self.ref return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "description" in response_body: - self.__description = response_body["description"] - if "$ref" in response_body: - self.__ref = response_body["$ref"] + if 'description' in response_body: + self.__description = response_body['description'] + if '$ref' in response_body: + self.__ref = response_body['$ref'] diff --git a/com/alipay/ams/api/model/result_status_type.py b/com/alipay/ams/api/model/result_status_type.py index 7520295..8eca7cd 100644 --- a/com/alipay/ams/api/model/result_status_type.py +++ b/com/alipay/ams/api/model/result_status_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class ResultStatusType(Enum): """ResultStatusType枚举类""" diff --git a/com/alipay/ams/api/model/risk_address.py b/com/alipay/ams/api/model/risk_address.py index 1a29ca1..903b641 100644 --- a/com/alipay/ams/api/model/risk_address.py +++ b/com/alipay/ams/api/model/risk_address.py @@ -1,14 +1,17 @@ import json + + class RiskAddress: def __init__(self): - + self.__shipping_phone_type = None # type: str self.__is_bill_ship_state_same = None # type: bool self.__is_previous_state_same = None # type: bool self.__loc_to_ship_distance = None # type: int self.__min_previous_ship_to_bill_distance = None # type: int + @property def shipping_phone_type(self): @@ -20,7 +23,6 @@ def shipping_phone_type(self): @shipping_phone_type.setter def shipping_phone_type(self, value): self.__shipping_phone_type = value - @property def is_bill_ship_state_same(self): """ @@ -31,7 +33,6 @@ def is_bill_ship_state_same(self): @is_bill_ship_state_same.setter def is_bill_ship_state_same(self, value): self.__is_bill_ship_state_same = value - @property def is_previous_state_same(self): """ @@ -42,7 +43,6 @@ def is_previous_state_same(self): @is_previous_state_same.setter def is_previous_state_same(self, value): self.__is_previous_state_same = value - @property def loc_to_ship_distance(self): """ @@ -53,7 +53,6 @@ def loc_to_ship_distance(self): @loc_to_ship_distance.setter def loc_to_ship_distance(self, value): self.__loc_to_ship_distance = value - @property def min_previous_ship_to_bill_distance(self): """ @@ -65,49 +64,34 @@ def min_previous_ship_to_bill_distance(self): def min_previous_ship_to_bill_distance(self, value): self.__min_previous_ship_to_bill_distance = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "shipping_phone_type") - and self.shipping_phone_type is not None - ): - params["shippingPhoneType"] = self.shipping_phone_type - if ( - hasattr(self, "is_bill_ship_state_same") - and self.is_bill_ship_state_same is not None - ): - params["isBillShipStateSame"] = self.is_bill_ship_state_same - if ( - hasattr(self, "is_previous_state_same") - and self.is_previous_state_same is not None - ): - params["isPreviousStateSame"] = self.is_previous_state_same - if ( - hasattr(self, "loc_to_ship_distance") - and self.loc_to_ship_distance is not None - ): - params["locToShipDistance"] = self.loc_to_ship_distance - if ( - hasattr(self, "min_previous_ship_to_bill_distance") - and self.min_previous_ship_to_bill_distance is not None - ): - params["minPreviousShipToBillDistance"] = ( - self.min_previous_ship_to_bill_distance - ) + if hasattr(self, "shipping_phone_type") and self.shipping_phone_type is not None: + params['shippingPhoneType'] = self.shipping_phone_type + if hasattr(self, "is_bill_ship_state_same") and self.is_bill_ship_state_same is not None: + params['isBillShipStateSame'] = self.is_bill_ship_state_same + if hasattr(self, "is_previous_state_same") and self.is_previous_state_same is not None: + params['isPreviousStateSame'] = self.is_previous_state_same + if hasattr(self, "loc_to_ship_distance") and self.loc_to_ship_distance is not None: + params['locToShipDistance'] = self.loc_to_ship_distance + if hasattr(self, "min_previous_ship_to_bill_distance") and self.min_previous_ship_to_bill_distance is not None: + params['minPreviousShipToBillDistance'] = self.min_previous_ship_to_bill_distance return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "shippingPhoneType" in response_body: - self.__shipping_phone_type = response_body["shippingPhoneType"] - if "isBillShipStateSame" in response_body: - self.__is_bill_ship_state_same = response_body["isBillShipStateSame"] - if "isPreviousStateSame" in response_body: - self.__is_previous_state_same = response_body["isPreviousStateSame"] - if "locToShipDistance" in response_body: - self.__loc_to_ship_distance = response_body["locToShipDistance"] - if "minPreviousShipToBillDistance" in response_body: - self.__min_previous_ship_to_bill_distance = response_body[ - "minPreviousShipToBillDistance" - ] + if 'shippingPhoneType' in response_body: + self.__shipping_phone_type = response_body['shippingPhoneType'] + if 'isBillShipStateSame' in response_body: + self.__is_bill_ship_state_same = response_body['isBillShipStateSame'] + if 'isPreviousStateSame' in response_body: + self.__is_previous_state_same = response_body['isPreviousStateSame'] + if 'locToShipDistance' in response_body: + self.__loc_to_ship_distance = response_body['locToShipDistance'] + if 'minPreviousShipToBillDistance' in response_body: + self.__min_previous_ship_to_bill_distance = response_body['minPreviousShipToBillDistance'] diff --git a/com/alipay/ams/api/model/risk_buyer.py b/com/alipay/ams/api/model/risk_buyer.py index 6999fa5..34bd926 100644 --- a/com/alipay/ams/api/model/risk_buyer.py +++ b/com/alipay/ams/api/model/risk_buyer.py @@ -1,13 +1,16 @@ import json + + class RiskBuyer: def __init__(self): - + self.__note_to_merchant = None # type: str self.__note_to_shipping = None # type: str self.__order_count_in1_h = None # type: int self.__order_count_in24_h = None # type: int + @property def note_to_merchant(self): @@ -19,7 +22,6 @@ def note_to_merchant(self): @note_to_merchant.setter def note_to_merchant(self, value): self.__note_to_merchant = value - @property def note_to_shipping(self): """ @@ -30,7 +32,6 @@ def note_to_shipping(self): @note_to_shipping.setter def note_to_shipping(self, value): self.__note_to_shipping = value - @property def order_count_in1_h(self): """ @@ -41,7 +42,6 @@ def order_count_in1_h(self): @order_count_in1_h.setter def order_count_in1_h(self, value): self.__order_count_in1_h = value - @property def order_count_in24_h(self): """ @@ -53,26 +53,30 @@ def order_count_in24_h(self): def order_count_in24_h(self, value): self.__order_count_in24_h = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "note_to_merchant") and self.note_to_merchant is not None: - params["noteToMerchant"] = self.note_to_merchant + params['noteToMerchant'] = self.note_to_merchant if hasattr(self, "note_to_shipping") and self.note_to_shipping is not None: - params["noteToShipping"] = self.note_to_shipping + params['noteToShipping'] = self.note_to_shipping if hasattr(self, "order_count_in1_h") and self.order_count_in1_h is not None: - params["orderCountIn1H"] = self.order_count_in1_h + params['orderCountIn1H'] = self.order_count_in1_h if hasattr(self, "order_count_in24_h") and self.order_count_in24_h is not None: - params["orderCountIn24H"] = self.order_count_in24_h + params['orderCountIn24H'] = self.order_count_in24_h return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "noteToMerchant" in response_body: - self.__note_to_merchant = response_body["noteToMerchant"] - if "noteToShipping" in response_body: - self.__note_to_shipping = response_body["noteToShipping"] - if "orderCountIn1H" in response_body: - self.__order_count_in1_h = response_body["orderCountIn1H"] - if "orderCountIn24H" in response_body: - self.__order_count_in24_h = response_body["orderCountIn24H"] + if 'noteToMerchant' in response_body: + self.__note_to_merchant = response_body['noteToMerchant'] + if 'noteToShipping' in response_body: + self.__note_to_shipping = response_body['noteToShipping'] + if 'orderCountIn1H' in response_body: + self.__order_count_in1_h = response_body['orderCountIn1H'] + if 'orderCountIn24H' in response_body: + self.__order_count_in24_h = response_body['orderCountIn24H'] diff --git a/com/alipay/ams/api/model/risk_data.py b/com/alipay/ams/api/model/risk_data.py index 6318bea..d2c6317 100644 --- a/com/alipay/ams/api/model/risk_data.py +++ b/com/alipay/ams/api/model/risk_data.py @@ -7,109 +7,118 @@ from com.alipay.ams.api.model.card_verification_result import CardVerificationResult + + class RiskData: def __init__(self): - + self.__order = None # type: RiskOrder self.__buyer = None # type: RiskBuyer self.__env = None # type: RiskEnv self.__risk_signal = None # type: RiskSignal self.__address = None # type: RiskAddress self.__card_verification_result = None # type: CardVerificationResult + @property def order(self): - """Gets the order of this RiskData.""" + """Gets the order of this RiskData. + + """ return self.__order @order.setter def order(self, value): self.__order = value - @property def buyer(self): - """Gets the buyer of this RiskData.""" + """Gets the buyer of this RiskData. + + """ return self.__buyer @buyer.setter def buyer(self, value): self.__buyer = value - @property def env(self): - """Gets the env of this RiskData.""" + """Gets the env of this RiskData. + + """ return self.__env @env.setter def env(self, value): self.__env = value - @property def risk_signal(self): - """Gets the risk_signal of this RiskData.""" + """Gets the risk_signal of this RiskData. + + """ return self.__risk_signal @risk_signal.setter def risk_signal(self, value): self.__risk_signal = value - @property def address(self): - """Gets the address of this RiskData.""" + """Gets the address of this RiskData. + + """ return self.__address @address.setter def address(self, value): self.__address = value - @property def card_verification_result(self): - """Gets the card_verification_result of this RiskData.""" + """Gets the card_verification_result of this RiskData. + + """ return self.__card_verification_result @card_verification_result.setter def card_verification_result(self, value): self.__card_verification_result = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "order") and self.order is not None: - params["order"] = self.order + params['order'] = self.order if hasattr(self, "buyer") and self.buyer is not None: - params["buyer"] = self.buyer + params['buyer'] = self.buyer if hasattr(self, "env") and self.env is not None: - params["env"] = self.env + params['env'] = self.env if hasattr(self, "risk_signal") and self.risk_signal is not None: - params["riskSignal"] = self.risk_signal + params['riskSignal'] = self.risk_signal if hasattr(self, "address") and self.address is not None: - params["address"] = self.address - if ( - hasattr(self, "card_verification_result") - and self.card_verification_result is not None - ): - params["cardVerificationResult"] = self.card_verification_result + params['address'] = self.address + if hasattr(self, "card_verification_result") and self.card_verification_result is not None: + params['cardVerificationResult'] = self.card_verification_result return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "order" in response_body: + if 'order' in response_body: self.__order = RiskOrder() - self.__order.parse_rsp_body(response_body["order"]) - if "buyer" in response_body: + self.__order.parse_rsp_body(response_body['order']) + if 'buyer' in response_body: self.__buyer = RiskBuyer() - self.__buyer.parse_rsp_body(response_body["buyer"]) - if "env" in response_body: + self.__buyer.parse_rsp_body(response_body['buyer']) + if 'env' in response_body: self.__env = RiskEnv() - self.__env.parse_rsp_body(response_body["env"]) - if "riskSignal" in response_body: + self.__env.parse_rsp_body(response_body['env']) + if 'riskSignal' in response_body: self.__risk_signal = RiskSignal() - self.__risk_signal.parse_rsp_body(response_body["riskSignal"]) - if "address" in response_body: + self.__risk_signal.parse_rsp_body(response_body['riskSignal']) + if 'address' in response_body: self.__address = RiskAddress() - self.__address.parse_rsp_body(response_body["address"]) - if "cardVerificationResult" in response_body: + self.__address.parse_rsp_body(response_body['address']) + if 'cardVerificationResult' in response_body: self.__card_verification_result = CardVerificationResult() - self.__card_verification_result.parse_rsp_body( - response_body["cardVerificationResult"] - ) + self.__card_verification_result.parse_rsp_body(response_body['cardVerificationResult']) diff --git a/com/alipay/ams/api/model/risk_env.py b/com/alipay/ams/api/model/risk_env.py index e829dd7..6f3b916 100644 --- a/com/alipay/ams/api/model/risk_env.py +++ b/com/alipay/ams/api/model/risk_env.py @@ -1,10 +1,13 @@ import json + + class RiskEnv: def __init__(self): - + self.__ip_address_type = None # type: str + @property def ip_address_type(self): @@ -17,14 +20,18 @@ def ip_address_type(self): def ip_address_type(self, value): self.__ip_address_type = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "ip_address_type") and self.ip_address_type is not None: - params["ipAddressType"] = self.ip_address_type + params['ipAddressType'] = self.ip_address_type return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "ipAddressType" in response_body: - self.__ip_address_type = response_body["ipAddressType"] + if 'ipAddressType' in response_body: + self.__ip_address_type = response_body['ipAddressType'] diff --git a/com/alipay/ams/api/model/risk_order.py b/com/alipay/ams/api/model/risk_order.py index 6938df1..211441a 100644 --- a/com/alipay/ams/api/model/risk_order.py +++ b/com/alipay/ams/api/model/risk_order.py @@ -1,11 +1,14 @@ import json + + class RiskOrder: def __init__(self): - + self.__order_type = None # type: str self.__referring_site = None # type: str + @property def order_type(self): @@ -17,7 +20,6 @@ def order_type(self): @order_type.setter def order_type(self, value): self.__order_type = value - @property def referring_site(self): """ @@ -29,18 +31,22 @@ def referring_site(self): def referring_site(self, value): self.__referring_site = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "order_type") and self.order_type is not None: - params["orderType"] = self.order_type + params['orderType'] = self.order_type if hasattr(self, "referring_site") and self.referring_site is not None: - params["referringSite"] = self.referring_site + params['referringSite'] = self.referring_site return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "orderType" in response_body: - self.__order_type = response_body["orderType"] - if "referringSite" in response_body: - self.__referring_site = response_body["referringSite"] + if 'orderType' in response_body: + self.__order_type = response_body['orderType'] + if 'referringSite' in response_body: + self.__referring_site = response_body['referringSite'] diff --git a/com/alipay/ams/api/model/risk_signal.py b/com/alipay/ams/api/model/risk_signal.py index 46c1013..a9a06cf 100644 --- a/com/alipay/ams/api/model/risk_signal.py +++ b/com/alipay/ams/api/model/risk_signal.py @@ -1,11 +1,14 @@ import json + + class RiskSignal: def __init__(self): - + self.__risk_code = None # type: str self.__risk_reason = None # type: str + @property def risk_code(self): @@ -17,7 +20,6 @@ def risk_code(self): @risk_code.setter def risk_code(self, value): self.__risk_code = value - @property def risk_reason(self): """ @@ -29,18 +31,22 @@ def risk_reason(self): def risk_reason(self, value): self.__risk_reason = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "risk_code") and self.risk_code is not None: - params["riskCode"] = self.risk_code + params['riskCode'] = self.risk_code if hasattr(self, "risk_reason") and self.risk_reason is not None: - params["riskReason"] = self.risk_reason + params['riskReason'] = self.risk_reason return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "riskCode" in response_body: - self.__risk_code = response_body["riskCode"] - if "riskReason" in response_body: - self.__risk_reason = response_body["riskReason"] + if 'riskCode' in response_body: + self.__risk_code = response_body['riskCode'] + if 'riskReason' in response_body: + self.__risk_reason = response_body['riskReason'] diff --git a/com/alipay/ams/api/model/risk_three_ds_result.py b/com/alipay/ams/api/model/risk_three_ds_result.py index de296dd..078bc50 100644 --- a/com/alipay/ams/api/model/risk_three_ds_result.py +++ b/com/alipay/ams/api/model/risk_three_ds_result.py @@ -1,13 +1,16 @@ import json + + class RiskThreeDSResult: def __init__(self): - + self.__three_ds_version = None # type: str self.__three_ds_interaction_mode = None # type: str self.__eci = None # type: str self.__cavv = None # type: str + @property def three_ds_version(self): @@ -19,7 +22,6 @@ def three_ds_version(self): @three_ds_version.setter def three_ds_version(self, value): self.__three_ds_version = value - @property def three_ds_interaction_mode(self): """ @@ -30,7 +32,6 @@ def three_ds_interaction_mode(self): @three_ds_interaction_mode.setter def three_ds_interaction_mode(self, value): self.__three_ds_interaction_mode = value - @property def eci(self): """ @@ -41,7 +42,6 @@ def eci(self): @eci.setter def eci(self, value): self.__eci = value - @property def cavv(self): """ @@ -53,29 +53,30 @@ def cavv(self): def cavv(self, value): self.__cavv = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "three_ds_version") and self.three_ds_version is not None: - params["threeDSVersion"] = self.three_ds_version - if ( - hasattr(self, "three_ds_interaction_mode") - and self.three_ds_interaction_mode is not None - ): - params["threeDSInteractionMode"] = self.three_ds_interaction_mode + params['threeDSVersion'] = self.three_ds_version + if hasattr(self, "three_ds_interaction_mode") and self.three_ds_interaction_mode is not None: + params['threeDSInteractionMode'] = self.three_ds_interaction_mode if hasattr(self, "eci") and self.eci is not None: - params["eci"] = self.eci + params['eci'] = self.eci if hasattr(self, "cavv") and self.cavv is not None: - params["cavv"] = self.cavv + params['cavv'] = self.cavv return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "threeDSVersion" in response_body: - self.__three_ds_version = response_body["threeDSVersion"] - if "threeDSInteractionMode" in response_body: - self.__three_ds_interaction_mode = response_body["threeDSInteractionMode"] - if "eci" in response_body: - self.__eci = response_body["eci"] - if "cavv" in response_body: - self.__cavv = response_body["cavv"] + if 'threeDSVersion' in response_body: + self.__three_ds_version = response_body['threeDSVersion'] + if 'threeDSInteractionMode' in response_body: + self.__three_ds_interaction_mode = response_body['threeDSInteractionMode'] + if 'eci' in response_body: + self.__eci = response_body['eci'] + if 'cavv' in response_body: + self.__cavv = response_body['cavv'] diff --git a/com/alipay/ams/api/model/scope_type.py b/com/alipay/ams/api/model/scope_type.py index 7b455ec..a2e59f2 100644 --- a/com/alipay/ams/api/model/scope_type.py +++ b/com/alipay/ams/api/model/scope_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class ScopeType(Enum): """ScopeType枚举类""" diff --git a/com/alipay/ams/api/model/service.py b/com/alipay/ams/api/model/service.py index b16eeb1..86709c6 100644 --- a/com/alipay/ams/api/model/service.py +++ b/com/alipay/ams/api/model/service.py @@ -1,11 +1,14 @@ import json + + class Service: def __init__(self): - + self.__category_code = None # type: str self.__sub_category_code = None # type: str + @property def category_code(self): @@ -17,7 +20,6 @@ def category_code(self): @category_code.setter def category_code(self, value): self.__category_code = value - @property def sub_category_code(self): """ @@ -29,18 +31,22 @@ def sub_category_code(self): def sub_category_code(self, value): self.__sub_category_code = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "category_code") and self.category_code is not None: - params["categoryCode"] = self.category_code + params['categoryCode'] = self.category_code if hasattr(self, "sub_category_code") and self.sub_category_code is not None: - params["subCategoryCode"] = self.sub_category_code + params['subCategoryCode'] = self.sub_category_code return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "categoryCode" in response_body: - self.__category_code = response_body["categoryCode"] - if "subCategoryCode" in response_body: - self.__sub_category_code = response_body["subCategoryCode"] + if 'categoryCode' in response_body: + self.__category_code = response_body['categoryCode'] + if 'subCategoryCode' in response_body: + self.__sub_category_code = response_body['subCategoryCode'] diff --git a/com/alipay/ams/api/model/settle_to_type.py b/com/alipay/ams/api/model/settle_to_type.py index 8accf22..92f0258 100644 --- a/com/alipay/ams/api/model/settle_to_type.py +++ b/com/alipay/ams/api/model/settle_to_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class SettleToType(Enum): """SettleToType枚举类""" diff --git a/com/alipay/ams/api/model/settlement_bank_account.py b/com/alipay/ams/api/model/settlement_bank_account.py index 1382ddc..a03975e 100644 --- a/com/alipay/ams/api/model/settlement_bank_account.py +++ b/com/alipay/ams/api/model/settlement_bank_account.py @@ -4,9 +4,11 @@ from com.alipay.ams.api.model.address import Address + + class SettlementBankAccount: def __init__(self): - + self.__bank_account_no = None # type: str self.__account_holder_name = None # type: str self.__swift_code = None # type: str @@ -19,6 +21,7 @@ def __init__(self): self.__bank_name = None # type: str self.__account_holder_address = None # type: Address self.__iban = None # type: str + @property def bank_account_no(self): @@ -30,7 +33,6 @@ def bank_account_no(self): @bank_account_no.setter def bank_account_no(self, value): self.__bank_account_no = value - @property def account_holder_name(self): """ @@ -41,7 +43,6 @@ def account_holder_name(self): @account_holder_name.setter def account_holder_name(self, value): self.__account_holder_name = value - @property def swift_code(self): """ @@ -52,38 +53,36 @@ def swift_code(self): @swift_code.setter def swift_code(self, value): self.__swift_code = value - @property def bank_region(self): """ - The region where the bank is located. The value of this parameter is a 2-letter region or country code that follows the ISO 3166 Country Codes standard. More information: Maximum length: 2 characters + The region where the bank is located. The value of this parameter is a 2-letter region or country code that follows the ISO 3166 Country Codes standard. More information: Maximum length: 2 characters """ return self.__bank_region @bank_region.setter def bank_region(self, value): self.__bank_region = value - @property def account_holder_type(self): - """Gets the account_holder_type of this SettlementBankAccount.""" + """Gets the account_holder_type of this SettlementBankAccount. + + """ return self.__account_holder_type @account_holder_type.setter def account_holder_type(self, value): self.__account_holder_type = value - @property def routing_number(self): """ - The routing number. See Bank routing number for valid values. Specify this parameter when the issuing bank is in Brazil. More information: Maximum length: 9 characters + The routing number. See Bank routing number for valid values. Specify this parameter when the issuing bank is in Brazil. More information: Maximum length: 9 characters """ return self.__routing_number @routing_number.setter def routing_number(self, value): self.__routing_number = value - @property def branch_code(self): """ @@ -94,7 +93,6 @@ def branch_code(self): @branch_code.setter def branch_code(self, value): self.__branch_code = value - @property def account_holder_tin(self): """ @@ -105,16 +103,16 @@ def account_holder_tin(self): @account_holder_tin.setter def account_holder_tin(self, value): self.__account_holder_tin = value - @property def account_type(self): - """Gets the account_type of this SettlementBankAccount.""" + """Gets the account_type of this SettlementBankAccount. + + """ return self.__account_type @account_type.setter def account_type(self, value): self.__account_type = value - @property def bank_name(self): """ @@ -125,16 +123,16 @@ def bank_name(self): @bank_name.setter def bank_name(self, value): self.__bank_name = value - @property def account_holder_address(self): - """Gets the account_holder_address of this SettlementBankAccount.""" + """Gets the account_holder_address of this SettlementBankAccount. + + """ return self.__account_holder_address @account_holder_address.setter def account_holder_address(self, value): self.__account_holder_address = value - @property def iban(self): """ @@ -146,74 +144,65 @@ def iban(self): def iban(self, value): self.__iban = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "bank_account_no") and self.bank_account_no is not None: - params["bankAccountNo"] = self.bank_account_no - if ( - hasattr(self, "account_holder_name") - and self.account_holder_name is not None - ): - params["accountHolderName"] = self.account_holder_name + params['bankAccountNo'] = self.bank_account_no + if hasattr(self, "account_holder_name") and self.account_holder_name is not None: + params['accountHolderName'] = self.account_holder_name if hasattr(self, "swift_code") and self.swift_code is not None: - params["swiftCode"] = self.swift_code + params['swiftCode'] = self.swift_code if hasattr(self, "bank_region") and self.bank_region is not None: - params["bankRegion"] = self.bank_region - if ( - hasattr(self, "account_holder_type") - and self.account_holder_type is not None - ): - params["accountHolderType"] = self.account_holder_type + params['bankRegion'] = self.bank_region + if hasattr(self, "account_holder_type") and self.account_holder_type is not None: + params['accountHolderType'] = self.account_holder_type if hasattr(self, "routing_number") and self.routing_number is not None: - params["routingNumber"] = self.routing_number + params['routingNumber'] = self.routing_number if hasattr(self, "branch_code") and self.branch_code is not None: - params["branchCode"] = self.branch_code + params['branchCode'] = self.branch_code if hasattr(self, "account_holder_tin") and self.account_holder_tin is not None: - params["accountHolderTIN"] = self.account_holder_tin + params['accountHolderTIN'] = self.account_holder_tin if hasattr(self, "account_type") and self.account_type is not None: - params["accountType"] = self.account_type + params['accountType'] = self.account_type if hasattr(self, "bank_name") and self.bank_name is not None: - params["bankName"] = self.bank_name - if ( - hasattr(self, "account_holder_address") - and self.account_holder_address is not None - ): - params["accountHolderAddress"] = self.account_holder_address + params['bankName'] = self.bank_name + if hasattr(self, "account_holder_address") and self.account_holder_address is not None: + params['accountHolderAddress'] = self.account_holder_address if hasattr(self, "iban") and self.iban is not None: - params["iban"] = self.iban + params['iban'] = self.iban return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "bankAccountNo" in response_body: - self.__bank_account_no = response_body["bankAccountNo"] - if "accountHolderName" in response_body: - self.__account_holder_name = response_body["accountHolderName"] - if "swiftCode" in response_body: - self.__swift_code = response_body["swiftCode"] - if "bankRegion" in response_body: - self.__bank_region = response_body["bankRegion"] - if "accountHolderType" in response_body: - account_holder_type_temp = AccountHolderType.value_of( - response_body["accountHolderType"] - ) + if 'bankAccountNo' in response_body: + self.__bank_account_no = response_body['bankAccountNo'] + if 'accountHolderName' in response_body: + self.__account_holder_name = response_body['accountHolderName'] + if 'swiftCode' in response_body: + self.__swift_code = response_body['swiftCode'] + if 'bankRegion' in response_body: + self.__bank_region = response_body['bankRegion'] + if 'accountHolderType' in response_body: + account_holder_type_temp = AccountHolderType.value_of(response_body['accountHolderType']) self.__account_holder_type = account_holder_type_temp - if "routingNumber" in response_body: - self.__routing_number = response_body["routingNumber"] - if "branchCode" in response_body: - self.__branch_code = response_body["branchCode"] - if "accountHolderTIN" in response_body: - self.__account_holder_tin = response_body["accountHolderTIN"] - if "accountType" in response_body: - account_type_temp = AccountType.value_of(response_body["accountType"]) + if 'routingNumber' in response_body: + self.__routing_number = response_body['routingNumber'] + if 'branchCode' in response_body: + self.__branch_code = response_body['branchCode'] + if 'accountHolderTIN' in response_body: + self.__account_holder_tin = response_body['accountHolderTIN'] + if 'accountType' in response_body: + account_type_temp = AccountType.value_of(response_body['accountType']) self.__account_type = account_type_temp - if "bankName" in response_body: - self.__bank_name = response_body["bankName"] - if "accountHolderAddress" in response_body: + if 'bankName' in response_body: + self.__bank_name = response_body['bankName'] + if 'accountHolderAddress' in response_body: self.__account_holder_address = Address() - self.__account_holder_address.parse_rsp_body( - response_body["accountHolderAddress"] - ) - if "iban" in response_body: - self.__iban = response_body["iban"] + self.__account_holder_address.parse_rsp_body(response_body['accountHolderAddress']) + if 'iban' in response_body: + self.__iban = response_body['iban'] diff --git a/com/alipay/ams/api/model/settlement_detail.py b/com/alipay/ams/api/model/settlement_detail.py index 078b25b..37147db 100644 --- a/com/alipay/ams/api/model/settlement_detail.py +++ b/com/alipay/ams/api/model/settlement_detail.py @@ -3,44 +3,54 @@ from com.alipay.ams.api.model.amount import Amount + + class SettlementDetail: def __init__(self): - + self.__settle_to = None # type: SettleToType self.__settlement_amount = None # type: Amount + @property def settle_to(self): - """Gets the settle_to of this SettlementDetail.""" + """Gets the settle_to of this SettlementDetail. + + """ return self.__settle_to @settle_to.setter def settle_to(self, value): self.__settle_to = value - @property def settlement_amount(self): - """Gets the settlement_amount of this SettlementDetail.""" + """Gets the settlement_amount of this SettlementDetail. + + """ return self.__settlement_amount @settlement_amount.setter def settlement_amount(self, value): self.__settlement_amount = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "settle_to") and self.settle_to is not None: - params["settleTo"] = self.settle_to + params['settleTo'] = self.settle_to if hasattr(self, "settlement_amount") and self.settlement_amount is not None: - params["settlementAmount"] = self.settlement_amount + params['settlementAmount'] = self.settlement_amount return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "settleTo" in response_body: - settle_to_temp = SettleToType.value_of(response_body["settleTo"]) + if 'settleTo' in response_body: + settle_to_temp = SettleToType.value_of(response_body['settleTo']) self.__settle_to = settle_to_temp - if "settlementAmount" in response_body: + if 'settlementAmount' in response_body: self.__settlement_amount = Amount() - self.__settlement_amount.parse_rsp_body(response_body["settlementAmount"]) + self.__settlement_amount.parse_rsp_body(response_body['settlementAmount']) diff --git a/com/alipay/ams/api/model/settlement_info.py b/com/alipay/ams/api/model/settlement_info.py index 4a2ce0b..0f97b74 100644 --- a/com/alipay/ams/api/model/settlement_info.py +++ b/com/alipay/ams/api/model/settlement_info.py @@ -2,53 +2,53 @@ from com.alipay.ams.api.model.settlement_bank_account import SettlementBankAccount + + class SettlementInfo: def __init__(self): - + self.__settlement_currency = None # type: str self.__settlement_bank_account = None # type: SettlementBankAccount + @property def settlement_currency(self): """ - The sub-merchant's settlement currency that is specified in the settlement contract. The value of this parameter is a 3-letter currency code that follows the ISO 4217 standard. More information: Maximum length: 3 characters + The sub-merchant's settlement currency that is specified in the settlement contract. The value of this parameter is a 3-letter currency code that follows the ISO 4217 standard. More information: Maximum length: 3 characters """ return self.__settlement_currency @settlement_currency.setter def settlement_currency(self, value): self.__settlement_currency = value - @property def settlement_bank_account(self): - """Gets the settlement_bank_account of this SettlementInfo.""" + """Gets the settlement_bank_account of this SettlementInfo. + + """ return self.__settlement_bank_account @settlement_bank_account.setter def settlement_bank_account(self, value): self.__settlement_bank_account = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "settlement_currency") - and self.settlement_currency is not None - ): - params["settlementCurrency"] = self.settlement_currency - if ( - hasattr(self, "settlement_bank_account") - and self.settlement_bank_account is not None - ): - params["settlementBankAccount"] = self.settlement_bank_account + if hasattr(self, "settlement_currency") and self.settlement_currency is not None: + params['settlementCurrency'] = self.settlement_currency + if hasattr(self, "settlement_bank_account") and self.settlement_bank_account is not None: + params['settlementBankAccount'] = self.settlement_bank_account return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "settlementCurrency" in response_body: - self.__settlement_currency = response_body["settlementCurrency"] - if "settlementBankAccount" in response_body: + if 'settlementCurrency' in response_body: + self.__settlement_currency = response_body['settlementCurrency'] + if 'settlementBankAccount' in response_body: self.__settlement_bank_account = SettlementBankAccount() - self.__settlement_bank_account.parse_rsp_body( - response_body["settlementBankAccount"] - ) + self.__settlement_bank_account.parse_rsp_body(response_body['settlementBankAccount']) diff --git a/com/alipay/ams/api/model/settlement_strategy.py b/com/alipay/ams/api/model/settlement_strategy.py index f7a2763..e58cfdf 100644 --- a/com/alipay/ams/api/model/settlement_strategy.py +++ b/com/alipay/ams/api/model/settlement_strategy.py @@ -1,10 +1,13 @@ import json + + class SettlementStrategy: def __init__(self): - + self.__settlement_currency = None # type: str + @property def settlement_currency(self): @@ -17,17 +20,18 @@ def settlement_currency(self): def settlement_currency(self, value): self.__settlement_currency = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "settlement_currency") - and self.settlement_currency is not None - ): - params["settlementCurrency"] = self.settlement_currency + if hasattr(self, "settlement_currency") and self.settlement_currency is not None: + params['settlementCurrency'] = self.settlement_currency return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "settlementCurrency" in response_body: - self.__settlement_currency = response_body["settlementCurrency"] + if 'settlementCurrency' in response_body: + self.__settlement_currency = response_body['settlementCurrency'] diff --git a/com/alipay/ams/api/model/shipping.py b/com/alipay/ams/api/model/shipping.py index 92ff872..95cf450 100644 --- a/com/alipay/ams/api/model/shipping.py +++ b/com/alipay/ams/api/model/shipping.py @@ -5,9 +5,11 @@ from com.alipay.ams.api.model.delivery_estimate import DeliveryEstimate + + class Shipping: def __init__(self): - + self.__shipping_name = None # type: UserName self.__shipping_address = None # type: Address self.__shipping_carrier = None # type: str @@ -19,25 +21,28 @@ def __init__(self): self.__delivery_estimate = None # type: DeliveryEstimate self.__shipping_number = None # type: str self.__notes = None # type: str + @property def shipping_name(self): - """Gets the shipping_name of this Shipping.""" + """Gets the shipping_name of this Shipping. + + """ return self.__shipping_name @shipping_name.setter def shipping_name(self, value): self.__shipping_name = value - @property def shipping_address(self): - """Gets the shipping_address of this Shipping.""" + """Gets the shipping_address of this Shipping. + + """ return self.__shipping_address @shipping_address.setter def shipping_address(self, value): self.__shipping_address = value - @property def shipping_carrier(self): """ @@ -48,7 +53,6 @@ def shipping_carrier(self): @shipping_carrier.setter def shipping_carrier(self, value): self.__shipping_carrier = value - @property def shipping_phone_no(self): """ @@ -59,7 +63,6 @@ def shipping_phone_no(self): @shipping_phone_no.setter def shipping_phone_no(self, value): self.__shipping_phone_no = value - @property def ship_to_email(self): """ @@ -70,7 +73,6 @@ def ship_to_email(self): @ship_to_email.setter def ship_to_email(self, value): self.__ship_to_email = value - @property def shipping_fee_id(self): """ @@ -81,16 +83,16 @@ def shipping_fee_id(self): @shipping_fee_id.setter def shipping_fee_id(self, value): self.__shipping_fee_id = value - @property def shipping_fee(self): - """Gets the shipping_fee of this Shipping.""" + """Gets the shipping_fee of this Shipping. + + """ return self.__shipping_fee @shipping_fee.setter def shipping_fee(self, value): self.__shipping_fee = value - @property def shipping_description(self): """ @@ -101,16 +103,16 @@ def shipping_description(self): @shipping_description.setter def shipping_description(self, value): self.__shipping_description = value - @property def delivery_estimate(self): - """Gets the delivery_estimate of this Shipping.""" + """Gets the delivery_estimate of this Shipping. + + """ return self.__delivery_estimate @delivery_estimate.setter def delivery_estimate(self, value): self.__delivery_estimate = value - @property def shipping_number(self): """ @@ -121,7 +123,6 @@ def shipping_number(self): @shipping_number.setter def shipping_number(self, value): self.__shipping_number = value - @property def notes(self): """ @@ -133,61 +134,62 @@ def notes(self): def notes(self, value): self.__notes = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "shipping_name") and self.shipping_name is not None: - params["shippingName"] = self.shipping_name + params['shippingName'] = self.shipping_name if hasattr(self, "shipping_address") and self.shipping_address is not None: - params["shippingAddress"] = self.shipping_address + params['shippingAddress'] = self.shipping_address if hasattr(self, "shipping_carrier") and self.shipping_carrier is not None: - params["shippingCarrier"] = self.shipping_carrier + params['shippingCarrier'] = self.shipping_carrier if hasattr(self, "shipping_phone_no") and self.shipping_phone_no is not None: - params["shippingPhoneNo"] = self.shipping_phone_no + params['shippingPhoneNo'] = self.shipping_phone_no if hasattr(self, "ship_to_email") and self.ship_to_email is not None: - params["shipToEmail"] = self.ship_to_email + params['shipToEmail'] = self.ship_to_email if hasattr(self, "shipping_fee_id") and self.shipping_fee_id is not None: - params["shippingFeeId"] = self.shipping_fee_id + params['shippingFeeId'] = self.shipping_fee_id if hasattr(self, "shipping_fee") and self.shipping_fee is not None: - params["shippingFee"] = self.shipping_fee - if ( - hasattr(self, "shipping_description") - and self.shipping_description is not None - ): - params["shippingDescription"] = self.shipping_description + params['shippingFee'] = self.shipping_fee + if hasattr(self, "shipping_description") and self.shipping_description is not None: + params['shippingDescription'] = self.shipping_description if hasattr(self, "delivery_estimate") and self.delivery_estimate is not None: - params["deliveryEstimate"] = self.delivery_estimate + params['deliveryEstimate'] = self.delivery_estimate if hasattr(self, "shipping_number") and self.shipping_number is not None: - params["shippingNumber"] = self.shipping_number + params['shippingNumber'] = self.shipping_number if hasattr(self, "notes") and self.notes is not None: - params["notes"] = self.notes + params['notes'] = self.notes return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "shippingName" in response_body: + if 'shippingName' in response_body: self.__shipping_name = UserName() - self.__shipping_name.parse_rsp_body(response_body["shippingName"]) - if "shippingAddress" in response_body: + self.__shipping_name.parse_rsp_body(response_body['shippingName']) + if 'shippingAddress' in response_body: self.__shipping_address = Address() - self.__shipping_address.parse_rsp_body(response_body["shippingAddress"]) - if "shippingCarrier" in response_body: - self.__shipping_carrier = response_body["shippingCarrier"] - if "shippingPhoneNo" in response_body: - self.__shipping_phone_no = response_body["shippingPhoneNo"] - if "shipToEmail" in response_body: - self.__ship_to_email = response_body["shipToEmail"] - if "shippingFeeId" in response_body: - self.__shipping_fee_id = response_body["shippingFeeId"] - if "shippingFee" in response_body: + self.__shipping_address.parse_rsp_body(response_body['shippingAddress']) + if 'shippingCarrier' in response_body: + self.__shipping_carrier = response_body['shippingCarrier'] + if 'shippingPhoneNo' in response_body: + self.__shipping_phone_no = response_body['shippingPhoneNo'] + if 'shipToEmail' in response_body: + self.__ship_to_email = response_body['shipToEmail'] + if 'shippingFeeId' in response_body: + self.__shipping_fee_id = response_body['shippingFeeId'] + if 'shippingFee' in response_body: self.__shipping_fee = Amount() - self.__shipping_fee.parse_rsp_body(response_body["shippingFee"]) - if "shippingDescription" in response_body: - self.__shipping_description = response_body["shippingDescription"] - if "deliveryEstimate" in response_body: + self.__shipping_fee.parse_rsp_body(response_body['shippingFee']) + if 'shippingDescription' in response_body: + self.__shipping_description = response_body['shippingDescription'] + if 'deliveryEstimate' in response_body: self.__delivery_estimate = DeliveryEstimate() - self.__delivery_estimate.parse_rsp_body(response_body["deliveryEstimate"]) - if "shippingNumber" in response_body: - self.__shipping_number = response_body["shippingNumber"] - if "notes" in response_body: - self.__notes = response_body["notes"] + self.__delivery_estimate.parse_rsp_body(response_body['deliveryEstimate']) + if 'shippingNumber' in response_body: + self.__shipping_number = response_body['shippingNumber'] + if 'notes' in response_body: + self.__notes = response_body['notes'] diff --git a/com/alipay/ams/api/model/statement.py b/com/alipay/ams/api/model/statement.py index 9dec207..708e8b2 100644 --- a/com/alipay/ams/api/model/statement.py +++ b/com/alipay/ams/api/model/statement.py @@ -2,43 +2,53 @@ from com.alipay.ams.api.model.fund_move_detail import FundMoveDetail + + class Statement: def __init__(self): - + self.__statement_id = None # type: str self.__fund_move_detail = None # type: FundMoveDetail + @property def statement_id(self): - """Gets the statement_id of this Statement.""" + """Gets the statement_id of this Statement. + + """ return self.__statement_id @statement_id.setter def statement_id(self, value): self.__statement_id = value - @property def fund_move_detail(self): - """Gets the fund_move_detail of this Statement.""" + """Gets the fund_move_detail of this Statement. + + """ return self.__fund_move_detail @fund_move_detail.setter def fund_move_detail(self, value): self.__fund_move_detail = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "statement_id") and self.statement_id is not None: - params["statementId"] = self.statement_id + params['statementId'] = self.statement_id if hasattr(self, "fund_move_detail") and self.fund_move_detail is not None: - params["fundMoveDetail"] = self.fund_move_detail + params['fundMoveDetail'] = self.fund_move_detail return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "statementId" in response_body: - self.__statement_id = response_body["statementId"] - if "fundMoveDetail" in response_body: + if 'statementId' in response_body: + self.__statement_id = response_body['statementId'] + if 'fundMoveDetail' in response_body: self.__fund_move_detail = FundMoveDetail() - self.__fund_move_detail.parse_rsp_body(response_body["fundMoveDetail"]) + self.__fund_move_detail.parse_rsp_body(response_body['fundMoveDetail']) diff --git a/com/alipay/ams/api/model/stock_info.py b/com/alipay/ams/api/model/stock_info.py index 6b8e6db..518b6e1 100644 --- a/com/alipay/ams/api/model/stock_info.py +++ b/com/alipay/ams/api/model/stock_info.py @@ -1,23 +1,25 @@ import json + + class StockInfo: def __init__(self): - + self.__listed_region = None # type: str self.__ticker_symbol = None # type: str + @property def listed_region(self): """ - The region or country where the company is listed. More information: Maximum length: 2 characters + The region or country where the company is listed. More information: Maximum length: 2 characters """ return self.__listed_region @listed_region.setter def listed_region(self, value): self.__listed_region = value - @property def ticker_symbol(self): """ @@ -29,18 +31,22 @@ def ticker_symbol(self): def ticker_symbol(self, value): self.__ticker_symbol = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "listed_region") and self.listed_region is not None: - params["listedRegion"] = self.listed_region + params['listedRegion'] = self.listed_region if hasattr(self, "ticker_symbol") and self.ticker_symbol is not None: - params["tickerSymbol"] = self.ticker_symbol + params['tickerSymbol'] = self.ticker_symbol return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "listedRegion" in response_body: - self.__listed_region = response_body["listedRegion"] - if "tickerSymbol" in response_body: - self.__ticker_symbol = response_body["tickerSymbol"] + if 'listedRegion' in response_body: + self.__listed_region = response_body['listedRegion'] + if 'tickerSymbol' in response_body: + self.__ticker_symbol = response_body['tickerSymbol'] diff --git a/com/alipay/ams/api/model/store.py b/com/alipay/ams/api/model/store.py index a8988a2..7a3b54d 100644 --- a/com/alipay/ams/api/model/store.py +++ b/com/alipay/ams/api/model/store.py @@ -2,9 +2,11 @@ from com.alipay.ams.api.model.address import Address + + class Store: def __init__(self): - + self.__reference_store_id = None # type: str self.__store_name = None # type: str self.__store_mcc = None # type: str @@ -13,116 +15,130 @@ def __init__(self): self.__store_operator_id = None # type: str self.__store_address = None # type: Address self.__store_phone_no = None # type: str + @property def reference_store_id(self): - """Gets the reference_store_id of this Store.""" + """Gets the reference_store_id of this Store. + + """ return self.__reference_store_id @reference_store_id.setter def reference_store_id(self, value): self.__reference_store_id = value - @property def store_name(self): - """Gets the store_name of this Store.""" + """Gets the store_name of this Store. + + """ return self.__store_name @store_name.setter def store_name(self, value): self.__store_name = value - @property def store_mcc(self): - """Gets the store_mcc of this Store.""" + """Gets the store_mcc of this Store. + + """ return self.__store_mcc @store_mcc.setter def store_mcc(self, value): self.__store_mcc = value - @property def store_display_name(self): - """Gets the store_display_name of this Store.""" + """Gets the store_display_name of this Store. + + """ return self.__store_display_name @store_display_name.setter def store_display_name(self, value): self.__store_display_name = value - @property def store_terminal_id(self): - """Gets the store_terminal_id of this Store.""" + """Gets the store_terminal_id of this Store. + + """ return self.__store_terminal_id @store_terminal_id.setter def store_terminal_id(self, value): self.__store_terminal_id = value - @property def store_operator_id(self): - """Gets the store_operator_id of this Store.""" + """Gets the store_operator_id of this Store. + + """ return self.__store_operator_id @store_operator_id.setter def store_operator_id(self, value): self.__store_operator_id = value - @property def store_address(self): - """Gets the store_address of this Store.""" + """Gets the store_address of this Store. + + """ return self.__store_address @store_address.setter def store_address(self, value): self.__store_address = value - @property def store_phone_no(self): - """Gets the store_phone_no of this Store.""" + """Gets the store_phone_no of this Store. + + """ return self.__store_phone_no @store_phone_no.setter def store_phone_no(self, value): self.__store_phone_no = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "reference_store_id") and self.reference_store_id is not None: - params["referenceStoreId"] = self.reference_store_id + params['referenceStoreId'] = self.reference_store_id if hasattr(self, "store_name") and self.store_name is not None: - params["storeName"] = self.store_name + params['storeName'] = self.store_name if hasattr(self, "store_mcc") and self.store_mcc is not None: - params["storeMCC"] = self.store_mcc + params['storeMCC'] = self.store_mcc if hasattr(self, "store_display_name") and self.store_display_name is not None: - params["storeDisplayName"] = self.store_display_name + params['storeDisplayName'] = self.store_display_name if hasattr(self, "store_terminal_id") and self.store_terminal_id is not None: - params["storeTerminalId"] = self.store_terminal_id + params['storeTerminalId'] = self.store_terminal_id if hasattr(self, "store_operator_id") and self.store_operator_id is not None: - params["storeOperatorId"] = self.store_operator_id + params['storeOperatorId'] = self.store_operator_id if hasattr(self, "store_address") and self.store_address is not None: - params["storeAddress"] = self.store_address + params['storeAddress'] = self.store_address if hasattr(self, "store_phone_no") and self.store_phone_no is not None: - params["storePhoneNo"] = self.store_phone_no + params['storePhoneNo'] = self.store_phone_no return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "referenceStoreId" in response_body: - self.__reference_store_id = response_body["referenceStoreId"] - if "storeName" in response_body: - self.__store_name = response_body["storeName"] - if "storeMCC" in response_body: - self.__store_mcc = response_body["storeMCC"] - if "storeDisplayName" in response_body: - self.__store_display_name = response_body["storeDisplayName"] - if "storeTerminalId" in response_body: - self.__store_terminal_id = response_body["storeTerminalId"] - if "storeOperatorId" in response_body: - self.__store_operator_id = response_body["storeOperatorId"] - if "storeAddress" in response_body: + if 'referenceStoreId' in response_body: + self.__reference_store_id = response_body['referenceStoreId'] + if 'storeName' in response_body: + self.__store_name = response_body['storeName'] + if 'storeMCC' in response_body: + self.__store_mcc = response_body['storeMCC'] + if 'storeDisplayName' in response_body: + self.__store_display_name = response_body['storeDisplayName'] + if 'storeTerminalId' in response_body: + self.__store_terminal_id = response_body['storeTerminalId'] + if 'storeOperatorId' in response_body: + self.__store_operator_id = response_body['storeOperatorId'] + if 'storeAddress' in response_body: self.__store_address = Address() - self.__store_address.parse_rsp_body(response_body["storeAddress"]) - if "storePhoneNo" in response_body: - self.__store_phone_no = response_body["storePhoneNo"] + self.__store_address.parse_rsp_body(response_body['storeAddress']) + if 'storePhoneNo' in response_body: + self.__store_phone_no = response_body['storePhoneNo'] diff --git a/com/alipay/ams/api/model/subscription_info.py b/com/alipay/ams/api/model/subscription_info.py index 30177c9..167ca56 100644 --- a/com/alipay/ams/api/model/subscription_info.py +++ b/com/alipay/ams/api/model/subscription_info.py @@ -3,9 +3,11 @@ from com.alipay.ams.api.model.trial import Trial + + class SubscriptionInfo: def __init__(self): - + self.__subscription_description = None # type: str self.__subscription_start_time = None # type: str self.__subscription_end_time = None # type: str @@ -13,6 +15,7 @@ def __init__(self): self.__trials = None # type: [Trial] self.__subscription_notify_url = None # type: str self.__subscription_expiry_time = None # type: str + @property def subscription_description(self): @@ -24,7 +27,6 @@ def subscription_description(self): @subscription_description.setter def subscription_description(self, value): self.__subscription_description = value - @property def subscription_start_time(self): """ @@ -35,7 +37,6 @@ def subscription_start_time(self): @subscription_start_time.setter def subscription_start_time(self, value): self.__subscription_start_time = value - @property def subscription_end_time(self): """ @@ -46,16 +47,16 @@ def subscription_end_time(self): @subscription_end_time.setter def subscription_end_time(self, value): self.__subscription_end_time = value - @property def period_rule(self): - """Gets the period_rule of this SubscriptionInfo.""" + """Gets the period_rule of this SubscriptionInfo. + + """ return self.__period_rule @period_rule.setter def period_rule(self, value): self.__period_rule = value - @property def trials(self): """ @@ -66,7 +67,6 @@ def trials(self): @trials.setter def trials(self, value): self.__trials = value - @property def subscription_notify_url(self): """ @@ -77,7 +77,6 @@ def subscription_notify_url(self): @subscription_notify_url.setter def subscription_notify_url(self, value): self.__subscription_notify_url = value - @property def subscription_expiry_time(self): """ @@ -89,56 +88,45 @@ def subscription_expiry_time(self): def subscription_expiry_time(self, value): self.__subscription_expiry_time = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "subscription_description") - and self.subscription_description is not None - ): - params["subscriptionDescription"] = self.subscription_description - if ( - hasattr(self, "subscription_start_time") - and self.subscription_start_time is not None - ): - params["subscriptionStartTime"] = self.subscription_start_time - if ( - hasattr(self, "subscription_end_time") - and self.subscription_end_time is not None - ): - params["subscriptionEndTime"] = self.subscription_end_time + if hasattr(self, "subscription_description") and self.subscription_description is not None: + params['subscriptionDescription'] = self.subscription_description + if hasattr(self, "subscription_start_time") and self.subscription_start_time is not None: + params['subscriptionStartTime'] = self.subscription_start_time + if hasattr(self, "subscription_end_time") and self.subscription_end_time is not None: + params['subscriptionEndTime'] = self.subscription_end_time if hasattr(self, "period_rule") and self.period_rule is not None: - params["periodRule"] = self.period_rule + params['periodRule'] = self.period_rule if hasattr(self, "trials") and self.trials is not None: - params["trials"] = self.trials - if ( - hasattr(self, "subscription_notify_url") - and self.subscription_notify_url is not None - ): - params["subscriptionNotifyUrl"] = self.subscription_notify_url - if ( - hasattr(self, "subscription_expiry_time") - and self.subscription_expiry_time is not None - ): - params["subscriptionExpiryTime"] = self.subscription_expiry_time + params['trials'] = self.trials + if hasattr(self, "subscription_notify_url") and self.subscription_notify_url is not None: + params['subscriptionNotifyUrl'] = self.subscription_notify_url + if hasattr(self, "subscription_expiry_time") and self.subscription_expiry_time is not None: + params['subscriptionExpiryTime'] = self.subscription_expiry_time return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "subscriptionDescription" in response_body: - self.__subscription_description = response_body["subscriptionDescription"] - if "subscriptionStartTime" in response_body: - self.__subscription_start_time = response_body["subscriptionStartTime"] - if "subscriptionEndTime" in response_body: - self.__subscription_end_time = response_body["subscriptionEndTime"] - if "periodRule" in response_body: + if 'subscriptionDescription' in response_body: + self.__subscription_description = response_body['subscriptionDescription'] + if 'subscriptionStartTime' in response_body: + self.__subscription_start_time = response_body['subscriptionStartTime'] + if 'subscriptionEndTime' in response_body: + self.__subscription_end_time = response_body['subscriptionEndTime'] + if 'periodRule' in response_body: self.__period_rule = PeriodRule() - self.__period_rule.parse_rsp_body(response_body["periodRule"]) - if "trials" in response_body: + self.__period_rule.parse_rsp_body(response_body['periodRule']) + if 'trials' in response_body: self.__trials = [] - for item in response_body["trials"]: + for item in response_body['trials']: self.__trials.append(item) - if "subscriptionNotifyUrl" in response_body: - self.__subscription_notify_url = response_body["subscriptionNotifyUrl"] - if "subscriptionExpiryTime" in response_body: - self.__subscription_expiry_time = response_body["subscriptionExpiryTime"] + if 'subscriptionNotifyUrl' in response_body: + self.__subscription_notify_url = response_body['subscriptionNotifyUrl'] + if 'subscriptionExpiryTime' in response_body: + self.__subscription_expiry_time = response_body['subscriptionExpiryTime'] diff --git a/com/alipay/ams/api/model/subscription_plan.py b/com/alipay/ams/api/model/subscription_plan.py index 7480a9a..5cba9f1 100644 --- a/com/alipay/ams/api/model/subscription_plan.py +++ b/com/alipay/ams/api/model/subscription_plan.py @@ -3,14 +3,17 @@ from com.alipay.ams.api.model.period_rule import PeriodRule + + class SubscriptionPlan: def __init__(self): - + self.__allow_accumulate = None # type: bool self.__max_accumulate_amount = None # type: Amount self.__period_rule = None # type: PeriodRule self.__subscription_start_time = None # type: str self.__subscription_notification_url = None # type: str + @property def allow_accumulate(self): @@ -22,25 +25,26 @@ def allow_accumulate(self): @allow_accumulate.setter def allow_accumulate(self, value): self.__allow_accumulate = value - @property def max_accumulate_amount(self): - """Gets the max_accumulate_amount of this SubscriptionPlan.""" + """Gets the max_accumulate_amount of this SubscriptionPlan. + + """ return self.__max_accumulate_amount @max_accumulate_amount.setter def max_accumulate_amount(self, value): self.__max_accumulate_amount = value - @property def period_rule(self): - """Gets the period_rule of this SubscriptionPlan.""" + """Gets the period_rule of this SubscriptionPlan. + + """ return self.__period_rule @period_rule.setter def period_rule(self, value): self.__period_rule = value - @property def subscription_start_time(self): """ @@ -51,7 +55,6 @@ def subscription_start_time(self): @subscription_start_time.setter def subscription_start_time(self, value): self.__subscription_start_time = value - @property def subscription_notification_url(self): """ @@ -63,45 +66,36 @@ def subscription_notification_url(self): def subscription_notification_url(self, value): self.__subscription_notification_url = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "allow_accumulate") and self.allow_accumulate is not None: - params["allowAccumulate"] = self.allow_accumulate - if ( - hasattr(self, "max_accumulate_amount") - and self.max_accumulate_amount is not None - ): - params["maxAccumulateAmount"] = self.max_accumulate_amount + params['allowAccumulate'] = self.allow_accumulate + if hasattr(self, "max_accumulate_amount") and self.max_accumulate_amount is not None: + params['maxAccumulateAmount'] = self.max_accumulate_amount if hasattr(self, "period_rule") and self.period_rule is not None: - params["periodRule"] = self.period_rule - if ( - hasattr(self, "subscription_start_time") - and self.subscription_start_time is not None - ): - params["subscriptionStartTime"] = self.subscription_start_time - if ( - hasattr(self, "subscription_notification_url") - and self.subscription_notification_url is not None - ): - params["subscriptionNotificationUrl"] = self.subscription_notification_url + params['periodRule'] = self.period_rule + if hasattr(self, "subscription_start_time") and self.subscription_start_time is not None: + params['subscriptionStartTime'] = self.subscription_start_time + if hasattr(self, "subscription_notification_url") and self.subscription_notification_url is not None: + params['subscriptionNotificationUrl'] = self.subscription_notification_url return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "allowAccumulate" in response_body: - self.__allow_accumulate = response_body["allowAccumulate"] - if "maxAccumulateAmount" in response_body: + if 'allowAccumulate' in response_body: + self.__allow_accumulate = response_body['allowAccumulate'] + if 'maxAccumulateAmount' in response_body: self.__max_accumulate_amount = Amount() - self.__max_accumulate_amount.parse_rsp_body( - response_body["maxAccumulateAmount"] - ) - if "periodRule" in response_body: + self.__max_accumulate_amount.parse_rsp_body(response_body['maxAccumulateAmount']) + if 'periodRule' in response_body: self.__period_rule = PeriodRule() - self.__period_rule.parse_rsp_body(response_body["periodRule"]) - if "subscriptionStartTime" in response_body: - self.__subscription_start_time = response_body["subscriptionStartTime"] - if "subscriptionNotificationUrl" in response_body: - self.__subscription_notification_url = response_body[ - "subscriptionNotificationUrl" - ] + self.__period_rule.parse_rsp_body(response_body['periodRule']) + if 'subscriptionStartTime' in response_body: + self.__subscription_start_time = response_body['subscriptionStartTime'] + if 'subscriptionNotificationUrl' in response_body: + self.__subscription_notification_url = response_body['subscriptionNotificationUrl'] diff --git a/com/alipay/ams/api/model/support_bank.py b/com/alipay/ams/api/model/support_bank.py index 48cddda..e8ffa50 100644 --- a/com/alipay/ams/api/model/support_bank.py +++ b/com/alipay/ams/api/model/support_bank.py @@ -2,64 +2,68 @@ from com.alipay.ams.api.model.logo import Logo + + class SupportBank: def __init__(self): - + self.__bank_identifier_code = None # type: str self.__bank_short_name = None # type: str self.__bank_logo = None # type: Logo + @property def bank_identifier_code(self): """ - The unique code of the bank. See the Bank list to check the valid values. + The unique code of the bank. See the Bank list to check the valid values. """ return self.__bank_identifier_code @bank_identifier_code.setter def bank_identifier_code(self, value): self.__bank_identifier_code = value - @property def bank_short_name(self): """ - The short name of the bank. The unique code of the bank. See the Bank list to check the valid values. + The short name of the bank. The unique code of the bank. See the Bank list to check the valid values. """ return self.__bank_short_name @bank_short_name.setter def bank_short_name(self, value): self.__bank_short_name = value - @property def bank_logo(self): - """Gets the bank_logo of this SupportBank.""" + """Gets the bank_logo of this SupportBank. + + """ return self.__bank_logo @bank_logo.setter def bank_logo(self, value): self.__bank_logo = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "bank_identifier_code") - and self.bank_identifier_code is not None - ): - params["bankIdentifierCode"] = self.bank_identifier_code + if hasattr(self, "bank_identifier_code") and self.bank_identifier_code is not None: + params['bankIdentifierCode'] = self.bank_identifier_code if hasattr(self, "bank_short_name") and self.bank_short_name is not None: - params["bankShortName"] = self.bank_short_name + params['bankShortName'] = self.bank_short_name if hasattr(self, "bank_logo") and self.bank_logo is not None: - params["bankLogo"] = self.bank_logo + params['bankLogo'] = self.bank_logo return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "bankIdentifierCode" in response_body: - self.__bank_identifier_code = response_body["bankIdentifierCode"] - if "bankShortName" in response_body: - self.__bank_short_name = response_body["bankShortName"] - if "bankLogo" in response_body: + if 'bankIdentifierCode' in response_body: + self.__bank_identifier_code = response_body['bankIdentifierCode'] + if 'bankShortName' in response_body: + self.__bank_short_name = response_body['bankShortName'] + if 'bankLogo' in response_body: self.__bank_logo = Logo() - self.__bank_logo.parse_rsp_body(response_body["bankLogo"]) + self.__bank_logo.parse_rsp_body(response_body['bankLogo']) diff --git a/com/alipay/ams/api/model/support_card_brand.py b/com/alipay/ams/api/model/support_card_brand.py index 64ddc08..64dd953 100644 --- a/com/alipay/ams/api/model/support_card_brand.py +++ b/com/alipay/ams/api/model/support_card_brand.py @@ -2,11 +2,14 @@ from com.alipay.ams.api.model.logo import Logo + + class SupportCardBrand: def __init__(self): - + self.__card_brand = None # type: str self.__logo = None # type: Logo + @property def card_brand(self): @@ -18,29 +21,34 @@ def card_brand(self): @card_brand.setter def card_brand(self, value): self.__card_brand = value - @property def logo(self): - """Gets the logo of this SupportCardBrand.""" + """Gets the logo of this SupportCardBrand. + + """ return self.__logo @logo.setter def logo(self, value): self.__logo = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "card_brand") and self.card_brand is not None: - params["cardBrand"] = self.card_brand + params['cardBrand'] = self.card_brand if hasattr(self, "logo") and self.logo is not None: - params["logo"] = self.logo + params['logo'] = self.logo return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "cardBrand" in response_body: - self.__card_brand = response_body["cardBrand"] - if "logo" in response_body: + if 'cardBrand' in response_body: + self.__card_brand = response_body['cardBrand'] + if 'logo' in response_body: self.__logo = Logo() - self.__logo.parse_rsp_body(response_body["logo"]) + self.__logo.parse_rsp_body(response_body['logo']) diff --git a/com/alipay/ams/api/model/terminal_type.py b/com/alipay/ams/api/model/terminal_type.py index ea2504f..2935115 100644 --- a/com/alipay/ams/api/model/terminal_type.py +++ b/com/alipay/ams/api/model/terminal_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class TerminalType(Enum): """TerminalType枚举类""" diff --git a/com/alipay/ams/api/model/three_ds_result.py b/com/alipay/ams/api/model/three_ds_result.py index d6d0753..edf7a16 100644 --- a/com/alipay/ams/api/model/three_ds_result.py +++ b/com/alipay/ams/api/model/three_ds_result.py @@ -1,9 +1,11 @@ import json + + class ThreeDSResult: def __init__(self): - + self.__three_ds_version = None # type: str self.__eci = None # type: str self.__cavv = None # type: str @@ -14,6 +16,7 @@ def __init__(self): self.__challenged = None # type: bool self.__exemption_type = None # type: str self.__three_ds_offered = None # type: bool + @property def three_ds_version(self): @@ -25,7 +28,6 @@ def three_ds_version(self): @three_ds_version.setter def three_ds_version(self, value): self.__three_ds_version = value - @property def eci(self): """ @@ -36,7 +38,6 @@ def eci(self): @eci.setter def eci(self, value): self.__eci = value - @property def cavv(self): """ @@ -47,7 +48,6 @@ def cavv(self): @cavv.setter def cavv(self, value): self.__cavv = value - @property def ds_transaction_id(self): """ @@ -58,7 +58,6 @@ def ds_transaction_id(self): @ds_transaction_id.setter def ds_transaction_id(self, value): self.__ds_transaction_id = value - @property def xid(self): """ @@ -69,7 +68,6 @@ def xid(self): @xid.setter def xid(self, value): self.__xid = value - @property def three_d_stransaction_status_reason(self): """ @@ -80,7 +78,6 @@ def three_d_stransaction_status_reason(self): @three_d_stransaction_status_reason.setter def three_d_stransaction_status_reason(self, value): self.__three_d_stransaction_status_reason = value - @property def challenge_cancel(self): """ @@ -91,7 +88,6 @@ def challenge_cancel(self): @challenge_cancel.setter def challenge_cancel(self, value): self.__challenge_cancel = value - @property def challenged(self): """ @@ -102,7 +98,6 @@ def challenged(self): @challenged.setter def challenged(self, value): self.__challenged = value - @property def exemption_type(self): """ @@ -113,7 +108,6 @@ def exemption_type(self): @exemption_type.setter def exemption_type(self, value): self.__exemption_type = value - @property def three_ds_offered(self): """ @@ -125,57 +119,54 @@ def three_ds_offered(self): def three_ds_offered(self, value): self.__three_ds_offered = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "three_ds_version") and self.three_ds_version is not None: - params["threeDSVersion"] = self.three_ds_version + params['threeDSVersion'] = self.three_ds_version if hasattr(self, "eci") and self.eci is not None: - params["eci"] = self.eci + params['eci'] = self.eci if hasattr(self, "cavv") and self.cavv is not None: - params["cavv"] = self.cavv + params['cavv'] = self.cavv if hasattr(self, "ds_transaction_id") and self.ds_transaction_id is not None: - params["dsTransactionId"] = self.ds_transaction_id + params['dsTransactionId'] = self.ds_transaction_id if hasattr(self, "xid") and self.xid is not None: - params["xid"] = self.xid - if ( - hasattr(self, "three_d_stransaction_status_reason") - and self.three_d_stransaction_status_reason is not None - ): - params["threeDStransactionStatusReason"] = ( - self.three_d_stransaction_status_reason - ) + params['xid'] = self.xid + if hasattr(self, "three_d_stransaction_status_reason") and self.three_d_stransaction_status_reason is not None: + params['threeDStransactionStatusReason'] = self.three_d_stransaction_status_reason if hasattr(self, "challenge_cancel") and self.challenge_cancel is not None: - params["challengeCancel"] = self.challenge_cancel + params['challengeCancel'] = self.challenge_cancel if hasattr(self, "challenged") and self.challenged is not None: - params["challenged"] = self.challenged + params['challenged'] = self.challenged if hasattr(self, "exemption_type") and self.exemption_type is not None: - params["exemptionType"] = self.exemption_type + params['exemptionType'] = self.exemption_type if hasattr(self, "three_ds_offered") and self.three_ds_offered is not None: - params["threeDSOffered"] = self.three_ds_offered + params['threeDSOffered'] = self.three_ds_offered return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "threeDSVersion" in response_body: - self.__three_ds_version = response_body["threeDSVersion"] - if "eci" in response_body: - self.__eci = response_body["eci"] - if "cavv" in response_body: - self.__cavv = response_body["cavv"] - if "dsTransactionId" in response_body: - self.__ds_transaction_id = response_body["dsTransactionId"] - if "xid" in response_body: - self.__xid = response_body["xid"] - if "threeDStransactionStatusReason" in response_body: - self.__three_d_stransaction_status_reason = response_body[ - "threeDStransactionStatusReason" - ] - if "challengeCancel" in response_body: - self.__challenge_cancel = response_body["challengeCancel"] - if "challenged" in response_body: - self.__challenged = response_body["challenged"] - if "exemptionType" in response_body: - self.__exemption_type = response_body["exemptionType"] - if "threeDSOffered" in response_body: - self.__three_ds_offered = response_body["threeDSOffered"] + if 'threeDSVersion' in response_body: + self.__three_ds_version = response_body['threeDSVersion'] + if 'eci' in response_body: + self.__eci = response_body['eci'] + if 'cavv' in response_body: + self.__cavv = response_body['cavv'] + if 'dsTransactionId' in response_body: + self.__ds_transaction_id = response_body['dsTransactionId'] + if 'xid' in response_body: + self.__xid = response_body['xid'] + if 'threeDStransactionStatusReason' in response_body: + self.__three_d_stransaction_status_reason = response_body['threeDStransactionStatusReason'] + if 'challengeCancel' in response_body: + self.__challenge_cancel = response_body['challengeCancel'] + if 'challenged' in response_body: + self.__challenged = response_body['challenged'] + if 'exemptionType' in response_body: + self.__exemption_type = response_body['exemptionType'] + if 'threeDSOffered' in response_body: + self.__three_ds_offered = response_body['threeDSOffered'] diff --git a/com/alipay/ams/api/model/transaction.py b/com/alipay/ams/api/model/transaction.py index b5e5989..db00473 100644 --- a/com/alipay/ams/api/model/transaction.py +++ b/com/alipay/ams/api/model/transaction.py @@ -6,9 +6,11 @@ from com.alipay.ams.api.model.acquirer_info import AcquirerInfo + + class Transaction: def __init__(self): - + self.__transaction_result = None # type: Result self.__transaction_id = None # type: str self.__transaction_type = None # type: TransactionType @@ -17,16 +19,18 @@ def __init__(self): self.__transaction_request_id = None # type: str self.__transaction_time = None # type: str self.__acquirer_info = None # type: AcquirerInfo + @property def transaction_result(self): - """Gets the transaction_result of this Transaction.""" + """Gets the transaction_result of this Transaction. + + """ return self.__transaction_result @transaction_result.setter def transaction_result(self, value): self.__transaction_result = value - @property def transaction_id(self): """ @@ -37,34 +41,36 @@ def transaction_id(self): @transaction_id.setter def transaction_id(self, value): self.__transaction_id = value - @property def transaction_type(self): - """Gets the transaction_type of this Transaction.""" + """Gets the transaction_type of this Transaction. + + """ return self.__transaction_type @transaction_type.setter def transaction_type(self, value): self.__transaction_type = value - @property def transaction_status(self): - """Gets the transaction_status of this Transaction.""" + """Gets the transaction_status of this Transaction. + + """ return self.__transaction_status @transaction_status.setter def transaction_status(self, value): self.__transaction_status = value - @property def transaction_amount(self): - """Gets the transaction_amount of this Transaction.""" + """Gets the transaction_amount of this Transaction. + + """ return self.__transaction_amount @transaction_amount.setter def transaction_amount(self, value): self.__transaction_amount = value - @property def transaction_request_id(self): """ @@ -75,73 +81,72 @@ def transaction_request_id(self): @transaction_request_id.setter def transaction_request_id(self, value): self.__transaction_request_id = value - @property def transaction_time(self): - """Gets the transaction_time of this Transaction.""" + """Gets the transaction_time of this Transaction. + + """ return self.__transaction_time @transaction_time.setter def transaction_time(self, value): self.__transaction_time = value - @property def acquirer_info(self): - """Gets the acquirer_info of this Transaction.""" + """Gets the acquirer_info of this Transaction. + + """ return self.__acquirer_info @acquirer_info.setter def acquirer_info(self, value): self.__acquirer_info = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "transaction_result") and self.transaction_result is not None: - params["transactionResult"] = self.transaction_result + params['transactionResult'] = self.transaction_result if hasattr(self, "transaction_id") and self.transaction_id is not None: - params["transactionId"] = self.transaction_id + params['transactionId'] = self.transaction_id if hasattr(self, "transaction_type") and self.transaction_type is not None: - params["transactionType"] = self.transaction_type + params['transactionType'] = self.transaction_type if hasattr(self, "transaction_status") and self.transaction_status is not None: - params["transactionStatus"] = self.transaction_status + params['transactionStatus'] = self.transaction_status if hasattr(self, "transaction_amount") and self.transaction_amount is not None: - params["transactionAmount"] = self.transaction_amount - if ( - hasattr(self, "transaction_request_id") - and self.transaction_request_id is not None - ): - params["transactionRequestId"] = self.transaction_request_id + params['transactionAmount'] = self.transaction_amount + if hasattr(self, "transaction_request_id") and self.transaction_request_id is not None: + params['transactionRequestId'] = self.transaction_request_id if hasattr(self, "transaction_time") and self.transaction_time is not None: - params["transactionTime"] = self.transaction_time + params['transactionTime'] = self.transaction_time if hasattr(self, "acquirer_info") and self.acquirer_info is not None: - params["acquirerInfo"] = self.acquirer_info + params['acquirerInfo'] = self.acquirer_info return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "transactionResult" in response_body: + if 'transactionResult' in response_body: self.__transaction_result = Result() - self.__transaction_result.parse_rsp_body(response_body["transactionResult"]) - if "transactionId" in response_body: - self.__transaction_id = response_body["transactionId"] - if "transactionType" in response_body: - transaction_type_temp = TransactionType.value_of( - response_body["transactionType"] - ) + self.__transaction_result.parse_rsp_body(response_body['transactionResult']) + if 'transactionId' in response_body: + self.__transaction_id = response_body['transactionId'] + if 'transactionType' in response_body: + transaction_type_temp = TransactionType.value_of(response_body['transactionType']) self.__transaction_type = transaction_type_temp - if "transactionStatus" in response_body: - transaction_status_temp = TransactionStatusType.value_of( - response_body["transactionStatus"] - ) + if 'transactionStatus' in response_body: + transaction_status_temp = TransactionStatusType.value_of(response_body['transactionStatus']) self.__transaction_status = transaction_status_temp - if "transactionAmount" in response_body: + if 'transactionAmount' in response_body: self.__transaction_amount = Amount() - self.__transaction_amount.parse_rsp_body(response_body["transactionAmount"]) - if "transactionRequestId" in response_body: - self.__transaction_request_id = response_body["transactionRequestId"] - if "transactionTime" in response_body: - self.__transaction_time = response_body["transactionTime"] - if "acquirerInfo" in response_body: + self.__transaction_amount.parse_rsp_body(response_body['transactionAmount']) + if 'transactionRequestId' in response_body: + self.__transaction_request_id = response_body['transactionRequestId'] + if 'transactionTime' in response_body: + self.__transaction_time = response_body['transactionTime'] + if 'acquirerInfo' in response_body: self.__acquirer_info = AcquirerInfo() - self.__acquirer_info.parse_rsp_body(response_body["acquirerInfo"]) + self.__acquirer_info.parse_rsp_body(response_body['acquirerInfo']) diff --git a/com/alipay/ams/api/model/transaction_status_type.py b/com/alipay/ams/api/model/transaction_status_type.py index bdbb50a..b4f7d70 100644 --- a/com/alipay/ams/api/model/transaction_status_type.py +++ b/com/alipay/ams/api/model/transaction_status_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class TransactionStatusType(Enum): """TransactionStatusType枚举类""" diff --git a/com/alipay/ams/api/model/transaction_type.py b/com/alipay/ams/api/model/transaction_type.py index cedc915..f8d1dd1 100644 --- a/com/alipay/ams/api/model/transaction_type.py +++ b/com/alipay/ams/api/model/transaction_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class TransactionType(Enum): """TransactionType枚举类""" diff --git a/com/alipay/ams/api/model/transfer_from_detail.py b/com/alipay/ams/api/model/transfer_from_detail.py index c75abdb..0af752d 100644 --- a/com/alipay/ams/api/model/transfer_from_detail.py +++ b/com/alipay/ams/api/model/transfer_from_detail.py @@ -3,54 +3,54 @@ from com.alipay.ams.api.model.amount import Amount + + class TransferFromDetail: def __init__(self): - + self.__transfer_from_method = None # type: PaymentMethod self.__transfer_from_amount = None # type: Amount + @property def transfer_from_method(self): - """Gets the transfer_from_method of this TransferFromDetail.""" + """Gets the transfer_from_method of this TransferFromDetail. + + """ return self.__transfer_from_method @transfer_from_method.setter def transfer_from_method(self, value): self.__transfer_from_method = value - @property def transfer_from_amount(self): - """Gets the transfer_from_amount of this TransferFromDetail.""" + """Gets the transfer_from_amount of this TransferFromDetail. + + """ return self.__transfer_from_amount @transfer_from_amount.setter def transfer_from_amount(self, value): self.__transfer_from_amount = value + + + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "transfer_from_method") - and self.transfer_from_method is not None - ): - params["transferFromMethod"] = self.transfer_from_method - if ( - hasattr(self, "transfer_from_amount") - and self.transfer_from_amount is not None - ): - params["transferFromAmount"] = self.transfer_from_amount + if hasattr(self, "transfer_from_method") and self.transfer_from_method is not None: + params['transferFromMethod'] = self.transfer_from_method + if hasattr(self, "transfer_from_amount") and self.transfer_from_amount is not None: + params['transferFromAmount'] = self.transfer_from_amount return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "transferFromMethod" in response_body: + if 'transferFromMethod' in response_body: self.__transfer_from_method = PaymentMethod() - self.__transfer_from_method.parse_rsp_body( - response_body["transferFromMethod"] - ) - if "transferFromAmount" in response_body: + self.__transfer_from_method.parse_rsp_body(response_body['transferFromMethod']) + if 'transferFromAmount' in response_body: self.__transfer_from_amount = Amount() - self.__transfer_from_amount.parse_rsp_body( - response_body["transferFromAmount"] - ) + self.__transfer_from_amount.parse_rsp_body(response_body['transferFromAmount']) diff --git a/com/alipay/ams/api/model/transfer_to_detail.py b/com/alipay/ams/api/model/transfer_to_detail.py index f708a6a..4391514 100644 --- a/com/alipay/ams/api/model/transfer_to_detail.py +++ b/com/alipay/ams/api/model/transfer_to_detail.py @@ -4,9 +4,11 @@ from com.alipay.ams.api.model.amount import Amount + + class TransferToDetail: def __init__(self): - + self.__transfer_to_method = None # type: PaymentMethod self.__transfer_to_currency = None # type: str self.__fee_amount = None # type: Amount @@ -14,16 +16,18 @@ def __init__(self): self.__purpose_code = None # type: str self.__transfer_notify_url = None # type: str self.__transfer_remark = None # type: str + @property def transfer_to_method(self): - """Gets the transfer_to_method of this TransferToDetail.""" + """Gets the transfer_to_method of this TransferToDetail. + + """ return self.__transfer_to_method @transfer_to_method.setter def transfer_to_method(self, value): self.__transfer_to_method = value - @property def transfer_to_currency(self): """ @@ -34,25 +38,26 @@ def transfer_to_currency(self): @transfer_to_currency.setter def transfer_to_currency(self, value): self.__transfer_to_currency = value - @property def fee_amount(self): - """Gets the fee_amount of this TransferToDetail.""" + """Gets the fee_amount of this TransferToDetail. + + """ return self.__fee_amount @fee_amount.setter def fee_amount(self, value): self.__fee_amount = value - @property def actual_transfer_to_amount(self): - """Gets the actual_transfer_to_amount of this TransferToDetail.""" + """Gets the actual_transfer_to_amount of this TransferToDetail. + + """ return self.__actual_transfer_to_amount @actual_transfer_to_amount.setter def actual_transfer_to_amount(self, value): self.__actual_transfer_to_amount = value - @property def purpose_code(self): """ @@ -63,7 +68,6 @@ def purpose_code(self): @purpose_code.setter def purpose_code(self, value): self.__purpose_code = value - @property def transfer_notify_url(self): """ @@ -74,7 +78,6 @@ def transfer_notify_url(self): @transfer_notify_url.setter def transfer_notify_url(self, value): self.__transfer_notify_url = value - @property def transfer_remark(self): """ @@ -86,52 +89,45 @@ def transfer_remark(self): def transfer_remark(self, value): self.__transfer_remark = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "transfer_to_method") and self.transfer_to_method is not None: - params["transferToMethod"] = self.transfer_to_method - if ( - hasattr(self, "transfer_to_currency") - and self.transfer_to_currency is not None - ): - params["transferToCurrency"] = self.transfer_to_currency + params['transferToMethod'] = self.transfer_to_method + if hasattr(self, "transfer_to_currency") and self.transfer_to_currency is not None: + params['transferToCurrency'] = self.transfer_to_currency if hasattr(self, "fee_amount") and self.fee_amount is not None: - params["feeAmount"] = self.fee_amount - if ( - hasattr(self, "actual_transfer_to_amount") - and self.actual_transfer_to_amount is not None - ): - params["actualTransferToAmount"] = self.actual_transfer_to_amount + params['feeAmount'] = self.fee_amount + if hasattr(self, "actual_transfer_to_amount") and self.actual_transfer_to_amount is not None: + params['actualTransferToAmount'] = self.actual_transfer_to_amount if hasattr(self, "purpose_code") and self.purpose_code is not None: - params["purposeCode"] = self.purpose_code - if ( - hasattr(self, "transfer_notify_url") - and self.transfer_notify_url is not None - ): - params["transferNotifyUrl"] = self.transfer_notify_url + params['purposeCode'] = self.purpose_code + if hasattr(self, "transfer_notify_url") and self.transfer_notify_url is not None: + params['transferNotifyUrl'] = self.transfer_notify_url if hasattr(self, "transfer_remark") and self.transfer_remark is not None: - params["transferRemark"] = self.transfer_remark + params['transferRemark'] = self.transfer_remark return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "transferToMethod" in response_body: + if 'transferToMethod' in response_body: self.__transfer_to_method = PaymentMethod() - self.__transfer_to_method.parse_rsp_body(response_body["transferToMethod"]) - if "transferToCurrency" in response_body: - self.__transfer_to_currency = response_body["transferToCurrency"] - if "feeAmount" in response_body: + self.__transfer_to_method.parse_rsp_body(response_body['transferToMethod']) + if 'transferToCurrency' in response_body: + self.__transfer_to_currency = response_body['transferToCurrency'] + if 'feeAmount' in response_body: self.__fee_amount = Amount() - self.__fee_amount.parse_rsp_body(response_body["feeAmount"]) - if "actualTransferToAmount" in response_body: + self.__fee_amount.parse_rsp_body(response_body['feeAmount']) + if 'actualTransferToAmount' in response_body: self.__actual_transfer_to_amount = Amount() - self.__actual_transfer_to_amount.parse_rsp_body( - response_body["actualTransferToAmount"] - ) - if "purposeCode" in response_body: - self.__purpose_code = response_body["purposeCode"] - if "transferNotifyUrl" in response_body: - self.__transfer_notify_url = response_body["transferNotifyUrl"] - if "transferRemark" in response_body: - self.__transfer_remark = response_body["transferRemark"] + self.__actual_transfer_to_amount.parse_rsp_body(response_body['actualTransferToAmount']) + if 'purposeCode' in response_body: + self.__purpose_code = response_body['purposeCode'] + if 'transferNotifyUrl' in response_body: + self.__transfer_notify_url = response_body['transferNotifyUrl'] + if 'transferRemark' in response_body: + self.__transfer_remark = response_body['transferRemark'] diff --git a/com/alipay/ams/api/model/transit.py b/com/alipay/ams/api/model/transit.py index 5564ce4..40ab461 100644 --- a/com/alipay/ams/api/model/transit.py +++ b/com/alipay/ams/api/model/transit.py @@ -5,9 +5,11 @@ from com.alipay.ams.api.model.ancillary_data import AncillaryData + + class Transit: def __init__(self): - + self.__transit_type = None # type: TransitType self.__legs = None # type: [Leg] self.__passengers = None # type: [Passenger] @@ -17,16 +19,18 @@ def __init__(self): self.__ticket_issuer_code = None # type: str self.__restricted_ticket_indicator = None # type: str self.__ancillary_data = None # type: AncillaryData + @property def transit_type(self): - """Gets the transit_type of this Transit.""" + """Gets the transit_type of this Transit. + + """ return self.__transit_type @transit_type.setter def transit_type(self, value): self.__transit_type = value - @property def legs(self): """ @@ -37,7 +41,6 @@ def legs(self): @legs.setter def legs(self, value): self.__legs = value - @property def passengers(self): """ @@ -48,7 +51,6 @@ def passengers(self): @passengers.setter def passengers(self, value): self.__passengers = value - @property def agent_code(self): """ @@ -59,7 +61,6 @@ def agent_code(self): @agent_code.setter def agent_code(self, value): self.__agent_code = value - @property def agent_name(self): """ @@ -70,7 +71,6 @@ def agent_name(self): @agent_name.setter def agent_name(self, value): self.__agent_name = value - @property def ticket_number(self): """ @@ -81,7 +81,6 @@ def ticket_number(self): @ticket_number.setter def ticket_number(self, value): self.__ticket_number = value - @property def ticket_issuer_code(self): """ @@ -92,7 +91,6 @@ def ticket_issuer_code(self): @ticket_issuer_code.setter def ticket_issuer_code(self, value): self.__ticket_issuer_code = value - @property def restricted_ticket_indicator(self): """ @@ -103,71 +101,71 @@ def restricted_ticket_indicator(self): @restricted_ticket_indicator.setter def restricted_ticket_indicator(self, value): self.__restricted_ticket_indicator = value - @property def ancillary_data(self): - """Gets the ancillary_data of this Transit.""" + """Gets the ancillary_data of this Transit. + + """ return self.__ancillary_data @ancillary_data.setter def ancillary_data(self, value): self.__ancillary_data = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "transit_type") and self.transit_type is not None: - params["transitType"] = self.transit_type + params['transitType'] = self.transit_type if hasattr(self, "legs") and self.legs is not None: - params["legs"] = self.legs + params['legs'] = self.legs if hasattr(self, "passengers") and self.passengers is not None: - params["passengers"] = self.passengers + params['passengers'] = self.passengers if hasattr(self, "agent_code") and self.agent_code is not None: - params["agentCode"] = self.agent_code + params['agentCode'] = self.agent_code if hasattr(self, "agent_name") and self.agent_name is not None: - params["agentName"] = self.agent_name + params['agentName'] = self.agent_name if hasattr(self, "ticket_number") and self.ticket_number is not None: - params["ticketNumber"] = self.ticket_number + params['ticketNumber'] = self.ticket_number if hasattr(self, "ticket_issuer_code") and self.ticket_issuer_code is not None: - params["ticketIssuerCode"] = self.ticket_issuer_code - if ( - hasattr(self, "restricted_ticket_indicator") - and self.restricted_ticket_indicator is not None - ): - params["restrictedTicketIndicator"] = self.restricted_ticket_indicator + params['ticketIssuerCode'] = self.ticket_issuer_code + if hasattr(self, "restricted_ticket_indicator") and self.restricted_ticket_indicator is not None: + params['restrictedTicketIndicator'] = self.restricted_ticket_indicator if hasattr(self, "ancillary_data") and self.ancillary_data is not None: - params["ancillaryData"] = self.ancillary_data + params['ancillaryData'] = self.ancillary_data return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "transitType" in response_body: - transit_type_temp = TransitType.value_of(response_body["transitType"]) + if 'transitType' in response_body: + transit_type_temp = TransitType.value_of(response_body['transitType']) self.__transit_type = transit_type_temp - if "legs" in response_body: + if 'legs' in response_body: self.__legs = [] - for item in response_body["legs"]: + for item in response_body['legs']: obj = Leg() obj.parse_rsp_body(item) self.__legs.append(obj) - if "passengers" in response_body: + if 'passengers' in response_body: self.__passengers = [] - for item in response_body["passengers"]: + for item in response_body['passengers']: obj = Passenger() obj.parse_rsp_body(item) self.__passengers.append(obj) - if "agentCode" in response_body: - self.__agent_code = response_body["agentCode"] - if "agentName" in response_body: - self.__agent_name = response_body["agentName"] - if "ticketNumber" in response_body: - self.__ticket_number = response_body["ticketNumber"] - if "ticketIssuerCode" in response_body: - self.__ticket_issuer_code = response_body["ticketIssuerCode"] - if "restrictedTicketIndicator" in response_body: - self.__restricted_ticket_indicator = response_body[ - "restrictedTicketIndicator" - ] - if "ancillaryData" in response_body: + if 'agentCode' in response_body: + self.__agent_code = response_body['agentCode'] + if 'agentName' in response_body: + self.__agent_name = response_body['agentName'] + if 'ticketNumber' in response_body: + self.__ticket_number = response_body['ticketNumber'] + if 'ticketIssuerCode' in response_body: + self.__ticket_issuer_code = response_body['ticketIssuerCode'] + if 'restrictedTicketIndicator' in response_body: + self.__restricted_ticket_indicator = response_body['restrictedTicketIndicator'] + if 'ancillaryData' in response_body: self.__ancillary_data = AncillaryData() - self.__ancillary_data.parse_rsp_body(response_body["ancillaryData"]) + self.__ancillary_data.parse_rsp_body(response_body['ancillaryData']) diff --git a/com/alipay/ams/api/model/transit_type.py b/com/alipay/ams/api/model/transit_type.py index e355976..ed78a45 100644 --- a/com/alipay/ams/api/model/transit_type.py +++ b/com/alipay/ams/api/model/transit_type.py @@ -1,6 +1,4 @@ from enum import Enum, unique - - @unique class TransitType(Enum): """Type of transit""" diff --git a/com/alipay/ams/api/model/trial.py b/com/alipay/ams/api/model/trial.py index f9aaa10..d0f1431 100644 --- a/com/alipay/ams/api/model/trial.py +++ b/com/alipay/ams/api/model/trial.py @@ -2,32 +2,37 @@ from com.alipay.ams.api.model.amount import Amount + + class Trial: def __init__(self): - + self.__trial_period = None # type: int self.__trial_amount = None # type: Amount self.__trial_start_period = None # type: int self.__trial_end_period = None # type: int + @property def trial_period(self): - """Gets the trial_period of this Trial.""" + """Gets the trial_period of this Trial. + + """ return self.__trial_period @trial_period.setter def trial_period(self, value): self.__trial_period = value - @property def trial_amount(self): - """Gets the trial_amount of this Trial.""" + """Gets the trial_amount of this Trial. + + """ return self.__trial_amount @trial_amount.setter def trial_amount(self, value): self.__trial_amount = value - @property def trial_start_period(self): """ @@ -38,11 +43,10 @@ def trial_start_period(self): @trial_start_period.setter def trial_start_period(self, value): self.__trial_start_period = value - @property def trial_end_period(self): """ - The end subscription period of the trial. For example, if the trial ends at the third subscription period, specify this parameter as 3. Note: Specify this parameter if the end subscription period is different from the start subscription period. If you leave this parameter empty, the default value of this parameter is the same as the value of trialStartPeriod. More information: Value range: 1 - unlimited + The end subscription period of the trial. For example, if the trial ends at the third subscription period, specify this parameter as 3. Note: Specify this parameter if the end subscription period is different from the start subscription period. If you leave this parameter empty, the default value of this parameter is the same as the value of trialStartPeriod. More information: Value range: 1 - unlimited """ return self.__trial_end_period @@ -50,27 +54,31 @@ def trial_end_period(self): def trial_end_period(self, value): self.__trial_end_period = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "trial_period") and self.trial_period is not None: - params["trialPeriod"] = self.trial_period + params['trialPeriod'] = self.trial_period if hasattr(self, "trial_amount") and self.trial_amount is not None: - params["trialAmount"] = self.trial_amount + params['trialAmount'] = self.trial_amount if hasattr(self, "trial_start_period") and self.trial_start_period is not None: - params["trialStartPeriod"] = self.trial_start_period + params['trialStartPeriod'] = self.trial_start_period if hasattr(self, "trial_end_period") and self.trial_end_period is not None: - params["trialEndPeriod"] = self.trial_end_period + params['trialEndPeriod'] = self.trial_end_period return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "trialPeriod" in response_body: - self.__trial_period = response_body["trialPeriod"] - if "trialAmount" in response_body: + if 'trialPeriod' in response_body: + self.__trial_period = response_body['trialPeriod'] + if 'trialAmount' in response_body: self.__trial_amount = Amount() - self.__trial_amount.parse_rsp_body(response_body["trialAmount"]) - if "trialStartPeriod" in response_body: - self.__trial_start_period = response_body["trialStartPeriod"] - if "trialEndPeriod" in response_body: - self.__trial_end_period = response_body["trialEndPeriod"] + self.__trial_amount.parse_rsp_body(response_body['trialAmount']) + if 'trialStartPeriod' in response_body: + self.__trial_start_period = response_body['trialStartPeriod'] + if 'trialEndPeriod' in response_body: + self.__trial_end_period = response_body['trialEndPeriod'] diff --git a/com/alipay/ams/api/model/user_name.py b/com/alipay/ams/api/model/user_name.py index 14e02fb..5be3d6f 100644 --- a/com/alipay/ams/api/model/user_name.py +++ b/com/alipay/ams/api/model/user_name.py @@ -1,70 +1,82 @@ import json + + class UserName: def __init__(self): - + self.__first_name = None # type: str self.__middle_name = None # type: str self.__last_name = None # type: str self.__full_name = None # type: str + @property def first_name(self): - """Gets the first_name of this UserName.""" + """ + First name. More information: Maximum length: 32 characters + """ return self.__first_name @first_name.setter def first_name(self, value): self.__first_name = value - @property def middle_name(self): - """Gets the middle_name of this UserName.""" + """ + Middle name More information: Maximum length: 32 characters + """ return self.__middle_name @middle_name.setter def middle_name(self, value): self.__middle_name = value - @property def last_name(self): - """Gets the last_name of this UserName.""" + """ + Last name More information: Maximum length: 32 characters + """ return self.__last_name @last_name.setter def last_name(self, value): self.__last_name = value - @property def full_name(self): - """Gets the full_name of this UserName.""" + """ + Full name More information: Maximum length: 128 characters + """ return self.__full_name @full_name.setter def full_name(self, value): self.__full_name = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "first_name") and self.first_name is not None: - params["firstName"] = self.first_name + params['firstName'] = self.first_name if hasattr(self, "middle_name") and self.middle_name is not None: - params["middleName"] = self.middle_name + params['middleName'] = self.middle_name if hasattr(self, "last_name") and self.last_name is not None: - params["lastName"] = self.last_name + params['lastName'] = self.last_name if hasattr(self, "full_name") and self.full_name is not None: - params["fullName"] = self.full_name + params['fullName'] = self.full_name return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "firstName" in response_body: - self.__first_name = response_body["firstName"] - if "middleName" in response_body: - self.__middle_name = response_body["middleName"] - if "lastName" in response_body: - self.__last_name = response_body["lastName"] - if "fullName" in response_body: - self.__full_name = response_body["fullName"] + if 'firstName' in response_body: + self.__first_name = response_body['firstName'] + if 'middleName' in response_body: + self.__middle_name = response_body['middleName'] + if 'lastName' in response_body: + self.__last_name = response_body['lastName'] + if 'fullName' in response_body: + self.__full_name = response_body['fullName'] diff --git a/com/alipay/ams/api/model/wallet.py b/com/alipay/ams/api/model/wallet.py index de0aabf..b7f6e0f 100644 --- a/com/alipay/ams/api/model/wallet.py +++ b/com/alipay/ams/api/model/wallet.py @@ -3,9 +3,11 @@ from com.alipay.ams.api.model.address import Address + + class Wallet: def __init__(self): - + self.__account_no = None # type: str self.__account_holder_name = None # type: UserName self.__phone_no = None # type: str @@ -13,52 +15,58 @@ def __init__(self): self.__billing_address = None # type: Address self.__token = None # type: str self.__token_expiry_time = None # type: str + @property def account_no(self): - """Gets the account_no of this Wallet.""" + """Gets the account_no of this Wallet. + + """ return self.__account_no @account_no.setter def account_no(self, value): self.__account_no = value - @property def account_holder_name(self): - """Gets the account_holder_name of this Wallet.""" + """Gets the account_holder_name of this Wallet. + + """ return self.__account_holder_name @account_holder_name.setter def account_holder_name(self, value): self.__account_holder_name = value - @property def phone_no(self): - """Gets the phone_no of this Wallet.""" + """Gets the phone_no of this Wallet. + + """ return self.__phone_no @phone_no.setter def phone_no(self, value): self.__phone_no = value - @property def email(self): - """Gets the email of this Wallet.""" + """Gets the email of this Wallet. + + """ return self.__email @email.setter def email(self, value): self.__email = value - @property def billing_address(self): - """Gets the billing_address of this Wallet.""" + """Gets the billing_address of this Wallet. + + """ return self.__billing_address @billing_address.setter def billing_address(self, value): self.__billing_address = value - @property def token(self): """ @@ -69,7 +77,6 @@ def token(self): @token.setter def token(self, value): self.__token = value - @property def token_expiry_time(self): """ @@ -81,45 +88,44 @@ def token_expiry_time(self): def token_expiry_time(self, value): self.__token_expiry_time = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "account_no") and self.account_no is not None: - params["accountNo"] = self.account_no - if ( - hasattr(self, "account_holder_name") - and self.account_holder_name is not None - ): - params["accountHolderName"] = self.account_holder_name + params['accountNo'] = self.account_no + if hasattr(self, "account_holder_name") and self.account_holder_name is not None: + params['accountHolderName'] = self.account_holder_name if hasattr(self, "phone_no") and self.phone_no is not None: - params["phoneNo"] = self.phone_no + params['phoneNo'] = self.phone_no if hasattr(self, "email") and self.email is not None: - params["email"] = self.email + params['email'] = self.email if hasattr(self, "billing_address") and self.billing_address is not None: - params["billingAddress"] = self.billing_address + params['billingAddress'] = self.billing_address if hasattr(self, "token") and self.token is not None: - params["token"] = self.token + params['token'] = self.token if hasattr(self, "token_expiry_time") and self.token_expiry_time is not None: - params["tokenExpiryTime"] = self.token_expiry_time + params['tokenExpiryTime'] = self.token_expiry_time return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "accountNo" in response_body: - self.__account_no = response_body["accountNo"] - if "accountHolderName" in response_body: + if 'accountNo' in response_body: + self.__account_no = response_body['accountNo'] + if 'accountHolderName' in response_body: self.__account_holder_name = UserName() - self.__account_holder_name.parse_rsp_body( - response_body["accountHolderName"] - ) - if "phoneNo" in response_body: - self.__phone_no = response_body["phoneNo"] - if "email" in response_body: - self.__email = response_body["email"] - if "billingAddress" in response_body: + self.__account_holder_name.parse_rsp_body(response_body['accountHolderName']) + if 'phoneNo' in response_body: + self.__phone_no = response_body['phoneNo'] + if 'email' in response_body: + self.__email = response_body['email'] + if 'billingAddress' in response_body: self.__billing_address = Address() - self.__billing_address.parse_rsp_body(response_body["billingAddress"]) - if "token" in response_body: - self.__token = response_body["token"] - if "tokenExpiryTime" in response_body: - self.__token_expiry_time = response_body["tokenExpiryTime"] + self.__billing_address.parse_rsp_body(response_body['billingAddress']) + if 'token' in response_body: + self.__token = response_body['token'] + if 'tokenExpiryTime' in response_body: + self.__token_expiry_time = response_body['tokenExpiryTime'] diff --git a/com/alipay/ams/api/model/web_site.py b/com/alipay/ams/api/model/web_site.py index dfa3622..3aad424 100644 --- a/com/alipay/ams/api/model/web_site.py +++ b/com/alipay/ams/api/model/web_site.py @@ -1,23 +1,27 @@ import json + + class WebSite: def __init__(self): - + self.__name = None # type: str self.__url = None # type: str self.__desc = None # type: str self.__type = None # type: str + @property def name(self): - """Gets the name of this WebSite.""" + """Gets the name of this WebSite. + + """ return self.__name @name.setter def name(self, value): self.__name = value - @property def url(self): """ @@ -28,16 +32,16 @@ def url(self): @url.setter def url(self, value): self.__url = value - @property def desc(self): - """Gets the desc of this WebSite.""" + """Gets the desc of this WebSite. + + """ return self.__desc @desc.setter def desc(self, value): self.__desc = value - @property def type(self): """ @@ -49,26 +53,30 @@ def type(self): def type(self, value): self.__type = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "name") and self.name is not None: - params["name"] = self.name + params['name'] = self.name if hasattr(self, "url") and self.url is not None: - params["url"] = self.url + params['url'] = self.url if hasattr(self, "desc") and self.desc is not None: - params["desc"] = self.desc + params['desc'] = self.desc if hasattr(self, "type") and self.type is not None: - params["type"] = self.type + params['type'] = self.type return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "name" in response_body: - self.__name = response_body["name"] - if "url" in response_body: - self.__url = response_body["url"] - if "desc" in response_body: - self.__desc = response_body["desc"] - if "type" in response_body: - self.__type = response_body["type"] + if 'name' in response_body: + self.__name = response_body['name'] + if 'url' in response_body: + self.__url = response_body['url'] + if 'desc' in response_body: + self.__desc = response_body['desc'] + if 'type' in response_body: + self.__type = response_body['type'] diff --git a/com/alipay/ams/api/request/aba/alipay_inquiry_statement_list_request.py b/com/alipay/ams/api/request/aba/alipay_inquiry_statement_list_request.py index c1bb552..65c2162 100644 --- a/com/alipay/ams/api/request/aba/alipay_inquiry_statement_list_request.py +++ b/com/alipay/ams/api/request/aba/alipay_inquiry_statement_list_request.py @@ -1,14 +1,12 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayInquiryStatementListRequest(AlipayRequest): def __init__(self): - super(AlipayInquiryStatementListRequest, self).__init__( - "/ams/api/v1/aba/accounts/inquiryStatementList" - ) + super(AlipayInquiryStatementListRequest, self).__init__("/ams/api/v1/aba/accounts/inquiryStatementList") self.__customer_id = None # type: str self.__access_token = None # type: str @@ -18,124 +16,132 @@ def __init__(self): self.__currency_list = None # type: [str] self.__page_size = None # type: str self.__page_number = None # type: str + @property def customer_id(self): - """Gets the customer_id of this AlipayInquiryStatementListRequest.""" + """Gets the customer_id of this AlipayInquiryStatementListRequest. + + """ return self.__customer_id @customer_id.setter def customer_id(self, value): self.__customer_id = value - @property def access_token(self): - """Gets the access_token of this AlipayInquiryStatementListRequest.""" + """Gets the access_token of this AlipayInquiryStatementListRequest. + + """ return self.__access_token @access_token.setter def access_token(self, value): self.__access_token = value - @property def start_time(self): - """Gets the start_time of this AlipayInquiryStatementListRequest.""" + """Gets the start_time of this AlipayInquiryStatementListRequest. + + """ return self.__start_time @start_time.setter def start_time(self, value): self.__start_time = value - @property def end_time(self): - """Gets the end_time of this AlipayInquiryStatementListRequest.""" + """Gets the end_time of this AlipayInquiryStatementListRequest. + + """ return self.__end_time @end_time.setter def end_time(self, value): self.__end_time = value - @property def transaction_type_list(self): - """Gets the transaction_type_list of this AlipayInquiryStatementListRequest.""" + """Gets the transaction_type_list of this AlipayInquiryStatementListRequest. + + """ return self.__transaction_type_list @transaction_type_list.setter def transaction_type_list(self, value): self.__transaction_type_list = value - @property def currency_list(self): - """Gets the currency_list of this AlipayInquiryStatementListRequest.""" + """Gets the currency_list of this AlipayInquiryStatementListRequest. + + """ return self.__currency_list @currency_list.setter def currency_list(self, value): self.__currency_list = value - @property def page_size(self): - """Gets the page_size of this AlipayInquiryStatementListRequest.""" + """Gets the page_size of this AlipayInquiryStatementListRequest. + + """ return self.__page_size @page_size.setter def page_size(self, value): self.__page_size = value - @property def page_number(self): - """Gets the page_number of this AlipayInquiryStatementListRequest.""" + """Gets the page_number of this AlipayInquiryStatementListRequest. + + """ return self.__page_number @page_number.setter def page_number(self, value): self.__page_number = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "customer_id") and self.customer_id is not None: - params["customerId"] = self.customer_id + params['customerId'] = self.customer_id if hasattr(self, "access_token") and self.access_token is not None: - params["accessToken"] = self.access_token + params['accessToken'] = self.access_token if hasattr(self, "start_time") and self.start_time is not None: - params["startTime"] = self.start_time + params['startTime'] = self.start_time if hasattr(self, "end_time") and self.end_time is not None: - params["endTime"] = self.end_time - if ( - hasattr(self, "transaction_type_list") - and self.transaction_type_list is not None - ): - params["transactionTypeList"] = self.transaction_type_list + params['endTime'] = self.end_time + if hasattr(self, "transaction_type_list") and self.transaction_type_list is not None: + params['transactionTypeList'] = self.transaction_type_list if hasattr(self, "currency_list") and self.currency_list is not None: - params["currencyList"] = self.currency_list + params['currencyList'] = self.currency_list if hasattr(self, "page_size") and self.page_size is not None: - params["pageSize"] = self.page_size + params['pageSize'] = self.page_size if hasattr(self, "page_number") and self.page_number is not None: - params["pageNumber"] = self.page_number + params['pageNumber'] = self.page_number return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "customerId" in response_body: - self.__customer_id = response_body["customerId"] - if "accessToken" in response_body: - self.__access_token = response_body["accessToken"] - if "startTime" in response_body: - self.__start_time = response_body["startTime"] - if "endTime" in response_body: - self.__end_time = response_body["endTime"] - if "transactionTypeList" in response_body: - self.__transaction_type_list = response_body["transactionTypeList"] - if "currencyList" in response_body: - self.__currency_list = response_body["currencyList"] - if "pageSize" in response_body: - self.__page_size = response_body["pageSize"] - if "pageNumber" in response_body: - self.__page_number = response_body["pageNumber"] + if 'customerId' in response_body: + self.__customer_id = response_body['customerId'] + if 'accessToken' in response_body: + self.__access_token = response_body['accessToken'] + if 'startTime' in response_body: + self.__start_time = response_body['startTime'] + if 'endTime' in response_body: + self.__end_time = response_body['endTime'] + if 'transactionTypeList' in response_body: + self.__transaction_type_list = response_body['transactionTypeList'] + if 'currencyList' in response_body: + self.__currency_list = response_body['currencyList'] + if 'pageSize' in response_body: + self.__page_size = response_body['pageSize'] + if 'pageNumber' in response_body: + self.__page_number = response_body['pageNumber'] diff --git a/com/alipay/ams/api/request/auth/alipay_auth_apply_token_request.py b/com/alipay/ams/api/request/auth/alipay_auth_apply_token_request.py index 9e35f6c..8114e9b 100644 --- a/com/alipay/ams/api/request/auth/alipay_auth_apply_token_request.py +++ b/com/alipay/ams/api/request/auth/alipay_auth_apply_token_request.py @@ -3,14 +3,12 @@ from com.alipay.ams.api.model.customer_belongs_to import CustomerBelongsTo -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayAuthApplyTokenRequest(AlipayRequest): def __init__(self): - super(AlipayAuthApplyTokenRequest, self).__init__( - "/ams/api/v1/authorizations/applyToken" - ) + super(AlipayAuthApplyTokenRequest, self).__init__("/ams/api/v1/authorizations/applyToken") self.__merchant_account_id = None # type: str self.__grant_type = None # type: GrantType @@ -19,6 +17,7 @@ def __init__(self): self.__refresh_token = None # type: str self.__extend_info = None # type: str self.__merchant_region = None # type: str + @property def merchant_account_id(self): @@ -30,25 +29,26 @@ def merchant_account_id(self): @merchant_account_id.setter def merchant_account_id(self, value): self.__merchant_account_id = value - @property def grant_type(self): - """Gets the grant_type of this AlipayAuthApplyTokenRequest.""" + """Gets the grant_type of this AlipayAuthApplyTokenRequest. + + """ return self.__grant_type @grant_type.setter def grant_type(self, value): self.__grant_type = value - @property def customer_belongs_to(self): - """Gets the customer_belongs_to of this AlipayAuthApplyTokenRequest.""" + """Gets the customer_belongs_to of this AlipayAuthApplyTokenRequest. + + """ return self.__customer_belongs_to @customer_belongs_to.setter def customer_belongs_to(self, value): self.__customer_belongs_to = value - @property def auth_code(self): """ @@ -59,7 +59,6 @@ def auth_code(self): @auth_code.setter def auth_code(self, value): self.__auth_code = value - @property def refresh_token(self): """ @@ -70,16 +69,16 @@ def refresh_token(self): @refresh_token.setter def refresh_token(self, value): self.__refresh_token = value - @property def extend_info(self): - """Gets the extend_info of this AlipayAuthApplyTokenRequest.""" + """Gets the extend_info of this AlipayAuthApplyTokenRequest. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def merchant_region(self): """ @@ -91,54 +90,47 @@ def merchant_region(self): def merchant_region(self, value): self.__merchant_region = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id if hasattr(self, "grant_type") and self.grant_type is not None: - params["grantType"] = self.grant_type - if ( - hasattr(self, "customer_belongs_to") - and self.customer_belongs_to is not None - ): - params["customerBelongsTo"] = self.customer_belongs_to + params['grantType'] = self.grant_type + if hasattr(self, "customer_belongs_to") and self.customer_belongs_to is not None: + params['customerBelongsTo'] = self.customer_belongs_to if hasattr(self, "auth_code") and self.auth_code is not None: - params["authCode"] = self.auth_code + params['authCode'] = self.auth_code if hasattr(self, "refresh_token") and self.refresh_token is not None: - params["refreshToken"] = self.refresh_token + params['refreshToken'] = self.refresh_token if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "merchant_region") and self.merchant_region is not None: - params["merchantRegion"] = self.merchant_region + params['merchantRegion'] = self.merchant_region return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] - if "grantType" in response_body: - grant_type_temp = GrantType.value_of(response_body["grantType"]) + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'grantType' in response_body: + grant_type_temp = GrantType.value_of(response_body['grantType']) self.__grant_type = grant_type_temp - if "customerBelongsTo" in response_body: - customer_belongs_to_temp = CustomerBelongsTo.value_of( - response_body["customerBelongsTo"] - ) + if 'customerBelongsTo' in response_body: + customer_belongs_to_temp = CustomerBelongsTo.value_of(response_body['customerBelongsTo']) self.__customer_belongs_to = customer_belongs_to_temp - if "authCode" in response_body: - self.__auth_code = response_body["authCode"] - if "refreshToken" in response_body: - self.__refresh_token = response_body["refreshToken"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "merchantRegion" in response_body: - self.__merchant_region = response_body["merchantRegion"] + if 'authCode' in response_body: + self.__auth_code = response_body['authCode'] + if 'refreshToken' in response_body: + self.__refresh_token = response_body['refreshToken'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'merchantRegion' in response_body: + self.__merchant_region = response_body['merchantRegion'] diff --git a/com/alipay/ams/api/request/auth/alipay_auth_consult_request.py b/com/alipay/ams/api/request/auth/alipay_auth_consult_request.py index 5f9db03..412dd05 100644 --- a/com/alipay/ams/api/request/auth/alipay_auth_consult_request.py +++ b/com/alipay/ams/api/request/auth/alipay_auth_consult_request.py @@ -7,14 +7,12 @@ from com.alipay.ams.api.model.env import Env -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayAuthConsultRequest(AlipayRequest): def __init__(self): - super(AlipayAuthConsultRequest, self).__init__( - "/ams/api/v1/authorizations/consult" - ) + super(AlipayAuthConsultRequest, self).__init__("/ams/api/v1/authorizations/consult") self.__merchant_account_id = None # type: str self.__auth_notify_url = None # type: str @@ -31,6 +29,7 @@ def __init__(self): self.__recurring_payment = None # type: bool self.__auth_meta_data = None # type: AuthMetaData self.__env = None # type: Env + @property def merchant_account_id(self): @@ -42,7 +41,6 @@ def merchant_account_id(self): @merchant_account_id.setter def merchant_account_id(self, value): self.__merchant_account_id = value - @property def auth_notify_url(self): """ @@ -53,16 +51,16 @@ def auth_notify_url(self): @auth_notify_url.setter def auth_notify_url(self, value): self.__auth_notify_url = value - @property def customer_belongs_to(self): - """Gets the customer_belongs_to of this AlipayAuthConsultRequest.""" + """Gets the customer_belongs_to of this AlipayAuthConsultRequest. + + """ return self.__customer_belongs_to @customer_belongs_to.setter def customer_belongs_to(self, value): self.__customer_belongs_to = value - @property def auth_client_id(self): """ @@ -73,27 +71,26 @@ def auth_client_id(self): @auth_client_id.setter def auth_client_id(self, value): self.__auth_client_id = value - @property def auth_redirect_url(self): """ - The redirection URL that the user is redirected to after the user agrees to authorize. This value is provided by the merchant. More information: Maximum length: 1024 characters + The redirection URL that the user is redirected to after the user agrees to authorize. This value is provided by the merchant. More information: Maximum length: 1024 characters """ return self.__auth_redirect_url @auth_redirect_url.setter def auth_redirect_url(self, value): self.__auth_redirect_url = value - @property def scopes(self): - """Gets the scopes of this AlipayAuthConsultRequest.""" + """Gets the scopes of this AlipayAuthConsultRequest. + + """ return self.__scopes @scopes.setter def scopes(self, value): self.__scopes = value - @property def auth_state(self): """ @@ -104,25 +101,26 @@ def auth_state(self): @auth_state.setter def auth_state(self, value): self.__auth_state = value - @property def terminal_type(self): - """Gets the terminal_type of this AlipayAuthConsultRequest.""" + """Gets the terminal_type of this AlipayAuthConsultRequest. + + """ return self.__terminal_type @terminal_type.setter def terminal_type(self, value): self.__terminal_type = value - @property def os_type(self): - """Gets the os_type of this AlipayAuthConsultRequest.""" + """Gets the os_type of this AlipayAuthConsultRequest. + + """ return self.__os_type @os_type.setter def os_type(self, value): self.__os_type = value - @property def os_version(self): """ @@ -133,16 +131,16 @@ def os_version(self): @os_version.setter def os_version(self, value): self.__os_version = value - @property def extend_info(self): - """Gets the extend_info of this AlipayAuthConsultRequest.""" + """Gets the extend_info of this AlipayAuthConsultRequest. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def merchant_region(self): """ @@ -153,7 +151,6 @@ def merchant_region(self): @merchant_region.setter def merchant_region(self, value): self.__merchant_region = value - @property def recurring_payment(self): """ @@ -164,112 +161,107 @@ def recurring_payment(self): @recurring_payment.setter def recurring_payment(self, value): self.__recurring_payment = value - @property def auth_meta_data(self): - """Gets the auth_meta_data of this AlipayAuthConsultRequest.""" + """Gets the auth_meta_data of this AlipayAuthConsultRequest. + + """ return self.__auth_meta_data @auth_meta_data.setter def auth_meta_data(self, value): self.__auth_meta_data = value - @property def env(self): - """Gets the env of this AlipayAuthConsultRequest.""" + """Gets the env of this AlipayAuthConsultRequest. + + """ return self.__env @env.setter def env(self, value): self.__env = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id if hasattr(self, "auth_notify_url") and self.auth_notify_url is not None: - params["authNotifyUrl"] = self.auth_notify_url - if ( - hasattr(self, "customer_belongs_to") - and self.customer_belongs_to is not None - ): - params["customerBelongsTo"] = self.customer_belongs_to + params['authNotifyUrl'] = self.auth_notify_url + if hasattr(self, "customer_belongs_to") and self.customer_belongs_to is not None: + params['customerBelongsTo'] = self.customer_belongs_to if hasattr(self, "auth_client_id") and self.auth_client_id is not None: - params["authClientId"] = self.auth_client_id + params['authClientId'] = self.auth_client_id if hasattr(self, "auth_redirect_url") and self.auth_redirect_url is not None: - params["authRedirectUrl"] = self.auth_redirect_url + params['authRedirectUrl'] = self.auth_redirect_url if hasattr(self, "scopes") and self.scopes is not None: - params["scopes"] = self.scopes + params['scopes'] = self.scopes if hasattr(self, "auth_state") and self.auth_state is not None: - params["authState"] = self.auth_state + params['authState'] = self.auth_state if hasattr(self, "terminal_type") and self.terminal_type is not None: - params["terminalType"] = self.terminal_type + params['terminalType'] = self.terminal_type if hasattr(self, "os_type") and self.os_type is not None: - params["osType"] = self.os_type + params['osType'] = self.os_type if hasattr(self, "os_version") and self.os_version is not None: - params["osVersion"] = self.os_version + params['osVersion'] = self.os_version if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "merchant_region") and self.merchant_region is not None: - params["merchantRegion"] = self.merchant_region + params['merchantRegion'] = self.merchant_region if hasattr(self, "recurring_payment") and self.recurring_payment is not None: - params["recurringPayment"] = self.recurring_payment + params['recurringPayment'] = self.recurring_payment if hasattr(self, "auth_meta_data") and self.auth_meta_data is not None: - params["authMetaData"] = self.auth_meta_data + params['authMetaData'] = self.auth_meta_data if hasattr(self, "env") and self.env is not None: - params["env"] = self.env + params['env'] = self.env return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] - if "authNotifyUrl" in response_body: - self.__auth_notify_url = response_body["authNotifyUrl"] - if "customerBelongsTo" in response_body: - customer_belongs_to_temp = CustomerBelongsTo.value_of( - response_body["customerBelongsTo"] - ) + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'authNotifyUrl' in response_body: + self.__auth_notify_url = response_body['authNotifyUrl'] + if 'customerBelongsTo' in response_body: + customer_belongs_to_temp = CustomerBelongsTo.value_of(response_body['customerBelongsTo']) self.__customer_belongs_to = customer_belongs_to_temp - if "authClientId" in response_body: - self.__auth_client_id = response_body["authClientId"] - if "authRedirectUrl" in response_body: - self.__auth_redirect_url = response_body["authRedirectUrl"] - if "scopes" in response_body: + if 'authClientId' in response_body: + self.__auth_client_id = response_body['authClientId'] + if 'authRedirectUrl' in response_body: + self.__auth_redirect_url = response_body['authRedirectUrl'] + if 'scopes' in response_body: self.__scopes = [] - for item in response_body["scopes"]: + for item in response_body['scopes']: self.__scopes.append(item) - scopes_temp = ScopeType.value_of(response_body["scopes"]) + scopes_temp = ScopeType.value_of(response_body['scopes']) self.__scopes = scopes_temp - if "authState" in response_body: - self.__auth_state = response_body["authState"] - if "terminalType" in response_body: - terminal_type_temp = TerminalType.value_of(response_body["terminalType"]) + if 'authState' in response_body: + self.__auth_state = response_body['authState'] + if 'terminalType' in response_body: + terminal_type_temp = TerminalType.value_of(response_body['terminalType']) self.__terminal_type = terminal_type_temp - if "osType" in response_body: - os_type_temp = OsType.value_of(response_body["osType"]) + if 'osType' in response_body: + os_type_temp = OsType.value_of(response_body['osType']) self.__os_type = os_type_temp - if "osVersion" in response_body: - self.__os_version = response_body["osVersion"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "merchantRegion" in response_body: - self.__merchant_region = response_body["merchantRegion"] - if "recurringPayment" in response_body: - self.__recurring_payment = response_body["recurringPayment"] - if "authMetaData" in response_body: + if 'osVersion' in response_body: + self.__os_version = response_body['osVersion'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'merchantRegion' in response_body: + self.__merchant_region = response_body['merchantRegion'] + if 'recurringPayment' in response_body: + self.__recurring_payment = response_body['recurringPayment'] + if 'authMetaData' in response_body: self.__auth_meta_data = AuthMetaData() - self.__auth_meta_data.parse_rsp_body(response_body["authMetaData"]) - if "env" in response_body: + self.__auth_meta_data.parse_rsp_body(response_body['authMetaData']) + if 'env' in response_body: self.__env = Env() - self.__env.parse_rsp_body(response_body["env"]) + self.__env.parse_rsp_body(response_body['env']) diff --git a/com/alipay/ams/api/request/auth/alipay_auth_revoke_token_request.py b/com/alipay/ams/api/request/auth/alipay_auth_revoke_token_request.py index dd6cbc6..7af315a 100644 --- a/com/alipay/ams/api/request/auth/alipay_auth_revoke_token_request.py +++ b/com/alipay/ams/api/request/auth/alipay_auth_revoke_token_request.py @@ -1,18 +1,17 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayAuthRevokeTokenRequest(AlipayRequest): def __init__(self): - super(AlipayAuthRevokeTokenRequest, self).__init__( - "/ams/api/v1/authorizations/revoke" - ) + super(AlipayAuthRevokeTokenRequest, self).__init__("/ams/api/v1/authorizations/revoke") self.__access_token = None # type: str self.__extend_info = None # type: str self.__merchant_account_id = None # type: str + @property def access_token(self): @@ -24,16 +23,16 @@ def access_token(self): @access_token.setter def access_token(self, value): self.__access_token = value - @property def extend_info(self): - """Gets the extend_info of this AlipayAuthRevokeTokenRequest.""" + """Gets the extend_info of this AlipayAuthRevokeTokenRequest. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def merchant_account_id(self): """ @@ -45,31 +44,29 @@ def merchant_account_id(self): def merchant_account_id(self, value): self.__merchant_account_id = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "access_token") and self.access_token is not None: - params["accessToken"] = self.access_token + params['accessToken'] = self.access_token if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + params['extendInfo'] = self.extend_info + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "accessToken" in response_body: - self.__access_token = response_body["accessToken"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] + if 'accessToken' in response_body: + self.__access_token = response_body['accessToken'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] diff --git a/com/alipay/ams/api/request/dispute/alipay_accept_dispute_request.py b/com/alipay/ams/api/request/dispute/alipay_accept_dispute_request.py index 79d1e28..a2642e9 100644 --- a/com/alipay/ams/api/request/dispute/alipay_accept_dispute_request.py +++ b/com/alipay/ams/api/request/dispute/alipay_accept_dispute_request.py @@ -1,16 +1,15 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayAcceptDisputeRequest(AlipayRequest): def __init__(self): - super(AlipayAcceptDisputeRequest, self).__init__( - "/ams/api/v1/payments/acceptDispute" - ) + super(AlipayAcceptDisputeRequest, self).__init__("/ams/api/v1/payments/acceptDispute") self.__dispute_id = None # type: str + @property def dispute_id(self): @@ -23,20 +22,21 @@ def dispute_id(self): def dispute_id(self, value): self.__dispute_id = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "dispute_id") and self.dispute_id is not None: - params["disputeId"] = self.dispute_id + params['disputeId'] = self.dispute_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "disputeId" in response_body: - self.__dispute_id = response_body["disputeId"] + if 'disputeId' in response_body: + self.__dispute_id = response_body['disputeId'] diff --git a/com/alipay/ams/api/request/dispute/alipay_download_dispute_evidence_request.py b/com/alipay/ams/api/request/dispute/alipay_download_dispute_evidence_request.py index bba991b..b179466 100644 --- a/com/alipay/ams/api/request/dispute/alipay_download_dispute_evidence_request.py +++ b/com/alipay/ams/api/request/dispute/alipay_download_dispute_evidence_request.py @@ -2,17 +2,16 @@ from com.alipay.ams.api.model.dispute_evidence_type import DisputeEvidenceType -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayDownloadDisputeEvidenceRequest(AlipayRequest): def __init__(self): - super(AlipayDownloadDisputeEvidenceRequest, self).__init__( - "/ams/api/v1/payments/downloadDisputeEvidence" - ) + super(AlipayDownloadDisputeEvidenceRequest, self).__init__("/ams/api/v1/payments/downloadDisputeEvidence") self.__dispute_id = None # type: str self.__dispute_evidence_type = None # type: DisputeEvidenceType + @property def dispute_id(self): @@ -24,40 +23,37 @@ def dispute_id(self): @dispute_id.setter def dispute_id(self, value): self.__dispute_id = value - @property def dispute_evidence_type(self): - """Gets the dispute_evidence_type of this AlipayDownloadDisputeEvidenceRequest.""" + """Gets the dispute_evidence_type of this AlipayDownloadDisputeEvidenceRequest. + + """ return self.__dispute_evidence_type @dispute_evidence_type.setter def dispute_evidence_type(self, value): self.__dispute_evidence_type = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "dispute_id") and self.dispute_id is not None: - params["disputeId"] = self.dispute_id - if ( - hasattr(self, "dispute_evidence_type") - and self.dispute_evidence_type is not None - ): - params["disputeEvidenceType"] = self.dispute_evidence_type + params['disputeId'] = self.dispute_id + if hasattr(self, "dispute_evidence_type") and self.dispute_evidence_type is not None: + params['disputeEvidenceType'] = self.dispute_evidence_type return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "disputeId" in response_body: - self.__dispute_id = response_body["disputeId"] - if "disputeEvidenceType" in response_body: - dispute_evidence_type_temp = DisputeEvidenceType.value_of( - response_body["disputeEvidenceType"] - ) + if 'disputeId' in response_body: + self.__dispute_id = response_body['disputeId'] + if 'disputeEvidenceType' in response_body: + dispute_evidence_type_temp = DisputeEvidenceType.value_of(response_body['disputeEvidenceType']) self.__dispute_evidence_type = dispute_evidence_type_temp diff --git a/com/alipay/ams/api/request/dispute/alipay_supply_defense_document_request.py b/com/alipay/ams/api/request/dispute/alipay_supply_defense_document_request.py index fdd5657..4e18e8e 100644 --- a/com/alipay/ams/api/request/dispute/alipay_supply_defense_document_request.py +++ b/com/alipay/ams/api/request/dispute/alipay_supply_defense_document_request.py @@ -1,17 +1,16 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipaySupplyDefenseDocumentRequest(AlipayRequest): def __init__(self): - super(AlipaySupplyDefenseDocumentRequest, self).__init__( - "/ams/api/v1/payments/supplyDefenseDocument" - ) + super(AlipaySupplyDefenseDocumentRequest, self).__init__("/ams/api/v1/payments/supplyDefenseDocument") self.__dispute_id = None # type: str self.__dispute_evidence = None # type: str + @property def dispute_id(self): @@ -23,7 +22,6 @@ def dispute_id(self): @dispute_id.setter def dispute_id(self, value): self.__dispute_id = value - @property def dispute_evidence(self): """ @@ -35,24 +33,25 @@ def dispute_evidence(self): def dispute_evidence(self, value): self.__dispute_evidence = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "dispute_id") and self.dispute_id is not None: - params["disputeId"] = self.dispute_id + params['disputeId'] = self.dispute_id if hasattr(self, "dispute_evidence") and self.dispute_evidence is not None: - params["disputeEvidence"] = self.dispute_evidence + params['disputeEvidence'] = self.dispute_evidence return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "disputeId" in response_body: - self.__dispute_id = response_body["disputeId"] - if "disputeEvidence" in response_body: - self.__dispute_evidence = response_body["disputeEvidence"] + if 'disputeId' in response_body: + self.__dispute_id = response_body['disputeId'] + if 'disputeEvidence' in response_body: + self.__dispute_evidence = response_body['disputeEvidence'] diff --git a/com/alipay/ams/api/request/marketplace/alipay_create_payout_request.py b/com/alipay/ams/api/request/marketplace/alipay_create_payout_request.py index 5135537..6aed37b 100644 --- a/com/alipay/ams/api/request/marketplace/alipay_create_payout_request.py +++ b/com/alipay/ams/api/request/marketplace/alipay_create_payout_request.py @@ -3,18 +3,17 @@ from com.alipay.ams.api.model.transfer_to_detail import TransferToDetail -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayCreatePayoutRequest(AlipayRequest): def __init__(self): - super(AlipayCreatePayoutRequest, self).__init__( - "/ams/api/v1/funds/createPayout" - ) + super(AlipayCreatePayoutRequest, self).__init__("/ams/api/v1/funds/createPayout") self.__transfer_request_id = None # type: str self.__transfer_from_detail = None # type: TransferFromDetail self.__transfer_to_detail = None # type: TransferToDetail + @property def transfer_request_id(self): @@ -26,57 +25,52 @@ def transfer_request_id(self): @transfer_request_id.setter def transfer_request_id(self, value): self.__transfer_request_id = value - @property def transfer_from_detail(self): - """Gets the transfer_from_detail of this AlipayCreatePayoutRequest.""" + """Gets the transfer_from_detail of this AlipayCreatePayoutRequest. + + """ return self.__transfer_from_detail @transfer_from_detail.setter def transfer_from_detail(self, value): self.__transfer_from_detail = value - @property def transfer_to_detail(self): - """Gets the transfer_to_detail of this AlipayCreatePayoutRequest.""" + """Gets the transfer_to_detail of this AlipayCreatePayoutRequest. + + """ return self.__transfer_to_detail @transfer_to_detail.setter def transfer_to_detail(self, value): self.__transfer_to_detail = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "transfer_request_id") - and self.transfer_request_id is not None - ): - params["transferRequestId"] = self.transfer_request_id - if ( - hasattr(self, "transfer_from_detail") - and self.transfer_from_detail is not None - ): - params["transferFromDetail"] = self.transfer_from_detail + if hasattr(self, "transfer_request_id") and self.transfer_request_id is not None: + params['transferRequestId'] = self.transfer_request_id + if hasattr(self, "transfer_from_detail") and self.transfer_from_detail is not None: + params['transferFromDetail'] = self.transfer_from_detail if hasattr(self, "transfer_to_detail") and self.transfer_to_detail is not None: - params["transferToDetail"] = self.transfer_to_detail + params['transferToDetail'] = self.transfer_to_detail return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "transferRequestId" in response_body: - self.__transfer_request_id = response_body["transferRequestId"] - if "transferFromDetail" in response_body: + if 'transferRequestId' in response_body: + self.__transfer_request_id = response_body['transferRequestId'] + if 'transferFromDetail' in response_body: self.__transfer_from_detail = TransferFromDetail() - self.__transfer_from_detail.parse_rsp_body( - response_body["transferFromDetail"] - ) - if "transferToDetail" in response_body: + self.__transfer_from_detail.parse_rsp_body(response_body['transferFromDetail']) + if 'transferToDetail' in response_body: self.__transfer_to_detail = TransferToDetail() - self.__transfer_to_detail.parse_rsp_body(response_body["transferToDetail"]) + self.__transfer_to_detail.parse_rsp_body(response_body['transferToDetail']) diff --git a/com/alipay/ams/api/request/marketplace/alipay_create_transfer_request.py b/com/alipay/ams/api/request/marketplace/alipay_create_transfer_request.py index 7d0a801..e91d070 100644 --- a/com/alipay/ams/api/request/marketplace/alipay_create_transfer_request.py +++ b/com/alipay/ams/api/request/marketplace/alipay_create_transfer_request.py @@ -3,80 +3,74 @@ from com.alipay.ams.api.model.transfer_to_detail import TransferToDetail -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayCreateTransferRequest(AlipayRequest): def __init__(self): - super(AlipayCreateTransferRequest, self).__init__( - "/ams/api/v1/funds/createTransfer" - ) + super(AlipayCreateTransferRequest, self).__init__("/ams/api/v1/funds/createTransfer") self.__transfer_request_id = None # type: str self.__transfer_from_detail = None # type: TransferFromDetail self.__transfer_to_detail = None # type: TransferToDetail + @property def transfer_request_id(self): """ - The unique ID assigned by the marketplace to identify a transfer request. More information: This field is an API idempotency field.For requests that are initiated with the same value of transferRequestId and reach a final status (S or F), the same result is to be returned for the request. Maximum length: 64 characters + The unique ID assigned by the marketplace to identify a transfer request. More information: This field is an API idempotency field.For requests that are initiated with the same value of transferRequestId and reach a final status (S or F), the same result is to be returned for the request. Maximum length: 64 characters """ return self.__transfer_request_id @transfer_request_id.setter def transfer_request_id(self, value): self.__transfer_request_id = value - @property def transfer_from_detail(self): - """Gets the transfer_from_detail of this AlipayCreateTransferRequest.""" + """Gets the transfer_from_detail of this AlipayCreateTransferRequest. + + """ return self.__transfer_from_detail @transfer_from_detail.setter def transfer_from_detail(self, value): self.__transfer_from_detail = value - @property def transfer_to_detail(self): - """Gets the transfer_to_detail of this AlipayCreateTransferRequest.""" + """Gets the transfer_to_detail of this AlipayCreateTransferRequest. + + """ return self.__transfer_to_detail @transfer_to_detail.setter def transfer_to_detail(self, value): self.__transfer_to_detail = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "transfer_request_id") - and self.transfer_request_id is not None - ): - params["transferRequestId"] = self.transfer_request_id - if ( - hasattr(self, "transfer_from_detail") - and self.transfer_from_detail is not None - ): - params["transferFromDetail"] = self.transfer_from_detail + if hasattr(self, "transfer_request_id") and self.transfer_request_id is not None: + params['transferRequestId'] = self.transfer_request_id + if hasattr(self, "transfer_from_detail") and self.transfer_from_detail is not None: + params['transferFromDetail'] = self.transfer_from_detail if hasattr(self, "transfer_to_detail") and self.transfer_to_detail is not None: - params["transferToDetail"] = self.transfer_to_detail + params['transferToDetail'] = self.transfer_to_detail return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "transferRequestId" in response_body: - self.__transfer_request_id = response_body["transferRequestId"] - if "transferFromDetail" in response_body: + if 'transferRequestId' in response_body: + self.__transfer_request_id = response_body['transferRequestId'] + if 'transferFromDetail' in response_body: self.__transfer_from_detail = TransferFromDetail() - self.__transfer_from_detail.parse_rsp_body( - response_body["transferFromDetail"] - ) - if "transferToDetail" in response_body: + self.__transfer_from_detail.parse_rsp_body(response_body['transferFromDetail']) + if 'transferToDetail' in response_body: self.__transfer_to_detail = TransferToDetail() - self.__transfer_to_detail.parse_rsp_body(response_body["transferToDetail"]) + self.__transfer_to_detail.parse_rsp_body(response_body['transferToDetail']) diff --git a/com/alipay/ams/api/request/marketplace/alipay_inquire_balance_request.py b/com/alipay/ams/api/request/marketplace/alipay_inquire_balance_request.py index 0db155d..9627bdd 100644 --- a/com/alipay/ams/api/request/marketplace/alipay_inquire_balance_request.py +++ b/com/alipay/ams/api/request/marketplace/alipay_inquire_balance_request.py @@ -1,16 +1,15 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayInquireBalanceRequest(AlipayRequest): def __init__(self): - super(AlipayInquireBalanceRequest, self).__init__( - "/ams/api/v1/accounts/inquireBalance" - ) + super(AlipayInquireBalanceRequest, self).__init__("/ams/api/v1/accounts/inquireBalance") self.__reference_merchant_id = None # type: str + @property def reference_merchant_id(self): @@ -23,23 +22,21 @@ def reference_merchant_id(self): def reference_merchant_id(self, value): self.__reference_merchant_id = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "reference_merchant_id") - and self.reference_merchant_id is not None - ): - params["referenceMerchantId"] = self.reference_merchant_id + if hasattr(self, "reference_merchant_id") and self.reference_merchant_id is not None: + params['referenceMerchantId'] = self.reference_merchant_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "referenceMerchantId" in response_body: - self.__reference_merchant_id = response_body["referenceMerchantId"] + if 'referenceMerchantId' in response_body: + self.__reference_merchant_id = response_body['referenceMerchantId'] diff --git a/com/alipay/ams/api/request/marketplace/alipay_register_request.py b/com/alipay/ams/api/request/marketplace/alipay_register_request.py index 7baaa44..6e6eb05 100644 --- a/com/alipay/ams/api/request/marketplace/alipay_register_request.py +++ b/com/alipay/ams/api/request/marketplace/alipay_register_request.py @@ -4,17 +4,18 @@ from com.alipay.ams.api.model.payment_method import PaymentMethod -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayRegisterRequest(AlipayRequest): def __init__(self): - super(AlipayRegisterRequest, self).__init__("/ams/api/v1/merchants/register") + super(AlipayRegisterRequest, self).__init__("/ams/api/v1/merchants/register") self.__registration_request_id = None # type: str self.__settlement_infos = None # type: [SettlementInfo] self.__merchant_info = None # type: MerchantInfo self.__payment_methods = None # type: [PaymentMethod] + @property def registration_request_id(self): @@ -26,7 +27,6 @@ def registration_request_id(self): @registration_request_id.setter def registration_request_id(self, value): self.__registration_request_id = value - @property def settlement_infos(self): """ @@ -37,16 +37,16 @@ def settlement_infos(self): @settlement_infos.setter def settlement_infos(self, value): self.__settlement_infos = value - @property def merchant_info(self): - """Gets the merchant_info of this AlipayRegisterRequest.""" + """Gets the merchant_info of this AlipayRegisterRequest. + + """ return self.__merchant_info @merchant_info.setter def merchant_info(self, value): self.__merchant_info = value - @property def payment_methods(self): """ @@ -58,44 +58,42 @@ def payment_methods(self): def payment_methods(self, value): self.__payment_methods = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "registration_request_id") - and self.registration_request_id is not None - ): - params["registrationRequestId"] = self.registration_request_id + if hasattr(self, "registration_request_id") and self.registration_request_id is not None: + params['registrationRequestId'] = self.registration_request_id if hasattr(self, "settlement_infos") and self.settlement_infos is not None: - params["settlementInfos"] = self.settlement_infos + params['settlementInfos'] = self.settlement_infos if hasattr(self, "merchant_info") and self.merchant_info is not None: - params["merchantInfo"] = self.merchant_info + params['merchantInfo'] = self.merchant_info if hasattr(self, "payment_methods") and self.payment_methods is not None: - params["paymentMethods"] = self.payment_methods + params['paymentMethods'] = self.payment_methods return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "registrationRequestId" in response_body: - self.__registration_request_id = response_body["registrationRequestId"] - if "settlementInfos" in response_body: + if 'registrationRequestId' in response_body: + self.__registration_request_id = response_body['registrationRequestId'] + if 'settlementInfos' in response_body: self.__settlement_infos = [] - for item in response_body["settlementInfos"]: + for item in response_body['settlementInfos']: obj = SettlementInfo() obj.parse_rsp_body(item) self.__settlement_infos.append(obj) - if "merchantInfo" in response_body: + if 'merchantInfo' in response_body: self.__merchant_info = MerchantInfo() - self.__merchant_info.parse_rsp_body(response_body["merchantInfo"]) - if "paymentMethods" in response_body: + self.__merchant_info.parse_rsp_body(response_body['merchantInfo']) + if 'paymentMethods' in response_body: self.__payment_methods = [] - for item in response_body["paymentMethods"]: + for item in response_body['paymentMethods']: obj = PaymentMethod() obj.parse_rsp_body(item) self.__payment_methods.append(obj) diff --git a/com/alipay/ams/api/request/marketplace/alipay_settle_request.py b/com/alipay/ams/api/request/marketplace/alipay_settle_request.py index 706c330..7a40be9 100644 --- a/com/alipay/ams/api/request/marketplace/alipay_settle_request.py +++ b/com/alipay/ams/api/request/marketplace/alipay_settle_request.py @@ -2,16 +2,17 @@ from com.alipay.ams.api.model.settlement_detail import SettlementDetail -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipaySettleRequest(AlipayRequest): def __init__(self): - super(AlipaySettleRequest, self).__init__("/ams/api/v1/payments/settle") + super(AlipaySettleRequest, self).__init__("/ams/api/v1/payments/settle") self.__settlement_request_id = None # type: str self.__payment_id = None # type: str self.__settlement_details = None # type: [SettlementDetail] + @property def settlement_request_id(self): @@ -23,7 +24,6 @@ def settlement_request_id(self): @settlement_request_id.setter def settlement_request_id(self, value): self.__settlement_request_id = value - @property def payment_id(self): """ @@ -34,7 +34,6 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def settlement_details(self): """ @@ -46,35 +45,33 @@ def settlement_details(self): def settlement_details(self, value): self.__settlement_details = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "settlement_request_id") - and self.settlement_request_id is not None - ): - params["settlementRequestId"] = self.settlement_request_id + if hasattr(self, "settlement_request_id") and self.settlement_request_id is not None: + params['settlementRequestId'] = self.settlement_request_id if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id + params['paymentId'] = self.payment_id if hasattr(self, "settlement_details") and self.settlement_details is not None: - params["settlementDetails"] = self.settlement_details + params['settlementDetails'] = self.settlement_details return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "settlementRequestId" in response_body: - self.__settlement_request_id = response_body["settlementRequestId"] - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "settlementDetails" in response_body: + if 'settlementRequestId' in response_body: + self.__settlement_request_id = response_body['settlementRequestId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'settlementDetails' in response_body: self.__settlement_details = [] - for item in response_body["settlementDetails"]: + for item in response_body['settlementDetails']: obj = SettlementDetail() obj.parse_rsp_body(item) self.__settlement_details.append(obj) diff --git a/com/alipay/ams/api/request/marketplace/alipay_settlement_info_update_request.py b/com/alipay/ams/api/request/marketplace/alipay_settlement_info_update_request.py index d9632a4..f6a4ff7 100644 --- a/com/alipay/ams/api/request/marketplace/alipay_settlement_info_update_request.py +++ b/com/alipay/ams/api/request/marketplace/alipay_settlement_info_update_request.py @@ -2,19 +2,18 @@ from com.alipay.ams.api.model.settlement_bank_account import SettlementBankAccount -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipaySettlementInfoUpdateRequest(AlipayRequest): def __init__(self): - super(AlipaySettlementInfoUpdateRequest, self).__init__( - "/ams/api/v1/merchants/settlementInfo/update" - ) + super(AlipaySettlementInfoUpdateRequest, self).__init__("/ams/api/v1/merchants/settlementInfo/update") self.__update_request_id = None # type: str self.__reference_merchant_id = None # type: str self.__settlement_currency = None # type: str self.__settlement_bank_account = None # type: SettlementBankAccount + @property def update_request_id(self): @@ -26,7 +25,6 @@ def update_request_id(self): @update_request_id.setter def update_request_id(self, value): self.__update_request_id = value - @property def reference_merchant_id(self): """ @@ -37,7 +35,6 @@ def reference_merchant_id(self): @reference_merchant_id.setter def reference_merchant_id(self, value): self.__reference_merchant_id = value - @property def settlement_currency(self): """ @@ -48,54 +45,45 @@ def settlement_currency(self): @settlement_currency.setter def settlement_currency(self, value): self.__settlement_currency = value - @property def settlement_bank_account(self): - """Gets the settlement_bank_account of this AlipaySettlementInfoUpdateRequest.""" + """Gets the settlement_bank_account of this AlipaySettlementInfoUpdateRequest. + + """ return self.__settlement_bank_account @settlement_bank_account.setter def settlement_bank_account(self, value): self.__settlement_bank_account = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "update_request_id") and self.update_request_id is not None: - params["updateRequestId"] = self.update_request_id - if ( - hasattr(self, "reference_merchant_id") - and self.reference_merchant_id is not None - ): - params["referenceMerchantId"] = self.reference_merchant_id - if ( - hasattr(self, "settlement_currency") - and self.settlement_currency is not None - ): - params["settlementCurrency"] = self.settlement_currency - if ( - hasattr(self, "settlement_bank_account") - and self.settlement_bank_account is not None - ): - params["settlementBankAccount"] = self.settlement_bank_account + params['updateRequestId'] = self.update_request_id + if hasattr(self, "reference_merchant_id") and self.reference_merchant_id is not None: + params['referenceMerchantId'] = self.reference_merchant_id + if hasattr(self, "settlement_currency") and self.settlement_currency is not None: + params['settlementCurrency'] = self.settlement_currency + if hasattr(self, "settlement_bank_account") and self.settlement_bank_account is not None: + params['settlementBankAccount'] = self.settlement_bank_account return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "updateRequestId" in response_body: - self.__update_request_id = response_body["updateRequestId"] - if "referenceMerchantId" in response_body: - self.__reference_merchant_id = response_body["referenceMerchantId"] - if "settlementCurrency" in response_body: - self.__settlement_currency = response_body["settlementCurrency"] - if "settlementBankAccount" in response_body: + if 'updateRequestId' in response_body: + self.__update_request_id = response_body['updateRequestId'] + if 'referenceMerchantId' in response_body: + self.__reference_merchant_id = response_body['referenceMerchantId'] + if 'settlementCurrency' in response_body: + self.__settlement_currency = response_body['settlementCurrency'] + if 'settlementBankAccount' in response_body: self.__settlement_bank_account = SettlementBankAccount() - self.__settlement_bank_account.parse_rsp_body( - response_body["settlementBankAccount"] - ) + self.__settlement_bank_account.parse_rsp_body(response_body['settlementBankAccount']) diff --git a/com/alipay/ams/api/request/marketplace/alipay_submit_attachment_request.py b/com/alipay/ams/api/request/marketplace/alipay_submit_attachment_request.py index 273fcee..14cd7da 100644 --- a/com/alipay/ams/api/request/marketplace/alipay_submit_attachment_request.py +++ b/com/alipay/ams/api/request/marketplace/alipay_submit_attachment_request.py @@ -2,18 +2,17 @@ from com.alipay.ams.api.model.attachment_type import AttachmentType -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipaySubmitAttachmentRequest(AlipayRequest): def __init__(self): - super(AlipaySubmitAttachmentRequest, self).__init__( - "/ams/api/open/openapiv2_file/v1/business/attachment/submitAttachment" - ) + super(AlipaySubmitAttachmentRequest, self).__init__("/ams/api/open/openapiv2_file/v1/business/attachment/submitAttachment") self.__submit_attachment_request_id = None # type: str self.__attachment_type = None # type: AttachmentType self.__file_sha256 = None # type: str + @property def submit_attachment_request_id(self): @@ -25,16 +24,16 @@ def submit_attachment_request_id(self): @submit_attachment_request_id.setter def submit_attachment_request_id(self, value): self.__submit_attachment_request_id = value - @property def attachment_type(self): - """Gets the attachment_type of this AlipaySubmitAttachmentRequest.""" + """Gets the attachment_type of this AlipaySubmitAttachmentRequest. + + """ return self.__attachment_type @attachment_type.setter def attachment_type(self, value): self.__attachment_type = value - @property def file_sha256(self): """ @@ -46,36 +45,30 @@ def file_sha256(self): def file_sha256(self, value): self.__file_sha256 = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "submit_attachment_request_id") - and self.submit_attachment_request_id is not None - ): - params["submitAttachmentRequestId"] = self.submit_attachment_request_id + if hasattr(self, "submit_attachment_request_id") and self.submit_attachment_request_id is not None: + params['submitAttachmentRequestId'] = self.submit_attachment_request_id if hasattr(self, "attachment_type") and self.attachment_type is not None: - params["attachmentType"] = self.attachment_type + params['attachmentType'] = self.attachment_type if hasattr(self, "file_sha256") and self.file_sha256 is not None: - params["fileSha256"] = self.file_sha256 + params['fileSha256'] = self.file_sha256 return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "submitAttachmentRequestId" in response_body: - self.__submit_attachment_request_id = response_body[ - "submitAttachmentRequestId" - ] - if "attachmentType" in response_body: - attachment_type_temp = AttachmentType.value_of( - response_body["attachmentType"] - ) + if 'submitAttachmentRequestId' in response_body: + self.__submit_attachment_request_id = response_body['submitAttachmentRequestId'] + if 'attachmentType' in response_body: + attachment_type_temp = AttachmentType.value_of(response_body['attachmentType']) self.__attachment_type = attachment_type_temp - if "fileSha256" in response_body: - self.__file_sha256 = response_body["fileSha256"] + if 'fileSha256' in response_body: + self.__file_sha256 = response_body['fileSha256'] diff --git a/com/alipay/ams/api/request/pay/alipay_capture_request.py b/com/alipay/ams/api/request/pay/alipay_capture_request.py index 73587e2..14853e3 100644 --- a/com/alipay/ams/api/request/pay/alipay_capture_request.py +++ b/com/alipay/ams/api/request/pay/alipay_capture_request.py @@ -3,12 +3,12 @@ from com.alipay.ams.api.model.transit import Transit -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayCaptureRequest(AlipayRequest): def __init__(self): - super(AlipayCaptureRequest, self).__init__("/ams/api/v1/payments/capture") + super(AlipayCaptureRequest, self).__init__("/ams/api/v1/payments/capture") self.__capture_request_id = None # type: str self.__payment_id = None # type: str @@ -16,6 +16,7 @@ def __init__(self): self.__is_last_capture = None # type: bool self.__capture_type = None # type: str self.__transit = None # type: Transit + @property def capture_request_id(self): @@ -27,7 +28,6 @@ def capture_request_id(self): @capture_request_id.setter def capture_request_id(self, value): self.__capture_request_id = value - @property def payment_id(self): """ @@ -38,25 +38,26 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def capture_amount(self): - """Gets the capture_amount of this AlipayCaptureRequest.""" + """Gets the capture_amount of this AlipayCaptureRequest. + + """ return self.__capture_amount @capture_amount.setter def capture_amount(self, value): self.__capture_amount = value - @property def is_last_capture(self): - """Gets the is_last_capture of this AlipayCaptureRequest.""" + """Gets the is_last_capture of this AlipayCaptureRequest. + + """ return self.__is_last_capture @is_last_capture.setter def is_last_capture(self, value): self.__is_last_capture = value - @property def capture_type(self): """ @@ -67,52 +68,54 @@ def capture_type(self): @capture_type.setter def capture_type(self, value): self.__capture_type = value - @property def transit(self): - """Gets the transit of this AlipayCaptureRequest.""" + """Gets the transit of this AlipayCaptureRequest. + + """ return self.__transit @transit.setter def transit(self, value): self.__transit = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "capture_request_id") and self.capture_request_id is not None: - params["captureRequestId"] = self.capture_request_id + params['captureRequestId'] = self.capture_request_id if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id + params['paymentId'] = self.payment_id if hasattr(self, "capture_amount") and self.capture_amount is not None: - params["captureAmount"] = self.capture_amount + params['captureAmount'] = self.capture_amount if hasattr(self, "is_last_capture") and self.is_last_capture is not None: - params["isLastCapture"] = self.is_last_capture + params['isLastCapture'] = self.is_last_capture if hasattr(self, "capture_type") and self.capture_type is not None: - params["captureType"] = self.capture_type + params['captureType'] = self.capture_type if hasattr(self, "transit") and self.transit is not None: - params["transit"] = self.transit + params['transit'] = self.transit return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "captureRequestId" in response_body: - self.__capture_request_id = response_body["captureRequestId"] - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "captureAmount" in response_body: + if 'captureRequestId' in response_body: + self.__capture_request_id = response_body['captureRequestId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'captureAmount' in response_body: self.__capture_amount = Amount() - self.__capture_amount.parse_rsp_body(response_body["captureAmount"]) - if "isLastCapture" in response_body: - self.__is_last_capture = response_body["isLastCapture"] - if "captureType" in response_body: - self.__capture_type = response_body["captureType"] - if "transit" in response_body: + self.__capture_amount.parse_rsp_body(response_body['captureAmount']) + if 'isLastCapture' in response_body: + self.__is_last_capture = response_body['isLastCapture'] + if 'captureType' in response_body: + self.__capture_type = response_body['captureType'] + if 'transit' in response_body: self.__transit = Transit() - self.__transit.parse_rsp_body(response_body["transit"]) + self.__transit.parse_rsp_body(response_body['transit']) diff --git a/com/alipay/ams/api/request/pay/alipay_inquire_exchange_rate_request.py b/com/alipay/ams/api/request/pay/alipay_inquire_exchange_rate_request.py index 2db46ae..ad7d9a2 100644 --- a/com/alipay/ams/api/request/pay/alipay_inquire_exchange_rate_request.py +++ b/com/alipay/ams/api/request/pay/alipay_inquire_exchange_rate_request.py @@ -3,14 +3,12 @@ from com.alipay.ams.api.model.product_code_type import ProductCodeType -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayInquireExchangeRateRequest(AlipayRequest): def __init__(self): - super(AlipayInquireExchangeRateRequest, self).__init__( - "/ams/api/v1/payments/inquireExchangeRate" - ) + super(AlipayInquireExchangeRateRequest, self).__init__("/ams/api/v1/payments/inquireExchangeRate") self.__merchant_account_id = None # type: str self.__payment_currency = None # type: str @@ -18,103 +16,109 @@ def __init__(self): self.__sell_currency = None # type: str self.__buy_currency = None # type: str self.__product_code = None # type: ProductCodeType + @property def merchant_account_id(self): - """Gets the merchant_account_id of this AlipayInquireExchangeRateRequest.""" + """Gets the merchant_account_id of this AlipayInquireExchangeRateRequest. + + """ return self.__merchant_account_id @merchant_account_id.setter def merchant_account_id(self, value): self.__merchant_account_id = value - @property def payment_currency(self): - """Gets the payment_currency of this AlipayInquireExchangeRateRequest.""" + """Gets the payment_currency of this AlipayInquireExchangeRateRequest. + + """ return self.__payment_currency @payment_currency.setter def payment_currency(self, value): self.__payment_currency = value - @property def currency_pairs(self): - """Gets the currency_pairs of this AlipayInquireExchangeRateRequest.""" + """Gets the currency_pairs of this AlipayInquireExchangeRateRequest. + + """ return self.__currency_pairs @currency_pairs.setter def currency_pairs(self, value): self.__currency_pairs = value - @property def sell_currency(self): - """Gets the sell_currency of this AlipayInquireExchangeRateRequest.""" + """Gets the sell_currency of this AlipayInquireExchangeRateRequest. + + """ return self.__sell_currency @sell_currency.setter def sell_currency(self, value): self.__sell_currency = value - @property def buy_currency(self): - """Gets the buy_currency of this AlipayInquireExchangeRateRequest.""" + """Gets the buy_currency of this AlipayInquireExchangeRateRequest. + + """ return self.__buy_currency @buy_currency.setter def buy_currency(self, value): self.__buy_currency = value - @property def product_code(self): - """Gets the product_code of this AlipayInquireExchangeRateRequest.""" + """Gets the product_code of this AlipayInquireExchangeRateRequest. + + """ return self.__product_code @product_code.setter def product_code(self, value): self.__product_code = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id if hasattr(self, "payment_currency") and self.payment_currency is not None: - params["paymentCurrency"] = self.payment_currency + params['paymentCurrency'] = self.payment_currency if hasattr(self, "currency_pairs") and self.currency_pairs is not None: - params["currencyPairs"] = self.currency_pairs + params['currencyPairs'] = self.currency_pairs if hasattr(self, "sell_currency") and self.sell_currency is not None: - params["sellCurrency"] = self.sell_currency + params['sellCurrency'] = self.sell_currency if hasattr(self, "buy_currency") and self.buy_currency is not None: - params["buyCurrency"] = self.buy_currency + params['buyCurrency'] = self.buy_currency if hasattr(self, "product_code") and self.product_code is not None: - params["productCode"] = self.product_code + params['productCode'] = self.product_code return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] - if "paymentCurrency" in response_body: - self.__payment_currency = response_body["paymentCurrency"] - if "currencyPairs" in response_body: + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'paymentCurrency' in response_body: + self.__payment_currency = response_body['paymentCurrency'] + if 'currencyPairs' in response_body: self.__currency_pairs = [] - for item in response_body["currencyPairs"]: + for item in response_body['currencyPairs']: obj = CurrencyPair() obj.parse_rsp_body(item) self.__currency_pairs.append(obj) - if "sellCurrency" in response_body: - self.__sell_currency = response_body["sellCurrency"] - if "buyCurrency" in response_body: - self.__buy_currency = response_body["buyCurrency"] - if "productCode" in response_body: - product_code_temp = ProductCodeType.value_of(response_body["productCode"]) + if 'sellCurrency' in response_body: + self.__sell_currency = response_body['sellCurrency'] + if 'buyCurrency' in response_body: + self.__buy_currency = response_body['buyCurrency'] + if 'productCode' in response_body: + product_code_temp = ProductCodeType.value_of(response_body['productCode']) self.__product_code = product_code_temp diff --git a/com/alipay/ams/api/request/pay/alipay_inquiry_refund_request.py b/com/alipay/ams/api/request/pay/alipay_inquiry_refund_request.py index 3c795cb..cc47e9e 100644 --- a/com/alipay/ams/api/request/pay/alipay_inquiry_refund_request.py +++ b/com/alipay/ams/api/request/pay/alipay_inquiry_refund_request.py @@ -1,18 +1,17 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayInquiryRefundRequest(AlipayRequest): def __init__(self): - super(AlipayInquiryRefundRequest, self).__init__( - "/ams/api/v1/payments/inquiryRefund" - ) + super(AlipayInquiryRefundRequest, self).__init__("/ams/api/v1/payments/inquiryRefund") self.__refund_request_id = None # type: str self.__refund_id = None # type: str self.__merchant_account_id = None # type: str + @property def refund_request_id(self): @@ -24,7 +23,6 @@ def refund_request_id(self): @refund_request_id.setter def refund_request_id(self, value): self.__refund_request_id = value - @property def refund_id(self): """ @@ -35,41 +33,40 @@ def refund_id(self): @refund_id.setter def refund_id(self, value): self.__refund_id = value - @property def merchant_account_id(self): - """Gets the merchant_account_id of this AlipayInquiryRefundRequest.""" + """Gets the merchant_account_id of this AlipayInquiryRefundRequest. + + """ return self.__merchant_account_id @merchant_account_id.setter def merchant_account_id(self, value): self.__merchant_account_id = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "refund_request_id") and self.refund_request_id is not None: - params["refundRequestId"] = self.refund_request_id + params['refundRequestId'] = self.refund_request_id if hasattr(self, "refund_id") and self.refund_id is not None: - params["refundId"] = self.refund_id - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + params['refundId'] = self.refund_id + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "refundRequestId" in response_body: - self.__refund_request_id = response_body["refundRequestId"] - if "refundId" in response_body: - self.__refund_id = response_body["refundId"] - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] + if 'refundRequestId' in response_body: + self.__refund_request_id = response_body['refundRequestId'] + if 'refundId' in response_body: + self.__refund_id = response_body['refundId'] + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] diff --git a/com/alipay/ams/api/request/pay/alipay_pay_cancel_request.py b/com/alipay/ams/api/request/pay/alipay_pay_cancel_request.py index 8e0eab3..9dc5545 100644 --- a/com/alipay/ams/api/request/pay/alipay_pay_cancel_request.py +++ b/com/alipay/ams/api/request/pay/alipay_pay_cancel_request.py @@ -1,16 +1,17 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayPayCancelRequest(AlipayRequest): def __init__(self): - super(AlipayPayCancelRequest, self).__init__("/ams/api/v1/payments/cancel") + super(AlipayPayCancelRequest, self).__init__("/ams/api/v1/payments/cancel") self.__payment_id = None # type: str self.__payment_request_id = None # type: str self.__merchant_account_id = None # type: str + @property def payment_id(self): @@ -22,7 +23,6 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def payment_request_id(self): """ @@ -33,7 +33,6 @@ def payment_request_id(self): @payment_request_id.setter def payment_request_id(self, value): self.__payment_request_id = value - @property def merchant_account_id(self): """ @@ -45,31 +44,29 @@ def merchant_account_id(self): def merchant_account_id(self, value): self.__merchant_account_id = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id + params['paymentId'] = self.payment_id if hasattr(self, "payment_request_id") and self.payment_request_id is not None: - params["paymentRequestId"] = self.payment_request_id - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + params['paymentRequestId'] = self.payment_request_id + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "paymentRequestId" in response_body: - self.__payment_request_id = response_body["paymentRequestId"] - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] diff --git a/com/alipay/ams/api/request/pay/alipay_pay_consult_request.py b/com/alipay/ams/api/request/pay/alipay_pay_consult_request.py index 3cc3e9d..624e2b9 100644 --- a/com/alipay/ams/api/request/pay/alipay_pay_consult_request.py +++ b/com/alipay/ams/api/request/pay/alipay_pay_consult_request.py @@ -8,12 +8,12 @@ from com.alipay.ams.api.model.buyer import Buyer -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayPayConsultRequest(AlipayRequest): def __init__(self): - super(AlipayPayConsultRequest, self).__init__("/ams/api/v1/payments/consult") + super(AlipayPayConsultRequest, self).__init__("/ams/api/v1/payments/consult") self.__product_code = None # type: ProductCodeType self.__payment_amount = None # type: Amount @@ -33,25 +33,28 @@ def __init__(self): self.__allowed_psp_regions = None # type: [str] self.__buyer = None # type: Buyer self.__merchant_account_id = None # type: str + @property def product_code(self): - """Gets the product_code of this AlipayPayConsultRequest.""" + """Gets the product_code of this AlipayPayConsultRequest. + + """ return self.__product_code @product_code.setter def product_code(self, value): self.__product_code = value - @property def payment_amount(self): - """Gets the payment_amount of this AlipayPayConsultRequest.""" + """Gets the payment_amount of this AlipayPayConsultRequest. + + """ return self.__payment_amount @payment_amount.setter def payment_amount(self, value): self.__payment_amount = value - @property def merchant_region(self): """ @@ -62,7 +65,6 @@ def merchant_region(self): @merchant_region.setter def merchant_region(self, value): self.__merchant_region = value - @property def allowed_payment_method_regions(self): """ @@ -73,70 +75,76 @@ def allowed_payment_method_regions(self): @allowed_payment_method_regions.setter def allowed_payment_method_regions(self, value): self.__allowed_payment_method_regions = value - @property def allowed_payment_methods(self): - """Gets the allowed_payment_methods of this AlipayPayConsultRequest.""" + """Gets the allowed_payment_methods of this AlipayPayConsultRequest. + + """ return self.__allowed_payment_methods @allowed_payment_methods.setter def allowed_payment_methods(self, value): self.__allowed_payment_methods = value - @property def blocked_payment_methods(self): - """Gets the blocked_payment_methods of this AlipayPayConsultRequest.""" + """Gets the blocked_payment_methods of this AlipayPayConsultRequest. + + """ return self.__blocked_payment_methods @blocked_payment_methods.setter def blocked_payment_methods(self, value): self.__blocked_payment_methods = value - @property def region(self): - """Gets the region of this AlipayPayConsultRequest.""" + """Gets the region of this AlipayPayConsultRequest. + + """ return self.__region @region.setter def region(self, value): self.__region = value - @property def customer_id(self): - """Gets the customer_id of this AlipayPayConsultRequest.""" + """Gets the customer_id of this AlipayPayConsultRequest. + + """ return self.__customer_id @customer_id.setter def customer_id(self, value): self.__customer_id = value - @property def reference_user_id(self): - """Gets the reference_user_id of this AlipayPayConsultRequest.""" + """Gets the reference_user_id of this AlipayPayConsultRequest. + + """ return self.__reference_user_id @reference_user_id.setter def reference_user_id(self, value): self.__reference_user_id = value - @property def env(self): - """Gets the env of this AlipayPayConsultRequest.""" + """Gets the env of this AlipayPayConsultRequest. + + """ return self.__env @env.setter def env(self, value): self.__env = value - @property def extend_info(self): - """Gets the extend_info of this AlipayPayConsultRequest.""" + """Gets the extend_info of this AlipayPayConsultRequest. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def user_region(self): """ @@ -147,52 +155,56 @@ def user_region(self): @user_region.setter def user_region(self, value): self.__user_region = value - @property def payment_factor(self): - """Gets the payment_factor of this AlipayPayConsultRequest.""" + """Gets the payment_factor of this AlipayPayConsultRequest. + + """ return self.__payment_factor @payment_factor.setter def payment_factor(self, value): self.__payment_factor = value - @property def settlement_strategy(self): - """Gets the settlement_strategy of this AlipayPayConsultRequest.""" + """Gets the settlement_strategy of this AlipayPayConsultRequest. + + """ return self.__settlement_strategy @settlement_strategy.setter def settlement_strategy(self, value): self.__settlement_strategy = value - @property def merchant(self): - """Gets the merchant of this AlipayPayConsultRequest.""" + """Gets the merchant of this AlipayPayConsultRequest. + + """ return self.__merchant @merchant.setter def merchant(self, value): self.__merchant = value - @property def allowed_psp_regions(self): - """Gets the allowed_psp_regions of this AlipayPayConsultRequest.""" + """Gets the allowed_psp_regions of this AlipayPayConsultRequest. + + """ return self.__allowed_psp_regions @allowed_psp_regions.setter def allowed_psp_regions(self, value): self.__allowed_psp_regions = value - @property def buyer(self): - """Gets the buyer of this AlipayPayConsultRequest.""" + """Gets the buyer of this AlipayPayConsultRequest. + + """ return self.__buyer @buyer.setter def buyer(self, value): self.__buyer = value - @property def merchant_account_id(self): """ @@ -204,117 +216,96 @@ def merchant_account_id(self): def merchant_account_id(self, value): self.__merchant_account_id = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "product_code") and self.product_code is not None: - params["productCode"] = self.product_code + params['productCode'] = self.product_code if hasattr(self, "payment_amount") and self.payment_amount is not None: - params["paymentAmount"] = self.payment_amount + params['paymentAmount'] = self.payment_amount if hasattr(self, "merchant_region") and self.merchant_region is not None: - params["merchantRegion"] = self.merchant_region - if ( - hasattr(self, "allowed_payment_method_regions") - and self.allowed_payment_method_regions is not None - ): - params["allowedPaymentMethodRegions"] = self.allowed_payment_method_regions - if ( - hasattr(self, "allowed_payment_methods") - and self.allowed_payment_methods is not None - ): - params["allowedPaymentMethods"] = self.allowed_payment_methods - if ( - hasattr(self, "blocked_payment_methods") - and self.blocked_payment_methods is not None - ): - params["blockedPaymentMethods"] = self.blocked_payment_methods + params['merchantRegion'] = self.merchant_region + if hasattr(self, "allowed_payment_method_regions") and self.allowed_payment_method_regions is not None: + params['allowedPaymentMethodRegions'] = self.allowed_payment_method_regions + if hasattr(self, "allowed_payment_methods") and self.allowed_payment_methods is not None: + params['allowedPaymentMethods'] = self.allowed_payment_methods + if hasattr(self, "blocked_payment_methods") and self.blocked_payment_methods is not None: + params['blockedPaymentMethods'] = self.blocked_payment_methods if hasattr(self, "region") and self.region is not None: - params["region"] = self.region + params['region'] = self.region if hasattr(self, "customer_id") and self.customer_id is not None: - params["customerId"] = self.customer_id + params['customerId'] = self.customer_id if hasattr(self, "reference_user_id") and self.reference_user_id is not None: - params["referenceUserId"] = self.reference_user_id + params['referenceUserId'] = self.reference_user_id if hasattr(self, "env") and self.env is not None: - params["env"] = self.env + params['env'] = self.env if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "user_region") and self.user_region is not None: - params["userRegion"] = self.user_region + params['userRegion'] = self.user_region if hasattr(self, "payment_factor") and self.payment_factor is not None: - params["paymentFactor"] = self.payment_factor - if ( - hasattr(self, "settlement_strategy") - and self.settlement_strategy is not None - ): - params["settlementStrategy"] = self.settlement_strategy + params['paymentFactor'] = self.payment_factor + if hasattr(self, "settlement_strategy") and self.settlement_strategy is not None: + params['settlementStrategy'] = self.settlement_strategy if hasattr(self, "merchant") and self.merchant is not None: - params["merchant"] = self.merchant - if ( - hasattr(self, "allowed_psp_regions") - and self.allowed_psp_regions is not None - ): - params["allowedPspRegions"] = self.allowed_psp_regions + params['merchant'] = self.merchant + if hasattr(self, "allowed_psp_regions") and self.allowed_psp_regions is not None: + params['allowedPspRegions'] = self.allowed_psp_regions if hasattr(self, "buyer") and self.buyer is not None: - params["buyer"] = self.buyer - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + params['buyer'] = self.buyer + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "productCode" in response_body: - product_code_temp = ProductCodeType.value_of(response_body["productCode"]) + if 'productCode' in response_body: + product_code_temp = ProductCodeType.value_of(response_body['productCode']) self.__product_code = product_code_temp - if "paymentAmount" in response_body: + if 'paymentAmount' in response_body: self.__payment_amount = Amount() - self.__payment_amount.parse_rsp_body(response_body["paymentAmount"]) - if "merchantRegion" in response_body: - self.__merchant_region = response_body["merchantRegion"] - if "allowedPaymentMethodRegions" in response_body: - self.__allowed_payment_method_regions = response_body[ - "allowedPaymentMethodRegions" - ] - if "allowedPaymentMethods" in response_body: - self.__allowed_payment_methods = response_body["allowedPaymentMethods"] - if "blockedPaymentMethods" in response_body: - self.__blocked_payment_methods = response_body["blockedPaymentMethods"] - if "region" in response_body: - self.__region = response_body["region"] - if "customerId" in response_body: - self.__customer_id = response_body["customerId"] - if "referenceUserId" in response_body: - self.__reference_user_id = response_body["referenceUserId"] - if "env" in response_body: + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'merchantRegion' in response_body: + self.__merchant_region = response_body['merchantRegion'] + if 'allowedPaymentMethodRegions' in response_body: + self.__allowed_payment_method_regions = response_body['allowedPaymentMethodRegions'] + if 'allowedPaymentMethods' in response_body: + self.__allowed_payment_methods = response_body['allowedPaymentMethods'] + if 'blockedPaymentMethods' in response_body: + self.__blocked_payment_methods = response_body['blockedPaymentMethods'] + if 'region' in response_body: + self.__region = response_body['region'] + if 'customerId' in response_body: + self.__customer_id = response_body['customerId'] + if 'referenceUserId' in response_body: + self.__reference_user_id = response_body['referenceUserId'] + if 'env' in response_body: self.__env = Env() - self.__env.parse_rsp_body(response_body["env"]) - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "userRegion" in response_body: - self.__user_region = response_body["userRegion"] - if "paymentFactor" in response_body: + self.__env.parse_rsp_body(response_body['env']) + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'userRegion' in response_body: + self.__user_region = response_body['userRegion'] + if 'paymentFactor' in response_body: self.__payment_factor = PaymentFactor() - self.__payment_factor.parse_rsp_body(response_body["paymentFactor"]) - if "settlementStrategy" in response_body: + self.__payment_factor.parse_rsp_body(response_body['paymentFactor']) + if 'settlementStrategy' in response_body: self.__settlement_strategy = SettlementStrategy() - self.__settlement_strategy.parse_rsp_body( - response_body["settlementStrategy"] - ) - if "merchant" in response_body: + self.__settlement_strategy.parse_rsp_body(response_body['settlementStrategy']) + if 'merchant' in response_body: self.__merchant = Merchant() - self.__merchant.parse_rsp_body(response_body["merchant"]) - if "allowedPspRegions" in response_body: - self.__allowed_psp_regions = response_body["allowedPspRegions"] - if "buyer" in response_body: + self.__merchant.parse_rsp_body(response_body['merchant']) + if 'allowedPspRegions' in response_body: + self.__allowed_psp_regions = response_body['allowedPspRegions'] + if 'buyer' in response_body: self.__buyer = Buyer() - self.__buyer.parse_rsp_body(response_body["buyer"]) - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] + self.__buyer.parse_rsp_body(response_body['buyer']) + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] diff --git a/com/alipay/ams/api/request/pay/alipay_pay_query_request.py b/com/alipay/ams/api/request/pay/alipay_pay_query_request.py index 5193a3b..a4cb66e 100644 --- a/com/alipay/ams/api/request/pay/alipay_pay_query_request.py +++ b/com/alipay/ams/api/request/pay/alipay_pay_query_request.py @@ -1,18 +1,17 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayPayQueryRequest(AlipayRequest): def __init__(self): - super(AlipayPayQueryRequest, self).__init__( - "/ams/api/v1/payments/inquiryPayment" - ) + super(AlipayPayQueryRequest, self).__init__("/ams/api/v1/payments/inquiryPayment") self.__payment_request_id = None # type: str self.__payment_id = None # type: str self.__merchant_account_id = None # type: str + @property def payment_request_id(self): @@ -24,7 +23,6 @@ def payment_request_id(self): @payment_request_id.setter def payment_request_id(self, value): self.__payment_request_id = value - @property def payment_id(self): """ @@ -35,7 +33,6 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def merchant_account_id(self): """ @@ -47,31 +44,29 @@ def merchant_account_id(self): def merchant_account_id(self, value): self.__merchant_account_id = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "payment_request_id") and self.payment_request_id is not None: - params["paymentRequestId"] = self.payment_request_id + params['paymentRequestId'] = self.payment_request_id if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + params['paymentId'] = self.payment_id + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "paymentRequestId" in response_body: - self.__payment_request_id = response_body["paymentRequestId"] - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] diff --git a/com/alipay/ams/api/request/pay/alipay_pay_request.py b/com/alipay/ams/api/request/pay/alipay_pay_request.py index 4e4ae3c..155b36e 100644 --- a/com/alipay/ams/api/request/pay/alipay_pay_request.py +++ b/com/alipay/ams/api/request/pay/alipay_pay_request.py @@ -17,12 +17,12 @@ from com.alipay.ams.api.model.payment_verification_data import PaymentVerificationData -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayPayRequest(AlipayRequest): def __init__(self): - super(AlipayPayRequest, self).__init__("/ams/api/v1/payments/pay") + super(AlipayPayRequest, self).__init__("/ams/api/v1/payments/pay") self.__metadata = None # type: str self.__customized_info = None # type: CustomizedInfo @@ -52,6 +52,7 @@ def __init__(self): self.__extend_info = None # type: str self.__merchant_account_id = None # type: str self.__dual_offline_payment = None # type: bool + @property def metadata(self): @@ -63,61 +64,66 @@ def metadata(self): @metadata.setter def metadata(self, value): self.__metadata = value - @property def customized_info(self): - """Gets the customized_info of this AlipayPayRequest.""" + """Gets the customized_info of this AlipayPayRequest. + + """ return self.__customized_info @customized_info.setter def customized_info(self, value): self.__customized_info = value - @property def payment_quote(self): - """Gets the payment_quote of this AlipayPayRequest.""" + """Gets the payment_quote of this AlipayPayRequest. + + """ return self.__payment_quote @payment_quote.setter def payment_quote(self, value): self.__payment_quote = value - @property def agreement_info(self): - """Gets the agreement_info of this AlipayPayRequest.""" + """Gets the agreement_info of this AlipayPayRequest. + + """ return self.__agreement_info @agreement_info.setter def agreement_info(self, value): self.__agreement_info = value - @property def subscription_info(self): - """Gets the subscription_info of this AlipayPayRequest.""" + """Gets the subscription_info of this AlipayPayRequest. + + """ return self.__subscription_info @subscription_info.setter def subscription_info(self, value): self.__subscription_info = value - @property def processing_amount(self): - """Gets the processing_amount of this AlipayPayRequest.""" + """Gets the processing_amount of this AlipayPayRequest. + + """ return self.__processing_amount @processing_amount.setter def processing_amount(self, value): self.__processing_amount = value - @property def product_code(self): - """Gets the product_code of this AlipayPayRequest.""" + """Gets the product_code of this AlipayPayRequest. + + """ return self.__product_code @product_code.setter def product_code(self, value): self.__product_code = value - @property def payment_request_id(self): """ @@ -128,56 +134,56 @@ def payment_request_id(self): @payment_request_id.setter def payment_request_id(self, value): self.__payment_request_id = value - @property def order(self): - """Gets the order of this AlipayPayRequest.""" + """Gets the order of this AlipayPayRequest. + + """ return self.__order @order.setter def order(self, value): self.__order = value - @property def payment_amount(self): - """Gets the payment_amount of this AlipayPayRequest.""" + """Gets the payment_amount of this AlipayPayRequest. + + """ return self.__payment_amount @payment_amount.setter def payment_amount(self, value): self.__payment_amount = value - @property def payment_method(self): - """Gets the payment_method of this AlipayPayRequest.""" + """Gets the payment_method of this AlipayPayRequest. + + """ return self.__payment_method @payment_method.setter def payment_method(self, value): self.__payment_method = value - @property def payment_expiry_time(self): """ - The payment expiration time is a specific time after which the payment will expire and the acquirer or merchant must terminate the order processing. Notes: For bank transfer payments, the default payment expiration time is 48 hours after the payment request is sent. For other payment categories, the default payment expiration time is usually 14 minutes after the payment request is sent. For example, if the request is sent on 2019-11-27T12:00:01+08:30, the payment expiration time is 2019-11-27T12:14:01+08:30. Specify this field if you want to use a payment expiration time that differs from the default time. For bank transfer payments, the specified payment expiration time must be less than 48 hours after the payment request is sent. For other payment categories, the specified payment expiration time must be less than 10 minutes after the payment request is sent. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + The payment expiration time is a specific time after which the payment will expire and the acquirer or merchant must terminate the order processing. Notes: For bank transfer payments, the default payment expiration time is 48 hours after the payment request is sent. For other payment categories, the default payment expiration time is usually 14 minutes after the payment request is sent. For example, if the request is sent on 2019-11-27T12:00:01+08:30, the payment expiration time is 2019-11-27T12:14:01+08:30. Specify this field if you want to use a payment expiration time that differs from the default time. For bank transfer payments, the specified payment expiration time must be less than 48 hours after the payment request is sent. For other payment categories, the specified payment expiration time must be less than 10 minutes after the payment request is sent. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__payment_expiry_time @payment_expiry_time.setter def payment_expiry_time(self, value): self.__payment_expiry_time = value - @property def payment_redirect_url(self): """ - The merchant page URL that the user is redirected to after the payment is completed. More information: Maximum length: 2048 characters + The merchant page URL that the user is redirected to after the payment is completed. More information: Maximum length: 2048 characters """ return self.__payment_redirect_url @payment_redirect_url.setter def payment_redirect_url(self, value): self.__payment_redirect_url = value - @property def payment_notify_url(self): """ @@ -188,34 +194,36 @@ def payment_notify_url(self): @payment_notify_url.setter def payment_notify_url(self, value): self.__payment_notify_url = value - @property def payment_factor(self): - """Gets the payment_factor of this AlipayPayRequest.""" + """Gets the payment_factor of this AlipayPayRequest. + + """ return self.__payment_factor @payment_factor.setter def payment_factor(self, value): self.__payment_factor = value - @property def settlement_strategy(self): - """Gets the settlement_strategy of this AlipayPayRequest.""" + """Gets the settlement_strategy of this AlipayPayRequest. + + """ return self.__settlement_strategy @settlement_strategy.setter def settlement_strategy(self, value): self.__settlement_strategy = value - @property def credit_pay_plan(self): - """Gets the credit_pay_plan of this AlipayPayRequest.""" + """Gets the credit_pay_plan of this AlipayPayRequest. + + """ return self.__credit_pay_plan @credit_pay_plan.setter def credit_pay_plan(self, value): self.__credit_pay_plan = value - @property def app_id(self): """ @@ -226,18 +234,16 @@ def app_id(self): @app_id.setter def app_id(self, value): self.__app_id = value - @property def merchant_region(self): """ - The country or region where the merchant operates the business. The parameter is a 2-letter country or region code that follows ISO 3166 Country Codes standard. Some possible values are US, SG, HK, PK, JP, CN, BR, AU, and MY. Note: This parameter is required when you use the Global Acquirer Gateway (GAGW) product. More information: Maximum length: 2 characters + The country or region where the merchant operates the business. The parameter is a 2-letter country or region code that follows ISO 3166 Country Codes standard. Some possible values are US, SG, HK, PK, JP, CN, BR, AU, and MY. Note: This parameter is required when you use the Global Acquirer Gateway (GAGW) product. More information: Maximum length: 2 characters """ return self.__merchant_region @merchant_region.setter def merchant_region(self, value): self.__merchant_region = value - @property def user_region(self): """ @@ -248,61 +254,66 @@ def user_region(self): @user_region.setter def user_region(self, value): self.__user_region = value - @property def env(self): - """Gets the env of this AlipayPayRequest.""" + """Gets the env of this AlipayPayRequest. + + """ return self.__env @env.setter def env(self, value): self.__env = value - @property def pay_to_method(self): - """Gets the pay_to_method of this AlipayPayRequest.""" + """Gets the pay_to_method of this AlipayPayRequest. + + """ return self.__pay_to_method @pay_to_method.setter def pay_to_method(self, value): self.__pay_to_method = value - @property def is_authorization(self): - """Gets the is_authorization of this AlipayPayRequest.""" + """Gets the is_authorization of this AlipayPayRequest. + + """ return self.__is_authorization @is_authorization.setter def is_authorization(self, value): self.__is_authorization = value - @property def merchant(self): - """Gets the merchant of this AlipayPayRequest.""" + """Gets the merchant of this AlipayPayRequest. + + """ return self.__merchant @merchant.setter def merchant(self, value): self.__merchant = value - @property def payment_verification_data(self): - """Gets the payment_verification_data of this AlipayPayRequest.""" + """Gets the payment_verification_data of this AlipayPayRequest. + + """ return self.__payment_verification_data @payment_verification_data.setter def payment_verification_data(self, value): self.__payment_verification_data = value - @property def extend_info(self): - """Gets the extend_info of this AlipayPayRequest.""" + """Gets the extend_info of this AlipayPayRequest. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def merchant_account_id(self): """ @@ -313,176 +324,156 @@ def merchant_account_id(self): @merchant_account_id.setter def merchant_account_id(self, value): self.__merchant_account_id = value - @property def dual_offline_payment(self): - """Gets the dual_offline_payment of this AlipayPayRequest.""" + """Gets the dual_offline_payment of this AlipayPayRequest. + + """ return self.__dual_offline_payment @dual_offline_payment.setter def dual_offline_payment(self, value): self.__dual_offline_payment = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "metadata") and self.metadata is not None: - params["metadata"] = self.metadata + params['metadata'] = self.metadata if hasattr(self, "customized_info") and self.customized_info is not None: - params["customizedInfo"] = self.customized_info + params['customizedInfo'] = self.customized_info if hasattr(self, "payment_quote") and self.payment_quote is not None: - params["paymentQuote"] = self.payment_quote + params['paymentQuote'] = self.payment_quote if hasattr(self, "agreement_info") and self.agreement_info is not None: - params["agreementInfo"] = self.agreement_info + params['agreementInfo'] = self.agreement_info if hasattr(self, "subscription_info") and self.subscription_info is not None: - params["subscriptionInfo"] = self.subscription_info + params['subscriptionInfo'] = self.subscription_info if hasattr(self, "processing_amount") and self.processing_amount is not None: - params["processingAmount"] = self.processing_amount + params['processingAmount'] = self.processing_amount if hasattr(self, "product_code") and self.product_code is not None: - params["productCode"] = self.product_code + params['productCode'] = self.product_code if hasattr(self, "payment_request_id") and self.payment_request_id is not None: - params["paymentRequestId"] = self.payment_request_id + params['paymentRequestId'] = self.payment_request_id if hasattr(self, "order") and self.order is not None: - params["order"] = self.order + params['order'] = self.order if hasattr(self, "payment_amount") and self.payment_amount is not None: - params["paymentAmount"] = self.payment_amount + params['paymentAmount'] = self.payment_amount if hasattr(self, "payment_method") and self.payment_method is not None: - params["paymentMethod"] = self.payment_method - if ( - hasattr(self, "payment_expiry_time") - and self.payment_expiry_time is not None - ): - params["paymentExpiryTime"] = self.payment_expiry_time - if ( - hasattr(self, "payment_redirect_url") - and self.payment_redirect_url is not None - ): - params["paymentRedirectUrl"] = self.payment_redirect_url + params['paymentMethod'] = self.payment_method + if hasattr(self, "payment_expiry_time") and self.payment_expiry_time is not None: + params['paymentExpiryTime'] = self.payment_expiry_time + if hasattr(self, "payment_redirect_url") and self.payment_redirect_url is not None: + params['paymentRedirectUrl'] = self.payment_redirect_url if hasattr(self, "payment_notify_url") and self.payment_notify_url is not None: - params["paymentNotifyUrl"] = self.payment_notify_url + params['paymentNotifyUrl'] = self.payment_notify_url if hasattr(self, "payment_factor") and self.payment_factor is not None: - params["paymentFactor"] = self.payment_factor - if ( - hasattr(self, "settlement_strategy") - and self.settlement_strategy is not None - ): - params["settlementStrategy"] = self.settlement_strategy + params['paymentFactor'] = self.payment_factor + if hasattr(self, "settlement_strategy") and self.settlement_strategy is not None: + params['settlementStrategy'] = self.settlement_strategy if hasattr(self, "credit_pay_plan") and self.credit_pay_plan is not None: - params["creditPayPlan"] = self.credit_pay_plan + params['creditPayPlan'] = self.credit_pay_plan if hasattr(self, "app_id") and self.app_id is not None: - params["appId"] = self.app_id + params['appId'] = self.app_id if hasattr(self, "merchant_region") and self.merchant_region is not None: - params["merchantRegion"] = self.merchant_region + params['merchantRegion'] = self.merchant_region if hasattr(self, "user_region") and self.user_region is not None: - params["userRegion"] = self.user_region + params['userRegion'] = self.user_region if hasattr(self, "env") and self.env is not None: - params["env"] = self.env + params['env'] = self.env if hasattr(self, "pay_to_method") and self.pay_to_method is not None: - params["payToMethod"] = self.pay_to_method + params['payToMethod'] = self.pay_to_method if hasattr(self, "is_authorization") and self.is_authorization is not None: - params["isAuthorization"] = self.is_authorization + params['isAuthorization'] = self.is_authorization if hasattr(self, "merchant") and self.merchant is not None: - params["merchant"] = self.merchant - if ( - hasattr(self, "payment_verification_data") - and self.payment_verification_data is not None - ): - params["paymentVerificationData"] = self.payment_verification_data + params['merchant'] = self.merchant + if hasattr(self, "payment_verification_data") and self.payment_verification_data is not None: + params['paymentVerificationData'] = self.payment_verification_data if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id - if ( - hasattr(self, "dual_offline_payment") - and self.dual_offline_payment is not None - ): - params["dualOfflinePayment"] = self.dual_offline_payment + params['extendInfo'] = self.extend_info + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id + if hasattr(self, "dual_offline_payment") and self.dual_offline_payment is not None: + params['dualOfflinePayment'] = self.dual_offline_payment return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "metadata" in response_body: - self.__metadata = response_body["metadata"] - if "customizedInfo" in response_body: + if 'metadata' in response_body: + self.__metadata = response_body['metadata'] + if 'customizedInfo' in response_body: self.__customized_info = CustomizedInfo() - self.__customized_info.parse_rsp_body(response_body["customizedInfo"]) - if "paymentQuote" in response_body: + self.__customized_info.parse_rsp_body(response_body['customizedInfo']) + if 'paymentQuote' in response_body: self.__payment_quote = Quote() - self.__payment_quote.parse_rsp_body(response_body["paymentQuote"]) - if "agreementInfo" in response_body: + self.__payment_quote.parse_rsp_body(response_body['paymentQuote']) + if 'agreementInfo' in response_body: self.__agreement_info = AgreementInfo() - self.__agreement_info.parse_rsp_body(response_body["agreementInfo"]) - if "subscriptionInfo" in response_body: + self.__agreement_info.parse_rsp_body(response_body['agreementInfo']) + if 'subscriptionInfo' in response_body: self.__subscription_info = SubscriptionInfo() - self.__subscription_info.parse_rsp_body(response_body["subscriptionInfo"]) - if "processingAmount" in response_body: + self.__subscription_info.parse_rsp_body(response_body['subscriptionInfo']) + if 'processingAmount' in response_body: self.__processing_amount = Amount() - self.__processing_amount.parse_rsp_body(response_body["processingAmount"]) - if "productCode" in response_body: - product_code_temp = ProductCodeType.value_of(response_body["productCode"]) + self.__processing_amount.parse_rsp_body(response_body['processingAmount']) + if 'productCode' in response_body: + product_code_temp = ProductCodeType.value_of(response_body['productCode']) self.__product_code = product_code_temp - if "paymentRequestId" in response_body: - self.__payment_request_id = response_body["paymentRequestId"] - if "order" in response_body: + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] + if 'order' in response_body: self.__order = Order() - self.__order.parse_rsp_body(response_body["order"]) - if "paymentAmount" in response_body: + self.__order.parse_rsp_body(response_body['order']) + if 'paymentAmount' in response_body: self.__payment_amount = Amount() - self.__payment_amount.parse_rsp_body(response_body["paymentAmount"]) - if "paymentMethod" in response_body: + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'paymentMethod' in response_body: self.__payment_method = PaymentMethod() - self.__payment_method.parse_rsp_body(response_body["paymentMethod"]) - if "paymentExpiryTime" in response_body: - self.__payment_expiry_time = response_body["paymentExpiryTime"] - if "paymentRedirectUrl" in response_body: - self.__payment_redirect_url = response_body["paymentRedirectUrl"] - if "paymentNotifyUrl" in response_body: - self.__payment_notify_url = response_body["paymentNotifyUrl"] - if "paymentFactor" in response_body: + self.__payment_method.parse_rsp_body(response_body['paymentMethod']) + if 'paymentExpiryTime' in response_body: + self.__payment_expiry_time = response_body['paymentExpiryTime'] + if 'paymentRedirectUrl' in response_body: + self.__payment_redirect_url = response_body['paymentRedirectUrl'] + if 'paymentNotifyUrl' in response_body: + self.__payment_notify_url = response_body['paymentNotifyUrl'] + if 'paymentFactor' in response_body: self.__payment_factor = PaymentFactor() - self.__payment_factor.parse_rsp_body(response_body["paymentFactor"]) - if "settlementStrategy" in response_body: + self.__payment_factor.parse_rsp_body(response_body['paymentFactor']) + if 'settlementStrategy' in response_body: self.__settlement_strategy = SettlementStrategy() - self.__settlement_strategy.parse_rsp_body( - response_body["settlementStrategy"] - ) - if "creditPayPlan" in response_body: + self.__settlement_strategy.parse_rsp_body(response_body['settlementStrategy']) + if 'creditPayPlan' in response_body: self.__credit_pay_plan = CreditPayPlan() - self.__credit_pay_plan.parse_rsp_body(response_body["creditPayPlan"]) - if "appId" in response_body: - self.__app_id = response_body["appId"] - if "merchantRegion" in response_body: - self.__merchant_region = response_body["merchantRegion"] - if "userRegion" in response_body: - self.__user_region = response_body["userRegion"] - if "env" in response_body: + self.__credit_pay_plan.parse_rsp_body(response_body['creditPayPlan']) + if 'appId' in response_body: + self.__app_id = response_body['appId'] + if 'merchantRegion' in response_body: + self.__merchant_region = response_body['merchantRegion'] + if 'userRegion' in response_body: + self.__user_region = response_body['userRegion'] + if 'env' in response_body: self.__env = Env() - self.__env.parse_rsp_body(response_body["env"]) - if "payToMethod" in response_body: + self.__env.parse_rsp_body(response_body['env']) + if 'payToMethod' in response_body: self.__pay_to_method = PaymentMethod() - self.__pay_to_method.parse_rsp_body(response_body["payToMethod"]) - if "isAuthorization" in response_body: - self.__is_authorization = response_body["isAuthorization"] - if "merchant" in response_body: + self.__pay_to_method.parse_rsp_body(response_body['payToMethod']) + if 'isAuthorization' in response_body: + self.__is_authorization = response_body['isAuthorization'] + if 'merchant' in response_body: self.__merchant = Merchant() - self.__merchant.parse_rsp_body(response_body["merchant"]) - if "paymentVerificationData" in response_body: + self.__merchant.parse_rsp_body(response_body['merchant']) + if 'paymentVerificationData' in response_body: self.__payment_verification_data = PaymentVerificationData() - self.__payment_verification_data.parse_rsp_body( - response_body["paymentVerificationData"] - ) - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] - if "dualOfflinePayment" in response_body: - self.__dual_offline_payment = response_body["dualOfflinePayment"] + self.__payment_verification_data.parse_rsp_body(response_body['paymentVerificationData']) + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'dualOfflinePayment' in response_body: + self.__dual_offline_payment = response_body['dualOfflinePayment'] diff --git a/com/alipay/ams/api/request/pay/alipay_payment_session_request.py b/com/alipay/ams/api/request/pay/alipay_payment_session_request.py index 96450d2..dc837b9 100644 --- a/com/alipay/ams/api/request/pay/alipay_payment_session_request.py +++ b/com/alipay/ams/api/request/pay/alipay_payment_session_request.py @@ -18,14 +18,12 @@ from com.alipay.ams.api.model.available_payment_method import AvailablePaymentMethod -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayPaymentSessionRequest(AlipayRequest): def __init__(self): - super(AlipayPaymentSessionRequest, self).__init__( - "/ams/api/v1/payments/createPaymentSession" - ) + super(AlipayPaymentSessionRequest, self).__init__("/ams/api/v1/payments/createPaymentSession") self.__merchant_account_id = None # type: str self.__metadata = None # type: str @@ -58,6 +56,7 @@ def __init__(self): self.__locale = None # type: str self.__available_payment_method = None # type: AvailablePaymentMethod self.__payment_expiry_time = None # type: str + @property def merchant_account_id(self): @@ -69,7 +68,6 @@ def merchant_account_id(self): @merchant_account_id.setter def merchant_account_id(self, value): self.__merchant_account_id = value - @property def metadata(self): """ @@ -80,7 +78,6 @@ def metadata(self): @metadata.setter def metadata(self, value): self.__metadata = value - @property def allowed_payment_method_regions(self): """ @@ -91,52 +88,56 @@ def allowed_payment_method_regions(self): @allowed_payment_method_regions.setter def allowed_payment_method_regions(self, value): self.__allowed_payment_method_regions = value - @property def customized_info(self): - """Gets the customized_info of this AlipayPaymentSessionRequest.""" + """Gets the customized_info of this AlipayPaymentSessionRequest. + + """ return self.__customized_info @customized_info.setter def customized_info(self, value): self.__customized_info = value - @property def payment_quote(self): - """Gets the payment_quote of this AlipayPaymentSessionRequest.""" + """Gets the payment_quote of this AlipayPaymentSessionRequest. + + """ return self.__payment_quote @payment_quote.setter def payment_quote(self, value): self.__payment_quote = value - @property def processing_amount(self): - """Gets the processing_amount of this AlipayPaymentSessionRequest.""" + """Gets the processing_amount of this AlipayPaymentSessionRequest. + + """ return self.__processing_amount @processing_amount.setter def processing_amount(self, value): self.__processing_amount = value - @property def subscription_plan(self): - """Gets the subscription_plan of this AlipayPaymentSessionRequest.""" + """Gets the subscription_plan of this AlipayPaymentSessionRequest. + + """ return self.__subscription_plan @subscription_plan.setter def subscription_plan(self, value): self.__subscription_plan = value - @property def subscription_info(self): - """Gets the subscription_info of this AlipayPaymentSessionRequest.""" + """Gets the subscription_info of this AlipayPaymentSessionRequest. + + """ return self.__subscription_info @subscription_info.setter def subscription_info(self, value): self.__subscription_info = value - @property def user_region(self): """ @@ -147,7 +148,6 @@ def user_region(self): @user_region.setter def user_region(self, value): self.__user_region = value - @property def scopes(self): """ @@ -158,16 +158,16 @@ def scopes(self): @scopes.setter def scopes(self, value): self.__scopes = value - @property def product_code(self): - """Gets the product_code of this AlipayPaymentSessionRequest.""" + """Gets the product_code of this AlipayPaymentSessionRequest. + + """ return self.__product_code @product_code.setter def product_code(self, value): self.__product_code = value - @property def payment_request_id(self): """ @@ -178,34 +178,36 @@ def payment_request_id(self): @payment_request_id.setter def payment_request_id(self, value): self.__payment_request_id = value - @property def order(self): - """Gets the order of this AlipayPaymentSessionRequest.""" + """Gets the order of this AlipayPaymentSessionRequest. + + """ return self.__order @order.setter def order(self, value): self.__order = value - @property def payment_amount(self): - """Gets the payment_amount of this AlipayPaymentSessionRequest.""" + """Gets the payment_amount of this AlipayPaymentSessionRequest. + + """ return self.__payment_amount @payment_amount.setter def payment_amount(self, value): self.__payment_amount = value - @property def payment_method(self): - """Gets the payment_method of this AlipayPaymentSessionRequest.""" + """Gets the payment_method of this AlipayPaymentSessionRequest. + + """ return self.__payment_method @payment_method.setter def payment_method(self, value): self.__payment_method = value - @property def payment_session_expiry_time(self): """ @@ -216,7 +218,6 @@ def payment_session_expiry_time(self): @payment_session_expiry_time.setter def payment_session_expiry_time(self, value): self.__payment_session_expiry_time = value - @property def payment_redirect_url(self): """ @@ -227,7 +228,6 @@ def payment_redirect_url(self): @payment_redirect_url.setter def payment_redirect_url(self, value): self.__payment_redirect_url = value - @property def payment_notify_url(self): """ @@ -238,45 +238,46 @@ def payment_notify_url(self): @payment_notify_url.setter def payment_notify_url(self, value): self.__payment_notify_url = value - @property def payment_factor(self): - """Gets the payment_factor of this AlipayPaymentSessionRequest.""" + """Gets the payment_factor of this AlipayPaymentSessionRequest. + + """ return self.__payment_factor @payment_factor.setter def payment_factor(self, value): self.__payment_factor = value - @property def settlement_strategy(self): - """Gets the settlement_strategy of this AlipayPaymentSessionRequest.""" + """Gets the settlement_strategy of this AlipayPaymentSessionRequest. + + """ return self.__settlement_strategy @settlement_strategy.setter def settlement_strategy(self, value): self.__settlement_strategy = value - @property def enable_installment_collection(self): """ - Indicates whether Antom collects the installment information for the payment. Specify this parameter if you need Antom to collect the installment information. Valid values are: true: indicates Antom collects installment information when the user's card supports installments. Installments are not available when the user's card does not support installments. false: indicates you do not need Antom to collect the installment information. The same applies when the value is empty or you do not specify this parameter. + Indicates whether Antom collects the installment information for the payment. Specify this parameter if you need Antom to collect the installment information. Valid values are: true: indicates Antom collects installment information when the user's card supports installments. Installments are not available when the user's card does not support installments. false: indicates you do not need Antom to collect the installment information. The same applies when the value is empty or you do not specify this parameter. """ return self.__enable_installment_collection @enable_installment_collection.setter def enable_installment_collection(self, value): self.__enable_installment_collection = value - @property def credit_pay_plan(self): - """Gets the credit_pay_plan of this AlipayPaymentSessionRequest.""" + """Gets the credit_pay_plan of this AlipayPaymentSessionRequest. + + """ return self.__credit_pay_plan @credit_pay_plan.setter def credit_pay_plan(self, value): self.__credit_pay_plan = value - @property def merchant_region(self): """ @@ -287,34 +288,36 @@ def merchant_region(self): @merchant_region.setter def merchant_region(self, value): self.__merchant_region = value - @property def env(self): - """Gets the env of this AlipayPaymentSessionRequest.""" + """Gets the env of this AlipayPaymentSessionRequest. + + """ return self.__env @env.setter def env(self, value): self.__env = value - @property def agreement_info(self): - """Gets the agreement_info of this AlipayPaymentSessionRequest.""" + """Gets the agreement_info of this AlipayPaymentSessionRequest. + + """ return self.__agreement_info @agreement_info.setter def agreement_info(self, value): self.__agreement_info = value - @property def risk_data(self): - """Gets the risk_data of this AlipayPaymentSessionRequest.""" + """Gets the risk_data of this AlipayPaymentSessionRequest. + + """ return self.__risk_data @risk_data.setter def risk_data(self, value): self.__risk_data = value - @property def product_scene(self): """ @@ -325,7 +328,6 @@ def product_scene(self): @product_scene.setter def product_scene(self, value): self.__product_scene = value - @property def saved_payment_methods(self): """ @@ -336,7 +338,6 @@ def saved_payment_methods(self): @saved_payment_methods.setter def saved_payment_methods(self, value): self.__saved_payment_methods = value - @property def locale(self): """ @@ -347,16 +348,16 @@ def locale(self): @locale.setter def locale(self, value): self.__locale = value - @property def available_payment_method(self): - """Gets the available_payment_method of this AlipayPaymentSessionRequest.""" + """Gets the available_payment_method of this AlipayPaymentSessionRequest. + + """ return self.__available_payment_method @available_payment_method.setter def available_payment_method(self, value): self.__available_payment_method = value - @property def payment_expiry_time(self): """ @@ -368,197 +369,161 @@ def payment_expiry_time(self): def payment_expiry_time(self, value): self.__payment_expiry_time = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id if hasattr(self, "metadata") and self.metadata is not None: - params["metadata"] = self.metadata - if ( - hasattr(self, "allowed_payment_method_regions") - and self.allowed_payment_method_regions is not None - ): - params["allowedPaymentMethodRegions"] = self.allowed_payment_method_regions + params['metadata'] = self.metadata + if hasattr(self, "allowed_payment_method_regions") and self.allowed_payment_method_regions is not None: + params['allowedPaymentMethodRegions'] = self.allowed_payment_method_regions if hasattr(self, "customized_info") and self.customized_info is not None: - params["customizedInfo"] = self.customized_info + params['customizedInfo'] = self.customized_info if hasattr(self, "payment_quote") and self.payment_quote is not None: - params["paymentQuote"] = self.payment_quote + params['paymentQuote'] = self.payment_quote if hasattr(self, "processing_amount") and self.processing_amount is not None: - params["processingAmount"] = self.processing_amount + params['processingAmount'] = self.processing_amount if hasattr(self, "subscription_plan") and self.subscription_plan is not None: - params["subscriptionPlan"] = self.subscription_plan + params['subscriptionPlan'] = self.subscription_plan if hasattr(self, "subscription_info") and self.subscription_info is not None: - params["subscriptionInfo"] = self.subscription_info + params['subscriptionInfo'] = self.subscription_info if hasattr(self, "user_region") and self.user_region is not None: - params["userRegion"] = self.user_region + params['userRegion'] = self.user_region if hasattr(self, "scopes") and self.scopes is not None: - params["scopes"] = self.scopes + params['scopes'] = self.scopes if hasattr(self, "product_code") and self.product_code is not None: - params["productCode"] = self.product_code + params['productCode'] = self.product_code if hasattr(self, "payment_request_id") and self.payment_request_id is not None: - params["paymentRequestId"] = self.payment_request_id + params['paymentRequestId'] = self.payment_request_id if hasattr(self, "order") and self.order is not None: - params["order"] = self.order + params['order'] = self.order if hasattr(self, "payment_amount") and self.payment_amount is not None: - params["paymentAmount"] = self.payment_amount + params['paymentAmount'] = self.payment_amount if hasattr(self, "payment_method") and self.payment_method is not None: - params["paymentMethod"] = self.payment_method - if ( - hasattr(self, "payment_session_expiry_time") - and self.payment_session_expiry_time is not None - ): - params["paymentSessionExpiryTime"] = self.payment_session_expiry_time - if ( - hasattr(self, "payment_redirect_url") - and self.payment_redirect_url is not None - ): - params["paymentRedirectUrl"] = self.payment_redirect_url + params['paymentMethod'] = self.payment_method + if hasattr(self, "payment_session_expiry_time") and self.payment_session_expiry_time is not None: + params['paymentSessionExpiryTime'] = self.payment_session_expiry_time + if hasattr(self, "payment_redirect_url") and self.payment_redirect_url is not None: + params['paymentRedirectUrl'] = self.payment_redirect_url if hasattr(self, "payment_notify_url") and self.payment_notify_url is not None: - params["paymentNotifyUrl"] = self.payment_notify_url + params['paymentNotifyUrl'] = self.payment_notify_url if hasattr(self, "payment_factor") and self.payment_factor is not None: - params["paymentFactor"] = self.payment_factor - if ( - hasattr(self, "settlement_strategy") - and self.settlement_strategy is not None - ): - params["settlementStrategy"] = self.settlement_strategy - if ( - hasattr(self, "enable_installment_collection") - and self.enable_installment_collection is not None - ): - params["enableInstallmentCollection"] = self.enable_installment_collection + params['paymentFactor'] = self.payment_factor + if hasattr(self, "settlement_strategy") and self.settlement_strategy is not None: + params['settlementStrategy'] = self.settlement_strategy + if hasattr(self, "enable_installment_collection") and self.enable_installment_collection is not None: + params['enableInstallmentCollection'] = self.enable_installment_collection if hasattr(self, "credit_pay_plan") and self.credit_pay_plan is not None: - params["creditPayPlan"] = self.credit_pay_plan + params['creditPayPlan'] = self.credit_pay_plan if hasattr(self, "merchant_region") and self.merchant_region is not None: - params["merchantRegion"] = self.merchant_region + params['merchantRegion'] = self.merchant_region if hasattr(self, "env") and self.env is not None: - params["env"] = self.env + params['env'] = self.env if hasattr(self, "agreement_info") and self.agreement_info is not None: - params["agreementInfo"] = self.agreement_info + params['agreementInfo'] = self.agreement_info if hasattr(self, "risk_data") and self.risk_data is not None: - params["riskData"] = self.risk_data + params['riskData'] = self.risk_data if hasattr(self, "product_scene") and self.product_scene is not None: - params["productScene"] = self.product_scene - if ( - hasattr(self, "saved_payment_methods") - and self.saved_payment_methods is not None - ): - params["savedPaymentMethods"] = self.saved_payment_methods + params['productScene'] = self.product_scene + if hasattr(self, "saved_payment_methods") and self.saved_payment_methods is not None: + params['savedPaymentMethods'] = self.saved_payment_methods if hasattr(self, "locale") and self.locale is not None: - params["locale"] = self.locale - if ( - hasattr(self, "available_payment_method") - and self.available_payment_method is not None - ): - params["availablePaymentMethod"] = self.available_payment_method - if ( - hasattr(self, "payment_expiry_time") - and self.payment_expiry_time is not None - ): - params["paymentExpiryTime"] = self.payment_expiry_time + params['locale'] = self.locale + if hasattr(self, "available_payment_method") and self.available_payment_method is not None: + params['availablePaymentMethod'] = self.available_payment_method + if hasattr(self, "payment_expiry_time") and self.payment_expiry_time is not None: + params['paymentExpiryTime'] = self.payment_expiry_time return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] - if "metadata" in response_body: - self.__metadata = response_body["metadata"] - if "allowedPaymentMethodRegions" in response_body: - self.__allowed_payment_method_regions = response_body[ - "allowedPaymentMethodRegions" - ] - if "customizedInfo" in response_body: + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'metadata' in response_body: + self.__metadata = response_body['metadata'] + if 'allowedPaymentMethodRegions' in response_body: + self.__allowed_payment_method_regions = response_body['allowedPaymentMethodRegions'] + if 'customizedInfo' in response_body: self.__customized_info = CustomizedInfo() - self.__customized_info.parse_rsp_body(response_body["customizedInfo"]) - if "paymentQuote" in response_body: + self.__customized_info.parse_rsp_body(response_body['customizedInfo']) + if 'paymentQuote' in response_body: self.__payment_quote = Quote() - self.__payment_quote.parse_rsp_body(response_body["paymentQuote"]) - if "processingAmount" in response_body: + self.__payment_quote.parse_rsp_body(response_body['paymentQuote']) + if 'processingAmount' in response_body: self.__processing_amount = Amount() - self.__processing_amount.parse_rsp_body(response_body["processingAmount"]) - if "subscriptionPlan" in response_body: + self.__processing_amount.parse_rsp_body(response_body['processingAmount']) + if 'subscriptionPlan' in response_body: self.__subscription_plan = SubscriptionPlan() - self.__subscription_plan.parse_rsp_body(response_body["subscriptionPlan"]) - if "subscriptionInfo" in response_body: + self.__subscription_plan.parse_rsp_body(response_body['subscriptionPlan']) + if 'subscriptionInfo' in response_body: self.__subscription_info = SubscriptionInfo() - self.__subscription_info.parse_rsp_body(response_body["subscriptionInfo"]) - if "userRegion" in response_body: - self.__user_region = response_body["userRegion"] - if "scopes" in response_body: - self.__scopes = response_body["scopes"] - if "productCode" in response_body: - product_code_temp = ProductCodeType.value_of(response_body["productCode"]) + self.__subscription_info.parse_rsp_body(response_body['subscriptionInfo']) + if 'userRegion' in response_body: + self.__user_region = response_body['userRegion'] + if 'scopes' in response_body: + self.__scopes = response_body['scopes'] + if 'productCode' in response_body: + product_code_temp = ProductCodeType.value_of(response_body['productCode']) self.__product_code = product_code_temp - if "paymentRequestId" in response_body: - self.__payment_request_id = response_body["paymentRequestId"] - if "order" in response_body: + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] + if 'order' in response_body: self.__order = Order() - self.__order.parse_rsp_body(response_body["order"]) - if "paymentAmount" in response_body: + self.__order.parse_rsp_body(response_body['order']) + if 'paymentAmount' in response_body: self.__payment_amount = Amount() - self.__payment_amount.parse_rsp_body(response_body["paymentAmount"]) - if "paymentMethod" in response_body: + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'paymentMethod' in response_body: self.__payment_method = PaymentMethod() - self.__payment_method.parse_rsp_body(response_body["paymentMethod"]) - if "paymentSessionExpiryTime" in response_body: - self.__payment_session_expiry_time = response_body[ - "paymentSessionExpiryTime" - ] - if "paymentRedirectUrl" in response_body: - self.__payment_redirect_url = response_body["paymentRedirectUrl"] - if "paymentNotifyUrl" in response_body: - self.__payment_notify_url = response_body["paymentNotifyUrl"] - if "paymentFactor" in response_body: + self.__payment_method.parse_rsp_body(response_body['paymentMethod']) + if 'paymentSessionExpiryTime' in response_body: + self.__payment_session_expiry_time = response_body['paymentSessionExpiryTime'] + if 'paymentRedirectUrl' in response_body: + self.__payment_redirect_url = response_body['paymentRedirectUrl'] + if 'paymentNotifyUrl' in response_body: + self.__payment_notify_url = response_body['paymentNotifyUrl'] + if 'paymentFactor' in response_body: self.__payment_factor = PaymentFactor() - self.__payment_factor.parse_rsp_body(response_body["paymentFactor"]) - if "settlementStrategy" in response_body: + self.__payment_factor.parse_rsp_body(response_body['paymentFactor']) + if 'settlementStrategy' in response_body: self.__settlement_strategy = SettlementStrategy() - self.__settlement_strategy.parse_rsp_body( - response_body["settlementStrategy"] - ) - if "enableInstallmentCollection" in response_body: - self.__enable_installment_collection = response_body[ - "enableInstallmentCollection" - ] - if "creditPayPlan" in response_body: + self.__settlement_strategy.parse_rsp_body(response_body['settlementStrategy']) + if 'enableInstallmentCollection' in response_body: + self.__enable_installment_collection = response_body['enableInstallmentCollection'] + if 'creditPayPlan' in response_body: self.__credit_pay_plan = CreditPayPlan() - self.__credit_pay_plan.parse_rsp_body(response_body["creditPayPlan"]) - if "merchantRegion" in response_body: - self.__merchant_region = response_body["merchantRegion"] - if "env" in response_body: + self.__credit_pay_plan.parse_rsp_body(response_body['creditPayPlan']) + if 'merchantRegion' in response_body: + self.__merchant_region = response_body['merchantRegion'] + if 'env' in response_body: self.__env = Env() - self.__env.parse_rsp_body(response_body["env"]) - if "agreementInfo" in response_body: + self.__env.parse_rsp_body(response_body['env']) + if 'agreementInfo' in response_body: self.__agreement_info = AgreementInfo() - self.__agreement_info.parse_rsp_body(response_body["agreementInfo"]) - if "riskData" in response_body: + self.__agreement_info.parse_rsp_body(response_body['agreementInfo']) + if 'riskData' in response_body: self.__risk_data = RiskData() - self.__risk_data.parse_rsp_body(response_body["riskData"]) - if "productScene" in response_body: - self.__product_scene = response_body["productScene"] - if "savedPaymentMethods" in response_body: + self.__risk_data.parse_rsp_body(response_body['riskData']) + if 'productScene' in response_body: + self.__product_scene = response_body['productScene'] + if 'savedPaymentMethods' in response_body: self.__saved_payment_methods = [] - for item in response_body["savedPaymentMethods"]: + for item in response_body['savedPaymentMethods']: obj = PaymentMethod() obj.parse_rsp_body(item) self.__saved_payment_methods.append(obj) - if "locale" in response_body: - self.__locale = response_body["locale"] - if "availablePaymentMethod" in response_body: + if 'locale' in response_body: + self.__locale = response_body['locale'] + if 'availablePaymentMethod' in response_body: self.__available_payment_method = AvailablePaymentMethod() - self.__available_payment_method.parse_rsp_body( - response_body["availablePaymentMethod"] - ) - if "paymentExpiryTime" in response_body: - self.__payment_expiry_time = response_body["paymentExpiryTime"] + self.__available_payment_method.parse_rsp_body(response_body['availablePaymentMethod']) + if 'paymentExpiryTime' in response_body: + self.__payment_expiry_time = response_body['paymentExpiryTime'] diff --git a/com/alipay/ams/api/request/pay/alipay_refund_request.py b/com/alipay/ams/api/request/pay/alipay_refund_request.py index f11f072..225ef48 100644 --- a/com/alipay/ams/api/request/pay/alipay_refund_request.py +++ b/com/alipay/ams/api/request/pay/alipay_refund_request.py @@ -5,12 +5,12 @@ from com.alipay.ams.api.model.refund_detail import RefundDetail -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayRefundRequest(AlipayRequest): def __init__(self): - super(AlipayRefundRequest, self).__init__("/ams/api/v1/payments/refund") + super(AlipayRefundRequest, self).__init__("/ams/api/v1/payments/refund") self.__metadata = None # type: str self.__customized_info = None # type: CustomizedInfo @@ -26,6 +26,7 @@ def __init__(self): self.__extend_info = None # type: str self.__refund_details = None # type: [RefundDetail] self.__refund_source_account_no = None # type: str + @property def metadata(self): @@ -37,34 +38,36 @@ def metadata(self): @metadata.setter def metadata(self, value): self.__metadata = value - @property def customized_info(self): - """Gets the customized_info of this AlipayRefundRequest.""" + """Gets the customized_info of this AlipayRefundRequest. + + """ return self.__customized_info @customized_info.setter def customized_info(self, value): self.__customized_info = value - @property def capture_id(self): - """Gets the capture_id of this AlipayRefundRequest.""" + """Gets the capture_id of this AlipayRefundRequest. + + """ return self.__capture_id @capture_id.setter def capture_id(self, value): self.__capture_id = value - @property def refund_to_bank_info(self): - """Gets the refund_to_bank_info of this AlipayRefundRequest.""" + """Gets the refund_to_bank_info of this AlipayRefundRequest. + + """ return self.__refund_to_bank_info @refund_to_bank_info.setter def refund_to_bank_info(self, value): self.__refund_to_bank_info = value - @property def refund_request_id(self): """ @@ -75,7 +78,6 @@ def refund_request_id(self): @refund_request_id.setter def refund_request_id(self, value): self.__refund_request_id = value - @property def payment_id(self): """ @@ -86,27 +88,26 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def reference_refund_id(self): """ - The unique ID to identify a refund, which is assigned by the merchant that directly provides services or goods to the customer. Note: Specify this field if this value is needed for internal use or reconciliation. More information: Maximum length: 64 characters + The unique ID to identify a refund, which is assigned by the merchant that directly provides services or goods to the customer. Note: Specify this field if this value is needed for internal use or reconciliation. More information: Maximum length: 64 characters """ return self.__reference_refund_id @reference_refund_id.setter def reference_refund_id(self, value): self.__reference_refund_id = value - @property def refund_amount(self): - """Gets the refund_amount of this AlipayRefundRequest.""" + """Gets the refund_amount of this AlipayRefundRequest. + + """ return self.__refund_amount @refund_amount.setter def refund_amount(self, value): self.__refund_amount = value - @property def refund_reason(self): """ @@ -117,136 +118,131 @@ def refund_reason(self): @refund_reason.setter def refund_reason(self, value): self.__refund_reason = value - @property def refund_notify_url(self): """ - The URL that is used to receive the refund result notification. The URL must be either specified in the request or set in Antom Dashboard. Note: Specify this field if you want to receive an asynchronous notification of the refund result. If the refund notification URL is specified in both the request and Antom Dashboard, the value specified in the request takes precedence. More information: Maximum length: 1024 characters + The URL that is used to receive the refund result notification. The URL must be either specified in the request or set in Antom Dashboard. Note: Specify this field if you want to receive an asynchronous notification of the refund result. If the refund notification URL is specified in both the request and Antom Dashboard, the value specified in the request takes precedence. More information: Maximum length: 1024 characters """ return self.__refund_notify_url @refund_notify_url.setter def refund_notify_url(self, value): self.__refund_notify_url = value - @property def is_async_refund(self): - """Gets the is_async_refund of this AlipayRefundRequest.""" + """Gets the is_async_refund of this AlipayRefundRequest. + + """ return self.__is_async_refund @is_async_refund.setter def is_async_refund(self, value): self.__is_async_refund = value - @property def extend_info(self): - """Gets the extend_info of this AlipayRefundRequest.""" + """Gets the extend_info of this AlipayRefundRequest. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def refund_details(self): - """Gets the refund_details of this AlipayRefundRequest.""" + """Gets the refund_details of this AlipayRefundRequest. + + """ return self.__refund_details @refund_details.setter def refund_details(self, value): self.__refund_details = value - @property def refund_source_account_no(self): - """Gets the refund_source_account_no of this AlipayRefundRequest.""" + """Gets the refund_source_account_no of this AlipayRefundRequest. + + """ return self.__refund_source_account_no @refund_source_account_no.setter def refund_source_account_no(self, value): self.__refund_source_account_no = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "metadata") and self.metadata is not None: - params["metadata"] = self.metadata + params['metadata'] = self.metadata if hasattr(self, "customized_info") and self.customized_info is not None: - params["customizedInfo"] = self.customized_info + params['customizedInfo'] = self.customized_info if hasattr(self, "capture_id") and self.capture_id is not None: - params["captureId"] = self.capture_id - if ( - hasattr(self, "refund_to_bank_info") - and self.refund_to_bank_info is not None - ): - params["refundToBankInfo"] = self.refund_to_bank_info + params['captureId'] = self.capture_id + if hasattr(self, "refund_to_bank_info") and self.refund_to_bank_info is not None: + params['refundToBankInfo'] = self.refund_to_bank_info if hasattr(self, "refund_request_id") and self.refund_request_id is not None: - params["refundRequestId"] = self.refund_request_id + params['refundRequestId'] = self.refund_request_id if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id - if ( - hasattr(self, "reference_refund_id") - and self.reference_refund_id is not None - ): - params["referenceRefundId"] = self.reference_refund_id + params['paymentId'] = self.payment_id + if hasattr(self, "reference_refund_id") and self.reference_refund_id is not None: + params['referenceRefundId'] = self.reference_refund_id if hasattr(self, "refund_amount") and self.refund_amount is not None: - params["refundAmount"] = self.refund_amount + params['refundAmount'] = self.refund_amount if hasattr(self, "refund_reason") and self.refund_reason is not None: - params["refundReason"] = self.refund_reason + params['refundReason'] = self.refund_reason if hasattr(self, "refund_notify_url") and self.refund_notify_url is not None: - params["refundNotifyUrl"] = self.refund_notify_url + params['refundNotifyUrl'] = self.refund_notify_url if hasattr(self, "is_async_refund") and self.is_async_refund is not None: - params["isAsyncRefund"] = self.is_async_refund + params['isAsyncRefund'] = self.is_async_refund if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "refund_details") and self.refund_details is not None: - params["refundDetails"] = self.refund_details - if ( - hasattr(self, "refund_source_account_no") - and self.refund_source_account_no is not None - ): - params["refundSourceAccountNo"] = self.refund_source_account_no + params['refundDetails'] = self.refund_details + if hasattr(self, "refund_source_account_no") and self.refund_source_account_no is not None: + params['refundSourceAccountNo'] = self.refund_source_account_no return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "metadata" in response_body: - self.__metadata = response_body["metadata"] - if "customizedInfo" in response_body: + if 'metadata' in response_body: + self.__metadata = response_body['metadata'] + if 'customizedInfo' in response_body: self.__customized_info = CustomizedInfo() - self.__customized_info.parse_rsp_body(response_body["customizedInfo"]) - if "captureId" in response_body: - self.__capture_id = response_body["captureId"] - if "refundToBankInfo" in response_body: + self.__customized_info.parse_rsp_body(response_body['customizedInfo']) + if 'captureId' in response_body: + self.__capture_id = response_body['captureId'] + if 'refundToBankInfo' in response_body: self.__refund_to_bank_info = RefundToBankInfo() - self.__refund_to_bank_info.parse_rsp_body(response_body["refundToBankInfo"]) - if "refundRequestId" in response_body: - self.__refund_request_id = response_body["refundRequestId"] - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "referenceRefundId" in response_body: - self.__reference_refund_id = response_body["referenceRefundId"] - if "refundAmount" in response_body: + self.__refund_to_bank_info.parse_rsp_body(response_body['refundToBankInfo']) + if 'refundRequestId' in response_body: + self.__refund_request_id = response_body['refundRequestId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'referenceRefundId' in response_body: + self.__reference_refund_id = response_body['referenceRefundId'] + if 'refundAmount' in response_body: self.__refund_amount = Amount() - self.__refund_amount.parse_rsp_body(response_body["refundAmount"]) - if "refundReason" in response_body: - self.__refund_reason = response_body["refundReason"] - if "refundNotifyUrl" in response_body: - self.__refund_notify_url = response_body["refundNotifyUrl"] - if "isAsyncRefund" in response_body: - self.__is_async_refund = response_body["isAsyncRefund"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "refundDetails" in response_body: + self.__refund_amount.parse_rsp_body(response_body['refundAmount']) + if 'refundReason' in response_body: + self.__refund_reason = response_body['refundReason'] + if 'refundNotifyUrl' in response_body: + self.__refund_notify_url = response_body['refundNotifyUrl'] + if 'isAsyncRefund' in response_body: + self.__is_async_refund = response_body['isAsyncRefund'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'refundDetails' in response_body: self.__refund_details = [] - for item in response_body["refundDetails"]: + for item in response_body['refundDetails']: obj = RefundDetail() obj.parse_rsp_body(item) self.__refund_details.append(obj) - if "refundSourceAccountNo" in response_body: - self.__refund_source_account_no = response_body["refundSourceAccountNo"] + if 'refundSourceAccountNo' in response_body: + self.__refund_source_account_no = response_body['refundSourceAccountNo'] diff --git a/com/alipay/ams/api/request/pay/alipay_vaulting_payment_method_request.py b/com/alipay/ams/api/request/pay/alipay_vaulting_payment_method_request.py index 72fd1fe..ebbafcb 100644 --- a/com/alipay/ams/api/request/pay/alipay_vaulting_payment_method_request.py +++ b/com/alipay/ams/api/request/pay/alipay_vaulting_payment_method_request.py @@ -4,14 +4,12 @@ from com.alipay.ams.api.model.customized_info import CustomizedInfo -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayVaultingPaymentMethodRequest(AlipayRequest): def __init__(self): - super(AlipayVaultingPaymentMethodRequest, self).__init__( - "/ams/api/v1/vaults/vaultPaymentMethod" - ) + super(AlipayVaultingPaymentMethodRequest, self).__init__("/ams/api/v1/vaults/vaultPaymentMethod") self.__merchant_account_id = None # type: str self.__metadata = None # type: str @@ -23,6 +21,7 @@ def __init__(self): self.__env = None # type: Env self.__vaulting_currency = None # type: str self.__customized_info = None # type: CustomizedInfo + @property def merchant_account_id(self): @@ -34,7 +33,6 @@ def merchant_account_id(self): @merchant_account_id.setter def merchant_account_id(self, value): self.__merchant_account_id = value - @property def metadata(self): """ @@ -45,7 +43,6 @@ def metadata(self): @metadata.setter def metadata(self, value): self.__metadata = value - @property def vaulting_request_id(self): """ @@ -56,7 +53,6 @@ def vaulting_request_id(self): @vaulting_request_id.setter def vaulting_request_id(self, value): self.__vaulting_request_id = value - @property def vaulting_notification_url(self): """ @@ -67,18 +63,16 @@ def vaulting_notification_url(self): @vaulting_notification_url.setter def vaulting_notification_url(self, value): self.__vaulting_notification_url = value - @property def redirect_url(self): """ - The merchant page URL that the buyer is redirected to after the vaulting process is completed. More information: Maximum length: 2048 characters + The merchant page URL that the buyer is redirected to after the vaulting process is completed. More information: Maximum length: 2048 characters """ return self.__redirect_url @redirect_url.setter def redirect_url(self, value): self.__redirect_url = value - @property def merchant_region(self): """ @@ -89,110 +83,101 @@ def merchant_region(self): @merchant_region.setter def merchant_region(self, value): self.__merchant_region = value - @property def payment_method_detail(self): - """Gets the payment_method_detail of this AlipayVaultingPaymentMethodRequest.""" + """Gets the payment_method_detail of this AlipayVaultingPaymentMethodRequest. + + """ return self.__payment_method_detail @payment_method_detail.setter def payment_method_detail(self, value): self.__payment_method_detail = value - @property def env(self): - """Gets the env of this AlipayVaultingPaymentMethodRequest.""" + """Gets the env of this AlipayVaultingPaymentMethodRequest. + + """ return self.__env @env.setter def env(self, value): self.__env = value - @property def vaulting_currency(self): - """Gets the vaulting_currency of this AlipayVaultingPaymentMethodRequest.""" + """Gets the vaulting_currency of this AlipayVaultingPaymentMethodRequest. + + """ return self.__vaulting_currency @vaulting_currency.setter def vaulting_currency(self, value): self.__vaulting_currency = value - @property def customized_info(self): - """Gets the customized_info of this AlipayVaultingPaymentMethodRequest.""" + """Gets the customized_info of this AlipayVaultingPaymentMethodRequest. + + """ return self.__customized_info @customized_info.setter def customized_info(self, value): self.__customized_info = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id if hasattr(self, "metadata") and self.metadata is not None: - params["metadata"] = self.metadata - if ( - hasattr(self, "vaulting_request_id") - and self.vaulting_request_id is not None - ): - params["vaultingRequestId"] = self.vaulting_request_id - if ( - hasattr(self, "vaulting_notification_url") - and self.vaulting_notification_url is not None - ): - params["vaultingNotificationUrl"] = self.vaulting_notification_url + params['metadata'] = self.metadata + if hasattr(self, "vaulting_request_id") and self.vaulting_request_id is not None: + params['vaultingRequestId'] = self.vaulting_request_id + if hasattr(self, "vaulting_notification_url") and self.vaulting_notification_url is not None: + params['vaultingNotificationUrl'] = self.vaulting_notification_url if hasattr(self, "redirect_url") and self.redirect_url is not None: - params["redirectUrl"] = self.redirect_url + params['redirectUrl'] = self.redirect_url if hasattr(self, "merchant_region") and self.merchant_region is not None: - params["merchantRegion"] = self.merchant_region - if ( - hasattr(self, "payment_method_detail") - and self.payment_method_detail is not None - ): - params["paymentMethodDetail"] = self.payment_method_detail + params['merchantRegion'] = self.merchant_region + if hasattr(self, "payment_method_detail") and self.payment_method_detail is not None: + params['paymentMethodDetail'] = self.payment_method_detail if hasattr(self, "env") and self.env is not None: - params["env"] = self.env + params['env'] = self.env if hasattr(self, "vaulting_currency") and self.vaulting_currency is not None: - params["vaultingCurrency"] = self.vaulting_currency + params['vaultingCurrency'] = self.vaulting_currency if hasattr(self, "customized_info") and self.customized_info is not None: - params["customizedInfo"] = self.customized_info + params['customizedInfo'] = self.customized_info return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] - if "metadata" in response_body: - self.__metadata = response_body["metadata"] - if "vaultingRequestId" in response_body: - self.__vaulting_request_id = response_body["vaultingRequestId"] - if "vaultingNotificationUrl" in response_body: - self.__vaulting_notification_url = response_body["vaultingNotificationUrl"] - if "redirectUrl" in response_body: - self.__redirect_url = response_body["redirectUrl"] - if "merchantRegion" in response_body: - self.__merchant_region = response_body["merchantRegion"] - if "paymentMethodDetail" in response_body: + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'metadata' in response_body: + self.__metadata = response_body['metadata'] + if 'vaultingRequestId' in response_body: + self.__vaulting_request_id = response_body['vaultingRequestId'] + if 'vaultingNotificationUrl' in response_body: + self.__vaulting_notification_url = response_body['vaultingNotificationUrl'] + if 'redirectUrl' in response_body: + self.__redirect_url = response_body['redirectUrl'] + if 'merchantRegion' in response_body: + self.__merchant_region = response_body['merchantRegion'] + if 'paymentMethodDetail' in response_body: self.__payment_method_detail = PaymentMethodDetail() - self.__payment_method_detail.parse_rsp_body( - response_body["paymentMethodDetail"] - ) - if "env" in response_body: + self.__payment_method_detail.parse_rsp_body(response_body['paymentMethodDetail']) + if 'env' in response_body: self.__env = Env() - self.__env.parse_rsp_body(response_body["env"]) - if "vaultingCurrency" in response_body: - self.__vaulting_currency = response_body["vaultingCurrency"] - if "customizedInfo" in response_body: + self.__env.parse_rsp_body(response_body['env']) + if 'vaultingCurrency' in response_body: + self.__vaulting_currency = response_body['vaultingCurrency'] + if 'customizedInfo' in response_body: self.__customized_info = CustomizedInfo() - self.__customized_info.parse_rsp_body(response_body["customizedInfo"]) + self.__customized_info.parse_rsp_body(response_body['customizedInfo']) diff --git a/com/alipay/ams/api/request/pay/alipay_vaulting_query_request.py b/com/alipay/ams/api/request/pay/alipay_vaulting_query_request.py index 129ac4a..7866a33 100644 --- a/com/alipay/ams/api/request/pay/alipay_vaulting_query_request.py +++ b/com/alipay/ams/api/request/pay/alipay_vaulting_query_request.py @@ -1,17 +1,16 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayVaultingQueryRequest(AlipayRequest): def __init__(self): - super(AlipayVaultingQueryRequest, self).__init__( - "/ams/api/v1/vaults/inquireVaulting" - ) + super(AlipayVaultingQueryRequest, self).__init__("/ams/api/v1/vaults/inquireVaulting") self.__vaulting_request_id = None # type: str self.__merchant_account_id = None # type: str + @property def vaulting_request_id(self): @@ -23,7 +22,6 @@ def vaulting_request_id(self): @vaulting_request_id.setter def vaulting_request_id(self, value): self.__vaulting_request_id = value - @property def merchant_account_id(self): """ @@ -35,30 +33,25 @@ def merchant_account_id(self): def merchant_account_id(self, value): self.__merchant_account_id = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "vaulting_request_id") - and self.vaulting_request_id is not None - ): - params["vaultingRequestId"] = self.vaulting_request_id - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + if hasattr(self, "vaulting_request_id") and self.vaulting_request_id is not None: + params['vaultingRequestId'] = self.vaulting_request_id + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "vaultingRequestId" in response_body: - self.__vaulting_request_id = response_body["vaultingRequestId"] - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] + if 'vaultingRequestId' in response_body: + self.__vaulting_request_id = response_body['vaultingRequestId'] + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] diff --git a/com/alipay/ams/api/request/pay/alipay_vaulting_session_request.py b/com/alipay/ams/api/request/pay/alipay_vaulting_session_request.py index 1c7b987..b3ea7c1 100644 --- a/com/alipay/ams/api/request/pay/alipay_vaulting_session_request.py +++ b/com/alipay/ams/api/request/pay/alipay_vaulting_session_request.py @@ -1,14 +1,12 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipayVaultingSessionRequest(AlipayRequest): def __init__(self): - super(AlipayVaultingSessionRequest, self).__init__( - "/ams/api/v1/vaults/createVaultingSession" - ) + super(AlipayVaultingSessionRequest, self).__init__("/ams/api/v1/vaults/createVaultingSession") self.__payment_method_type = None # type: str self.__vaulting_request_id = None # type: str @@ -16,6 +14,7 @@ def __init__(self): self.__redirect_url = None # type: str self.__merchant_region = None # type: str self.__is3_ds_authentication = None # type: bool + @property def payment_method_type(self): @@ -27,18 +26,16 @@ def payment_method_type(self): @payment_method_type.setter def payment_method_type(self, value): self.__payment_method_type = value - @property def vaulting_request_id(self): """ - The unique ID that is assigned by a merchant to identify a card vaulting request. More information: Maximum length: 64 characters + The unique ID that is assigned by a merchant to identify a card vaulting request. More information: Maximum length: 64 characters """ return self.__vaulting_request_id @vaulting_request_id.setter def vaulting_request_id(self, value): self.__vaulting_request_id = value - @property def vaulting_notification_url(self): """ @@ -49,18 +46,16 @@ def vaulting_notification_url(self): @vaulting_notification_url.setter def vaulting_notification_url(self, value): self.__vaulting_notification_url = value - @property def redirect_url(self): """ - The merchant page URL that the buyer is redirected to after the vaulting is completed. Note: Specify this parameter if you want to redirect the buyer to your page directly after the vaulting is completed. More information: Maximum length: 2048 characters + The merchant page URL that the buyer is redirected to after the vaulting is completed. Note: Specify this parameter if you want to redirect the buyer to your page directly after the vaulting is completed. More information: Maximum length: 2048 characters """ return self.__redirect_url @redirect_url.setter def redirect_url(self, value): self.__redirect_url = value - @property def merchant_region(self): """ @@ -71,7 +66,6 @@ def merchant_region(self): @merchant_region.setter def merchant_region(self, value): self.__merchant_region = value - @property def is3_ds_authentication(self): """ @@ -83,52 +77,41 @@ def is3_ds_authentication(self): def is3_ds_authentication(self, value): self.__is3_ds_authentication = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "payment_method_type") - and self.payment_method_type is not None - ): - params["paymentMethodType"] = self.payment_method_type - if ( - hasattr(self, "vaulting_request_id") - and self.vaulting_request_id is not None - ): - params["vaultingRequestId"] = self.vaulting_request_id - if ( - hasattr(self, "vaulting_notification_url") - and self.vaulting_notification_url is not None - ): - params["vaultingNotificationUrl"] = self.vaulting_notification_url + if hasattr(self, "payment_method_type") and self.payment_method_type is not None: + params['paymentMethodType'] = self.payment_method_type + if hasattr(self, "vaulting_request_id") and self.vaulting_request_id is not None: + params['vaultingRequestId'] = self.vaulting_request_id + if hasattr(self, "vaulting_notification_url") and self.vaulting_notification_url is not None: + params['vaultingNotificationUrl'] = self.vaulting_notification_url if hasattr(self, "redirect_url") and self.redirect_url is not None: - params["redirectUrl"] = self.redirect_url + params['redirectUrl'] = self.redirect_url if hasattr(self, "merchant_region") and self.merchant_region is not None: - params["merchantRegion"] = self.merchant_region - if ( - hasattr(self, "is3_ds_authentication") - and self.is3_ds_authentication is not None - ): - params["is3DSAuthentication"] = self.is3_ds_authentication + params['merchantRegion'] = self.merchant_region + if hasattr(self, "is3_ds_authentication") and self.is3_ds_authentication is not None: + params['is3DSAuthentication'] = self.is3_ds_authentication return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "paymentMethodType" in response_body: - self.__payment_method_type = response_body["paymentMethodType"] - if "vaultingRequestId" in response_body: - self.__vaulting_request_id = response_body["vaultingRequestId"] - if "vaultingNotificationUrl" in response_body: - self.__vaulting_notification_url = response_body["vaultingNotificationUrl"] - if "redirectUrl" in response_body: - self.__redirect_url = response_body["redirectUrl"] - if "merchantRegion" in response_body: - self.__merchant_region = response_body["merchantRegion"] - if "is3DSAuthentication" in response_body: - self.__is3_ds_authentication = response_body["is3DSAuthentication"] + if 'paymentMethodType' in response_body: + self.__payment_method_type = response_body['paymentMethodType'] + if 'vaultingRequestId' in response_body: + self.__vaulting_request_id = response_body['vaultingRequestId'] + if 'vaultingNotificationUrl' in response_body: + self.__vaulting_notification_url = response_body['vaultingNotificationUrl'] + if 'redirectUrl' in response_body: + self.__redirect_url = response_body['redirectUrl'] + if 'merchantRegion' in response_body: + self.__merchant_region = response_body['merchantRegion'] + if 'is3DSAuthentication' in response_body: + self.__is3_ds_authentication = response_body['is3DSAuthentication'] diff --git a/com/alipay/ams/api/request/pay/alipay_vaults_fetch_nonce_request.py b/com/alipay/ams/api/request/pay/alipay_vaults_fetch_nonce_request.py new file mode 100644 index 0000000..dc18922 --- /dev/null +++ b/com/alipay/ams/api/request/pay/alipay_vaults_fetch_nonce_request.py @@ -0,0 +1,44 @@ +import json +from com.alipay.ams.api.model.card import Card + + + +from com.alipay.ams.api.request.alipay_request import AlipayRequest + +class AlipayVaultsFetchNonceRequest(AlipayRequest): + def __init__(self): + super(AlipayVaultsFetchNonceRequest, self).__init__("/ams/api/v1/vaults/fetchNonce") + + self.__card = None # type: Card + + + @property + def card(self): + """Gets the card of this AlipayVaultsFetchNonceRequest. + + """ + return self.__card + + @card.setter + def card(self, value): + self.__card = value + + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) + return json_str + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "card") and self.card is not None: + params['card'] = self.card + return params + + + def parse_rsp_body(self, response_body): + if isinstance(response_body, str): + response_body = json.loads(response_body) + if 'card' in response_body: + self.__card = Card() + self.__card.parse_rsp_body(response_body['card']) diff --git a/com/alipay/ams/api/request/pay/ams_api_v1_payments_capture_post_request.py b/com/alipay/ams/api/request/pay/ams_api_v1_payments_capture_post_request.py index 509ca42..3a13ea8 100644 --- a/com/alipay/ams/api/request/pay/ams_api_v1_payments_capture_post_request.py +++ b/com/alipay/ams/api/request/pay/ams_api_v1_payments_capture_post_request.py @@ -2,19 +2,18 @@ from com.alipay.ams.api.model.amount import Amount -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AmsApiV1PaymentsCapturePostRequest(AlipayRequest): def __init__(self): - super(AmsApiV1PaymentsCapturePostRequest, self).__init__( - "/ams/api/v1/payments/capture" - ) + super(AmsApiV1PaymentsCapturePostRequest, self).__init__("/ams/api/v1/payments/capture") self.__capture_request_id = None # type: str self.__payment_id = None # type: str self.__capture_amount = None # type: Amount self.__is_last_capture = None # type: bool + @property def capture_request_id(self): @@ -26,7 +25,6 @@ def capture_request_id(self): @capture_request_id.setter def capture_request_id(self, value): self.__capture_request_id = value - @property def payment_id(self): """ @@ -37,52 +35,55 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def capture_amount(self): - """Gets the capture_amount of this AmsApiV1PaymentsCapturePostRequest.""" + """Gets the capture_amount of this AmsApiV1PaymentsCapturePostRequest. + + """ return self.__capture_amount @capture_amount.setter def capture_amount(self, value): self.__capture_amount = value - @property def is_last_capture(self): - """Gets the is_last_capture of this AmsApiV1PaymentsCapturePostRequest.""" + """Gets the is_last_capture of this AmsApiV1PaymentsCapturePostRequest. + + """ return self.__is_last_capture @is_last_capture.setter def is_last_capture(self, value): self.__is_last_capture = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "capture_request_id") and self.capture_request_id is not None: - params["captureRequestId"] = self.capture_request_id + params['captureRequestId'] = self.capture_request_id if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id + params['paymentId'] = self.payment_id if hasattr(self, "capture_amount") and self.capture_amount is not None: - params["captureAmount"] = self.capture_amount + params['captureAmount'] = self.capture_amount if hasattr(self, "is_last_capture") and self.is_last_capture is not None: - params["isLastCapture"] = self.is_last_capture + params['isLastCapture'] = self.is_last_capture return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "captureRequestId" in response_body: - self.__capture_request_id = response_body["captureRequestId"] - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "captureAmount" in response_body: + if 'captureRequestId' in response_body: + self.__capture_request_id = response_body['captureRequestId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'captureAmount' in response_body: self.__capture_amount = Amount() - self.__capture_amount.parse_rsp_body(response_body["captureAmount"]) - if "isLastCapture" in response_body: - self.__is_last_capture = response_body["isLastCapture"] + self.__capture_amount.parse_rsp_body(response_body['captureAmount']) + if 'isLastCapture' in response_body: + self.__is_last_capture = response_body['isLastCapture'] diff --git a/com/alipay/ams/api/request/pay/ams_api_v1_payments_inquiry_refund_post_request.py b/com/alipay/ams/api/request/pay/ams_api_v1_payments_inquiry_refund_post_request.py index 9b729ab..a841d5f 100644 --- a/com/alipay/ams/api/request/pay/ams_api_v1_payments_inquiry_refund_post_request.py +++ b/com/alipay/ams/api/request/pay/ams_api_v1_payments_inquiry_refund_post_request.py @@ -1,18 +1,17 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AmsApiV1PaymentsInquiryRefundPostRequest(AlipayRequest): def __init__(self): - super(AmsApiV1PaymentsInquiryRefundPostRequest, self).__init__( - "/ams/api/v1/payments/inquiryRefund" - ) + super(AmsApiV1PaymentsInquiryRefundPostRequest, self).__init__("/ams/api/v1/payments/inquiryRefund") self.__refund_request_id = None # type: str self.__refund_id = None # type: str self.__merchant_account_id = None # type: str + @property def refund_request_id(self): @@ -24,7 +23,6 @@ def refund_request_id(self): @refund_request_id.setter def refund_request_id(self, value): self.__refund_request_id = value - @property def refund_id(self): """ @@ -35,41 +33,40 @@ def refund_id(self): @refund_id.setter def refund_id(self, value): self.__refund_id = value - @property def merchant_account_id(self): - """Gets the merchant_account_id of this AmsApiV1PaymentsInquiryRefundPostRequest.""" + """Gets the merchant_account_id of this AmsApiV1PaymentsInquiryRefundPostRequest. + + """ return self.__merchant_account_id @merchant_account_id.setter def merchant_account_id(self, value): self.__merchant_account_id = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "refund_request_id") and self.refund_request_id is not None: - params["refundRequestId"] = self.refund_request_id + params['refundRequestId'] = self.refund_request_id if hasattr(self, "refund_id") and self.refund_id is not None: - params["refundId"] = self.refund_id - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + params['refundId'] = self.refund_id + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "refundRequestId" in response_body: - self.__refund_request_id = response_body["refundRequestId"] - if "refundId" in response_body: - self.__refund_id = response_body["refundId"] - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] + if 'refundRequestId' in response_body: + self.__refund_request_id = response_body['refundRequestId'] + if 'refundId' in response_body: + self.__refund_id = response_body['refundId'] + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] diff --git a/com/alipay/ams/api/request/subscription/alipay_subscription_cancel_request.py b/com/alipay/ams/api/request/subscription/alipay_subscription_cancel_request.py index ffdcdd5..b6b3c0a 100644 --- a/com/alipay/ams/api/request/subscription/alipay_subscription_cancel_request.py +++ b/com/alipay/ams/api/request/subscription/alipay_subscription_cancel_request.py @@ -1,18 +1,17 @@ import json -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipaySubscriptionCancelRequest(AlipayRequest): def __init__(self): - super(AlipaySubscriptionCancelRequest, self).__init__( - "/ams/api/v1/subscriptions/cancel" - ) + super(AlipaySubscriptionCancelRequest, self).__init__("/ams/api/v1/subscriptions/cancel") self.__subscription_id = None # type: str self.__subscription_request_id = None # type: str self.__cancellation_type = None # type: str + @property def subscription_id(self): @@ -24,18 +23,16 @@ def subscription_id(self): @subscription_id.setter def subscription_id(self, value): self.__subscription_id = value - @property def subscription_request_id(self): """ - The unique ID assigned by a merchant to identify a subscription request. Note: Specify at least one of subscriptionId and subscriptionRequestId. A one-to-one correspondence between paymentId and paymentRequestId exists. More information: Maximum length: 64 characters + The unique ID assigned by a merchant to identify a subscription request. Note: Specify at least one of subscriptionId and subscriptionRequestId. A one-to-one correspondence between paymentId and paymentRequestId exists. More information: Maximum length: 64 characters """ return self.__subscription_request_id @subscription_request_id.setter def subscription_request_id(self, value): self.__subscription_request_id = value - @property def cancellation_type(self): """ @@ -47,31 +44,29 @@ def cancellation_type(self): def cancellation_type(self, value): self.__cancellation_type = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "subscription_id") and self.subscription_id is not None: - params["subscriptionId"] = self.subscription_id - if ( - hasattr(self, "subscription_request_id") - and self.subscription_request_id is not None - ): - params["subscriptionRequestId"] = self.subscription_request_id + params['subscriptionId'] = self.subscription_id + if hasattr(self, "subscription_request_id") and self.subscription_request_id is not None: + params['subscriptionRequestId'] = self.subscription_request_id if hasattr(self, "cancellation_type") and self.cancellation_type is not None: - params["cancellationType"] = self.cancellation_type + params['cancellationType'] = self.cancellation_type return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "subscriptionId" in response_body: - self.__subscription_id = response_body["subscriptionId"] - if "subscriptionRequestId" in response_body: - self.__subscription_request_id = response_body["subscriptionRequestId"] - if "cancellationType" in response_body: - self.__cancellation_type = response_body["cancellationType"] + if 'subscriptionId' in response_body: + self.__subscription_id = response_body['subscriptionId'] + if 'subscriptionRequestId' in response_body: + self.__subscription_request_id = response_body['subscriptionRequestId'] + if 'cancellationType' in response_body: + self.__cancellation_type = response_body['cancellationType'] diff --git a/com/alipay/ams/api/request/subscription/alipay_subscription_change_request.py b/com/alipay/ams/api/request/subscription/alipay_subscription_change_request.py index b161a20..b85247f 100644 --- a/com/alipay/ams/api/request/subscription/alipay_subscription_change_request.py +++ b/com/alipay/ams/api/request/subscription/alipay_subscription_change_request.py @@ -6,14 +6,12 @@ from com.alipay.ams.api.model.amount import Amount -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipaySubscriptionChangeRequest(AlipayRequest): def __init__(self): - super(AlipaySubscriptionChangeRequest, self).__init__( - "/ams/api/v1/subscriptions/change" - ) + super(AlipaySubscriptionChangeRequest, self).__init__("/ams/api/v1/subscriptions/change") self.__allow_accumulate = None # type: bool self.__max_accumulate_amount = None # type: Amount @@ -27,6 +25,7 @@ def __init__(self): self.__order_info = None # type: OrderInfo self.__payment_amount = None # type: Amount self.__payment_amount_difference = None # type: Amount + @property def allow_accumulate(self): @@ -38,16 +37,16 @@ def allow_accumulate(self): @allow_accumulate.setter def allow_accumulate(self, value): self.__allow_accumulate = value - @property def max_accumulate_amount(self): - """Gets the max_accumulate_amount of this AlipaySubscriptionChangeRequest.""" + """Gets the max_accumulate_amount of this AlipaySubscriptionChangeRequest. + + """ return self.__max_accumulate_amount @max_accumulate_amount.setter def max_accumulate_amount(self, value): self.__max_accumulate_amount = value - @property def subscription_change_request_id(self): """ @@ -58,7 +57,6 @@ def subscription_change_request_id(self): @subscription_change_request_id.setter def subscription_change_request_id(self, value): self.__subscription_change_request_id = value - @property def subscription_id(self): """ @@ -69,7 +67,6 @@ def subscription_id(self): @subscription_id.setter def subscription_id(self, value): self.__subscription_id = value - @property def subscription_description(self): """ @@ -80,7 +77,6 @@ def subscription_description(self): @subscription_description.setter def subscription_description(self, value): self.__subscription_description = value - @property def subscription_start_time(self): """ @@ -91,7 +87,6 @@ def subscription_start_time(self): @subscription_start_time.setter def subscription_start_time(self, value): self.__subscription_start_time = value - @property def subscription_end_time(self): """ @@ -102,16 +97,16 @@ def subscription_end_time(self): @subscription_end_time.setter def subscription_end_time(self, value): self.__subscription_end_time = value - @property def period_rule(self): - """Gets the period_rule of this AlipaySubscriptionChangeRequest.""" + """Gets the period_rule of this AlipaySubscriptionChangeRequest. + + """ return self.__period_rule @period_rule.setter def period_rule(self, value): self.__period_rule = value - @property def subscription_expiry_time(self): """ @@ -122,124 +117,101 @@ def subscription_expiry_time(self): @subscription_expiry_time.setter def subscription_expiry_time(self, value): self.__subscription_expiry_time = value - @property def order_info(self): - """Gets the order_info of this AlipaySubscriptionChangeRequest.""" + """Gets the order_info of this AlipaySubscriptionChangeRequest. + + """ return self.__order_info @order_info.setter def order_info(self, value): self.__order_info = value - @property def payment_amount(self): - """Gets the payment_amount of this AlipaySubscriptionChangeRequest.""" + """Gets the payment_amount of this AlipaySubscriptionChangeRequest. + + """ return self.__payment_amount @payment_amount.setter def payment_amount(self, value): self.__payment_amount = value - @property def payment_amount_difference(self): - """Gets the payment_amount_difference of this AlipaySubscriptionChangeRequest.""" + """Gets the payment_amount_difference of this AlipaySubscriptionChangeRequest. + + """ return self.__payment_amount_difference @payment_amount_difference.setter def payment_amount_difference(self, value): self.__payment_amount_difference = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "allow_accumulate") and self.allow_accumulate is not None: - params["allowAccumulate"] = self.allow_accumulate - if ( - hasattr(self, "max_accumulate_amount") - and self.max_accumulate_amount is not None - ): - params["maxAccumulateAmount"] = self.max_accumulate_amount - if ( - hasattr(self, "subscription_change_request_id") - and self.subscription_change_request_id is not None - ): - params["subscriptionChangeRequestId"] = self.subscription_change_request_id + params['allowAccumulate'] = self.allow_accumulate + if hasattr(self, "max_accumulate_amount") and self.max_accumulate_amount is not None: + params['maxAccumulateAmount'] = self.max_accumulate_amount + if hasattr(self, "subscription_change_request_id") and self.subscription_change_request_id is not None: + params['subscriptionChangeRequestId'] = self.subscription_change_request_id if hasattr(self, "subscription_id") and self.subscription_id is not None: - params["subscriptionId"] = self.subscription_id - if ( - hasattr(self, "subscription_description") - and self.subscription_description is not None - ): - params["subscriptionDescription"] = self.subscription_description - if ( - hasattr(self, "subscription_start_time") - and self.subscription_start_time is not None - ): - params["subscriptionStartTime"] = self.subscription_start_time - if ( - hasattr(self, "subscription_end_time") - and self.subscription_end_time is not None - ): - params["subscriptionEndTime"] = self.subscription_end_time + params['subscriptionId'] = self.subscription_id + if hasattr(self, "subscription_description") and self.subscription_description is not None: + params['subscriptionDescription'] = self.subscription_description + if hasattr(self, "subscription_start_time") and self.subscription_start_time is not None: + params['subscriptionStartTime'] = self.subscription_start_time + if hasattr(self, "subscription_end_time") and self.subscription_end_time is not None: + params['subscriptionEndTime'] = self.subscription_end_time if hasattr(self, "period_rule") and self.period_rule is not None: - params["periodRule"] = self.period_rule - if ( - hasattr(self, "subscription_expiry_time") - and self.subscription_expiry_time is not None - ): - params["subscriptionExpiryTime"] = self.subscription_expiry_time + params['periodRule'] = self.period_rule + if hasattr(self, "subscription_expiry_time") and self.subscription_expiry_time is not None: + params['subscriptionExpiryTime'] = self.subscription_expiry_time if hasattr(self, "order_info") and self.order_info is not None: - params["orderInfo"] = self.order_info + params['orderInfo'] = self.order_info if hasattr(self, "payment_amount") and self.payment_amount is not None: - params["paymentAmount"] = self.payment_amount - if ( - hasattr(self, "payment_amount_difference") - and self.payment_amount_difference is not None - ): - params["paymentAmountDifference"] = self.payment_amount_difference + params['paymentAmount'] = self.payment_amount + if hasattr(self, "payment_amount_difference") and self.payment_amount_difference is not None: + params['paymentAmountDifference'] = self.payment_amount_difference return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "allowAccumulate" in response_body: - self.__allow_accumulate = response_body["allowAccumulate"] - if "maxAccumulateAmount" in response_body: + if 'allowAccumulate' in response_body: + self.__allow_accumulate = response_body['allowAccumulate'] + if 'maxAccumulateAmount' in response_body: self.__max_accumulate_amount = Amount() - self.__max_accumulate_amount.parse_rsp_body( - response_body["maxAccumulateAmount"] - ) - if "subscriptionChangeRequestId" in response_body: - self.__subscription_change_request_id = response_body[ - "subscriptionChangeRequestId" - ] - if "subscriptionId" in response_body: - self.__subscription_id = response_body["subscriptionId"] - if "subscriptionDescription" in response_body: - self.__subscription_description = response_body["subscriptionDescription"] - if "subscriptionStartTime" in response_body: - self.__subscription_start_time = response_body["subscriptionStartTime"] - if "subscriptionEndTime" in response_body: - self.__subscription_end_time = response_body["subscriptionEndTime"] - if "periodRule" in response_body: + self.__max_accumulate_amount.parse_rsp_body(response_body['maxAccumulateAmount']) + if 'subscriptionChangeRequestId' in response_body: + self.__subscription_change_request_id = response_body['subscriptionChangeRequestId'] + if 'subscriptionId' in response_body: + self.__subscription_id = response_body['subscriptionId'] + if 'subscriptionDescription' in response_body: + self.__subscription_description = response_body['subscriptionDescription'] + if 'subscriptionStartTime' in response_body: + self.__subscription_start_time = response_body['subscriptionStartTime'] + if 'subscriptionEndTime' in response_body: + self.__subscription_end_time = response_body['subscriptionEndTime'] + if 'periodRule' in response_body: self.__period_rule = PeriodRule() - self.__period_rule.parse_rsp_body(response_body["periodRule"]) - if "subscriptionExpiryTime" in response_body: - self.__subscription_expiry_time = response_body["subscriptionExpiryTime"] - if "orderInfo" in response_body: + self.__period_rule.parse_rsp_body(response_body['periodRule']) + if 'subscriptionExpiryTime' in response_body: + self.__subscription_expiry_time = response_body['subscriptionExpiryTime'] + if 'orderInfo' in response_body: self.__order_info = OrderInfo() - self.__order_info.parse_rsp_body(response_body["orderInfo"]) - if "paymentAmount" in response_body: + self.__order_info.parse_rsp_body(response_body['orderInfo']) + if 'paymentAmount' in response_body: self.__payment_amount = Amount() - self.__payment_amount.parse_rsp_body(response_body["paymentAmount"]) - if "paymentAmountDifference" in response_body: + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'paymentAmountDifference' in response_body: self.__payment_amount_difference = Amount() - self.__payment_amount_difference.parse_rsp_body( - response_body["paymentAmountDifference"] - ) + self.__payment_amount_difference.parse_rsp_body(response_body['paymentAmountDifference']) diff --git a/com/alipay/ams/api/request/subscription/alipay_subscription_create_request.py b/com/alipay/ams/api/request/subscription/alipay_subscription_create_request.py index b65a355..c8ab570 100644 --- a/com/alipay/ams/api/request/subscription/alipay_subscription_create_request.py +++ b/com/alipay/ams/api/request/subscription/alipay_subscription_create_request.py @@ -10,14 +10,12 @@ from com.alipay.ams.api.model.trial import Trial -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipaySubscriptionCreateRequest(AlipayRequest): def __init__(self): - super(AlipaySubscriptionCreateRequest, self).__init__( - "/ams/api/v1/subscriptions/create" - ) + super(AlipaySubscriptionCreateRequest, self).__init__("/ams/api/v1/subscriptions/create") self.__customized_info = None # type: CustomizedInfo self.__merchant_account_id = None # type: str @@ -38,16 +36,18 @@ def __init__(self): self.__settlement_strategy = None # type: SettlementStrategy self.__env = None # type: Env self.__trials = None # type: [Trial] + @property def customized_info(self): - """Gets the customized_info of this AlipaySubscriptionCreateRequest.""" + """Gets the customized_info of this AlipaySubscriptionCreateRequest. + + """ return self.__customized_info @customized_info.setter def customized_info(self, value): self.__customized_info = value - @property def merchant_account_id(self): """ @@ -58,7 +58,6 @@ def merchant_account_id(self): @merchant_account_id.setter def merchant_account_id(self, value): self.__merchant_account_id = value - @property def allow_accumulate(self): """ @@ -69,16 +68,16 @@ def allow_accumulate(self): @allow_accumulate.setter def allow_accumulate(self, value): self.__allow_accumulate = value - @property def max_accumulate_amount(self): - """Gets the max_accumulate_amount of this AlipaySubscriptionCreateRequest.""" + """Gets the max_accumulate_amount of this AlipaySubscriptionCreateRequest. + + """ return self.__max_accumulate_amount @max_accumulate_amount.setter def max_accumulate_amount(self, value): self.__max_accumulate_amount = value - @property def subscription_request_id(self): """ @@ -89,7 +88,6 @@ def subscription_request_id(self): @subscription_request_id.setter def subscription_request_id(self, value): self.__subscription_request_id = value - @property def subscription_description(self): """ @@ -100,49 +98,46 @@ def subscription_description(self): @subscription_description.setter def subscription_description(self, value): self.__subscription_description = value - @property def subscription_redirect_url(self): """ - The merchant page URL that the user is redirected to after authorizing the subscription. More information: Maximum length: 2048 characters + The merchant page URL that the user is redirected to after authorizing the subscription. More information: Maximum length: 2048 characters """ return self.__subscription_redirect_url @subscription_redirect_url.setter def subscription_redirect_url(self, value): self.__subscription_redirect_url = value - @property def subscription_start_time(self): """ - The date and time when the subscription becomes active. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + The date and time when the subscription becomes active. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__subscription_start_time @subscription_start_time.setter def subscription_start_time(self, value): self.__subscription_start_time = value - @property def subscription_end_time(self): """ - The date and time when the subscription ends. Note: Specify this parameter when you want to designate the subscription end time. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + The date and time when the subscription ends. Note: Specify this parameter when you want to designate the subscription end time. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__subscription_end_time @subscription_end_time.setter def subscription_end_time(self, value): self.__subscription_end_time = value - @property def period_rule(self): - """Gets the period_rule of this AlipaySubscriptionCreateRequest.""" + """Gets the period_rule of this AlipaySubscriptionCreateRequest. + + """ return self.__period_rule @period_rule.setter def period_rule(self, value): self.__period_rule = value - @property def subscription_expiry_time(self): """ @@ -153,16 +148,16 @@ def subscription_expiry_time(self): @subscription_expiry_time.setter def subscription_expiry_time(self, value): self.__subscription_expiry_time = value - @property def payment_method(self): - """Gets the payment_method of this AlipaySubscriptionCreateRequest.""" + """Gets the payment_method of this AlipaySubscriptionCreateRequest. + + """ return self.__payment_method @payment_method.setter def payment_method(self, value): self.__payment_method = value - @property def subscription_notification_url(self): """ @@ -173,54 +168,56 @@ def subscription_notification_url(self): @subscription_notification_url.setter def subscription_notification_url(self, value): self.__subscription_notification_url = value - @property def payment_notification_url(self): """ - The URL that is used to receive the payment result notification for each subscription period. You can also configure the subscription notification URL in Antom Dashboard. If you specify this URL in both this API and Antom Dashboard, the URL configured in the API takes precedence. You can only configure one subscription notification URL in Antom Dashboard. More information: Maximum length: 2048 characters + The URL that is used to receive the payment result notification for each subscription period. You can also configure the subscription notification URL in Antom Dashboard. If you specify this URL in both this API and Antom Dashboard, the URL configured in the API takes precedence. You can only configure one subscription notification URL in Antom Dashboard. More information: Maximum length: 2048 characters """ return self.__payment_notification_url @payment_notification_url.setter def payment_notification_url(self, value): self.__payment_notification_url = value - @property def order_info(self): - """Gets the order_info of this AlipaySubscriptionCreateRequest.""" + """Gets the order_info of this AlipaySubscriptionCreateRequest. + + """ return self.__order_info @order_info.setter def order_info(self, value): self.__order_info = value - @property def payment_amount(self): - """Gets the payment_amount of this AlipaySubscriptionCreateRequest.""" + """Gets the payment_amount of this AlipaySubscriptionCreateRequest. + + """ return self.__payment_amount @payment_amount.setter def payment_amount(self, value): self.__payment_amount = value - @property def settlement_strategy(self): - """Gets the settlement_strategy of this AlipaySubscriptionCreateRequest.""" + """Gets the settlement_strategy of this AlipaySubscriptionCreateRequest. + + """ return self.__settlement_strategy @settlement_strategy.setter def settlement_strategy(self, value): self.__settlement_strategy = value - @property def env(self): - """Gets the env of this AlipaySubscriptionCreateRequest.""" + """Gets the env of this AlipaySubscriptionCreateRequest. + + """ return self.__env @env.setter def env(self, value): self.__env = value - @property def trials(self): """ @@ -232,143 +229,105 @@ def trials(self): def trials(self, value): self.__trials = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() if hasattr(self, "customized_info") and self.customized_info is not None: - params["customizedInfo"] = self.customized_info - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + params['customizedInfo'] = self.customized_info + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id if hasattr(self, "allow_accumulate") and self.allow_accumulate is not None: - params["allowAccumulate"] = self.allow_accumulate - if ( - hasattr(self, "max_accumulate_amount") - and self.max_accumulate_amount is not None - ): - params["maxAccumulateAmount"] = self.max_accumulate_amount - if ( - hasattr(self, "subscription_request_id") - and self.subscription_request_id is not None - ): - params["subscriptionRequestId"] = self.subscription_request_id - if ( - hasattr(self, "subscription_description") - and self.subscription_description is not None - ): - params["subscriptionDescription"] = self.subscription_description - if ( - hasattr(self, "subscription_redirect_url") - and self.subscription_redirect_url is not None - ): - params["subscriptionRedirectUrl"] = self.subscription_redirect_url - if ( - hasattr(self, "subscription_start_time") - and self.subscription_start_time is not None - ): - params["subscriptionStartTime"] = self.subscription_start_time - if ( - hasattr(self, "subscription_end_time") - and self.subscription_end_time is not None - ): - params["subscriptionEndTime"] = self.subscription_end_time + params['allowAccumulate'] = self.allow_accumulate + if hasattr(self, "max_accumulate_amount") and self.max_accumulate_amount is not None: + params['maxAccumulateAmount'] = self.max_accumulate_amount + if hasattr(self, "subscription_request_id") and self.subscription_request_id is not None: + params['subscriptionRequestId'] = self.subscription_request_id + if hasattr(self, "subscription_description") and self.subscription_description is not None: + params['subscriptionDescription'] = self.subscription_description + if hasattr(self, "subscription_redirect_url") and self.subscription_redirect_url is not None: + params['subscriptionRedirectUrl'] = self.subscription_redirect_url + if hasattr(self, "subscription_start_time") and self.subscription_start_time is not None: + params['subscriptionStartTime'] = self.subscription_start_time + if hasattr(self, "subscription_end_time") and self.subscription_end_time is not None: + params['subscriptionEndTime'] = self.subscription_end_time if hasattr(self, "period_rule") and self.period_rule is not None: - params["periodRule"] = self.period_rule - if ( - hasattr(self, "subscription_expiry_time") - and self.subscription_expiry_time is not None - ): - params["subscriptionExpiryTime"] = self.subscription_expiry_time + params['periodRule'] = self.period_rule + if hasattr(self, "subscription_expiry_time") and self.subscription_expiry_time is not None: + params['subscriptionExpiryTime'] = self.subscription_expiry_time if hasattr(self, "payment_method") and self.payment_method is not None: - params["paymentMethod"] = self.payment_method - if ( - hasattr(self, "subscription_notification_url") - and self.subscription_notification_url is not None - ): - params["subscriptionNotificationUrl"] = self.subscription_notification_url - if ( - hasattr(self, "payment_notification_url") - and self.payment_notification_url is not None - ): - params["paymentNotificationUrl"] = self.payment_notification_url + params['paymentMethod'] = self.payment_method + if hasattr(self, "subscription_notification_url") and self.subscription_notification_url is not None: + params['subscriptionNotificationUrl'] = self.subscription_notification_url + if hasattr(self, "payment_notification_url") and self.payment_notification_url is not None: + params['paymentNotificationUrl'] = self.payment_notification_url if hasattr(self, "order_info") and self.order_info is not None: - params["orderInfo"] = self.order_info + params['orderInfo'] = self.order_info if hasattr(self, "payment_amount") and self.payment_amount is not None: - params["paymentAmount"] = self.payment_amount - if ( - hasattr(self, "settlement_strategy") - and self.settlement_strategy is not None - ): - params["settlementStrategy"] = self.settlement_strategy + params['paymentAmount'] = self.payment_amount + if hasattr(self, "settlement_strategy") and self.settlement_strategy is not None: + params['settlementStrategy'] = self.settlement_strategy if hasattr(self, "env") and self.env is not None: - params["env"] = self.env + params['env'] = self.env if hasattr(self, "trials") and self.trials is not None: - params["trials"] = self.trials + params['trials'] = self.trials return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "customizedInfo" in response_body: + if 'customizedInfo' in response_body: self.__customized_info = CustomizedInfo() - self.__customized_info.parse_rsp_body(response_body["customizedInfo"]) - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] - if "allowAccumulate" in response_body: - self.__allow_accumulate = response_body["allowAccumulate"] - if "maxAccumulateAmount" in response_body: + self.__customized_info.parse_rsp_body(response_body['customizedInfo']) + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'allowAccumulate' in response_body: + self.__allow_accumulate = response_body['allowAccumulate'] + if 'maxAccumulateAmount' in response_body: self.__max_accumulate_amount = Amount() - self.__max_accumulate_amount.parse_rsp_body( - response_body["maxAccumulateAmount"] - ) - if "subscriptionRequestId" in response_body: - self.__subscription_request_id = response_body["subscriptionRequestId"] - if "subscriptionDescription" in response_body: - self.__subscription_description = response_body["subscriptionDescription"] - if "subscriptionRedirectUrl" in response_body: - self.__subscription_redirect_url = response_body["subscriptionRedirectUrl"] - if "subscriptionStartTime" in response_body: - self.__subscription_start_time = response_body["subscriptionStartTime"] - if "subscriptionEndTime" in response_body: - self.__subscription_end_time = response_body["subscriptionEndTime"] - if "periodRule" in response_body: + self.__max_accumulate_amount.parse_rsp_body(response_body['maxAccumulateAmount']) + if 'subscriptionRequestId' in response_body: + self.__subscription_request_id = response_body['subscriptionRequestId'] + if 'subscriptionDescription' in response_body: + self.__subscription_description = response_body['subscriptionDescription'] + if 'subscriptionRedirectUrl' in response_body: + self.__subscription_redirect_url = response_body['subscriptionRedirectUrl'] + if 'subscriptionStartTime' in response_body: + self.__subscription_start_time = response_body['subscriptionStartTime'] + if 'subscriptionEndTime' in response_body: + self.__subscription_end_time = response_body['subscriptionEndTime'] + if 'periodRule' in response_body: self.__period_rule = PeriodRule() - self.__period_rule.parse_rsp_body(response_body["periodRule"]) - if "subscriptionExpiryTime" in response_body: - self.__subscription_expiry_time = response_body["subscriptionExpiryTime"] - if "paymentMethod" in response_body: + self.__period_rule.parse_rsp_body(response_body['periodRule']) + if 'subscriptionExpiryTime' in response_body: + self.__subscription_expiry_time = response_body['subscriptionExpiryTime'] + if 'paymentMethod' in response_body: self.__payment_method = PaymentMethod() - self.__payment_method.parse_rsp_body(response_body["paymentMethod"]) - if "subscriptionNotificationUrl" in response_body: - self.__subscription_notification_url = response_body[ - "subscriptionNotificationUrl" - ] - if "paymentNotificationUrl" in response_body: - self.__payment_notification_url = response_body["paymentNotificationUrl"] - if "orderInfo" in response_body: + self.__payment_method.parse_rsp_body(response_body['paymentMethod']) + if 'subscriptionNotificationUrl' in response_body: + self.__subscription_notification_url = response_body['subscriptionNotificationUrl'] + if 'paymentNotificationUrl' in response_body: + self.__payment_notification_url = response_body['paymentNotificationUrl'] + if 'orderInfo' in response_body: self.__order_info = OrderInfo() - self.__order_info.parse_rsp_body(response_body["orderInfo"]) - if "paymentAmount" in response_body: + self.__order_info.parse_rsp_body(response_body['orderInfo']) + if 'paymentAmount' in response_body: self.__payment_amount = Amount() - self.__payment_amount.parse_rsp_body(response_body["paymentAmount"]) - if "settlementStrategy" in response_body: + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'settlementStrategy' in response_body: self.__settlement_strategy = SettlementStrategy() - self.__settlement_strategy.parse_rsp_body( - response_body["settlementStrategy"] - ) - if "env" in response_body: + self.__settlement_strategy.parse_rsp_body(response_body['settlementStrategy']) + if 'env' in response_body: self.__env = Env() - self.__env.parse_rsp_body(response_body["env"]) - if "trials" in response_body: + self.__env.parse_rsp_body(response_body['env']) + if 'trials' in response_body: self.__trials = [] - for item in response_body["trials"]: + for item in response_body['trials']: obj = Trial() obj.parse_rsp_body(item) self.__trials.append(obj) diff --git a/com/alipay/ams/api/request/subscription/alipay_subscription_update_request.py b/com/alipay/ams/api/request/subscription/alipay_subscription_update_request.py index eb0db73..b272b33 100644 --- a/com/alipay/ams/api/request/subscription/alipay_subscription_update_request.py +++ b/com/alipay/ams/api/request/subscription/alipay_subscription_update_request.py @@ -4,14 +4,12 @@ from com.alipay.ams.api.model.order_info import OrderInfo -from com.alipay.ams.api.request.alipay_request import AlipayRequest +from com.alipay.ams.api.request.alipay_request import AlipayRequest class AlipaySubscriptionUpdateRequest(AlipayRequest): def __init__(self): - super(AlipaySubscriptionUpdateRequest, self).__init__( - "/ams/api/v1/subscriptions/update" - ) + super(AlipaySubscriptionUpdateRequest, self).__init__("/ams/api/v1/subscriptions/update") self.__subscription_update_request_id = None # type: str self.__subscription_id = None # type: str @@ -20,6 +18,7 @@ def __init__(self): self.__payment_amount = None # type: Amount self.__subscription_end_time = None # type: str self.__order_info = None # type: OrderInfo + @property def subscription_update_request_id(self): @@ -31,7 +30,6 @@ def subscription_update_request_id(self): @subscription_update_request_id.setter def subscription_update_request_id(self, value): self.__subscription_update_request_id = value - @property def subscription_id(self): """ @@ -42,7 +40,6 @@ def subscription_id(self): @subscription_id.setter def subscription_id(self, value): self.__subscription_id = value - @property def subscription_description(self): """ @@ -53,25 +50,26 @@ def subscription_description(self): @subscription_description.setter def subscription_description(self, value): self.__subscription_description = value - @property def period_rule(self): - """Gets the period_rule of this AlipaySubscriptionUpdateRequest.""" + """Gets the period_rule of this AlipaySubscriptionUpdateRequest. + + """ return self.__period_rule @period_rule.setter def period_rule(self, value): self.__period_rule = value - @property def payment_amount(self): - """Gets the payment_amount of this AlipaySubscriptionUpdateRequest.""" + """Gets the payment_amount of this AlipaySubscriptionUpdateRequest. + + """ return self.__payment_amount @payment_amount.setter def payment_amount(self, value): self.__payment_amount = value - @property def subscription_end_time(self): """ @@ -82,68 +80,59 @@ def subscription_end_time(self): @subscription_end_time.setter def subscription_end_time(self, value): self.__subscription_end_time = value - @property def order_info(self): - """Gets the order_info of this AlipaySubscriptionUpdateRequest.""" + """Gets the order_info of this AlipaySubscriptionUpdateRequest. + + """ return self.__order_info @order_info.setter def order_info(self, value): self.__order_info = value - def to_ams_json(self): - json_str = json.dumps( - obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3 - ) + + def to_ams_json(self): + json_str = json.dumps(obj=self.to_ams_dict(), default=lambda o: o.to_ams_dict(), indent=3) return json_str + def to_ams_dict(self): params = dict() - if ( - hasattr(self, "subscription_update_request_id") - and self.subscription_update_request_id is not None - ): - params["subscriptionUpdateRequestId"] = self.subscription_update_request_id + if hasattr(self, "subscription_update_request_id") and self.subscription_update_request_id is not None: + params['subscriptionUpdateRequestId'] = self.subscription_update_request_id if hasattr(self, "subscription_id") and self.subscription_id is not None: - params["subscriptionId"] = self.subscription_id - if ( - hasattr(self, "subscription_description") - and self.subscription_description is not None - ): - params["subscriptionDescription"] = self.subscription_description + params['subscriptionId'] = self.subscription_id + if hasattr(self, "subscription_description") and self.subscription_description is not None: + params['subscriptionDescription'] = self.subscription_description if hasattr(self, "period_rule") and self.period_rule is not None: - params["periodRule"] = self.period_rule + params['periodRule'] = self.period_rule if hasattr(self, "payment_amount") and self.payment_amount is not None: - params["paymentAmount"] = self.payment_amount - if ( - hasattr(self, "subscription_end_time") - and self.subscription_end_time is not None - ): - params["subscriptionEndTime"] = self.subscription_end_time + params['paymentAmount'] = self.payment_amount + if hasattr(self, "subscription_end_time") and self.subscription_end_time is not None: + params['subscriptionEndTime'] = self.subscription_end_time if hasattr(self, "order_info") and self.order_info is not None: - params["orderInfo"] = self.order_info + params['orderInfo'] = self.order_info return params + def parse_rsp_body(self, response_body): - if isinstance(response_body, str): + if isinstance(response_body, str): response_body = json.loads(response_body) - if "subscriptionUpdateRequestId" in response_body: - self.__subscription_update_request_id = response_body[ - "subscriptionUpdateRequestId" - ] - if "subscriptionId" in response_body: - self.__subscription_id = response_body["subscriptionId"] - if "subscriptionDescription" in response_body: - self.__subscription_description = response_body["subscriptionDescription"] - if "periodRule" in response_body: + if 'subscriptionUpdateRequestId' in response_body: + self.__subscription_update_request_id = response_body['subscriptionUpdateRequestId'] + if 'subscriptionId' in response_body: + self.__subscription_id = response_body['subscriptionId'] + if 'subscriptionDescription' in response_body: + self.__subscription_description = response_body['subscriptionDescription'] + if 'periodRule' in response_body: self.__period_rule = PeriodRule() - self.__period_rule.parse_rsp_body(response_body["periodRule"]) - if "paymentAmount" in response_body: + self.__period_rule.parse_rsp_body(response_body['periodRule']) + if 'paymentAmount' in response_body: self.__payment_amount = Amount() - self.__payment_amount.parse_rsp_body(response_body["paymentAmount"]) - if "subscriptionEndTime" in response_body: - self.__subscription_end_time = response_body["subscriptionEndTime"] - if "orderInfo" in response_body: + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'subscriptionEndTime' in response_body: + self.__subscription_end_time = response_body['subscriptionEndTime'] + if 'orderInfo' in response_body: self.__order_info = OrderInfo() - self.__order_info.parse_rsp_body(response_body["orderInfo"]) + self.__order_info.parse_rsp_body(response_body['orderInfo']) diff --git a/com/alipay/ams/api/response/aba/alipay_inquiry_statement_list_response.py b/com/alipay/ams/api/response/aba/alipay_inquiry_statement_list_response.py index 84a2dd5..5d5c940 100644 --- a/com/alipay/ams/api/response/aba/alipay_inquiry_statement_list_response.py +++ b/com/alipay/ams/api/response/aba/alipay_inquiry_statement_list_response.py @@ -3,53 +3,59 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayInquiryStatementListResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__statement_list = None # type: [Statement] self.__result = None # type: Result - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def statement_list(self): - """Gets the statement_list of this AlipayInquiryStatementListResponse.""" + """Gets the statement_list of this AlipayInquiryStatementListResponse. + + """ return self.__statement_list @statement_list.setter def statement_list(self, value): self.__statement_list = value - @property def result(self): - """Gets the result of this AlipayInquiryStatementListResponse.""" + """Gets the result of this AlipayInquiryStatementListResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "statement_list") and self.statement_list is not None: - params["statementList"] = self.statement_list + params['statementList'] = self.statement_list if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayInquiryStatementListResponse, self).parse_rsp_body( - response_body - ) - if "statementList" in response_body: + response_body = super(AlipayInquiryStatementListResponse, self).parse_rsp_body(response_body) + if 'statementList' in response_body: self.__statement_list = [] - for item in response_body["statementList"]: + for item in response_body['statementList']: obj = Statement() obj.parse_rsp_body(item) self.__statement_list.append(obj) - if "result" in response_body: + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) + self.__result.parse_rsp_body(response_body['result']) diff --git a/com/alipay/ams/api/response/auth/alipay_auth_apply_token_response.py b/com/alipay/ams/api/response/auth/alipay_auth_apply_token_response.py index d8d1f17..f81de4e 100644 --- a/com/alipay/ams/api/response/auth/alipay_auth_apply_token_response.py +++ b/com/alipay/ams/api/response/auth/alipay_auth_apply_token_response.py @@ -3,12 +3,12 @@ from com.alipay.ams.api.model.psp_customer_info import PspCustomerInfo -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayAuthApplyTokenResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__access_token = None # type: str @@ -18,39 +18,39 @@ def __init__(self, rsp_body): self.__extend_info = None # type: str self.__user_login_id = None # type: str self.__psp_customer_info = None # type: PspCustomerInfo - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayAuthApplyTokenResponse.""" + """Gets the result of this AlipayAuthApplyTokenResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def access_token(self): """ - The access token that is used to access the corresponding scope of the user resource. Note: This field is returned when the API is called successfully. More information: Maximum length: 128 characters + The access token that is used to access the corresponding scope of the user resource. Note: This field is returned when the API is called successfully. More information: Maximum length: 128 characters """ return self.__access_token @access_token.setter def access_token(self, value): self.__access_token = value - @property def access_token_expiry_time(self): """ - The time after which the access token expires. After the access token expires, the access token cannot be used to deduct money from the user's account. Note: This field is returned when accessToken is returned. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + The time after which the access token expires. After the access token expires, the access token cannot be used to deduct money from the user's account. Note: This field is returned when accessToken is returned. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__access_token_expiry_time @access_token_expiry_time.setter def access_token_expiry_time(self, value): self.__access_token_expiry_time = value - @property def refresh_token(self): """ @@ -61,7 +61,6 @@ def refresh_token(self): @refresh_token.setter def refresh_token(self, value): self.__refresh_token = value - @property def refresh_token_expiry_time(self): """ @@ -72,7 +71,6 @@ def refresh_token_expiry_time(self): @refresh_token_expiry_time.setter def refresh_token_expiry_time(self, value): self.__refresh_token_expiry_time = value - @property def extend_info(self): """ @@ -83,7 +81,6 @@ def extend_info(self): @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def user_login_id(self): """ @@ -94,61 +91,58 @@ def user_login_id(self): @user_login_id.setter def user_login_id(self, value): self.__user_login_id = value - @property def psp_customer_info(self): - """Gets the psp_customer_info of this AlipayAuthApplyTokenResponse.""" + """Gets the psp_customer_info of this AlipayAuthApplyTokenResponse. + + """ return self.__psp_customer_info @psp_customer_info.setter def psp_customer_info(self, value): self.__psp_customer_info = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "access_token") and self.access_token is not None: - params["accessToken"] = self.access_token - if ( - hasattr(self, "access_token_expiry_time") - and self.access_token_expiry_time is not None - ): - params["accessTokenExpiryTime"] = self.access_token_expiry_time + params['accessToken'] = self.access_token + if hasattr(self, "access_token_expiry_time") and self.access_token_expiry_time is not None: + params['accessTokenExpiryTime'] = self.access_token_expiry_time if hasattr(self, "refresh_token") and self.refresh_token is not None: - params["refreshToken"] = self.refresh_token - if ( - hasattr(self, "refresh_token_expiry_time") - and self.refresh_token_expiry_time is not None - ): - params["refreshTokenExpiryTime"] = self.refresh_token_expiry_time + params['refreshToken'] = self.refresh_token + if hasattr(self, "refresh_token_expiry_time") and self.refresh_token_expiry_time is not None: + params['refreshTokenExpiryTime'] = self.refresh_token_expiry_time if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "user_login_id") and self.user_login_id is not None: - params["userLoginId"] = self.user_login_id + params['userLoginId'] = self.user_login_id if hasattr(self, "psp_customer_info") and self.psp_customer_info is not None: - params["pspCustomerInfo"] = self.psp_customer_info + params['pspCustomerInfo'] = self.psp_customer_info return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayAuthApplyTokenResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayAuthApplyTokenResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "accessToken" in response_body: - self.__access_token = response_body["accessToken"] - if "accessTokenExpiryTime" in response_body: - self.__access_token_expiry_time = response_body["accessTokenExpiryTime"] - if "refreshToken" in response_body: - self.__refresh_token = response_body["refreshToken"] - if "refreshTokenExpiryTime" in response_body: - self.__refresh_token_expiry_time = response_body["refreshTokenExpiryTime"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "userLoginId" in response_body: - self.__user_login_id = response_body["userLoginId"] - if "pspCustomerInfo" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'accessToken' in response_body: + self.__access_token = response_body['accessToken'] + if 'accessTokenExpiryTime' in response_body: + self.__access_token_expiry_time = response_body['accessTokenExpiryTime'] + if 'refreshToken' in response_body: + self.__refresh_token = response_body['refreshToken'] + if 'refreshTokenExpiryTime' in response_body: + self.__refresh_token_expiry_time = response_body['refreshTokenExpiryTime'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'userLoginId' in response_body: + self.__user_login_id = response_body['userLoginId'] + if 'pspCustomerInfo' in response_body: self.__psp_customer_info = PspCustomerInfo() - self.__psp_customer_info.parse_rsp_body(response_body["pspCustomerInfo"]) + self.__psp_customer_info.parse_rsp_body(response_body['pspCustomerInfo']) diff --git a/com/alipay/ams/api/response/auth/alipay_auth_consult_response.py b/com/alipay/ams/api/response/auth/alipay_auth_consult_response.py index 8ed9da2..c71c222 100644 --- a/com/alipay/ams/api/response/auth/alipay_auth_consult_response.py +++ b/com/alipay/ams/api/response/auth/alipay_auth_consult_response.py @@ -3,12 +3,12 @@ from com.alipay.ams.api.model.auth_code_form import AuthCodeForm -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayAuthConsultResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__auth_url = None # type: str @@ -18,46 +18,49 @@ def __init__(self, rsp_body): self.__applink_url = None # type: str self.__app_identifier = None # type: str self.__auth_code_form = None # type: AuthCodeForm - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayAuthConsultResponse.""" + """Gets the result of this AlipayAuthConsultResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def auth_url(self): - """Gets the auth_url of this AlipayAuthConsultResponse.""" + """Gets the auth_url of this AlipayAuthConsultResponse. + + """ return self.__auth_url @auth_url.setter def auth_url(self, value): self.__auth_url = value - @property def extend_info(self): - """Gets the extend_info of this AlipayAuthConsultResponse.""" + """Gets the extend_info of this AlipayAuthConsultResponse. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def normal_url(self): """ - The URL that redirects users to a WAP or WEB page in the default browser or the embedded WebView. Note: When the value of result.resultCode is SUCCESS, at least one of schemeUrl, applinkUrl, and normalUrl is to be returned. More information: Maximum length: 2048 characters + The URL that redirects users to a WAP or WEB page in the default browser or the embedded WebView. Note: When the value of result.resultCode is SUCCESS, at least one of schemeUrl, applinkUrl, and normalUrl is to be returned. More information: Maximum length: 2048 characters """ return self.__normal_url @normal_url.setter def normal_url(self, value): self.__normal_url = value - @property def scheme_url(self): """ @@ -68,7 +71,6 @@ def scheme_url(self): @scheme_url.setter def scheme_url(self, value): self.__scheme_url = value - @property def applink_url(self): """ @@ -79,7 +81,6 @@ def applink_url(self): @applink_url.setter def applink_url(self, value): self.__applink_url = value - @property def app_identifier(self): """ @@ -90,55 +91,58 @@ def app_identifier(self): @app_identifier.setter def app_identifier(self, value): self.__app_identifier = value - @property def auth_code_form(self): - """Gets the auth_code_form of this AlipayAuthConsultResponse.""" + """Gets the auth_code_form of this AlipayAuthConsultResponse. + + """ return self.__auth_code_form @auth_code_form.setter def auth_code_form(self, value): self.__auth_code_form = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "auth_url") and self.auth_url is not None: - params["authUrl"] = self.auth_url + params['authUrl'] = self.auth_url if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "normal_url") and self.normal_url is not None: - params["normalUrl"] = self.normal_url + params['normalUrl'] = self.normal_url if hasattr(self, "scheme_url") and self.scheme_url is not None: - params["schemeUrl"] = self.scheme_url + params['schemeUrl'] = self.scheme_url if hasattr(self, "applink_url") and self.applink_url is not None: - params["applinkUrl"] = self.applink_url + params['applinkUrl'] = self.applink_url if hasattr(self, "app_identifier") and self.app_identifier is not None: - params["appIdentifier"] = self.app_identifier + params['appIdentifier'] = self.app_identifier if hasattr(self, "auth_code_form") and self.auth_code_form is not None: - params["authCodeForm"] = self.auth_code_form + params['authCodeForm'] = self.auth_code_form return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayAuthConsultResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayAuthConsultResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "authUrl" in response_body: - self.__auth_url = response_body["authUrl"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "normalUrl" in response_body: - self.__normal_url = response_body["normalUrl"] - if "schemeUrl" in response_body: - self.__scheme_url = response_body["schemeUrl"] - if "applinkUrl" in response_body: - self.__applink_url = response_body["applinkUrl"] - if "appIdentifier" in response_body: - self.__app_identifier = response_body["appIdentifier"] - if "authCodeForm" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'authUrl' in response_body: + self.__auth_url = response_body['authUrl'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'normalUrl' in response_body: + self.__normal_url = response_body['normalUrl'] + if 'schemeUrl' in response_body: + self.__scheme_url = response_body['schemeUrl'] + if 'applinkUrl' in response_body: + self.__applink_url = response_body['applinkUrl'] + if 'appIdentifier' in response_body: + self.__app_identifier = response_body['appIdentifier'] + if 'authCodeForm' in response_body: self.__auth_code_form = AuthCodeForm() - self.__auth_code_form.parse_rsp_body(response_body["authCodeForm"]) + self.__auth_code_form.parse_rsp_body(response_body['authCodeForm']) diff --git a/com/alipay/ams/api/response/auth/alipay_auth_revoke_token_response.py b/com/alipay/ams/api/response/auth/alipay_auth_revoke_token_response.py index ea2f312..dcac5cb 100644 --- a/com/alipay/ams/api/response/auth/alipay_auth_revoke_token_response.py +++ b/com/alipay/ams/api/response/auth/alipay_auth_revoke_token_response.py @@ -2,49 +2,55 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayAuthRevokeTokenResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__extend_info = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayAuthRevokeTokenResponse.""" + """Gets the result of this AlipayAuthRevokeTokenResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def extend_info(self): - """Gets the extend_info of this AlipayAuthRevokeTokenResponse.""" + """Gets the extend_info of this AlipayAuthRevokeTokenResponse. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayAuthRevokeTokenResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayAuthRevokeTokenResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] + self.__result.parse_rsp_body(response_body['result']) + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] diff --git a/com/alipay/ams/api/response/dispute/alipay_accept_dispute_response.py b/com/alipay/ams/api/response/dispute/alipay_accept_dispute_response.py index b1da643..3efe19b 100644 --- a/com/alipay/ams/api/response/dispute/alipay_accept_dispute_response.py +++ b/com/alipay/ams/api/response/dispute/alipay_accept_dispute_response.py @@ -2,27 +2,29 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayAcceptDisputeResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__dispute_id = None # type: str self.__dispute_resolution_time = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayAcceptDisputeResponse.""" + """Gets the result of this AlipayAcceptDisputeResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def dispute_id(self): """ @@ -33,7 +35,6 @@ def dispute_id(self): @dispute_id.setter def dispute_id(self, value): self.__dispute_id = value - @property def dispute_resolution_time(self): """ @@ -45,27 +46,26 @@ def dispute_resolution_time(self): def dispute_resolution_time(self, value): self.__dispute_resolution_time = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "dispute_id") and self.dispute_id is not None: - params["disputeId"] = self.dispute_id - if ( - hasattr(self, "dispute_resolution_time") - and self.dispute_resolution_time is not None - ): - params["disputeResolutionTime"] = self.dispute_resolution_time + params['disputeId'] = self.dispute_id + if hasattr(self, "dispute_resolution_time") and self.dispute_resolution_time is not None: + params['disputeResolutionTime'] = self.dispute_resolution_time return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayAcceptDisputeResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayAcceptDisputeResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "disputeId" in response_body: - self.__dispute_id = response_body["disputeId"] - if "disputeResolutionTime" in response_body: - self.__dispute_resolution_time = response_body["disputeResolutionTime"] + self.__result.parse_rsp_body(response_body['result']) + if 'disputeId' in response_body: + self.__dispute_id = response_body['disputeId'] + if 'disputeResolutionTime' in response_body: + self.__dispute_resolution_time = response_body['disputeResolutionTime'] diff --git a/com/alipay/ams/api/response/dispute/alipay_download_dispute_evidence_response.py b/com/alipay/ams/api/response/dispute/alipay_download_dispute_evidence_response.py index d6d0a06..a1a454c 100644 --- a/com/alipay/ams/api/response/dispute/alipay_download_dispute_evidence_response.py +++ b/com/alipay/ams/api/response/dispute/alipay_download_dispute_evidence_response.py @@ -1,75 +1,73 @@ import json from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.model.dispute_evidence_format_type import ( - DisputeEvidenceFormatType, -) +from com.alipay.ams.api.model.dispute_evidence_format_type import DisputeEvidenceFormatType -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayDownloadDisputeEvidenceResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__dispute_evidence = None # type: str self.__dispute_evidence_format = None # type: DisputeEvidenceFormatType - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayDownloadDisputeEvidenceResponse.""" + """Gets the result of this AlipayDownloadDisputeEvidenceResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def dispute_evidence(self): """ - The dispute evidence that is encoded in the Based64 format. Decode the Base64 document to get the Word or PDF file. Note: This prameter is returned when the value of resultCode is SUCCESS. More information: Maximum length: 1000000 characters + The dispute evidence that is encoded in the Based64 format. Decode the Base64 document to get the Word or PDF file. Note: This prameter is returned when the value of resultCode is SUCCESS. More information: Maximum length: 1000000 characters """ return self.__dispute_evidence @dispute_evidence.setter def dispute_evidence(self, value): self.__dispute_evidence = value - @property def dispute_evidence_format(self): - """Gets the dispute_evidence_format of this AlipayDownloadDisputeEvidenceResponse.""" + """Gets the dispute_evidence_format of this AlipayDownloadDisputeEvidenceResponse. + + """ return self.__dispute_evidence_format @dispute_evidence_format.setter def dispute_evidence_format(self, value): self.__dispute_evidence_format = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "dispute_evidence") and self.dispute_evidence is not None: - params["disputeEvidence"] = self.dispute_evidence - if ( - hasattr(self, "dispute_evidence_format") - and self.dispute_evidence_format is not None - ): - params["disputeEvidenceFormat"] = self.dispute_evidence_format + params['disputeEvidence'] = self.dispute_evidence + if hasattr(self, "dispute_evidence_format") and self.dispute_evidence_format is not None: + params['disputeEvidenceFormat'] = self.dispute_evidence_format return params + def parse_rsp_body(self, response_body): - response_body = super( - AlipayDownloadDisputeEvidenceResponse, self - ).parse_rsp_body(response_body) - if "result" in response_body: + response_body = super(AlipayDownloadDisputeEvidenceResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "disputeEvidence" in response_body: - self.__dispute_evidence = response_body["disputeEvidence"] - if "disputeEvidenceFormat" in response_body: - dispute_evidence_format_temp = DisputeEvidenceFormatType.value_of( - response_body["disputeEvidenceFormat"] - ) + self.__result.parse_rsp_body(response_body['result']) + if 'disputeEvidence' in response_body: + self.__dispute_evidence = response_body['disputeEvidence'] + if 'disputeEvidenceFormat' in response_body: + dispute_evidence_format_temp = DisputeEvidenceFormatType.value_of(response_body['disputeEvidenceFormat']) self.__dispute_evidence_format = dispute_evidence_format_temp diff --git a/com/alipay/ams/api/response/dispute/alipay_supply_defense_document_response.py b/com/alipay/ams/api/response/dispute/alipay_supply_defense_document_response.py index f8c2848..42a9d29 100644 --- a/com/alipay/ams/api/response/dispute/alipay_supply_defense_document_response.py +++ b/com/alipay/ams/api/response/dispute/alipay_supply_defense_document_response.py @@ -2,27 +2,29 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipaySupplyDefenseDocumentResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__dispute_id = None # type: str self.__dispute_resolution_time = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipaySupplyDefenseDocumentResponse.""" + """Gets the result of this AlipaySupplyDefenseDocumentResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def dispute_id(self): """ @@ -33,7 +35,6 @@ def dispute_id(self): @dispute_id.setter def dispute_id(self, value): self.__dispute_id = value - @property def dispute_resolution_time(self): """ @@ -45,27 +46,26 @@ def dispute_resolution_time(self): def dispute_resolution_time(self, value): self.__dispute_resolution_time = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "dispute_id") and self.dispute_id is not None: - params["disputeId"] = self.dispute_id - if ( - hasattr(self, "dispute_resolution_time") - and self.dispute_resolution_time is not None - ): - params["disputeResolutionTime"] = self.dispute_resolution_time + params['disputeId'] = self.dispute_id + if hasattr(self, "dispute_resolution_time") and self.dispute_resolution_time is not None: + params['disputeResolutionTime'] = self.dispute_resolution_time return params + def parse_rsp_body(self, response_body): - response_body = super(AlipaySupplyDefenseDocumentResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipaySupplyDefenseDocumentResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "disputeId" in response_body: - self.__dispute_id = response_body["disputeId"] - if "disputeResolutionTime" in response_body: - self.__dispute_resolution_time = response_body["disputeResolutionTime"] + self.__result.parse_rsp_body(response_body['result']) + if 'disputeId' in response_body: + self.__dispute_id = response_body['disputeId'] + if 'disputeResolutionTime' in response_body: + self.__dispute_resolution_time = response_body['disputeResolutionTime'] diff --git a/com/alipay/ams/api/response/marketplace/alipay_create_payout_response.py b/com/alipay/ams/api/response/marketplace/alipay_create_payout_response.py index 16836f7..090c56a 100644 --- a/com/alipay/ams/api/response/marketplace/alipay_create_payout_response.py +++ b/com/alipay/ams/api/response/marketplace/alipay_create_payout_response.py @@ -4,29 +4,31 @@ from com.alipay.ams.api.model.transfer_to_detail import TransferToDetail -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayCreatePayoutResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__transfer_id = None # type: str self.__transfer_request_id = None # type: str self.__transfer_from_detail = None # type: TransferFromDetail self.__transfer_to_detail = None # type: TransferToDetail - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayCreatePayoutResponse.""" + """Gets the result of this AlipayCreatePayoutResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def transfer_id(self): """ @@ -37,7 +39,6 @@ def transfer_id(self): @transfer_id.setter def transfer_id(self, value): self.__transfer_id = value - @property def transfer_request_id(self): """ @@ -48,61 +49,57 @@ def transfer_request_id(self): @transfer_request_id.setter def transfer_request_id(self, value): self.__transfer_request_id = value - @property def transfer_from_detail(self): - """Gets the transfer_from_detail of this AlipayCreatePayoutResponse.""" + """Gets the transfer_from_detail of this AlipayCreatePayoutResponse. + + """ return self.__transfer_from_detail @transfer_from_detail.setter def transfer_from_detail(self, value): self.__transfer_from_detail = value - @property def transfer_to_detail(self): - """Gets the transfer_to_detail of this AlipayCreatePayoutResponse.""" + """Gets the transfer_to_detail of this AlipayCreatePayoutResponse. + + """ return self.__transfer_to_detail @transfer_to_detail.setter def transfer_to_detail(self, value): self.__transfer_to_detail = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "transfer_id") and self.transfer_id is not None: - params["transferId"] = self.transfer_id - if ( - hasattr(self, "transfer_request_id") - and self.transfer_request_id is not None - ): - params["transferRequestId"] = self.transfer_request_id - if ( - hasattr(self, "transfer_from_detail") - and self.transfer_from_detail is not None - ): - params["transferFromDetail"] = self.transfer_from_detail + params['transferId'] = self.transfer_id + if hasattr(self, "transfer_request_id") and self.transfer_request_id is not None: + params['transferRequestId'] = self.transfer_request_id + if hasattr(self, "transfer_from_detail") and self.transfer_from_detail is not None: + params['transferFromDetail'] = self.transfer_from_detail if hasattr(self, "transfer_to_detail") and self.transfer_to_detail is not None: - params["transferToDetail"] = self.transfer_to_detail + params['transferToDetail'] = self.transfer_to_detail return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayCreatePayoutResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayCreatePayoutResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "transferId" in response_body: - self.__transfer_id = response_body["transferId"] - if "transferRequestId" in response_body: - self.__transfer_request_id = response_body["transferRequestId"] - if "transferFromDetail" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'transferId' in response_body: + self.__transfer_id = response_body['transferId'] + if 'transferRequestId' in response_body: + self.__transfer_request_id = response_body['transferRequestId'] + if 'transferFromDetail' in response_body: self.__transfer_from_detail = TransferFromDetail() - self.__transfer_from_detail.parse_rsp_body( - response_body["transferFromDetail"] - ) - if "transferToDetail" in response_body: + self.__transfer_from_detail.parse_rsp_body(response_body['transferFromDetail']) + if 'transferToDetail' in response_body: self.__transfer_to_detail = TransferToDetail() - self.__transfer_to_detail.parse_rsp_body(response_body["transferToDetail"]) + self.__transfer_to_detail.parse_rsp_body(response_body['transferToDetail']) diff --git a/com/alipay/ams/api/response/marketplace/alipay_create_transfer_response.py b/com/alipay/ams/api/response/marketplace/alipay_create_transfer_response.py index 52c0123..126a9aa 100644 --- a/com/alipay/ams/api/response/marketplace/alipay_create_transfer_response.py +++ b/com/alipay/ams/api/response/marketplace/alipay_create_transfer_response.py @@ -4,29 +4,31 @@ from com.alipay.ams.api.model.transfer_to_detail import TransferToDetail -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayCreateTransferResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__transfer_id = None # type: str self.__transfer_request_id = None # type: str self.__transfer_from_detail = None # type: TransferFromDetail self.__transfer_to_detail = None # type: TransferToDetail - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayCreateTransferResponse.""" + """Gets the result of this AlipayCreateTransferResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def transfer_id(self): """ @@ -37,7 +39,6 @@ def transfer_id(self): @transfer_id.setter def transfer_id(self, value): self.__transfer_id = value - @property def transfer_request_id(self): """ @@ -48,61 +49,57 @@ def transfer_request_id(self): @transfer_request_id.setter def transfer_request_id(self, value): self.__transfer_request_id = value - @property def transfer_from_detail(self): - """Gets the transfer_from_detail of this AlipayCreateTransferResponse.""" + """Gets the transfer_from_detail of this AlipayCreateTransferResponse. + + """ return self.__transfer_from_detail @transfer_from_detail.setter def transfer_from_detail(self, value): self.__transfer_from_detail = value - @property def transfer_to_detail(self): - """Gets the transfer_to_detail of this AlipayCreateTransferResponse.""" + """Gets the transfer_to_detail of this AlipayCreateTransferResponse. + + """ return self.__transfer_to_detail @transfer_to_detail.setter def transfer_to_detail(self, value): self.__transfer_to_detail = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "transfer_id") and self.transfer_id is not None: - params["transferId"] = self.transfer_id - if ( - hasattr(self, "transfer_request_id") - and self.transfer_request_id is not None - ): - params["transferRequestId"] = self.transfer_request_id - if ( - hasattr(self, "transfer_from_detail") - and self.transfer_from_detail is not None - ): - params["transferFromDetail"] = self.transfer_from_detail + params['transferId'] = self.transfer_id + if hasattr(self, "transfer_request_id") and self.transfer_request_id is not None: + params['transferRequestId'] = self.transfer_request_id + if hasattr(self, "transfer_from_detail") and self.transfer_from_detail is not None: + params['transferFromDetail'] = self.transfer_from_detail if hasattr(self, "transfer_to_detail") and self.transfer_to_detail is not None: - params["transferToDetail"] = self.transfer_to_detail + params['transferToDetail'] = self.transfer_to_detail return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayCreateTransferResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayCreateTransferResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "transferId" in response_body: - self.__transfer_id = response_body["transferId"] - if "transferRequestId" in response_body: - self.__transfer_request_id = response_body["transferRequestId"] - if "transferFromDetail" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'transferId' in response_body: + self.__transfer_id = response_body['transferId'] + if 'transferRequestId' in response_body: + self.__transfer_request_id = response_body['transferRequestId'] + if 'transferFromDetail' in response_body: self.__transfer_from_detail = TransferFromDetail() - self.__transfer_from_detail.parse_rsp_body( - response_body["transferFromDetail"] - ) - if "transferToDetail" in response_body: + self.__transfer_from_detail.parse_rsp_body(response_body['transferFromDetail']) + if 'transferToDetail' in response_body: self.__transfer_to_detail = TransferToDetail() - self.__transfer_to_detail.parse_rsp_body(response_body["transferToDetail"]) + self.__transfer_to_detail.parse_rsp_body(response_body['transferToDetail']) diff --git a/com/alipay/ams/api/response/marketplace/alipay_inquire_balance_response.py b/com/alipay/ams/api/response/marketplace/alipay_inquire_balance_response.py index 4d339d0..08e8676 100644 --- a/com/alipay/ams/api/response/marketplace/alipay_inquire_balance_response.py +++ b/com/alipay/ams/api/response/marketplace/alipay_inquire_balance_response.py @@ -3,26 +3,28 @@ from com.alipay.ams.api.model.account_balance import AccountBalance -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayInquireBalanceResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__account_balances = None # type: [AccountBalance] - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayInquireBalanceResponse.""" + """Gets the result of this AlipayInquireBalanceResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def account_balances(self): """ @@ -34,24 +36,26 @@ def account_balances(self): def account_balances(self, value): self.__account_balances = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "account_balances") and self.account_balances is not None: - params["accountBalances"] = self.account_balances + params['accountBalances'] = self.account_balances return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayInquireBalanceResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayInquireBalanceResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "accountBalances" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'accountBalances' in response_body: self.__account_balances = [] - for item in response_body["accountBalances"]: + for item in response_body['accountBalances']: obj = AccountBalance() obj.parse_rsp_body(item) self.__account_balances.append(obj) diff --git a/com/alipay/ams/api/response/marketplace/alipay_register_response.py b/com/alipay/ams/api/response/marketplace/alipay_register_response.py index 4c407aa..a1fb8a1 100644 --- a/com/alipay/ams/api/response/marketplace/alipay_register_response.py +++ b/com/alipay/ams/api/response/marketplace/alipay_register_response.py @@ -2,26 +2,28 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayRegisterResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__registration_status = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayRegisterResponse.""" + """Gets the result of this AlipayRegisterResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def registration_status(self): """ @@ -33,23 +35,22 @@ def registration_status(self): def registration_status(self, value): self.__registration_status = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result - if ( - hasattr(self, "registration_status") - and self.registration_status is not None - ): - params["registrationStatus"] = self.registration_status + params['result'] = self.result + if hasattr(self, "registration_status") and self.registration_status is not None: + params['registrationStatus'] = self.registration_status return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayRegisterResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayRegisterResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "registrationStatus" in response_body: - self.__registration_status = response_body["registrationStatus"] + self.__result.parse_rsp_body(response_body['result']) + if 'registrationStatus' in response_body: + self.__registration_status = response_body['registrationStatus'] diff --git a/com/alipay/ams/api/response/marketplace/alipay_settle_response.py b/com/alipay/ams/api/response/marketplace/alipay_settle_response.py index 9789c5e..f845df3 100644 --- a/com/alipay/ams/api/response/marketplace/alipay_settle_response.py +++ b/com/alipay/ams/api/response/marketplace/alipay_settle_response.py @@ -2,27 +2,29 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipaySettleResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__settlement_request_id = None # type: str self.__settlement_id = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipaySettleResponse.""" + """Gets the result of this AlipaySettleResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def settlement_request_id(self): """ @@ -33,7 +35,6 @@ def settlement_request_id(self): @settlement_request_id.setter def settlement_request_id(self, value): self.__settlement_request_id = value - @property def settlement_id(self): """ @@ -45,25 +46,26 @@ def settlement_id(self): def settlement_id(self, value): self.__settlement_id = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result - if ( - hasattr(self, "settlement_request_id") - and self.settlement_request_id is not None - ): - params["settlementRequestId"] = self.settlement_request_id + params['result'] = self.result + if hasattr(self, "settlement_request_id") and self.settlement_request_id is not None: + params['settlementRequestId'] = self.settlement_request_id if hasattr(self, "settlement_id") and self.settlement_id is not None: - params["settlementId"] = self.settlement_id + params['settlementId'] = self.settlement_id return params + def parse_rsp_body(self, response_body): response_body = super(AlipaySettleResponse, self).parse_rsp_body(response_body) - if "result" in response_body: + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "settlementRequestId" in response_body: - self.__settlement_request_id = response_body["settlementRequestId"] - if "settlementId" in response_body: - self.__settlement_id = response_body["settlementId"] + self.__result.parse_rsp_body(response_body['result']) + if 'settlementRequestId' in response_body: + self.__settlement_request_id = response_body['settlementRequestId'] + if 'settlementId' in response_body: + self.__settlement_id = response_body['settlementId'] diff --git a/com/alipay/ams/api/response/marketplace/alipay_settlement_info_update_response.py b/com/alipay/ams/api/response/marketplace/alipay_settlement_info_update_response.py index da9957a..771be1a 100644 --- a/com/alipay/ams/api/response/marketplace/alipay_settlement_info_update_response.py +++ b/com/alipay/ams/api/response/marketplace/alipay_settlement_info_update_response.py @@ -2,26 +2,28 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipaySettlementInfoUpdateResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__update_status = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipaySettlementInfoUpdateResponse.""" + """Gets the result of this AlipaySettlementInfoUpdateResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def update_status(self): """ @@ -33,20 +35,22 @@ def update_status(self): def update_status(self, value): self.__update_status = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "update_status") and self.update_status is not None: - params["updateStatus"] = self.update_status + params['updateStatus'] = self.update_status return params + def parse_rsp_body(self, response_body): - response_body = super(AlipaySettlementInfoUpdateResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipaySettlementInfoUpdateResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "updateStatus" in response_body: - self.__update_status = response_body["updateStatus"] + self.__result.parse_rsp_body(response_body['result']) + if 'updateStatus' in response_body: + self.__update_status = response_body['updateStatus'] diff --git a/com/alipay/ams/api/response/marketplace/alipay_submit_attachment_response.py b/com/alipay/ams/api/response/marketplace/alipay_submit_attachment_response.py index 28438ad..ef88de7 100644 --- a/com/alipay/ams/api/response/marketplace/alipay_submit_attachment_response.py +++ b/com/alipay/ams/api/response/marketplace/alipay_submit_attachment_response.py @@ -3,28 +3,30 @@ from com.alipay.ams.api.model.attachment_type import AttachmentType -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipaySubmitAttachmentResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__submit_attachment_request_id = None # type: str self.__attachment_type = None # type: AttachmentType self.__attachment_key = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipaySubmitAttachmentResponse.""" + """Gets the result of this AlipaySubmitAttachmentResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def submit_attachment_request_id(self): """ @@ -35,16 +37,16 @@ def submit_attachment_request_id(self): @submit_attachment_request_id.setter def submit_attachment_request_id(self, value): self.__submit_attachment_request_id = value - @property def attachment_type(self): - """Gets the attachment_type of this AlipaySubmitAttachmentResponse.""" + """Gets the attachment_type of this AlipaySubmitAttachmentResponse. + + """ return self.__attachment_type @attachment_type.setter def attachment_type(self, value): self.__attachment_type = value - @property def attachment_key(self): """ @@ -56,36 +58,31 @@ def attachment_key(self): def attachment_key(self, value): self.__attachment_key = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result - if ( - hasattr(self, "submit_attachment_request_id") - and self.submit_attachment_request_id is not None - ): - params["submitAttachmentRequestId"] = self.submit_attachment_request_id + params['result'] = self.result + if hasattr(self, "submit_attachment_request_id") and self.submit_attachment_request_id is not None: + params['submitAttachmentRequestId'] = self.submit_attachment_request_id if hasattr(self, "attachment_type") and self.attachment_type is not None: - params["attachmentType"] = self.attachment_type + params['attachmentType'] = self.attachment_type if hasattr(self, "attachment_key") and self.attachment_key is not None: - params["attachmentKey"] = self.attachment_key + params['attachmentKey'] = self.attachment_key return params + def parse_rsp_body(self, response_body): - response_body = super(AlipaySubmitAttachmentResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipaySubmitAttachmentResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "submitAttachmentRequestId" in response_body: - self.__submit_attachment_request_id = response_body[ - "submitAttachmentRequestId" - ] - if "attachmentType" in response_body: - attachment_type_temp = AttachmentType.value_of( - response_body["attachmentType"] - ) + self.__result.parse_rsp_body(response_body['result']) + if 'submitAttachmentRequestId' in response_body: + self.__submit_attachment_request_id = response_body['submitAttachmentRequestId'] + if 'attachmentType' in response_body: + attachment_type_temp = AttachmentType.value_of(response_body['attachmentType']) self.__attachment_type = attachment_type_temp - if "attachmentKey" in response_body: - self.__attachment_key = response_body["attachmentKey"] + if 'attachmentKey' in response_body: + self.__attachment_key = response_body['attachmentKey'] diff --git a/com/alipay/ams/api/response/pay/alipay_capture_response.py b/com/alipay/ams/api/response/pay/alipay_capture_response.py index fec8a8d..47ee28e 100644 --- a/com/alipay/ams/api/response/pay/alipay_capture_response.py +++ b/com/alipay/ams/api/response/pay/alipay_capture_response.py @@ -3,12 +3,12 @@ from com.alipay.ams.api.model.amount import Amount -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayCaptureResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__capture_request_id = None # type: str @@ -17,17 +17,19 @@ def __init__(self, rsp_body): self.__capture_amount = None # type: Amount self.__capture_time = None # type: str self.__acquirer_reference_no = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayCaptureResponse.""" + """Gets the result of this AlipayCaptureResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def capture_request_id(self): """ @@ -38,7 +40,6 @@ def capture_request_id(self): @capture_request_id.setter def capture_request_id(self, value): self.__capture_request_id = value - @property def capture_id(self): """ @@ -49,7 +50,6 @@ def capture_id(self): @capture_id.setter def capture_id(self, value): self.__capture_id = value - @property def payment_id(self): """ @@ -60,16 +60,16 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def capture_amount(self): - """Gets the capture_amount of this AlipayCaptureResponse.""" + """Gets the capture_amount of this AlipayCaptureResponse. + + """ return self.__capture_amount @capture_amount.setter def capture_amount(self, value): self.__capture_amount = value - @property def capture_time(self): """ @@ -80,7 +80,6 @@ def capture_time(self): @capture_time.setter def capture_time(self, value): self.__capture_time = value - @property def acquirer_reference_no(self): """ @@ -92,42 +91,43 @@ def acquirer_reference_no(self): def acquirer_reference_no(self, value): self.__acquirer_reference_no = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "capture_request_id") and self.capture_request_id is not None: - params["captureRequestId"] = self.capture_request_id + params['captureRequestId'] = self.capture_request_id if hasattr(self, "capture_id") and self.capture_id is not None: - params["captureId"] = self.capture_id + params['captureId'] = self.capture_id if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id + params['paymentId'] = self.payment_id if hasattr(self, "capture_amount") and self.capture_amount is not None: - params["captureAmount"] = self.capture_amount + params['captureAmount'] = self.capture_amount if hasattr(self, "capture_time") and self.capture_time is not None: - params["captureTime"] = self.capture_time - if ( - hasattr(self, "acquirer_reference_no") - and self.acquirer_reference_no is not None - ): - params["acquirerReferenceNo"] = self.acquirer_reference_no + params['captureTime'] = self.capture_time + if hasattr(self, "acquirer_reference_no") and self.acquirer_reference_no is not None: + params['acquirerReferenceNo'] = self.acquirer_reference_no return params + def parse_rsp_body(self, response_body): response_body = super(AlipayCaptureResponse, self).parse_rsp_body(response_body) - if "result" in response_body: + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "captureRequestId" in response_body: - self.__capture_request_id = response_body["captureRequestId"] - if "captureId" in response_body: - self.__capture_id = response_body["captureId"] - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "captureAmount" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'captureRequestId' in response_body: + self.__capture_request_id = response_body['captureRequestId'] + if 'captureId' in response_body: + self.__capture_id = response_body['captureId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'captureAmount' in response_body: self.__capture_amount = Amount() - self.__capture_amount.parse_rsp_body(response_body["captureAmount"]) - if "captureTime" in response_body: - self.__capture_time = response_body["captureTime"] - if "acquirerReferenceNo" in response_body: - self.__acquirer_reference_no = response_body["acquirerReferenceNo"] + self.__capture_amount.parse_rsp_body(response_body['captureAmount']) + if 'captureTime' in response_body: + self.__capture_time = response_body['captureTime'] + if 'acquirerReferenceNo' in response_body: + self.__acquirer_reference_no = response_body['acquirerReferenceNo'] diff --git a/com/alipay/ams/api/response/pay/alipay_inquire_exchange_rate_response.py b/com/alipay/ams/api/response/pay/alipay_inquire_exchange_rate_response.py index 6597edc..0dd3625 100644 --- a/com/alipay/ams/api/response/pay/alipay_inquire_exchange_rate_response.py +++ b/com/alipay/ams/api/response/pay/alipay_inquire_exchange_rate_response.py @@ -3,53 +3,59 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayInquireExchangeRateResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__quotes = None # type: [Quote] self.__result = None # type: Result - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def quotes(self): - """Gets the quotes of this AlipayInquireExchangeRateResponse.""" + """Gets the quotes of this AlipayInquireExchangeRateResponse. + + """ return self.__quotes @quotes.setter def quotes(self, value): self.__quotes = value - @property def result(self): - """Gets the result of this AlipayInquireExchangeRateResponse.""" + """Gets the result of this AlipayInquireExchangeRateResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "quotes") and self.quotes is not None: - params["quotes"] = self.quotes + params['quotes'] = self.quotes if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayInquireExchangeRateResponse, self).parse_rsp_body( - response_body - ) - if "quotes" in response_body: + response_body = super(AlipayInquireExchangeRateResponse, self).parse_rsp_body(response_body) + if 'quotes' in response_body: self.__quotes = [] - for item in response_body["quotes"]: + for item in response_body['quotes']: obj = Quote() obj.parse_rsp_body(item) self.__quotes.append(obj) - if "result" in response_body: + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) + self.__result.parse_rsp_body(response_body['result']) diff --git a/com/alipay/ams/api/response/pay/alipay_inquiry_refund_response.py b/com/alipay/ams/api/response/pay/alipay_inquiry_refund_response.py index 92bec39..99e0cb6 100644 --- a/com/alipay/ams/api/response/pay/alipay_inquiry_refund_response.py +++ b/com/alipay/ams/api/response/pay/alipay_inquiry_refund_response.py @@ -9,12 +9,12 @@ from com.alipay.ams.api.model.acquirer_info import AcquirerInfo -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayInquiryRefundResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__metadata = None # type: str self.__customized_info = None # type: CustomizedInfo @@ -30,7 +30,8 @@ def __init__(self, rsp_body): self.__settlement_quote = None # type: Quote self.__acquirer_info = None # type: AcquirerInfo self.__rrn = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def metadata(self): @@ -42,16 +43,16 @@ def metadata(self): @metadata.setter def metadata(self, value): self.__metadata = value - @property def customized_info(self): - """Gets the customized_info of this AlipayInquiryRefundResponse.""" + """Gets the customized_info of this AlipayInquiryRefundResponse. + + """ return self.__customized_info @customized_info.setter def customized_info(self, value): self.__customized_info = value - @property def arn(self): """ @@ -62,36 +63,36 @@ def arn(self): @arn.setter def arn(self, value): self.__arn = value - @property def actual_refund_amount(self): - """Gets the actual_refund_amount of this AlipayInquiryRefundResponse.""" + """Gets the actual_refund_amount of this AlipayInquiryRefundResponse. + + """ return self.__actual_refund_amount @actual_refund_amount.setter def actual_refund_amount(self, value): self.__actual_refund_amount = value - @property def result(self): - """Gets the result of this AlipayInquiryRefundResponse.""" + """Gets the result of this AlipayInquiryRefundResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def refund_id(self): """ - The unique ID assigned by Antom to identify a refund. A one-to-one correspondence between refundId and refundRequestId exists. Note: This field is null when the refund record cannot be found, or result.resultStatus is F or U. + The unique ID assigned by Antom to identify a refund. A one-to-one correspondence between refundId and refundRequestId exists. Note: This field is null when the refund record cannot be found, or result.resultStatus is F or U. """ return self.__refund_id @refund_id.setter def refund_id(self, value): self.__refund_id = value - @property def refund_request_id(self): """ @@ -102,25 +103,26 @@ def refund_request_id(self): @refund_request_id.setter def refund_request_id(self, value): self.__refund_request_id = value - @property def refund_amount(self): - """Gets the refund_amount of this AlipayInquiryRefundResponse.""" + """Gets the refund_amount of this AlipayInquiryRefundResponse. + + """ return self.__refund_amount @refund_amount.setter def refund_amount(self, value): self.__refund_amount = value - @property def refund_status(self): - """Gets the refund_status of this AlipayInquiryRefundResponse.""" + """Gets the refund_status of this AlipayInquiryRefundResponse. + + """ return self.__refund_status @refund_status.setter def refund_status(self, value): self.__refund_status = value - @property def refund_time(self): """ @@ -131,34 +133,36 @@ def refund_time(self): @refund_time.setter def refund_time(self, value): self.__refund_time = value - @property def gross_settlement_amount(self): - """Gets the gross_settlement_amount of this AlipayInquiryRefundResponse.""" + """Gets the gross_settlement_amount of this AlipayInquiryRefundResponse. + + """ return self.__gross_settlement_amount @gross_settlement_amount.setter def gross_settlement_amount(self, value): self.__gross_settlement_amount = value - @property def settlement_quote(self): - """Gets the settlement_quote of this AlipayInquiryRefundResponse.""" + """Gets the settlement_quote of this AlipayInquiryRefundResponse. + + """ return self.__settlement_quote @settlement_quote.setter def settlement_quote(self, value): self.__settlement_quote = value - @property def acquirer_info(self): - """Gets the acquirer_info of this AlipayInquiryRefundResponse.""" + """Gets the acquirer_info of this AlipayInquiryRefundResponse. + + """ return self.__acquirer_info @acquirer_info.setter def acquirer_info(self, value): self.__acquirer_info = value - @property def rrn(self): """ @@ -170,87 +174,77 @@ def rrn(self): def rrn(self, value): self.__rrn = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "metadata") and self.metadata is not None: - params["metadata"] = self.metadata + params['metadata'] = self.metadata if hasattr(self, "customized_info") and self.customized_info is not None: - params["customizedInfo"] = self.customized_info + params['customizedInfo'] = self.customized_info if hasattr(self, "arn") and self.arn is not None: - params["arn"] = self.arn - if ( - hasattr(self, "actual_refund_amount") - and self.actual_refund_amount is not None - ): - params["actualRefundAmount"] = self.actual_refund_amount + params['arn'] = self.arn + if hasattr(self, "actual_refund_amount") and self.actual_refund_amount is not None: + params['actualRefundAmount'] = self.actual_refund_amount if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "refund_id") and self.refund_id is not None: - params["refundId"] = self.refund_id + params['refundId'] = self.refund_id if hasattr(self, "refund_request_id") and self.refund_request_id is not None: - params["refundRequestId"] = self.refund_request_id + params['refundRequestId'] = self.refund_request_id if hasattr(self, "refund_amount") and self.refund_amount is not None: - params["refundAmount"] = self.refund_amount + params['refundAmount'] = self.refund_amount if hasattr(self, "refund_status") and self.refund_status is not None: - params["refundStatus"] = self.refund_status + params['refundStatus'] = self.refund_status if hasattr(self, "refund_time") and self.refund_time is not None: - params["refundTime"] = self.refund_time - if ( - hasattr(self, "gross_settlement_amount") - and self.gross_settlement_amount is not None - ): - params["grossSettlementAmount"] = self.gross_settlement_amount + params['refundTime'] = self.refund_time + if hasattr(self, "gross_settlement_amount") and self.gross_settlement_amount is not None: + params['grossSettlementAmount'] = self.gross_settlement_amount if hasattr(self, "settlement_quote") and self.settlement_quote is not None: - params["settlementQuote"] = self.settlement_quote + params['settlementQuote'] = self.settlement_quote if hasattr(self, "acquirer_info") and self.acquirer_info is not None: - params["acquirerInfo"] = self.acquirer_info + params['acquirerInfo'] = self.acquirer_info if hasattr(self, "rrn") and self.rrn is not None: - params["rrn"] = self.rrn + params['rrn'] = self.rrn return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayInquiryRefundResponse, self).parse_rsp_body( - response_body - ) - if "metadata" in response_body: - self.__metadata = response_body["metadata"] - if "customizedInfo" in response_body: + response_body = super(AlipayInquiryRefundResponse, self).parse_rsp_body(response_body) + if 'metadata' in response_body: + self.__metadata = response_body['metadata'] + if 'customizedInfo' in response_body: self.__customized_info = CustomizedInfo() - self.__customized_info.parse_rsp_body(response_body["customizedInfo"]) - if "arn" in response_body: - self.__arn = response_body["arn"] - if "actualRefundAmount" in response_body: + self.__customized_info.parse_rsp_body(response_body['customizedInfo']) + if 'arn' in response_body: + self.__arn = response_body['arn'] + if 'actualRefundAmount' in response_body: self.__actual_refund_amount = Amount() - self.__actual_refund_amount.parse_rsp_body( - response_body["actualRefundAmount"] - ) - if "result" in response_body: + self.__actual_refund_amount.parse_rsp_body(response_body['actualRefundAmount']) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "refundId" in response_body: - self.__refund_id = response_body["refundId"] - if "refundRequestId" in response_body: - self.__refund_request_id = response_body["refundRequestId"] - if "refundAmount" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'refundId' in response_body: + self.__refund_id = response_body['refundId'] + if 'refundRequestId' in response_body: + self.__refund_request_id = response_body['refundRequestId'] + if 'refundAmount' in response_body: self.__refund_amount = Amount() - self.__refund_amount.parse_rsp_body(response_body["refundAmount"]) - if "refundStatus" in response_body: - refund_status_temp = TransactionStatusType.value_of( - response_body["refundStatus"] - ) + self.__refund_amount.parse_rsp_body(response_body['refundAmount']) + if 'refundStatus' in response_body: + refund_status_temp = TransactionStatusType.value_of(response_body['refundStatus']) self.__refund_status = refund_status_temp - if "refundTime" in response_body: - self.__refund_time = response_body["refundTime"] - if "grossSettlementAmount" in response_body: + if 'refundTime' in response_body: + self.__refund_time = response_body['refundTime'] + if 'grossSettlementAmount' in response_body: self.__gross_settlement_amount = Amount() - self.__gross_settlement_amount.parse_rsp_body( - response_body["grossSettlementAmount"] - ) - if "settlementQuote" in response_body: + self.__gross_settlement_amount.parse_rsp_body(response_body['grossSettlementAmount']) + if 'settlementQuote' in response_body: self.__settlement_quote = Quote() - self.__settlement_quote.parse_rsp_body(response_body["settlementQuote"]) - if "acquirerInfo" in response_body: + self.__settlement_quote.parse_rsp_body(response_body['settlementQuote']) + if 'acquirerInfo' in response_body: self.__acquirer_info = AcquirerInfo() - self.__acquirer_info.parse_rsp_body(response_body["acquirerInfo"]) - if "rrn" in response_body: - self.__rrn = response_body["rrn"] + self.__acquirer_info.parse_rsp_body(response_body['acquirerInfo']) + if 'rrn' in response_body: + self.__rrn = response_body['rrn'] diff --git a/com/alipay/ams/api/response/pay/alipay_pay_cancel_response.py b/com/alipay/ams/api/response/pay/alipay_pay_cancel_response.py index b19c5c5..f5c5a99 100644 --- a/com/alipay/ams/api/response/pay/alipay_pay_cancel_response.py +++ b/com/alipay/ams/api/response/pay/alipay_pay_cancel_response.py @@ -2,28 +2,30 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayPayCancelResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__payment_id = None # type: str self.__payment_request_id = None # type: str self.__cancel_time = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayPayCancelResponse.""" + """Gets the result of this AlipayPayCancelResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def payment_id(self): """ @@ -34,7 +36,6 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def payment_request_id(self): """ @@ -45,7 +46,6 @@ def payment_request_id(self): @payment_request_id.setter def payment_request_id(self, value): self.__payment_request_id = value - @property def cancel_time(self): """ @@ -57,28 +57,30 @@ def cancel_time(self): def cancel_time(self, value): self.__cancel_time = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id + params['paymentId'] = self.payment_id if hasattr(self, "payment_request_id") and self.payment_request_id is not None: - params["paymentRequestId"] = self.payment_request_id + params['paymentRequestId'] = self.payment_request_id if hasattr(self, "cancel_time") and self.cancel_time is not None: - params["cancelTime"] = self.cancel_time + params['cancelTime'] = self.cancel_time return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayPayCancelResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayPayCancelResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "paymentRequestId" in response_body: - self.__payment_request_id = response_body["paymentRequestId"] - if "cancelTime" in response_body: - self.__cancel_time = response_body["cancelTime"] + self.__result.parse_rsp_body(response_body['result']) + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] + if 'cancelTime' in response_body: + self.__cancel_time = response_body['cancelTime'] diff --git a/com/alipay/ams/api/response/pay/alipay_pay_consult_response.py b/com/alipay/ams/api/response/pay/alipay_pay_consult_response.py index 8211c3e..cff1a6a 100644 --- a/com/alipay/ams/api/response/pay/alipay_pay_consult_response.py +++ b/com/alipay/ams/api/response/pay/alipay_pay_consult_response.py @@ -4,28 +4,30 @@ from com.alipay.ams.api.model.payment_method_info import PaymentMethodInfo -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayPayConsultResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__payment_options = None # type: [PaymentOption] self.__payment_method_infos = None # type: [PaymentMethodInfo] self.__extend_info = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayPayConsultResponse.""" + """Gets the result of this AlipayPayConsultResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def payment_options(self): """ @@ -36,58 +38,59 @@ def payment_options(self): @payment_options.setter def payment_options(self, value): self.__payment_options = value - @property def payment_method_infos(self): - """Gets the payment_method_infos of this AlipayPayConsultResponse.""" + """Gets the payment_method_infos of this AlipayPayConsultResponse. + + """ return self.__payment_method_infos @payment_method_infos.setter def payment_method_infos(self, value): self.__payment_method_infos = value - @property def extend_info(self): - """Gets the extend_info of this AlipayPayConsultResponse.""" + """Gets the extend_info of this AlipayPayConsultResponse. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "payment_options") and self.payment_options is not None: - params["paymentOptions"] = self.payment_options - if ( - hasattr(self, "payment_method_infos") - and self.payment_method_infos is not None - ): - params["paymentMethodInfos"] = self.payment_method_infos + params['paymentOptions'] = self.payment_options + if hasattr(self, "payment_method_infos") and self.payment_method_infos is not None: + params['paymentMethodInfos'] = self.payment_method_infos if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayPayConsultResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayPayConsultResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "paymentOptions" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'paymentOptions' in response_body: self.__payment_options = [] - for item in response_body["paymentOptions"]: + for item in response_body['paymentOptions']: obj = PaymentOption() obj.parse_rsp_body(item) self.__payment_options.append(obj) - if "paymentMethodInfos" in response_body: + if 'paymentMethodInfos' in response_body: self.__payment_method_infos = [] - for item in response_body["paymentMethodInfos"]: + for item in response_body['paymentMethodInfos']: obj = PaymentMethodInfo() obj.parse_rsp_body(item) self.__payment_method_infos.append(obj) - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] diff --git a/com/alipay/ams/api/response/pay/alipay_pay_query_response.py b/com/alipay/ams/api/response/pay/alipay_pay_query_response.py index f8bafbc..6a44654 100644 --- a/com/alipay/ams/api/response/pay/alipay_pay_query_response.py +++ b/com/alipay/ams/api/response/pay/alipay_pay_query_response.py @@ -19,12 +19,12 @@ from com.alipay.ams.api.model.promotion_result import PromotionResult -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayPayQueryResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__metadata = None # type: str self.__result = None # type: Result @@ -58,7 +58,8 @@ def __init__(self, rsp_body): self.__promotion_results = None # type: [PromotionResult] self.__earliest_settlement_time = None # type: str self.__payment_method_type = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def metadata(self): @@ -70,65 +71,66 @@ def metadata(self): @metadata.setter def metadata(self, value): self.__metadata = value - @property def result(self): - """Gets the result of this AlipayPayQueryResponse.""" + """Gets the result of this AlipayPayQueryResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def customized_info(self): - """Gets the customized_info of this AlipayPayQueryResponse.""" + """Gets the customized_info of this AlipayPayQueryResponse. + + """ return self.__customized_info @customized_info.setter def customized_info(self, value): self.__customized_info = value - @property def processing_amount(self): - """Gets the processing_amount of this AlipayPayQueryResponse.""" + """Gets the processing_amount of this AlipayPayQueryResponse. + + """ return self.__processing_amount @processing_amount.setter def processing_amount(self, value): self.__processing_amount = value - @property def payment_status(self): - """Gets the payment_status of this AlipayPayQueryResponse.""" + """Gets the payment_status of this AlipayPayQueryResponse. + + """ return self.__payment_status @payment_status.setter def payment_status(self, value): self.__payment_status = value - @property def payment_result_code(self): """ - The result code for different payment statuses. Possible payment result codes are listed in the Payment result codes table on this page. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 64 characters + The result code for different payment statuses. Possible payment result codes are listed in the Payment result codes table on this page. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 64 characters """ return self.__payment_result_code @payment_result_code.setter def payment_result_code(self, value): self.__payment_result_code = value - @property def payment_result_message(self): """ - The result message that explains the payment result code. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 256 characters + The result message that explains the payment result code. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: Maximum length: 256 characters """ return self.__payment_result_message @payment_result_message.setter def payment_result_message(self, value): self.__payment_result_message = value - @property def payment_request_id(self): """ @@ -139,7 +141,6 @@ def payment_request_id(self): @payment_request_id.setter def payment_request_id(self, value): self.__payment_request_id = value - @property def payment_id(self): """ @@ -150,132 +151,136 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def auth_payment_id(self): - """Gets the auth_payment_id of this AlipayPayQueryResponse.""" + """Gets the auth_payment_id of this AlipayPayQueryResponse. + + """ return self.__auth_payment_id @auth_payment_id.setter def auth_payment_id(self, value): self.__auth_payment_id = value - @property def payment_amount(self): - """Gets the payment_amount of this AlipayPayQueryResponse.""" + """Gets the payment_amount of this AlipayPayQueryResponse. + + """ return self.__payment_amount @payment_amount.setter def payment_amount(self, value): self.__payment_amount = value - @property def actual_payment_amount(self): - """Gets the actual_payment_amount of this AlipayPayQueryResponse.""" + """Gets the actual_payment_amount of this AlipayPayQueryResponse. + + """ return self.__actual_payment_amount @actual_payment_amount.setter def actual_payment_amount(self, value): self.__actual_payment_amount = value - @property def payment_quote(self): - """Gets the payment_quote of this AlipayPayQueryResponse.""" + """Gets the payment_quote of this AlipayPayQueryResponse. + + """ return self.__payment_quote @payment_quote.setter def payment_quote(self, value): self.__payment_quote = value - @property def auth_expiry_time(self): """ - The expiration date and time of the authorization payment. You cannot capture the payment after this time. This parameter is returned when the value of paymentMethodType in the pay (Checkout Payment) API is CARD. More information about this field: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + The expiration date and time of the authorization payment. You cannot capture the payment after this time. This parameter is returned when the value of paymentMethodType in the pay (Checkout Payment) API is CARD. More information about this field: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__auth_expiry_time @auth_expiry_time.setter def auth_expiry_time(self, value): self.__auth_expiry_time = value - @property def payment_create_time(self): """ - The date and time when the payment is created. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + The date and time when the payment is created. Note: This field is returned when the API is called successfully (the value of result.resultStatus is S). More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__payment_create_time @payment_create_time.setter def payment_create_time(self, value): self.__payment_create_time = value - @property def payment_time(self): """ - The date and time when the payment reaches a final state of success. Note: This field is returned only when the payment reaches a final state of success (the value of paymentStatus is SUCCESS). More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + The date and time when the payment reaches a final state of success. Note: This field is returned only when the payment reaches a final state of success (the value of paymentStatus is SUCCESS). More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__payment_time @payment_time.setter def payment_time(self, value): self.__payment_time = value - @property def non_guarantee_coupon_amount(self): - """Gets the non_guarantee_coupon_amount of this AlipayPayQueryResponse.""" + """Gets the non_guarantee_coupon_amount of this AlipayPayQueryResponse. + + """ return self.__non_guarantee_coupon_amount @non_guarantee_coupon_amount.setter def non_guarantee_coupon_amount(self, value): self.__non_guarantee_coupon_amount = value - @property def psp_customer_info(self): - """Gets the psp_customer_info of this AlipayPayQueryResponse.""" + """Gets the psp_customer_info of this AlipayPayQueryResponse. + + """ return self.__psp_customer_info @psp_customer_info.setter def psp_customer_info(self, value): self.__psp_customer_info = value - @property def redirect_action_form(self): - """Gets the redirect_action_form of this AlipayPayQueryResponse.""" + """Gets the redirect_action_form of this AlipayPayQueryResponse. + + """ return self.__redirect_action_form @redirect_action_form.setter def redirect_action_form(self, value): self.__redirect_action_form = value - @property def card_info(self): - """Gets the card_info of this AlipayPayQueryResponse.""" + """Gets the card_info of this AlipayPayQueryResponse. + + """ return self.__card_info @card_info.setter def card_info(self, value): self.__card_info = value - @property def acquirer_reference_no(self): """ - The unique ID assigned by the non-Antom acquirer for the transaction. More information: Maximum length: 64 characters + The unique ID assigned by the non-Antom acquirer for the transaction. More information: Maximum length: 64 characters """ return self.__acquirer_reference_no @acquirer_reference_no.setter def acquirer_reference_no(self, value): self.__acquirer_reference_no = value - @property def extend_info(self): - """Gets the extend_info of this AlipayPayQueryResponse.""" + """Gets the extend_info of this AlipayPayQueryResponse. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def transactions(self): """ @@ -286,61 +291,66 @@ def transactions(self): @transactions.setter def transactions(self, value): self.__transactions = value - @property def customs_declaration_amount(self): - """Gets the customs_declaration_amount of this AlipayPayQueryResponse.""" + """Gets the customs_declaration_amount of this AlipayPayQueryResponse. + + """ return self.__customs_declaration_amount @customs_declaration_amount.setter def customs_declaration_amount(self, value): self.__customs_declaration_amount = value - @property def gross_settlement_amount(self): - """Gets the gross_settlement_amount of this AlipayPayQueryResponse.""" + """Gets the gross_settlement_amount of this AlipayPayQueryResponse. + + """ return self.__gross_settlement_amount @gross_settlement_amount.setter def gross_settlement_amount(self, value): self.__gross_settlement_amount = value - @property def settlement_quote(self): - """Gets the settlement_quote of this AlipayPayQueryResponse.""" + """Gets the settlement_quote of this AlipayPayQueryResponse. + + """ return self.__settlement_quote @settlement_quote.setter def settlement_quote(self, value): self.__settlement_quote = value - @property def payment_result_info(self): - """Gets the payment_result_info of this AlipayPayQueryResponse.""" + """Gets the payment_result_info of this AlipayPayQueryResponse. + + """ return self.__payment_result_info @payment_result_info.setter def payment_result_info(self, value): self.__payment_result_info = value - @property def acquirer_info(self): - """Gets the acquirer_info of this AlipayPayQueryResponse.""" + """Gets the acquirer_info of this AlipayPayQueryResponse. + + """ return self.__acquirer_info @acquirer_info.setter def acquirer_info(self, value): self.__acquirer_info = value - @property def merchant_account_id(self): - """Gets the merchant_account_id of this AlipayPayQueryResponse.""" + """Gets the merchant_account_id of this AlipayPayQueryResponse. + + """ return self.__merchant_account_id @merchant_account_id.setter def merchant_account_id(self, value): self.__merchant_account_id = value - @property def promotion_results(self): """ @@ -351,16 +361,16 @@ def promotion_results(self): @promotion_results.setter def promotion_results(self, value): self.__promotion_results = value - @property def earliest_settlement_time(self): - """Gets the earliest_settlement_time of this AlipayPayQueryResponse.""" + """Gets the earliest_settlement_time of this AlipayPayQueryResponse. + + """ return self.__earliest_settlement_time @earliest_settlement_time.setter def earliest_settlement_time(self, value): self.__earliest_settlement_time = value - @property def payment_method_type(self): """ @@ -372,216 +382,165 @@ def payment_method_type(self): def payment_method_type(self, value): self.__payment_method_type = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "metadata") and self.metadata is not None: - params["metadata"] = self.metadata + params['metadata'] = self.metadata if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "customized_info") and self.customized_info is not None: - params["customizedInfo"] = self.customized_info + params['customizedInfo'] = self.customized_info if hasattr(self, "processing_amount") and self.processing_amount is not None: - params["processingAmount"] = self.processing_amount + params['processingAmount'] = self.processing_amount if hasattr(self, "payment_status") and self.payment_status is not None: - params["paymentStatus"] = self.payment_status - if ( - hasattr(self, "payment_result_code") - and self.payment_result_code is not None - ): - params["paymentResultCode"] = self.payment_result_code - if ( - hasattr(self, "payment_result_message") - and self.payment_result_message is not None - ): - params["paymentResultMessage"] = self.payment_result_message + params['paymentStatus'] = self.payment_status + if hasattr(self, "payment_result_code") and self.payment_result_code is not None: + params['paymentResultCode'] = self.payment_result_code + if hasattr(self, "payment_result_message") and self.payment_result_message is not None: + params['paymentResultMessage'] = self.payment_result_message if hasattr(self, "payment_request_id") and self.payment_request_id is not None: - params["paymentRequestId"] = self.payment_request_id + params['paymentRequestId'] = self.payment_request_id if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id + params['paymentId'] = self.payment_id if hasattr(self, "auth_payment_id") and self.auth_payment_id is not None: - params["authPaymentId"] = self.auth_payment_id + params['authPaymentId'] = self.auth_payment_id if hasattr(self, "payment_amount") and self.payment_amount is not None: - params["paymentAmount"] = self.payment_amount - if ( - hasattr(self, "actual_payment_amount") - and self.actual_payment_amount is not None - ): - params["actualPaymentAmount"] = self.actual_payment_amount + params['paymentAmount'] = self.payment_amount + if hasattr(self, "actual_payment_amount") and self.actual_payment_amount is not None: + params['actualPaymentAmount'] = self.actual_payment_amount if hasattr(self, "payment_quote") and self.payment_quote is not None: - params["paymentQuote"] = self.payment_quote + params['paymentQuote'] = self.payment_quote if hasattr(self, "auth_expiry_time") and self.auth_expiry_time is not None: - params["authExpiryTime"] = self.auth_expiry_time - if ( - hasattr(self, "payment_create_time") - and self.payment_create_time is not None - ): - params["paymentCreateTime"] = self.payment_create_time + params['authExpiryTime'] = self.auth_expiry_time + if hasattr(self, "payment_create_time") and self.payment_create_time is not None: + params['paymentCreateTime'] = self.payment_create_time if hasattr(self, "payment_time") and self.payment_time is not None: - params["paymentTime"] = self.payment_time - if ( - hasattr(self, "non_guarantee_coupon_amount") - and self.non_guarantee_coupon_amount is not None - ): - params["nonGuaranteeCouponAmount"] = self.non_guarantee_coupon_amount + params['paymentTime'] = self.payment_time + if hasattr(self, "non_guarantee_coupon_amount") and self.non_guarantee_coupon_amount is not None: + params['nonGuaranteeCouponAmount'] = self.non_guarantee_coupon_amount if hasattr(self, "psp_customer_info") and self.psp_customer_info is not None: - params["pspCustomerInfo"] = self.psp_customer_info - if ( - hasattr(self, "redirect_action_form") - and self.redirect_action_form is not None - ): - params["redirectActionForm"] = self.redirect_action_form + params['pspCustomerInfo'] = self.psp_customer_info + if hasattr(self, "redirect_action_form") and self.redirect_action_form is not None: + params['redirectActionForm'] = self.redirect_action_form if hasattr(self, "card_info") and self.card_info is not None: - params["cardInfo"] = self.card_info - if ( - hasattr(self, "acquirer_reference_no") - and self.acquirer_reference_no is not None - ): - params["acquirerReferenceNo"] = self.acquirer_reference_no + params['cardInfo'] = self.card_info + if hasattr(self, "acquirer_reference_no") and self.acquirer_reference_no is not None: + params['acquirerReferenceNo'] = self.acquirer_reference_no if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "transactions") and self.transactions is not None: - params["transactions"] = self.transactions - if ( - hasattr(self, "customs_declaration_amount") - and self.customs_declaration_amount is not None - ): - params["customsDeclarationAmount"] = self.customs_declaration_amount - if ( - hasattr(self, "gross_settlement_amount") - and self.gross_settlement_amount is not None - ): - params["grossSettlementAmount"] = self.gross_settlement_amount + params['transactions'] = self.transactions + if hasattr(self, "customs_declaration_amount") and self.customs_declaration_amount is not None: + params['customsDeclarationAmount'] = self.customs_declaration_amount + if hasattr(self, "gross_settlement_amount") and self.gross_settlement_amount is not None: + params['grossSettlementAmount'] = self.gross_settlement_amount if hasattr(self, "settlement_quote") and self.settlement_quote is not None: - params["settlementQuote"] = self.settlement_quote - if ( - hasattr(self, "payment_result_info") - and self.payment_result_info is not None - ): - params["paymentResultInfo"] = self.payment_result_info + params['settlementQuote'] = self.settlement_quote + if hasattr(self, "payment_result_info") and self.payment_result_info is not None: + params['paymentResultInfo'] = self.payment_result_info if hasattr(self, "acquirer_info") and self.acquirer_info is not None: - params["acquirerInfo"] = self.acquirer_info - if ( - hasattr(self, "merchant_account_id") - and self.merchant_account_id is not None - ): - params["merchantAccountId"] = self.merchant_account_id + params['acquirerInfo'] = self.acquirer_info + if hasattr(self, "merchant_account_id") and self.merchant_account_id is not None: + params['merchantAccountId'] = self.merchant_account_id if hasattr(self, "promotion_results") and self.promotion_results is not None: - params["promotionResults"] = self.promotion_results - if ( - hasattr(self, "earliest_settlement_time") - and self.earliest_settlement_time is not None - ): - params["earliestSettlementTime"] = self.earliest_settlement_time - if ( - hasattr(self, "payment_method_type") - and self.payment_method_type is not None - ): - params["paymentMethodType"] = self.payment_method_type + params['promotionResults'] = self.promotion_results + if hasattr(self, "earliest_settlement_time") and self.earliest_settlement_time is not None: + params['earliestSettlementTime'] = self.earliest_settlement_time + if hasattr(self, "payment_method_type") and self.payment_method_type is not None: + params['paymentMethodType'] = self.payment_method_type return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayPayQueryResponse, self).parse_rsp_body( - response_body - ) - if "metadata" in response_body: - self.__metadata = response_body["metadata"] - if "result" in response_body: + response_body = super(AlipayPayQueryResponse, self).parse_rsp_body(response_body) + if 'metadata' in response_body: + self.__metadata = response_body['metadata'] + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "customizedInfo" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'customizedInfo' in response_body: self.__customized_info = CustomizedInfo() - self.__customized_info.parse_rsp_body(response_body["customizedInfo"]) - if "processingAmount" in response_body: + self.__customized_info.parse_rsp_body(response_body['customizedInfo']) + if 'processingAmount' in response_body: self.__processing_amount = Amount() - self.__processing_amount.parse_rsp_body(response_body["processingAmount"]) - if "paymentStatus" in response_body: - payment_status_temp = TransactionStatusType.value_of( - response_body["paymentStatus"] - ) + self.__processing_amount.parse_rsp_body(response_body['processingAmount']) + if 'paymentStatus' in response_body: + payment_status_temp = TransactionStatusType.value_of(response_body['paymentStatus']) self.__payment_status = payment_status_temp - if "paymentResultCode" in response_body: - self.__payment_result_code = response_body["paymentResultCode"] - if "paymentResultMessage" in response_body: - self.__payment_result_message = response_body["paymentResultMessage"] - if "paymentRequestId" in response_body: - self.__payment_request_id = response_body["paymentRequestId"] - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "authPaymentId" in response_body: - self.__auth_payment_id = response_body["authPaymentId"] - if "paymentAmount" in response_body: + if 'paymentResultCode' in response_body: + self.__payment_result_code = response_body['paymentResultCode'] + if 'paymentResultMessage' in response_body: + self.__payment_result_message = response_body['paymentResultMessage'] + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'authPaymentId' in response_body: + self.__auth_payment_id = response_body['authPaymentId'] + if 'paymentAmount' in response_body: self.__payment_amount = Amount() - self.__payment_amount.parse_rsp_body(response_body["paymentAmount"]) - if "actualPaymentAmount" in response_body: + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'actualPaymentAmount' in response_body: self.__actual_payment_amount = Amount() - self.__actual_payment_amount.parse_rsp_body( - response_body["actualPaymentAmount"] - ) - if "paymentQuote" in response_body: + self.__actual_payment_amount.parse_rsp_body(response_body['actualPaymentAmount']) + if 'paymentQuote' in response_body: self.__payment_quote = Quote() - self.__payment_quote.parse_rsp_body(response_body["paymentQuote"]) - if "authExpiryTime" in response_body: - self.__auth_expiry_time = response_body["authExpiryTime"] - if "paymentCreateTime" in response_body: - self.__payment_create_time = response_body["paymentCreateTime"] - if "paymentTime" in response_body: - self.__payment_time = response_body["paymentTime"] - if "nonGuaranteeCouponAmount" in response_body: + self.__payment_quote.parse_rsp_body(response_body['paymentQuote']) + if 'authExpiryTime' in response_body: + self.__auth_expiry_time = response_body['authExpiryTime'] + if 'paymentCreateTime' in response_body: + self.__payment_create_time = response_body['paymentCreateTime'] + if 'paymentTime' in response_body: + self.__payment_time = response_body['paymentTime'] + if 'nonGuaranteeCouponAmount' in response_body: self.__non_guarantee_coupon_amount = Amount() - self.__non_guarantee_coupon_amount.parse_rsp_body( - response_body["nonGuaranteeCouponAmount"] - ) - if "pspCustomerInfo" in response_body: + self.__non_guarantee_coupon_amount.parse_rsp_body(response_body['nonGuaranteeCouponAmount']) + if 'pspCustomerInfo' in response_body: self.__psp_customer_info = PspCustomerInfo() - self.__psp_customer_info.parse_rsp_body(response_body["pspCustomerInfo"]) - if "redirectActionForm" in response_body: + self.__psp_customer_info.parse_rsp_body(response_body['pspCustomerInfo']) + if 'redirectActionForm' in response_body: self.__redirect_action_form = RedirectActionForm() - self.__redirect_action_form.parse_rsp_body( - response_body["redirectActionForm"] - ) - if "cardInfo" in response_body: + self.__redirect_action_form.parse_rsp_body(response_body['redirectActionForm']) + if 'cardInfo' in response_body: self.__card_info = CardInfo() - self.__card_info.parse_rsp_body(response_body["cardInfo"]) - if "acquirerReferenceNo" in response_body: - self.__acquirer_reference_no = response_body["acquirerReferenceNo"] - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "transactions" in response_body: + self.__card_info.parse_rsp_body(response_body['cardInfo']) + if 'acquirerReferenceNo' in response_body: + self.__acquirer_reference_no = response_body['acquirerReferenceNo'] + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'transactions' in response_body: self.__transactions = [] - for item in response_body["transactions"]: + for item in response_body['transactions']: obj = Transaction() obj.parse_rsp_body(item) self.__transactions.append(obj) - if "customsDeclarationAmount" in response_body: + if 'customsDeclarationAmount' in response_body: self.__customs_declaration_amount = Amount() - self.__customs_declaration_amount.parse_rsp_body( - response_body["customsDeclarationAmount"] - ) - if "grossSettlementAmount" in response_body: + self.__customs_declaration_amount.parse_rsp_body(response_body['customsDeclarationAmount']) + if 'grossSettlementAmount' in response_body: self.__gross_settlement_amount = Amount() - self.__gross_settlement_amount.parse_rsp_body( - response_body["grossSettlementAmount"] - ) - if "settlementQuote" in response_body: + self.__gross_settlement_amount.parse_rsp_body(response_body['grossSettlementAmount']) + if 'settlementQuote' in response_body: self.__settlement_quote = Quote() - self.__settlement_quote.parse_rsp_body(response_body["settlementQuote"]) - if "paymentResultInfo" in response_body: + self.__settlement_quote.parse_rsp_body(response_body['settlementQuote']) + if 'paymentResultInfo' in response_body: self.__payment_result_info = PaymentResultInfo() - self.__payment_result_info.parse_rsp_body( - response_body["paymentResultInfo"] - ) - if "acquirerInfo" in response_body: + self.__payment_result_info.parse_rsp_body(response_body['paymentResultInfo']) + if 'acquirerInfo' in response_body: self.__acquirer_info = AcquirerInfo() - self.__acquirer_info.parse_rsp_body(response_body["acquirerInfo"]) - if "merchantAccountId" in response_body: - self.__merchant_account_id = response_body["merchantAccountId"] - if "promotionResults" in response_body: + self.__acquirer_info.parse_rsp_body(response_body['acquirerInfo']) + if 'merchantAccountId' in response_body: + self.__merchant_account_id = response_body['merchantAccountId'] + if 'promotionResults' in response_body: self.__promotion_results = [] - for item in response_body["promotionResults"]: + for item in response_body['promotionResults']: obj = PromotionResult() obj.parse_rsp_body(item) self.__promotion_results.append(obj) - if "earliestSettlementTime" in response_body: - self.__earliest_settlement_time = response_body["earliestSettlementTime"] - if "paymentMethodType" in response_body: - self.__payment_method_type = response_body["paymentMethodType"] + if 'earliestSettlementTime' in response_body: + self.__earliest_settlement_time = response_body['earliestSettlementTime'] + if 'paymentMethodType' in response_body: + self.__payment_method_type = response_body['paymentMethodType'] diff --git a/com/alipay/ams/api/response/pay/alipay_pay_response.py b/com/alipay/ams/api/response/pay/alipay_pay_response.py index bdd26ac..d4458a1 100644 --- a/com/alipay/ams/api/response/pay/alipay_pay_response.py +++ b/com/alipay/ams/api/response/pay/alipay_pay_response.py @@ -16,12 +16,12 @@ from com.alipay.ams.api.model.promotion_result import PromotionResult -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayPayResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__processing_amount = None # type: Amount @@ -50,26 +50,29 @@ def __init__(self, rsp_body): self.__payment_result_info = None # type: PaymentResultInfo self.__acquirer_info = None # type: AcquirerInfo self.__promotion_result = None # type: [PromotionResult] - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayPayResponse.""" + """Gets the result of this AlipayPayResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def processing_amount(self): - """Gets the processing_amount of this AlipayPayResponse.""" + """Gets the processing_amount of this AlipayPayResponse. + + """ return self.__processing_amount @processing_amount.setter def processing_amount(self, value): self.__processing_amount = value - @property def payment_request_id(self): """ @@ -80,7 +83,6 @@ def payment_request_id(self): @payment_request_id.setter def payment_request_id(self, value): self.__payment_request_id = value - @property def payment_id(self): """ @@ -91,16 +93,16 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def payment_amount(self): - """Gets the payment_amount of this AlipayPayResponse.""" + """Gets the payment_amount of this AlipayPayResponse. + + """ return self.__payment_amount @payment_amount.setter def payment_amount(self, value): self.__payment_amount = value - @property def payment_data(self): """ @@ -111,34 +113,36 @@ def payment_data(self): @payment_data.setter def payment_data(self, value): self.__payment_data = value - @property def actual_payment_amount(self): - """Gets the actual_payment_amount of this AlipayPayResponse.""" + """Gets the actual_payment_amount of this AlipayPayResponse. + + """ return self.__actual_payment_amount @actual_payment_amount.setter def actual_payment_amount(self, value): self.__actual_payment_amount = value - @property def payment_quote(self): - """Gets the payment_quote of this AlipayPayResponse.""" + """Gets the payment_quote of this AlipayPayResponse. + + """ return self.__payment_quote @payment_quote.setter def payment_quote(self, value): self.__payment_quote = value - @property def payment_time(self): - """Gets the payment_time of this AlipayPayResponse.""" + """Gets the payment_time of this AlipayPayResponse. + + """ return self.__payment_time @payment_time.setter def payment_time(self, value): self.__payment_time = value - @property def payment_create_time(self): """ @@ -149,108 +153,116 @@ def payment_create_time(self): @payment_create_time.setter def payment_create_time(self, value): self.__payment_create_time = value - @property def auth_expiry_time(self): - """Gets the auth_expiry_time of this AlipayPayResponse.""" + """Gets the auth_expiry_time of this AlipayPayResponse. + + """ return self.__auth_expiry_time @auth_expiry_time.setter def auth_expiry_time(self, value): self.__auth_expiry_time = value - @property def non_guarantee_coupon_value(self): - """Gets the non_guarantee_coupon_value of this AlipayPayResponse.""" + """Gets the non_guarantee_coupon_value of this AlipayPayResponse. + + """ return self.__non_guarantee_coupon_value @non_guarantee_coupon_value.setter def non_guarantee_coupon_value(self, value): self.__non_guarantee_coupon_value = value - @property def payment_action_form(self): - """Gets the payment_action_form of this AlipayPayResponse.""" + """Gets the payment_action_form of this AlipayPayResponse. + + """ return self.__payment_action_form @payment_action_form.setter def payment_action_form(self, value): self.__payment_action_form = value - @property def psp_customer_info(self): - """Gets the psp_customer_info of this AlipayPayResponse.""" + """Gets the psp_customer_info of this AlipayPayResponse. + + """ return self.__psp_customer_info @psp_customer_info.setter def psp_customer_info(self, value): self.__psp_customer_info = value - @property def challenge_action_form(self): - """Gets the challenge_action_form of this AlipayPayResponse.""" + """Gets the challenge_action_form of this AlipayPayResponse. + + """ return self.__challenge_action_form @challenge_action_form.setter def challenge_action_form(self, value): self.__challenge_action_form = value - @property def redirect_action_form(self): - """Gets the redirect_action_form of this AlipayPayResponse.""" + """Gets the redirect_action_form of this AlipayPayResponse. + + """ return self.__redirect_action_form @redirect_action_form.setter def redirect_action_form(self, value): self.__redirect_action_form = value - @property def order_code_form(self): - """Gets the order_code_form of this AlipayPayResponse.""" + """Gets the order_code_form of this AlipayPayResponse. + + """ return self.__order_code_form @order_code_form.setter def order_code_form(self, value): self.__order_code_form = value - @property def gross_settlement_amount(self): - """Gets the gross_settlement_amount of this AlipayPayResponse.""" + """Gets the gross_settlement_amount of this AlipayPayResponse. + + """ return self.__gross_settlement_amount @gross_settlement_amount.setter def gross_settlement_amount(self, value): self.__gross_settlement_amount = value - @property def settlement_quote(self): - """Gets the settlement_quote of this AlipayPayResponse.""" + """Gets the settlement_quote of this AlipayPayResponse. + + """ return self.__settlement_quote @settlement_quote.setter def settlement_quote(self, value): self.__settlement_quote = value - @property def extend_info(self): - """Gets the extend_info of this AlipayPayResponse.""" + """Gets the extend_info of this AlipayPayResponse. + + """ return self.__extend_info @extend_info.setter def extend_info(self, value): self.__extend_info = value - @property def normal_url(self): """ - The URL that redirects users to a WAP or WEB page in the default browser or the embedded WebView. Note: When the value of resultCode is ​PAYMENT_IN_PROCESS​, at least one of schemeUrl, applinkUrl, and normalUrl is to be returned. More information: Maximum length: 2048 characters + The URL that redirects users to a WAP or WEB page in the default browser or the embedded WebView. Note: When the value of resultCode is ​PAYMENT_IN_PROCESS​, at least one of schemeUrl, applinkUrl, and normalUrl is to be returned. More information: Maximum length: 2048 characters """ return self.__normal_url @normal_url.setter def normal_url(self, value): self.__normal_url = value - @property def scheme_url(self): """ @@ -261,7 +273,6 @@ def scheme_url(self): @scheme_url.setter def scheme_url(self, value): self.__scheme_url = value - @property def applink_url(self): """ @@ -272,7 +283,6 @@ def applink_url(self): @applink_url.setter def applink_url(self, value): self.__applink_url = value - @property def app_identifier(self): """ @@ -283,25 +293,26 @@ def app_identifier(self): @app_identifier.setter def app_identifier(self, value): self.__app_identifier = value - @property def payment_result_info(self): - """Gets the payment_result_info of this AlipayPayResponse.""" + """Gets the payment_result_info of this AlipayPayResponse. + + """ return self.__payment_result_info @payment_result_info.setter def payment_result_info(self, value): self.__payment_result_info = value - @property def acquirer_info(self): - """Gets the acquirer_info of this AlipayPayResponse.""" + """Gets the acquirer_info of this AlipayPayResponse. + + """ return self.__acquirer_info @acquirer_info.setter def acquirer_info(self, value): self.__acquirer_info = value - @property def promotion_result(self): """ @@ -313,171 +324,139 @@ def promotion_result(self): def promotion_result(self, value): self.__promotion_result = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "processing_amount") and self.processing_amount is not None: - params["processingAmount"] = self.processing_amount + params['processingAmount'] = self.processing_amount if hasattr(self, "payment_request_id") and self.payment_request_id is not None: - params["paymentRequestId"] = self.payment_request_id + params['paymentRequestId'] = self.payment_request_id if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id + params['paymentId'] = self.payment_id if hasattr(self, "payment_amount") and self.payment_amount is not None: - params["paymentAmount"] = self.payment_amount + params['paymentAmount'] = self.payment_amount if hasattr(self, "payment_data") and self.payment_data is not None: - params["paymentData"] = self.payment_data - if ( - hasattr(self, "actual_payment_amount") - and self.actual_payment_amount is not None - ): - params["actualPaymentAmount"] = self.actual_payment_amount + params['paymentData'] = self.payment_data + if hasattr(self, "actual_payment_amount") and self.actual_payment_amount is not None: + params['actualPaymentAmount'] = self.actual_payment_amount if hasattr(self, "payment_quote") and self.payment_quote is not None: - params["paymentQuote"] = self.payment_quote + params['paymentQuote'] = self.payment_quote if hasattr(self, "payment_time") and self.payment_time is not None: - params["paymentTime"] = self.payment_time - if ( - hasattr(self, "payment_create_time") - and self.payment_create_time is not None - ): - params["paymentCreateTime"] = self.payment_create_time + params['paymentTime'] = self.payment_time + if hasattr(self, "payment_create_time") and self.payment_create_time is not None: + params['paymentCreateTime'] = self.payment_create_time if hasattr(self, "auth_expiry_time") and self.auth_expiry_time is not None: - params["authExpiryTime"] = self.auth_expiry_time - if ( - hasattr(self, "non_guarantee_coupon_value") - and self.non_guarantee_coupon_value is not None - ): - params["nonGuaranteeCouponValue"] = self.non_guarantee_coupon_value - if ( - hasattr(self, "payment_action_form") - and self.payment_action_form is not None - ): - params["paymentActionForm"] = self.payment_action_form + params['authExpiryTime'] = self.auth_expiry_time + if hasattr(self, "non_guarantee_coupon_value") and self.non_guarantee_coupon_value is not None: + params['nonGuaranteeCouponValue'] = self.non_guarantee_coupon_value + if hasattr(self, "payment_action_form") and self.payment_action_form is not None: + params['paymentActionForm'] = self.payment_action_form if hasattr(self, "psp_customer_info") and self.psp_customer_info is not None: - params["pspCustomerInfo"] = self.psp_customer_info - if ( - hasattr(self, "challenge_action_form") - and self.challenge_action_form is not None - ): - params["challengeActionForm"] = self.challenge_action_form - if ( - hasattr(self, "redirect_action_form") - and self.redirect_action_form is not None - ): - params["redirectActionForm"] = self.redirect_action_form + params['pspCustomerInfo'] = self.psp_customer_info + if hasattr(self, "challenge_action_form") and self.challenge_action_form is not None: + params['challengeActionForm'] = self.challenge_action_form + if hasattr(self, "redirect_action_form") and self.redirect_action_form is not None: + params['redirectActionForm'] = self.redirect_action_form if hasattr(self, "order_code_form") and self.order_code_form is not None: - params["orderCodeForm"] = self.order_code_form - if ( - hasattr(self, "gross_settlement_amount") - and self.gross_settlement_amount is not None - ): - params["grossSettlementAmount"] = self.gross_settlement_amount + params['orderCodeForm'] = self.order_code_form + if hasattr(self, "gross_settlement_amount") and self.gross_settlement_amount is not None: + params['grossSettlementAmount'] = self.gross_settlement_amount if hasattr(self, "settlement_quote") and self.settlement_quote is not None: - params["settlementQuote"] = self.settlement_quote + params['settlementQuote'] = self.settlement_quote if hasattr(self, "extend_info") and self.extend_info is not None: - params["extendInfo"] = self.extend_info + params['extendInfo'] = self.extend_info if hasattr(self, "normal_url") and self.normal_url is not None: - params["normalUrl"] = self.normal_url + params['normalUrl'] = self.normal_url if hasattr(self, "scheme_url") and self.scheme_url is not None: - params["schemeUrl"] = self.scheme_url + params['schemeUrl'] = self.scheme_url if hasattr(self, "applink_url") and self.applink_url is not None: - params["applinkUrl"] = self.applink_url + params['applinkUrl'] = self.applink_url if hasattr(self, "app_identifier") and self.app_identifier is not None: - params["appIdentifier"] = self.app_identifier - if ( - hasattr(self, "payment_result_info") - and self.payment_result_info is not None - ): - params["paymentResultInfo"] = self.payment_result_info + params['appIdentifier'] = self.app_identifier + if hasattr(self, "payment_result_info") and self.payment_result_info is not None: + params['paymentResultInfo'] = self.payment_result_info if hasattr(self, "acquirer_info") and self.acquirer_info is not None: - params["acquirerInfo"] = self.acquirer_info + params['acquirerInfo'] = self.acquirer_info if hasattr(self, "promotion_result") and self.promotion_result is not None: - params["promotionResult"] = self.promotion_result + params['promotionResult'] = self.promotion_result return params + def parse_rsp_body(self, response_body): response_body = super(AlipayPayResponse, self).parse_rsp_body(response_body) - if "result" in response_body: + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "processingAmount" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'processingAmount' in response_body: self.__processing_amount = Amount() - self.__processing_amount.parse_rsp_body(response_body["processingAmount"]) - if "paymentRequestId" in response_body: - self.__payment_request_id = response_body["paymentRequestId"] - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "paymentAmount" in response_body: + self.__processing_amount.parse_rsp_body(response_body['processingAmount']) + if 'paymentRequestId' in response_body: + self.__payment_request_id = response_body['paymentRequestId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'paymentAmount' in response_body: self.__payment_amount = Amount() - self.__payment_amount.parse_rsp_body(response_body["paymentAmount"]) - if "paymentData" in response_body: - self.__payment_data = response_body["paymentData"] - if "actualPaymentAmount" in response_body: + self.__payment_amount.parse_rsp_body(response_body['paymentAmount']) + if 'paymentData' in response_body: + self.__payment_data = response_body['paymentData'] + if 'actualPaymentAmount' in response_body: self.__actual_payment_amount = Amount() - self.__actual_payment_amount.parse_rsp_body( - response_body["actualPaymentAmount"] - ) - if "paymentQuote" in response_body: + self.__actual_payment_amount.parse_rsp_body(response_body['actualPaymentAmount']) + if 'paymentQuote' in response_body: self.__payment_quote = Quote() - self.__payment_quote.parse_rsp_body(response_body["paymentQuote"]) - if "paymentTime" in response_body: - self.__payment_time = response_body["paymentTime"] - if "paymentCreateTime" in response_body: - self.__payment_create_time = response_body["paymentCreateTime"] - if "authExpiryTime" in response_body: - self.__auth_expiry_time = response_body["authExpiryTime"] - if "nonGuaranteeCouponValue" in response_body: + self.__payment_quote.parse_rsp_body(response_body['paymentQuote']) + if 'paymentTime' in response_body: + self.__payment_time = response_body['paymentTime'] + if 'paymentCreateTime' in response_body: + self.__payment_create_time = response_body['paymentCreateTime'] + if 'authExpiryTime' in response_body: + self.__auth_expiry_time = response_body['authExpiryTime'] + if 'nonGuaranteeCouponValue' in response_body: self.__non_guarantee_coupon_value = Amount() - self.__non_guarantee_coupon_value.parse_rsp_body( - response_body["nonGuaranteeCouponValue"] - ) - if "paymentActionForm" in response_body: - self.__payment_action_form = response_body["paymentActionForm"] - if "pspCustomerInfo" in response_body: + self.__non_guarantee_coupon_value.parse_rsp_body(response_body['nonGuaranteeCouponValue']) + if 'paymentActionForm' in response_body: + self.__payment_action_form = response_body['paymentActionForm'] + if 'pspCustomerInfo' in response_body: self.__psp_customer_info = PspCustomerInfo() - self.__psp_customer_info.parse_rsp_body(response_body["pspCustomerInfo"]) - if "challengeActionForm" in response_body: + self.__psp_customer_info.parse_rsp_body(response_body['pspCustomerInfo']) + if 'challengeActionForm' in response_body: self.__challenge_action_form = ChallengeActionForm() - self.__challenge_action_form.parse_rsp_body( - response_body["challengeActionForm"] - ) - if "redirectActionForm" in response_body: + self.__challenge_action_form.parse_rsp_body(response_body['challengeActionForm']) + if 'redirectActionForm' in response_body: self.__redirect_action_form = RedirectActionForm() - self.__redirect_action_form.parse_rsp_body( - response_body["redirectActionForm"] - ) - if "orderCodeForm" in response_body: + self.__redirect_action_form.parse_rsp_body(response_body['redirectActionForm']) + if 'orderCodeForm' in response_body: self.__order_code_form = OrderCodeForm() - self.__order_code_form.parse_rsp_body(response_body["orderCodeForm"]) - if "grossSettlementAmount" in response_body: + self.__order_code_form.parse_rsp_body(response_body['orderCodeForm']) + if 'grossSettlementAmount' in response_body: self.__gross_settlement_amount = Amount() - self.__gross_settlement_amount.parse_rsp_body( - response_body["grossSettlementAmount"] - ) - if "settlementQuote" in response_body: + self.__gross_settlement_amount.parse_rsp_body(response_body['grossSettlementAmount']) + if 'settlementQuote' in response_body: self.__settlement_quote = Quote() - self.__settlement_quote.parse_rsp_body(response_body["settlementQuote"]) - if "extendInfo" in response_body: - self.__extend_info = response_body["extendInfo"] - if "normalUrl" in response_body: - self.__normal_url = response_body["normalUrl"] - if "schemeUrl" in response_body: - self.__scheme_url = response_body["schemeUrl"] - if "applinkUrl" in response_body: - self.__applink_url = response_body["applinkUrl"] - if "appIdentifier" in response_body: - self.__app_identifier = response_body["appIdentifier"] - if "paymentResultInfo" in response_body: + self.__settlement_quote.parse_rsp_body(response_body['settlementQuote']) + if 'extendInfo' in response_body: + self.__extend_info = response_body['extendInfo'] + if 'normalUrl' in response_body: + self.__normal_url = response_body['normalUrl'] + if 'schemeUrl' in response_body: + self.__scheme_url = response_body['schemeUrl'] + if 'applinkUrl' in response_body: + self.__applink_url = response_body['applinkUrl'] + if 'appIdentifier' in response_body: + self.__app_identifier = response_body['appIdentifier'] + if 'paymentResultInfo' in response_body: self.__payment_result_info = PaymentResultInfo() - self.__payment_result_info.parse_rsp_body( - response_body["paymentResultInfo"] - ) - if "acquirerInfo" in response_body: + self.__payment_result_info.parse_rsp_body(response_body['paymentResultInfo']) + if 'acquirerInfo' in response_body: self.__acquirer_info = AcquirerInfo() - self.__acquirer_info.parse_rsp_body(response_body["acquirerInfo"]) - if "promotionResult" in response_body: + self.__acquirer_info.parse_rsp_body(response_body['acquirerInfo']) + if 'promotionResult' in response_body: self.__promotion_result = [] - for item in response_body["promotionResult"]: + for item in response_body['promotionResult']: obj = PromotionResult() obj.parse_rsp_body(item) self.__promotion_result.append(obj) diff --git a/com/alipay/ams/api/response/pay/alipay_payment_session_response.py b/com/alipay/ams/api/response/pay/alipay_payment_session_response.py index 6228165..023671e 100644 --- a/com/alipay/ams/api/response/pay/alipay_payment_session_response.py +++ b/com/alipay/ams/api/response/pay/alipay_payment_session_response.py @@ -2,12 +2,12 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayPaymentSessionResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__payment_session_data = None # type: str @@ -15,17 +15,19 @@ def __init__(self, rsp_body): self.__payment_session_id = None # type: str self.__normal_url = None # type: str self.__url = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayPaymentSessionResponse.""" + """Gets the result of this AlipayPaymentSessionResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def payment_session_data(self): """ @@ -36,7 +38,6 @@ def payment_session_data(self): @payment_session_data.setter def payment_session_data(self, value): self.__payment_session_data = value - @property def payment_session_expiry_time(self): """ @@ -47,7 +48,6 @@ def payment_session_expiry_time(self): @payment_session_expiry_time.setter def payment_session_expiry_time(self, value): self.__payment_session_expiry_time = value - @property def payment_session_id(self): """ @@ -58,7 +58,6 @@ def payment_session_id(self): @payment_session_id.setter def payment_session_id(self, value): self.__payment_session_id = value - @property def normal_url(self): """ @@ -69,7 +68,6 @@ def normal_url(self): @normal_url.setter def normal_url(self, value): self.__normal_url = value - @property def url(self): """ @@ -81,44 +79,38 @@ def url(self): def url(self, value): self.__url = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result - if ( - hasattr(self, "payment_session_data") - and self.payment_session_data is not None - ): - params["paymentSessionData"] = self.payment_session_data - if ( - hasattr(self, "payment_session_expiry_time") - and self.payment_session_expiry_time is not None - ): - params["paymentSessionExpiryTime"] = self.payment_session_expiry_time + params['result'] = self.result + if hasattr(self, "payment_session_data") and self.payment_session_data is not None: + params['paymentSessionData'] = self.payment_session_data + if hasattr(self, "payment_session_expiry_time") and self.payment_session_expiry_time is not None: + params['paymentSessionExpiryTime'] = self.payment_session_expiry_time if hasattr(self, "payment_session_id") and self.payment_session_id is not None: - params["paymentSessionId"] = self.payment_session_id + params['paymentSessionId'] = self.payment_session_id if hasattr(self, "normal_url") and self.normal_url is not None: - params["normalUrl"] = self.normal_url + params['normalUrl'] = self.normal_url if hasattr(self, "url") and self.url is not None: - params["url"] = self.url + params['url'] = self.url return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayPaymentSessionResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayPaymentSessionResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "paymentSessionData" in response_body: - self.__payment_session_data = response_body["paymentSessionData"] - if "paymentSessionExpiryTime" in response_body: - self.__payment_session_expiry_time = response_body[ - "paymentSessionExpiryTime" - ] - if "paymentSessionId" in response_body: - self.__payment_session_id = response_body["paymentSessionId"] - if "normalUrl" in response_body: - self.__normal_url = response_body["normalUrl"] - if "url" in response_body: - self.__url = response_body["url"] + self.__result.parse_rsp_body(response_body['result']) + if 'paymentSessionData' in response_body: + self.__payment_session_data = response_body['paymentSessionData'] + if 'paymentSessionExpiryTime' in response_body: + self.__payment_session_expiry_time = response_body['paymentSessionExpiryTime'] + if 'paymentSessionId' in response_body: + self.__payment_session_id = response_body['paymentSessionId'] + if 'normalUrl' in response_body: + self.__normal_url = response_body['normalUrl'] + if 'url' in response_body: + self.__url = response_body['url'] diff --git a/com/alipay/ams/api/response/pay/alipay_refund_response.py b/com/alipay/ams/api/response/pay/alipay_refund_response.py index 3ffbd45..5b0fc21 100644 --- a/com/alipay/ams/api/response/pay/alipay_refund_response.py +++ b/com/alipay/ams/api/response/pay/alipay_refund_response.py @@ -8,12 +8,12 @@ from com.alipay.ams.api.model.acquirer_info import AcquirerInfo -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayRefundResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__actual_refund_amount = None # type: Amount @@ -27,26 +27,29 @@ def __init__(self, rsp_body): self.__settlement_quote = None # type: Quote self.__acquirer_info = None # type: AcquirerInfo self.__acquirer_reference_no = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayRefundResponse.""" + """Gets the result of this AlipayRefundResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def actual_refund_amount(self): - """Gets the actual_refund_amount of this AlipayRefundResponse.""" + """Gets the actual_refund_amount of this AlipayRefundResponse. + + """ return self.__actual_refund_amount @actual_refund_amount.setter def actual_refund_amount(self, value): self.__actual_refund_amount = value - @property def refund_request_id(self): """ @@ -57,7 +60,6 @@ def refund_request_id(self): @refund_request_id.setter def refund_request_id(self, value): self.__refund_request_id = value - @property def refund_id(self): """ @@ -68,7 +70,6 @@ def refund_id(self): @refund_id.setter def refund_id(self, value): self.__refund_id = value - @property def payment_id(self): """ @@ -79,63 +80,66 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def refund_amount(self): - """Gets the refund_amount of this AlipayRefundResponse.""" + """Gets the refund_amount of this AlipayRefundResponse. + + """ return self.__refund_amount @refund_amount.setter def refund_amount(self, value): self.__refund_amount = value - @property def refund_time(self): """ - The date and time when the refund reaches the state of success, failure, or unknown. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". + The date and time when the refund reaches the state of success, failure, or unknown. More information: The value follows the ISO 8601 standard format. For example, \"2019-11-27T12:01:01+08:00\". """ return self.__refund_time @refund_time.setter def refund_time(self, value): self.__refund_time = value - @property def refund_non_guarantee_coupon_amount(self): - """Gets the refund_non_guarantee_coupon_amount of this AlipayRefundResponse.""" + """Gets the refund_non_guarantee_coupon_amount of this AlipayRefundResponse. + + """ return self.__refund_non_guarantee_coupon_amount @refund_non_guarantee_coupon_amount.setter def refund_non_guarantee_coupon_amount(self, value): self.__refund_non_guarantee_coupon_amount = value - @property def gross_settlement_amount(self): - """Gets the gross_settlement_amount of this AlipayRefundResponse.""" + """Gets the gross_settlement_amount of this AlipayRefundResponse. + + """ return self.__gross_settlement_amount @gross_settlement_amount.setter def gross_settlement_amount(self, value): self.__gross_settlement_amount = value - @property def settlement_quote(self): - """Gets the settlement_quote of this AlipayRefundResponse.""" + """Gets the settlement_quote of this AlipayRefundResponse. + + """ return self.__settlement_quote @settlement_quote.setter def settlement_quote(self, value): self.__settlement_quote = value - @property def acquirer_info(self): - """Gets the acquirer_info of this AlipayRefundResponse.""" + """Gets the acquirer_info of this AlipayRefundResponse. + + """ return self.__acquirer_info @acquirer_info.setter def acquirer_info(self, value): self.__acquirer_info = value - @property def acquirer_reference_no(self): """ @@ -147,84 +151,68 @@ def acquirer_reference_no(self): def acquirer_reference_no(self, value): self.__acquirer_reference_no = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result - if ( - hasattr(self, "actual_refund_amount") - and self.actual_refund_amount is not None - ): - params["actualRefundAmount"] = self.actual_refund_amount + params['result'] = self.result + if hasattr(self, "actual_refund_amount") and self.actual_refund_amount is not None: + params['actualRefundAmount'] = self.actual_refund_amount if hasattr(self, "refund_request_id") and self.refund_request_id is not None: - params["refundRequestId"] = self.refund_request_id + params['refundRequestId'] = self.refund_request_id if hasattr(self, "refund_id") and self.refund_id is not None: - params["refundId"] = self.refund_id + params['refundId'] = self.refund_id if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id + params['paymentId'] = self.payment_id if hasattr(self, "refund_amount") and self.refund_amount is not None: - params["refundAmount"] = self.refund_amount + params['refundAmount'] = self.refund_amount if hasattr(self, "refund_time") and self.refund_time is not None: - params["refundTime"] = self.refund_time - if ( - hasattr(self, "refund_non_guarantee_coupon_amount") - and self.refund_non_guarantee_coupon_amount is not None - ): - params["refundNonGuaranteeCouponAmount"] = ( - self.refund_non_guarantee_coupon_amount - ) - if ( - hasattr(self, "gross_settlement_amount") - and self.gross_settlement_amount is not None - ): - params["grossSettlementAmount"] = self.gross_settlement_amount + params['refundTime'] = self.refund_time + if hasattr(self, "refund_non_guarantee_coupon_amount") and self.refund_non_guarantee_coupon_amount is not None: + params['refundNonGuaranteeCouponAmount'] = self.refund_non_guarantee_coupon_amount + if hasattr(self, "gross_settlement_amount") and self.gross_settlement_amount is not None: + params['grossSettlementAmount'] = self.gross_settlement_amount if hasattr(self, "settlement_quote") and self.settlement_quote is not None: - params["settlementQuote"] = self.settlement_quote + params['settlementQuote'] = self.settlement_quote if hasattr(self, "acquirer_info") and self.acquirer_info is not None: - params["acquirerInfo"] = self.acquirer_info - if ( - hasattr(self, "acquirer_reference_no") - and self.acquirer_reference_no is not None - ): - params["acquirerReferenceNo"] = self.acquirer_reference_no + params['acquirerInfo'] = self.acquirer_info + if hasattr(self, "acquirer_reference_no") and self.acquirer_reference_no is not None: + params['acquirerReferenceNo'] = self.acquirer_reference_no return params + def parse_rsp_body(self, response_body): response_body = super(AlipayRefundResponse, self).parse_rsp_body(response_body) - if "result" in response_body: + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "actualRefundAmount" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'actualRefundAmount' in response_body: self.__actual_refund_amount = Amount() - self.__actual_refund_amount.parse_rsp_body( - response_body["actualRefundAmount"] - ) - if "refundRequestId" in response_body: - self.__refund_request_id = response_body["refundRequestId"] - if "refundId" in response_body: - self.__refund_id = response_body["refundId"] - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "refundAmount" in response_body: + self.__actual_refund_amount.parse_rsp_body(response_body['actualRefundAmount']) + if 'refundRequestId' in response_body: + self.__refund_request_id = response_body['refundRequestId'] + if 'refundId' in response_body: + self.__refund_id = response_body['refundId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'refundAmount' in response_body: self.__refund_amount = Amount() - self.__refund_amount.parse_rsp_body(response_body["refundAmount"]) - if "refundTime" in response_body: - self.__refund_time = response_body["refundTime"] - if "refundNonGuaranteeCouponAmount" in response_body: + self.__refund_amount.parse_rsp_body(response_body['refundAmount']) + if 'refundTime' in response_body: + self.__refund_time = response_body['refundTime'] + if 'refundNonGuaranteeCouponAmount' in response_body: self.__refund_non_guarantee_coupon_amount = Amount() - self.__refund_non_guarantee_coupon_amount.parse_rsp_body( - response_body["refundNonGuaranteeCouponAmount"] - ) - if "grossSettlementAmount" in response_body: + self.__refund_non_guarantee_coupon_amount.parse_rsp_body(response_body['refundNonGuaranteeCouponAmount']) + if 'grossSettlementAmount' in response_body: self.__gross_settlement_amount = Amount() - self.__gross_settlement_amount.parse_rsp_body( - response_body["grossSettlementAmount"] - ) - if "settlementQuote" in response_body: + self.__gross_settlement_amount.parse_rsp_body(response_body['grossSettlementAmount']) + if 'settlementQuote' in response_body: self.__settlement_quote = Quote() - self.__settlement_quote.parse_rsp_body(response_body["settlementQuote"]) - if "acquirerInfo" in response_body: + self.__settlement_quote.parse_rsp_body(response_body['settlementQuote']) + if 'acquirerInfo' in response_body: self.__acquirer_info = AcquirerInfo() - self.__acquirer_info.parse_rsp_body(response_body["acquirerInfo"]) - if "acquirerReferenceNo" in response_body: - self.__acquirer_reference_no = response_body["acquirerReferenceNo"] + self.__acquirer_info.parse_rsp_body(response_body['acquirerInfo']) + if 'acquirerReferenceNo' in response_body: + self.__acquirer_reference_no = response_body['acquirerReferenceNo'] diff --git a/com/alipay/ams/api/response/pay/alipay_vaulting_payment_method_response.py b/com/alipay/ams/api/response/pay/alipay_vaulting_payment_method_response.py index c0f3578..df61eb4 100644 --- a/com/alipay/ams/api/response/pay/alipay_vaulting_payment_method_response.py +++ b/com/alipay/ams/api/response/pay/alipay_vaulting_payment_method_response.py @@ -3,12 +3,12 @@ from com.alipay.ams.api.model.payment_method_detail import PaymentMethodDetail -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayVaultingPaymentMethodResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__vaulting_request_id = None # type: str @@ -16,17 +16,19 @@ def __init__(self, rsp_body): self.__normal_url = None # type: str self.__scheme_url = None # type: str self.__applink_url = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayVaultingPaymentMethodResponse.""" + """Gets the result of this AlipayVaultingPaymentMethodResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def vaulting_request_id(self): """ @@ -37,16 +39,16 @@ def vaulting_request_id(self): @vaulting_request_id.setter def vaulting_request_id(self, value): self.__vaulting_request_id = value - @property def payment_method_detail(self): - """Gets the payment_method_detail of this AlipayVaultingPaymentMethodResponse.""" + """Gets the payment_method_detail of this AlipayVaultingPaymentMethodResponse. + + """ return self.__payment_method_detail @payment_method_detail.setter def payment_method_detail(self, value): self.__payment_method_detail = value - @property def normal_url(self): """ @@ -57,7 +59,6 @@ def normal_url(self): @normal_url.setter def normal_url(self, value): self.__normal_url = value - @property def scheme_url(self): """ @@ -68,7 +69,6 @@ def scheme_url(self): @scheme_url.setter def scheme_url(self, value): self.__scheme_url = value - @property def applink_url(self): """ @@ -80,45 +80,39 @@ def applink_url(self): def applink_url(self, value): self.__applink_url = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result - if ( - hasattr(self, "vaulting_request_id") - and self.vaulting_request_id is not None - ): - params["vaultingRequestId"] = self.vaulting_request_id - if ( - hasattr(self, "payment_method_detail") - and self.payment_method_detail is not None - ): - params["paymentMethodDetail"] = self.payment_method_detail + params['result'] = self.result + if hasattr(self, "vaulting_request_id") and self.vaulting_request_id is not None: + params['vaultingRequestId'] = self.vaulting_request_id + if hasattr(self, "payment_method_detail") and self.payment_method_detail is not None: + params['paymentMethodDetail'] = self.payment_method_detail if hasattr(self, "normal_url") and self.normal_url is not None: - params["normalUrl"] = self.normal_url + params['normalUrl'] = self.normal_url if hasattr(self, "scheme_url") and self.scheme_url is not None: - params["schemeUrl"] = self.scheme_url + params['schemeUrl'] = self.scheme_url if hasattr(self, "applink_url") and self.applink_url is not None: - params["applinkUrl"] = self.applink_url + params['applinkUrl'] = self.applink_url return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayVaultingPaymentMethodResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayVaultingPaymentMethodResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "vaultingRequestId" in response_body: - self.__vaulting_request_id = response_body["vaultingRequestId"] - if "paymentMethodDetail" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'vaultingRequestId' in response_body: + self.__vaulting_request_id = response_body['vaultingRequestId'] + if 'paymentMethodDetail' in response_body: self.__payment_method_detail = PaymentMethodDetail() - self.__payment_method_detail.parse_rsp_body( - response_body["paymentMethodDetail"] - ) - if "normalUrl" in response_body: - self.__normal_url = response_body["normalUrl"] - if "schemeUrl" in response_body: - self.__scheme_url = response_body["schemeUrl"] - if "applinkUrl" in response_body: - self.__applink_url = response_body["applinkUrl"] + self.__payment_method_detail.parse_rsp_body(response_body['paymentMethodDetail']) + if 'normalUrl' in response_body: + self.__normal_url = response_body['normalUrl'] + if 'schemeUrl' in response_body: + self.__scheme_url = response_body['schemeUrl'] + if 'applinkUrl' in response_body: + self.__applink_url = response_body['applinkUrl'] diff --git a/com/alipay/ams/api/response/pay/alipay_vaulting_query_response.py b/com/alipay/ams/api/response/pay/alipay_vaulting_query_response.py index 3ad8fe6..0d70a02 100644 --- a/com/alipay/ams/api/response/pay/alipay_vaulting_query_response.py +++ b/com/alipay/ams/api/response/pay/alipay_vaulting_query_response.py @@ -3,12 +3,12 @@ from com.alipay.ams.api.model.payment_method_detail import PaymentMethodDetail -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayVaultingQueryResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__vaulting_request_id = None # type: str @@ -18,17 +18,19 @@ def __init__(self, rsp_body): self.__vaulting_status = None # type: str self.__payment_method_detail = None # type: PaymentMethodDetail self.__metadata = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayVaultingQueryResponse.""" + """Gets the result of this AlipayVaultingQueryResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def vaulting_request_id(self): """ @@ -39,7 +41,6 @@ def vaulting_request_id(self): @vaulting_request_id.setter def vaulting_request_id(self, value): self.__vaulting_request_id = value - @property def normal_url(self): """ @@ -50,7 +51,6 @@ def normal_url(self): @normal_url.setter def normal_url(self, value): self.__normal_url = value - @property def scheme_url(self): """ @@ -61,18 +61,16 @@ def scheme_url(self): @scheme_url.setter def scheme_url(self, value): self.__scheme_url = value - @property def applink_url(self): """ - The URL that redirects users to open an app when the target app is installed, or to open a WAP page when the target app is not installed. For Android, the URL is a Native App Link. For iOS, the URL is a Universal Link. Note: When the value of result.resultStatus is S and the value of vaultingStatus is PROCESSING, one or more of the following URLs may be returned: schemeUrl, applinkUrl, and normalUrl. More information: Maximum length: 2048 characters + The URL that redirects users to open an app when the target app is installed, or to open a WAP page when the target app is not installed. For Android, the URL is a Native App Link. For iOS, the URL is a Universal Link. Note: When the value of result.resultStatus is S and the value of vaultingStatus is PROCESSING, one or more of the following URLs may be returned: schemeUrl, applinkUrl, and normalUrl. More information: Maximum length: 2048 characters """ return self.__applink_url @applink_url.setter def applink_url(self, value): self.__applink_url = value - @property def vaulting_status(self): """ @@ -83,16 +81,16 @@ def vaulting_status(self): @vaulting_status.setter def vaulting_status(self, value): self.__vaulting_status = value - @property def payment_method_detail(self): - """Gets the payment_method_detail of this AlipayVaultingQueryResponse.""" + """Gets the payment_method_detail of this AlipayVaultingQueryResponse. + + """ return self.__payment_method_detail @payment_method_detail.setter def payment_method_detail(self, value): self.__payment_method_detail = value - @property def metadata(self): """ @@ -104,53 +102,47 @@ def metadata(self): def metadata(self, value): self.__metadata = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result - if ( - hasattr(self, "vaulting_request_id") - and self.vaulting_request_id is not None - ): - params["vaultingRequestId"] = self.vaulting_request_id + params['result'] = self.result + if hasattr(self, "vaulting_request_id") and self.vaulting_request_id is not None: + params['vaultingRequestId'] = self.vaulting_request_id if hasattr(self, "normal_url") and self.normal_url is not None: - params["normalUrl"] = self.normal_url + params['normalUrl'] = self.normal_url if hasattr(self, "scheme_url") and self.scheme_url is not None: - params["schemeUrl"] = self.scheme_url + params['schemeUrl'] = self.scheme_url if hasattr(self, "applink_url") and self.applink_url is not None: - params["applinkUrl"] = self.applink_url + params['applinkUrl'] = self.applink_url if hasattr(self, "vaulting_status") and self.vaulting_status is not None: - params["vaultingStatus"] = self.vaulting_status - if ( - hasattr(self, "payment_method_detail") - and self.payment_method_detail is not None - ): - params["paymentMethodDetail"] = self.payment_method_detail + params['vaultingStatus'] = self.vaulting_status + if hasattr(self, "payment_method_detail") and self.payment_method_detail is not None: + params['paymentMethodDetail'] = self.payment_method_detail if hasattr(self, "metadata") and self.metadata is not None: - params["metadata"] = self.metadata + params['metadata'] = self.metadata return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayVaultingQueryResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayVaultingQueryResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "vaultingRequestId" in response_body: - self.__vaulting_request_id = response_body["vaultingRequestId"] - if "normalUrl" in response_body: - self.__normal_url = response_body["normalUrl"] - if "schemeUrl" in response_body: - self.__scheme_url = response_body["schemeUrl"] - if "applinkUrl" in response_body: - self.__applink_url = response_body["applinkUrl"] - if "vaultingStatus" in response_body: - self.__vaulting_status = response_body["vaultingStatus"] - if "paymentMethodDetail" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'vaultingRequestId' in response_body: + self.__vaulting_request_id = response_body['vaultingRequestId'] + if 'normalUrl' in response_body: + self.__normal_url = response_body['normalUrl'] + if 'schemeUrl' in response_body: + self.__scheme_url = response_body['schemeUrl'] + if 'applinkUrl' in response_body: + self.__applink_url = response_body['applinkUrl'] + if 'vaultingStatus' in response_body: + self.__vaulting_status = response_body['vaultingStatus'] + if 'paymentMethodDetail' in response_body: self.__payment_method_detail = PaymentMethodDetail() - self.__payment_method_detail.parse_rsp_body( - response_body["paymentMethodDetail"] - ) - if "metadata" in response_body: - self.__metadata = response_body["metadata"] + self.__payment_method_detail.parse_rsp_body(response_body['paymentMethodDetail']) + if 'metadata' in response_body: + self.__metadata = response_body['metadata'] diff --git a/com/alipay/ams/api/response/pay/alipay_vaulting_session_response.py b/com/alipay/ams/api/response/pay/alipay_vaulting_session_response.py index 7f47554..a8e58ab 100644 --- a/com/alipay/ams/api/response/pay/alipay_vaulting_session_response.py +++ b/com/alipay/ams/api/response/pay/alipay_vaulting_session_response.py @@ -2,51 +2,51 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipayVaultingSessionResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__vaulting_session_data = None # type: str self.__vaulting_session_id = None # type: str self.__vaulting_session_expiry_time = None # type: str self.__normal_url = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipayVaultingSessionResponse.""" + """Gets the result of this AlipayVaultingSessionResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def vaulting_session_data(self): """ - The encrypted vaulting session data. Pass the data to your front end to initiate the client-side SDK. More information: Maximum length: 4096 characters + The encrypted vaulting session data. Pass the data to your front end to initiate the client-side SDK. More information: Maximum length: 4096 characters """ return self.__vaulting_session_data @vaulting_session_data.setter def vaulting_session_data(self, value): self.__vaulting_session_data = value - @property def vaulting_session_id(self): """ - The encrypted ID is assigned by Antom to identify a vaulting session. More information: Maximum length: 64 characters + The encrypted ID is assigned by Antom to identify a vaulting session. More information: Maximum length: 64 characters """ return self.__vaulting_session_id @vaulting_session_id.setter def vaulting_session_id(self, value): self.__vaulting_session_id = value - @property def vaulting_session_expiry_time(self): """ @@ -57,7 +57,6 @@ def vaulting_session_expiry_time(self): @vaulting_session_expiry_time.setter def vaulting_session_expiry_time(self, value): self.__vaulting_session_expiry_time = value - @property def normal_url(self): """ @@ -69,43 +68,34 @@ def normal_url(self): def normal_url(self, value): self.__normal_url = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result - if ( - hasattr(self, "vaulting_session_data") - and self.vaulting_session_data is not None - ): - params["vaultingSessionData"] = self.vaulting_session_data - if ( - hasattr(self, "vaulting_session_id") - and self.vaulting_session_id is not None - ): - params["vaultingSessionId"] = self.vaulting_session_id - if ( - hasattr(self, "vaulting_session_expiry_time") - and self.vaulting_session_expiry_time is not None - ): - params["vaultingSessionExpiryTime"] = self.vaulting_session_expiry_time + params['result'] = self.result + if hasattr(self, "vaulting_session_data") and self.vaulting_session_data is not None: + params['vaultingSessionData'] = self.vaulting_session_data + if hasattr(self, "vaulting_session_id") and self.vaulting_session_id is not None: + params['vaultingSessionId'] = self.vaulting_session_id + if hasattr(self, "vaulting_session_expiry_time") and self.vaulting_session_expiry_time is not None: + params['vaultingSessionExpiryTime'] = self.vaulting_session_expiry_time if hasattr(self, "normal_url") and self.normal_url is not None: - params["normalUrl"] = self.normal_url + params['normalUrl'] = self.normal_url return params + def parse_rsp_body(self, response_body): - response_body = super(AlipayVaultingSessionResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipayVaultingSessionResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "vaultingSessionData" in response_body: - self.__vaulting_session_data = response_body["vaultingSessionData"] - if "vaultingSessionId" in response_body: - self.__vaulting_session_id = response_body["vaultingSessionId"] - if "vaultingSessionExpiryTime" in response_body: - self.__vaulting_session_expiry_time = response_body[ - "vaultingSessionExpiryTime" - ] - if "normalUrl" in response_body: - self.__normal_url = response_body["normalUrl"] + self.__result.parse_rsp_body(response_body['result']) + if 'vaultingSessionData' in response_body: + self.__vaulting_session_data = response_body['vaultingSessionData'] + if 'vaultingSessionId' in response_body: + self.__vaulting_session_id = response_body['vaultingSessionId'] + if 'vaultingSessionExpiryTime' in response_body: + self.__vaulting_session_expiry_time = response_body['vaultingSessionExpiryTime'] + if 'normalUrl' in response_body: + self.__normal_url = response_body['normalUrl'] diff --git a/com/alipay/ams/api/response/pay/alipay_vaults_fetch_nonce_response.py b/com/alipay/ams/api/response/pay/alipay_vaults_fetch_nonce_response.py new file mode 100644 index 0000000..9607e03 --- /dev/null +++ b/com/alipay/ams/api/response/pay/alipay_vaults_fetch_nonce_response.py @@ -0,0 +1,56 @@ +import json +from com.alipay.ams.api.model.result import Result + + + +from com.alipay.ams.api.response.alipay_response import AlipayResponse + +class AlipayVaultsFetchNonceResponse(AlipayResponse): + def __init__(self, rsp_body): + super(AlipayResponse, self).__init__() + + self.__card_token = None # type: str + self.__result = None # type: Result + self.parse_rsp_body(rsp_body) + + + @property + def card_token(self): + """Gets the card_token of this AlipayVaultsFetchNonceResponse. + + """ + return self.__card_token + + @card_token.setter + def card_token(self, value): + self.__card_token = value + @property + def result(self): + """Gets the result of this AlipayVaultsFetchNonceResponse. + + """ + return self.__result + + @result.setter + def result(self, value): + self.__result = value + + + + + def to_ams_dict(self): + params = dict() + if hasattr(self, "card_token") and self.card_token is not None: + params['cardToken'] = self.card_token + if hasattr(self, "result") and self.result is not None: + params['result'] = self.result + return params + + + def parse_rsp_body(self, response_body): + response_body = super(AlipayVaultsFetchNonceResponse, self).parse_rsp_body(response_body) + if 'cardToken' in response_body: + self.__card_token = response_body['cardToken'] + if 'result' in response_body: + self.__result = Result() + self.__result.parse_rsp_body(response_body['result']) diff --git a/com/alipay/ams/api/response/pay/ams_api_v1_payments_capture_post200_response.py b/com/alipay/ams/api/response/pay/ams_api_v1_payments_capture_post200_response.py index 2df7bc9..83c92b5 100644 --- a/com/alipay/ams/api/response/pay/ams_api_v1_payments_capture_post200_response.py +++ b/com/alipay/ams/api/response/pay/ams_api_v1_payments_capture_post200_response.py @@ -3,12 +3,12 @@ from com.alipay.ams.api.model.amount import Amount -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AmsApiV1PaymentsCapturePost200Response(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__capture_request_id = None # type: str @@ -17,17 +17,19 @@ def __init__(self, rsp_body): self.__capture_amount = None # type: Amount self.__capture_time = None # type: str self.__acquirer_reference_no = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AmsApiV1PaymentsCapturePost200Response.""" + """Gets the result of this AmsApiV1PaymentsCapturePost200Response. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def capture_request_id(self): """ @@ -38,7 +40,6 @@ def capture_request_id(self): @capture_request_id.setter def capture_request_id(self, value): self.__capture_request_id = value - @property def capture_id(self): """ @@ -49,7 +50,6 @@ def capture_id(self): @capture_id.setter def capture_id(self, value): self.__capture_id = value - @property def payment_id(self): """ @@ -60,16 +60,16 @@ def payment_id(self): @payment_id.setter def payment_id(self, value): self.__payment_id = value - @property def capture_amount(self): - """Gets the capture_amount of this AmsApiV1PaymentsCapturePost200Response.""" + """Gets the capture_amount of this AmsApiV1PaymentsCapturePost200Response. + + """ return self.__capture_amount @capture_amount.setter def capture_amount(self, value): self.__capture_amount = value - @property def capture_time(self): """ @@ -80,7 +80,6 @@ def capture_time(self): @capture_time.setter def capture_time(self, value): self.__capture_time = value - @property def acquirer_reference_no(self): """ @@ -92,44 +91,43 @@ def acquirer_reference_no(self): def acquirer_reference_no(self, value): self.__acquirer_reference_no = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "capture_request_id") and self.capture_request_id is not None: - params["captureRequestId"] = self.capture_request_id + params['captureRequestId'] = self.capture_request_id if hasattr(self, "capture_id") and self.capture_id is not None: - params["captureId"] = self.capture_id + params['captureId'] = self.capture_id if hasattr(self, "payment_id") and self.payment_id is not None: - params["paymentId"] = self.payment_id + params['paymentId'] = self.payment_id if hasattr(self, "capture_amount") and self.capture_amount is not None: - params["captureAmount"] = self.capture_amount + params['captureAmount'] = self.capture_amount if hasattr(self, "capture_time") and self.capture_time is not None: - params["captureTime"] = self.capture_time - if ( - hasattr(self, "acquirer_reference_no") - and self.acquirer_reference_no is not None - ): - params["acquirerReferenceNo"] = self.acquirer_reference_no + params['captureTime'] = self.capture_time + if hasattr(self, "acquirer_reference_no") and self.acquirer_reference_no is not None: + params['acquirerReferenceNo'] = self.acquirer_reference_no return params + def parse_rsp_body(self, response_body): - response_body = super( - AmsApiV1PaymentsCapturePost200Response, self - ).parse_rsp_body(response_body) - if "result" in response_body: + response_body = super(AmsApiV1PaymentsCapturePost200Response, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "captureRequestId" in response_body: - self.__capture_request_id = response_body["captureRequestId"] - if "captureId" in response_body: - self.__capture_id = response_body["captureId"] - if "paymentId" in response_body: - self.__payment_id = response_body["paymentId"] - if "captureAmount" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'captureRequestId' in response_body: + self.__capture_request_id = response_body['captureRequestId'] + if 'captureId' in response_body: + self.__capture_id = response_body['captureId'] + if 'paymentId' in response_body: + self.__payment_id = response_body['paymentId'] + if 'captureAmount' in response_body: self.__capture_amount = Amount() - self.__capture_amount.parse_rsp_body(response_body["captureAmount"]) - if "captureTime" in response_body: - self.__capture_time = response_body["captureTime"] - if "acquirerReferenceNo" in response_body: - self.__acquirer_reference_no = response_body["acquirerReferenceNo"] + self.__capture_amount.parse_rsp_body(response_body['captureAmount']) + if 'captureTime' in response_body: + self.__capture_time = response_body['captureTime'] + if 'acquirerReferenceNo' in response_body: + self.__acquirer_reference_no = response_body['acquirerReferenceNo'] diff --git a/com/alipay/ams/api/response/pay/ams_api_v1_payments_inquiry_refund_post200_response.py b/com/alipay/ams/api/response/pay/ams_api_v1_payments_inquiry_refund_post200_response.py index 89f0a0d..8d35bc9 100644 --- a/com/alipay/ams/api/response/pay/ams_api_v1_payments_inquiry_refund_post200_response.py +++ b/com/alipay/ams/api/response/pay/ams_api_v1_payments_inquiry_refund_post200_response.py @@ -7,12 +7,12 @@ from com.alipay.ams.api.model.acquirer_info import AcquirerInfo -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AmsApiV1PaymentsInquiryRefundPost200Response(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__refund_id = None # type: str @@ -23,28 +23,29 @@ def __init__(self, rsp_body): self.__gross_settlement_amount = None # type: Amount self.__settlement_quote = None # type: Quote self.__acquirer_info = None # type: AcquirerInfo - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AmsApiV1PaymentsInquiryRefundPost200Response.""" + """Gets the result of this AmsApiV1PaymentsInquiryRefundPost200Response. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def refund_id(self): """ - The unique ID assigned by Antom to identify a refund. A one-to-one correspondence between refundId and refundRequestId exists. Note: This field is null when the refund record cannot be found, or result.resultStatus is F or U. + The unique ID assigned by Antom to identify a refund. A one-to-one correspondence between refundId and refundRequestId exists. Note: This field is null when the refund record cannot be found, or result.resultStatus is F or U. """ return self.__refund_id @refund_id.setter def refund_id(self, value): self.__refund_id = value - @property def refund_request_id(self): """ @@ -55,25 +56,26 @@ def refund_request_id(self): @refund_request_id.setter def refund_request_id(self, value): self.__refund_request_id = value - @property def refund_amount(self): - """Gets the refund_amount of this AmsApiV1PaymentsInquiryRefundPost200Response.""" + """Gets the refund_amount of this AmsApiV1PaymentsInquiryRefundPost200Response. + + """ return self.__refund_amount @refund_amount.setter def refund_amount(self, value): self.__refund_amount = value - @property def refund_status(self): - """Gets the refund_status of this AmsApiV1PaymentsInquiryRefundPost200Response.""" + """Gets the refund_status of this AmsApiV1PaymentsInquiryRefundPost200Response. + + """ return self.__refund_status @refund_status.setter def refund_status(self, value): self.__refund_status = value - @property def refund_time(self): """ @@ -84,88 +86,86 @@ def refund_time(self): @refund_time.setter def refund_time(self, value): self.__refund_time = value - @property def gross_settlement_amount(self): - """Gets the gross_settlement_amount of this AmsApiV1PaymentsInquiryRefundPost200Response.""" + """Gets the gross_settlement_amount of this AmsApiV1PaymentsInquiryRefundPost200Response. + + """ return self.__gross_settlement_amount @gross_settlement_amount.setter def gross_settlement_amount(self, value): self.__gross_settlement_amount = value - @property def settlement_quote(self): - """Gets the settlement_quote of this AmsApiV1PaymentsInquiryRefundPost200Response.""" + """Gets the settlement_quote of this AmsApiV1PaymentsInquiryRefundPost200Response. + + """ return self.__settlement_quote @settlement_quote.setter def settlement_quote(self, value): self.__settlement_quote = value - @property def acquirer_info(self): - """Gets the acquirer_info of this AmsApiV1PaymentsInquiryRefundPost200Response.""" + """Gets the acquirer_info of this AmsApiV1PaymentsInquiryRefundPost200Response. + + """ return self.__acquirer_info @acquirer_info.setter def acquirer_info(self, value): self.__acquirer_info = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "refund_id") and self.refund_id is not None: - params["refundId"] = self.refund_id + params['refundId'] = self.refund_id if hasattr(self, "refund_request_id") and self.refund_request_id is not None: - params["refundRequestId"] = self.refund_request_id + params['refundRequestId'] = self.refund_request_id if hasattr(self, "refund_amount") and self.refund_amount is not None: - params["refundAmount"] = self.refund_amount + params['refundAmount'] = self.refund_amount if hasattr(self, "refund_status") and self.refund_status is not None: - params["refundStatus"] = self.refund_status + params['refundStatus'] = self.refund_status if hasattr(self, "refund_time") and self.refund_time is not None: - params["refundTime"] = self.refund_time - if ( - hasattr(self, "gross_settlement_amount") - and self.gross_settlement_amount is not None - ): - params["grossSettlementAmount"] = self.gross_settlement_amount + params['refundTime'] = self.refund_time + if hasattr(self, "gross_settlement_amount") and self.gross_settlement_amount is not None: + params['grossSettlementAmount'] = self.gross_settlement_amount if hasattr(self, "settlement_quote") and self.settlement_quote is not None: - params["settlementQuote"] = self.settlement_quote + params['settlementQuote'] = self.settlement_quote if hasattr(self, "acquirer_info") and self.acquirer_info is not None: - params["acquirerInfo"] = self.acquirer_info + params['acquirerInfo'] = self.acquirer_info return params + def parse_rsp_body(self, response_body): - response_body = super( - AmsApiV1PaymentsInquiryRefundPost200Response, self - ).parse_rsp_body(response_body) - if "result" in response_body: + response_body = super(AmsApiV1PaymentsInquiryRefundPost200Response, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "refundId" in response_body: - self.__refund_id = response_body["refundId"] - if "refundRequestId" in response_body: - self.__refund_request_id = response_body["refundRequestId"] - if "refundAmount" in response_body: + self.__result.parse_rsp_body(response_body['result']) + if 'refundId' in response_body: + self.__refund_id = response_body['refundId'] + if 'refundRequestId' in response_body: + self.__refund_request_id = response_body['refundRequestId'] + if 'refundAmount' in response_body: self.__refund_amount = Amount() - self.__refund_amount.parse_rsp_body(response_body["refundAmount"]) - if "refundStatus" in response_body: - refund_status_temp = TransactionStatusType.value_of( - response_body["refundStatus"] - ) + self.__refund_amount.parse_rsp_body(response_body['refundAmount']) + if 'refundStatus' in response_body: + refund_status_temp = TransactionStatusType.value_of(response_body['refundStatus']) self.__refund_status = refund_status_temp - if "refundTime" in response_body: - self.__refund_time = response_body["refundTime"] - if "grossSettlementAmount" in response_body: + if 'refundTime' in response_body: + self.__refund_time = response_body['refundTime'] + if 'grossSettlementAmount' in response_body: self.__gross_settlement_amount = Amount() - self.__gross_settlement_amount.parse_rsp_body( - response_body["grossSettlementAmount"] - ) - if "settlementQuote" in response_body: + self.__gross_settlement_amount.parse_rsp_body(response_body['grossSettlementAmount']) + if 'settlementQuote' in response_body: self.__settlement_quote = Quote() - self.__settlement_quote.parse_rsp_body(response_body["settlementQuote"]) - if "acquirerInfo" in response_body: + self.__settlement_quote.parse_rsp_body(response_body['settlementQuote']) + if 'acquirerInfo' in response_body: self.__acquirer_info = AcquirerInfo() - self.__acquirer_info.parse_rsp_body(response_body["acquirerInfo"]) + self.__acquirer_info.parse_rsp_body(response_body['acquirerInfo']) diff --git a/com/alipay/ams/api/response/subscription/alipay_subscription_cancel_response.py b/com/alipay/ams/api/response/subscription/alipay_subscription_cancel_response.py index b77be0b..186bc0d 100644 --- a/com/alipay/ams/api/response/subscription/alipay_subscription_cancel_response.py +++ b/com/alipay/ams/api/response/subscription/alipay_subscription_cancel_response.py @@ -2,35 +2,40 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipaySubscriptionCancelResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipaySubscriptionCancelResponse.""" + """Gets the result of this AlipaySubscriptionCancelResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result return params + def parse_rsp_body(self, response_body): - response_body = super(AlipaySubscriptionCancelResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipaySubscriptionCancelResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) + self.__result.parse_rsp_body(response_body['result']) diff --git a/com/alipay/ams/api/response/subscription/alipay_subscription_change_response.py b/com/alipay/ams/api/response/subscription/alipay_subscription_change_response.py index 903ed8e..1d45095 100644 --- a/com/alipay/ams/api/response/subscription/alipay_subscription_change_response.py +++ b/com/alipay/ams/api/response/subscription/alipay_subscription_change_response.py @@ -2,35 +2,40 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipaySubscriptionChangeResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipaySubscriptionChangeResponse.""" + """Gets the result of this AlipaySubscriptionChangeResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result return params + def parse_rsp_body(self, response_body): - response_body = super(AlipaySubscriptionChangeResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipaySubscriptionChangeResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) + self.__result.parse_rsp_body(response_body['result']) diff --git a/com/alipay/ams/api/response/subscription/alipay_subscription_create_response.py b/com/alipay/ams/api/response/subscription/alipay_subscription_create_response.py index efba993..254c4ae 100644 --- a/com/alipay/ams/api/response/subscription/alipay_subscription_create_response.py +++ b/com/alipay/ams/api/response/subscription/alipay_subscription_create_response.py @@ -2,29 +2,31 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipaySubscriptionCreateResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result self.__scheme_url = None # type: str self.__applink_url = None # type: str self.__normal_url = None # type: str self.__app_identifier = None # type: str - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipaySubscriptionCreateResponse.""" + """Gets the result of this AlipaySubscriptionCreateResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value - @property def scheme_url(self): """ @@ -35,7 +37,6 @@ def scheme_url(self): @scheme_url.setter def scheme_url(self, value): self.__scheme_url = value - @property def applink_url(self): """ @@ -46,7 +47,6 @@ def applink_url(self): @applink_url.setter def applink_url(self, value): self.__applink_url = value - @property def normal_url(self): """ @@ -57,7 +57,6 @@ def normal_url(self): @normal_url.setter def normal_url(self, value): self.__normal_url = value - @property def app_identifier(self): """ @@ -69,32 +68,34 @@ def app_identifier(self): def app_identifier(self, value): self.__app_identifier = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result if hasattr(self, "scheme_url") and self.scheme_url is not None: - params["schemeUrl"] = self.scheme_url + params['schemeUrl'] = self.scheme_url if hasattr(self, "applink_url") and self.applink_url is not None: - params["applinkUrl"] = self.applink_url + params['applinkUrl'] = self.applink_url if hasattr(self, "normal_url") and self.normal_url is not None: - params["normalUrl"] = self.normal_url + params['normalUrl'] = self.normal_url if hasattr(self, "app_identifier") and self.app_identifier is not None: - params["appIdentifier"] = self.app_identifier + params['appIdentifier'] = self.app_identifier return params + def parse_rsp_body(self, response_body): - response_body = super(AlipaySubscriptionCreateResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipaySubscriptionCreateResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) - if "schemeUrl" in response_body: - self.__scheme_url = response_body["schemeUrl"] - if "applinkUrl" in response_body: - self.__applink_url = response_body["applinkUrl"] - if "normalUrl" in response_body: - self.__normal_url = response_body["normalUrl"] - if "appIdentifier" in response_body: - self.__app_identifier = response_body["appIdentifier"] + self.__result.parse_rsp_body(response_body['result']) + if 'schemeUrl' in response_body: + self.__scheme_url = response_body['schemeUrl'] + if 'applinkUrl' in response_body: + self.__applink_url = response_body['applinkUrl'] + if 'normalUrl' in response_body: + self.__normal_url = response_body['normalUrl'] + if 'appIdentifier' in response_body: + self.__app_identifier = response_body['appIdentifier'] diff --git a/com/alipay/ams/api/response/subscription/alipay_subscription_update_response.py b/com/alipay/ams/api/response/subscription/alipay_subscription_update_response.py index 0fac625..f23aaa8 100644 --- a/com/alipay/ams/api/response/subscription/alipay_subscription_update_response.py +++ b/com/alipay/ams/api/response/subscription/alipay_subscription_update_response.py @@ -2,35 +2,40 @@ from com.alipay.ams.api.model.result import Result -from com.alipay.ams.api.response.alipay_response import AlipayResponse +from com.alipay.ams.api.response.alipay_response import AlipayResponse class AlipaySubscriptionUpdateResponse(AlipayResponse): def __init__(self, rsp_body): - super(AlipayResponse, self).__init__() + super(AlipayResponse, self).__init__() self.__result = None # type: Result - self.parse_rsp_body(rsp_body) + self.parse_rsp_body(rsp_body) + @property def result(self): - """Gets the result of this AlipaySubscriptionUpdateResponse.""" + """Gets the result of this AlipaySubscriptionUpdateResponse. + + """ return self.__result @result.setter def result(self, value): self.__result = value + + + def to_ams_dict(self): params = dict() if hasattr(self, "result") and self.result is not None: - params["result"] = self.result + params['result'] = self.result return params + def parse_rsp_body(self, response_body): - response_body = super(AlipaySubscriptionUpdateResponse, self).parse_rsp_body( - response_body - ) - if "result" in response_body: + response_body = super(AlipaySubscriptionUpdateResponse, self).parse_rsp_body(response_body) + if 'result' in response_body: self.__result = Result() - self.__result.parse_rsp_body(response_body["result"]) + self.__result.parse_rsp_body(response_body['result'])