Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions com/alipay/ams/api/model/authorization_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self):
self.__allowed_merchant_category_list = None # type: [str]
self.__allowed_auth_times = None # type: int
self.__allowed_currencies = None # type: [str]
self.__payment_preference_currencies = None # type: [str]
self.__card_limit_detail = None # type: CardLimitDetail
self.__card_limit_info = None # type: CardLimitInfo
self.__refund_preference = None # type: RefundPreference
Expand Down Expand Up @@ -70,6 +71,16 @@ def allowed_currencies(self):
def allowed_currencies(self, value):
self.__allowed_currencies = value
@property
def payment_preference_currencies(self):
"""
An ordered list of ISO 4217 currency codes that defines the card-level balance-consumption priority. Only applyCard accepts this field in a request; do not send it to updateCard. For applyCard, the list must not contain duplicates and every currency must be supported by Antom. Omission, null, or an empty list configures no card-level preference. The field participates in requestId idempotency, and invalid values, more than 9 entries, duplicates, or capability-disabled use return PARAM_ILLEGAL. For inquireCardDetail, a configured list is returned in stored order; an enabled merchant without a card-level preference receives null, and a disabled merchant does not receive the field. For inquireCardSensitiveInfo, a whitelisted merchant receives the configured list, the child field is omitted when no card-level preference exists, and a non-whitelisted merchant does not receive the parent cardDetail object. The initially supported currencies are USD, EUR, GBP, HKD, AUD, CAD, CNH, JPY, and NZD; the supported set is configuration-driven and can change without an API contract change.
"""
return self.__payment_preference_currencies

@payment_preference_currencies.setter
def payment_preference_currencies(self, value):
self.__payment_preference_currencies = value
@property
def card_limit_detail(self):
"""Gets the card_limit_detail of this AuthorizationControl.

Expand Down Expand Up @@ -115,6 +126,8 @@ def to_ams_dict(self):
params['allowedAuthTimes'] = self.allowed_auth_times
if hasattr(self, "allowed_currencies") and self.allowed_currencies is not None:
params['allowedCurrencies'] = self.allowed_currencies
if hasattr(self, "payment_preference_currencies") and self.payment_preference_currencies is not None:
params['paymentPreferenceCurrencies'] = self.payment_preference_currencies
if hasattr(self, "card_limit_detail") and self.card_limit_detail is not None:
params['cardLimitDetail'] = self.card_limit_detail
if hasattr(self, "card_limit_info") and self.card_limit_info is not None:
Expand All @@ -137,6 +150,8 @@ def parse_rsp_body(self, response_body):
self.__allowed_auth_times = response_body['allowedAuthTimes']
if 'allowedCurrencies' in response_body:
self.__allowed_currencies = response_body['allowedCurrencies']
if 'paymentPreferenceCurrencies' in response_body:
self.__payment_preference_currencies = response_body['paymentPreferenceCurrencies']
if 'cardLimitDetail' in response_body:
self.__card_limit_detail = CardLimitDetail()
self.__card_limit_detail.parse_rsp_body(response_body['cardLimitDetail'])
Expand Down
37 changes: 37 additions & 0 deletions com/alipay/ams/api/model/billing_subscription_status_change.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import json




class BillingSubscriptionStatusChange:
def __init__(self):

self.__action = None # type: str


@property
def action(self):
"""
The subscription status change action. The currently supported value is PAUSE, which pauses payment collection and changes the subscription status from ACTIVE to PAUSED. To reactivate a paused subscription, call the resume subscription API. Maximum length: 10 characters.
"""
return self.__action

@action.setter
def action(self, value):
self.__action = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "action") and self.action is not None:
params['action'] = self.action
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'action' in response_body:
self.__action = response_body['action']
18 changes: 18 additions & 0 deletions com/alipay/ams/api/model/funds_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from enum import Enum, unique
@unique
class FundsType(Enum):
"""The funds type. The current version supports COLLATERAL only."""

COLLATERAL = "COLLATERAL"

def to_ams_dict(self) -> str:
return self.name

@staticmethod
def value_of(value):
if not value:
return None

if FundsType.COLLATERAL.value == value:
return FundsType.COLLATERAL
return None
8 changes: 4 additions & 4 deletions com/alipay/ams/api/model/paginator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self):
@property
def current_page(self):
"""
The current page number, start from 1.
The current page number, starting from 1.
"""
return self.__current_page

Expand All @@ -25,7 +25,7 @@ def current_page(self, value):
@property
def page_size(self):
"""
The maximum records returned per page.
The number of records returned per page.
"""
return self.__page_size

Expand All @@ -35,7 +35,7 @@ def page_size(self, value):
@property
def total_page(self):
"""
Total number of pages.
The total number of pages.
"""
return self.__total_page

Expand All @@ -45,7 +45,7 @@ def total_page(self, value):
@property
def total_count(self):
"""
Total items that match the criteria.
The total number of records that match the query criteria.
"""
return self.__total_count

Expand Down
21 changes: 21 additions & 0 deletions com/alipay/ams/api/model/payment_method_scope.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from enum import Enum, unique
@unique
class PaymentMethodScope(Enum):
"""The payment method scope to which the reserve rule applies."""

ALL = "ALL"
CARD = "CARD"

def to_ams_dict(self) -> str:
return self.name

@staticmethod
def value_of(value):
if not value:
return None

if PaymentMethodScope.ALL.value == value:
return PaymentMethodScope.ALL
if PaymentMethodScope.CARD.value == value:
return PaymentMethodScope.CARD
return None
21 changes: 21 additions & 0 deletions com/alipay/ams/api/model/release_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from enum import Enum, unique
@unique
class ReleaseType(Enum):
"""The release schedule type. FIXED_TIME uses releaseTime and INTERVAL_TIME uses retentionTime."""

FIXED_TIME = "FIXED_TIME"
INTERVAL_TIME = "INTERVAL_TIME"

def to_ams_dict(self) -> str:
return self.name

@staticmethod
def value_of(value):
if not value:
return None

if ReleaseType.FIXED_TIME.value == value:
return ReleaseType.FIXED_TIME
if ReleaseType.INTERVAL_TIME.value == value:
return ReleaseType.INTERVAL_TIME
return None
212 changes: 212 additions & 0 deletions com/alipay/ams/api/model/reserve_rule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
import json
from com.alipay.ams.api.model.funds_type import FundsType
from com.alipay.ams.api.model.take_type import TakeType
from com.alipay.ams.api.model.payment_method_scope import PaymentMethodScope
from com.alipay.ams.api.model.release_type import ReleaseType
from com.alipay.ams.api.model.rule_status import RuleStatus




class ReserveRule:
def __init__(self):

self.__rule_id = None # type: str
self.__merchant_id = None # type: str
self.__funds_type = None # type: FundsType
self.__take_type = None # type: TakeType
self.__payment_method_scope = None # type: PaymentMethodScope
self.__ratio = None # type: int
self.__release_type = None # type: ReleaseType
self.__release_time = None # type: str
self.__retention_time = None # type: int
self.__rule_status = None # type: RuleStatus
self.__create_time = None # type: str
self.__update_time = None # type: str


@property
def rule_id(self):
"""
The Antom-assigned positive numeric reserve rule identifier. Save and return this value unchanged for updates, cancellation, and cursor pagination. Returned only when result.resultCode is SUCCESS.
"""
return self.__rule_id

@rule_id.setter
def rule_id(self, value):
self.__rule_id = value
@property
def merchant_id(self):
"""
The ID of the merchant that owns the reserve rule. Returned only when result.resultCode is SUCCESS.
"""
return self.__merchant_id

@merchant_id.setter
def merchant_id(self, value):
self.__merchant_id = value
@property
def funds_type(self):
"""Gets the funds_type of this ReserveRule.

"""
return self.__funds_type

@funds_type.setter
def funds_type(self, value):
self.__funds_type = value
@property
def take_type(self):
"""Gets the take_type of this ReserveRule.

"""
return self.__take_type

@take_type.setter
def take_type(self, value):
self.__take_type = value
@property
def payment_method_scope(self):
"""Gets the payment_method_scope of this ReserveRule.

"""
return self.__payment_method_scope

@payment_method_scope.setter
def payment_method_scope(self, value):
self.__payment_method_scope = value
@property
def ratio(self):
"""
The rolling reserve percentage. Returned when takeType is ROLLING and result.resultCode is SUCCESS.
"""
return self.__ratio

@ratio.setter
def ratio(self, value):
self.__ratio = value
@property
def release_type(self):
"""Gets the release_type of this ReserveRule.

"""
return self.__release_type

@release_type.setter
def release_type(self, value):
self.__release_type = value
@property
def release_time(self):
"""
The fixed release instant as an ISO 8601 UTC string, for example 2026-12-31T16:00:00Z. Returned when releaseType is FIXED_TIME and result.resultCode is SUCCESS.
"""
return self.__release_time

@release_time.setter
def release_time(self, value):
self.__release_time = value
@property
def retention_time(self):
"""
The rolling retention period in days. Returned when releaseType is INTERVAL_TIME and result.resultCode is SUCCESS.
"""
return self.__retention_time

@retention_time.setter
def retention_time(self, value):
self.__retention_time = value
@property
def rule_status(self):
"""Gets the rule_status of this ReserveRule.

"""
return self.__rule_status

@rule_status.setter
def rule_status(self, value):
self.__rule_status = value
@property
def create_time(self):
"""
The rule creation time as an ISO 8601 UTC string. Returned only when result.resultCode is SUCCESS.
"""
return self.__create_time

@create_time.setter
def create_time(self, value):
self.__create_time = value
@property
def update_time(self):
"""
The rule last-update time as an ISO 8601 UTC string. Returned only when result.resultCode is SUCCESS.
"""
return self.__update_time

@update_time.setter
def update_time(self, value):
self.__update_time = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "rule_id") and self.rule_id is not None:
params['ruleId'] = self.rule_id
if hasattr(self, "merchant_id") and self.merchant_id is not None:
params['merchantId'] = self.merchant_id
if hasattr(self, "funds_type") and self.funds_type is not None:
params['fundsType'] = self.funds_type
if hasattr(self, "take_type") and self.take_type is not None:
params['takeType'] = self.take_type
if hasattr(self, "payment_method_scope") and self.payment_method_scope is not None:
params['paymentMethodScope'] = self.payment_method_scope
if hasattr(self, "ratio") and self.ratio is not None:
params['ratio'] = self.ratio
if hasattr(self, "release_type") and self.release_type is not None:
params['releaseType'] = self.release_type
if hasattr(self, "release_time") and self.release_time is not None:
params['releaseTime'] = self.release_time
if hasattr(self, "retention_time") and self.retention_time is not None:
params['retentionTime'] = self.retention_time
if hasattr(self, "rule_status") and self.rule_status is not None:
params['ruleStatus'] = self.rule_status
if hasattr(self, "create_time") and self.create_time is not None:
params['createTime'] = self.create_time
if hasattr(self, "update_time") and self.update_time is not None:
params['updateTime'] = self.update_time
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'ruleId' in response_body:
self.__rule_id = response_body['ruleId']
if 'merchantId' in response_body:
self.__merchant_id = response_body['merchantId']
if 'fundsType' in response_body:
funds_type_temp = FundsType.value_of(response_body['fundsType'])
self.__funds_type = funds_type_temp
if 'takeType' in response_body:
take_type_temp = TakeType.value_of(response_body['takeType'])
self.__take_type = take_type_temp
if 'paymentMethodScope' in response_body:
payment_method_scope_temp = PaymentMethodScope.value_of(response_body['paymentMethodScope'])
self.__payment_method_scope = payment_method_scope_temp
if 'ratio' in response_body:
self.__ratio = response_body['ratio']
if 'releaseType' in response_body:
release_type_temp = ReleaseType.value_of(response_body['releaseType'])
self.__release_type = release_type_temp
if 'releaseTime' in response_body:
self.__release_time = response_body['releaseTime']
if 'retentionTime' in response_body:
self.__retention_time = response_body['retentionTime']
if 'ruleStatus' in response_body:
rule_status_temp = RuleStatus.value_of(response_body['ruleStatus'])
self.__rule_status = rule_status_temp
if 'createTime' in response_body:
self.__create_time = response_body['createTime']
if 'updateTime' in response_body:
self.__update_time = response_body['updateTime']
Loading