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
114 changes: 114 additions & 0 deletions com/alipay/ams/api/model/authorization_control.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
import json
from com.alipay.ams.api.model.card_limit_detail import CardLimitDetail




class AuthorizationControl:
def __init__(self):

self.__card_active_time = None # type: str
self.__card_cancel_time = None # type: str
self.__allowed_merchant_category_list = None # type: [str]
self.__allowed_auth_times = None # type: int
self.__allowed_currencies = None # type: [str]
self.__card_limit_detail = None # type: CardLimitDetail


@property
def card_active_time(self):
"""
If not present, It will be activated when the card is created. Datetime UTC time: 2018-10-31T00:00:00+0800 ISO 8601
"""
return self.__card_active_time

@card_active_time.setter
def card_active_time(self, value):
self.__card_active_time = value
@property
def card_cancel_time(self):
"""
Datetime UTC time: 2018-10-31T00:00:00+0800 ISO 8601
"""
return self.__card_cancel_time

@card_cancel_time.setter
def card_cancel_time(self, value):
self.__card_cancel_time = value
@property
def allowed_merchant_category_list(self):
"""
Allowed MCC (Merchant Category Code) list. If not set or left empty, all transactions are allowed.
"""
return self.__allowed_merchant_category_list

@allowed_merchant_category_list.setter
def allowed_merchant_category_list(self, value):
self.__allowed_merchant_category_list = value
@property
def allowed_auth_times(self):
"""
Indicates the number of allowed authorization times. If not set or left empty, all transactions are allowed.
"""
return self.__allowed_auth_times

@allowed_auth_times.setter
def allowed_auth_times(self, value):
self.__allowed_auth_times = value
@property
def allowed_currencies(self):
"""
Allowed transaction currencies (ISO 4217 three-letter codes). If not set, no currency restriction applies.
"""
return self.__allowed_currencies

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

"""
return self.__card_limit_detail

@card_limit_detail.setter
def card_limit_detail(self, value):
self.__card_limit_detail = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "card_active_time") and self.card_active_time is not None:
params['cardActiveTime'] = self.card_active_time
if hasattr(self, "card_cancel_time") and self.card_cancel_time is not None:
params['cardCancelTime'] = self.card_cancel_time
if hasattr(self, "allowed_merchant_category_list") and self.allowed_merchant_category_list is not None:
params['allowedMerchantCategoryList'] = self.allowed_merchant_category_list
if hasattr(self, "allowed_auth_times") and self.allowed_auth_times is not None:
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, "card_limit_detail") and self.card_limit_detail is not None:
params['cardLimitDetail'] = self.card_limit_detail
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'cardActiveTime' in response_body:
self.__card_active_time = response_body['cardActiveTime']
if 'cardCancelTime' in response_body:
self.__card_cancel_time = response_body['cardCancelTime']
if 'allowedMerchantCategoryList' in response_body:
self.__allowed_merchant_category_list = response_body['allowedMerchantCategoryList']
if 'allowedAuthTimes' in response_body:
self.__allowed_auth_times = response_body['allowedAuthTimes']
if 'allowedCurrencies' in response_body:
self.__allowed_currencies = response_body['allowedCurrencies']
if 'cardLimitDetail' in response_body:
self.__card_limit_detail = CardLimitDetail()
self.__card_limit_detail.parse_rsp_body(response_body['cardLimitDetail'])
150 changes: 150 additions & 0 deletions com/alipay/ams/api/model/card_limit_detail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import json
from com.alipay.ams.api.model.amount import Amount
from com.alipay.ams.api.model.limit import Limit
from com.alipay.ams.api.model.limit import Limit
from com.alipay.ams.api.model.limit import Limit




class CardLimitDetail:
def __init__(self):

self.__per_transaction_limit = None # type: Amount
self.__daily_limit = None # type: Limit
self.__monthly_limit = None # type: Limit
self.__per_card_limit = None # type: Limit
self.__daily_limit_max = None # type: str
self.__monthly_limit_max = None # type: str
self.__per_transaction_limit_max = None # type: str
self.__per_card_limit_max = None # type: str


@property
def per_transaction_limit(self):
"""Gets the per_transaction_limit of this CardLimitDetail.

"""
return self.__per_transaction_limit

@per_transaction_limit.setter
def per_transaction_limit(self, value):
self.__per_transaction_limit = value
@property
def daily_limit(self):
"""Gets the daily_limit of this CardLimitDetail.

"""
return self.__daily_limit

@daily_limit.setter
def daily_limit(self, value):
self.__daily_limit = value
@property
def monthly_limit(self):
"""Gets the monthly_limit of this CardLimitDetail.

"""
return self.__monthly_limit

@monthly_limit.setter
def monthly_limit(self, value):
self.__monthly_limit = value
@property
def per_card_limit(self):
"""Gets the per_card_limit of this CardLimitDetail.

"""
return self.__per_card_limit

@per_card_limit.setter
def per_card_limit(self, value):
self.__per_card_limit = value
@property
def daily_limit_max(self):
"""Gets the daily_limit_max of this CardLimitDetail.

"""
return self.__daily_limit_max

@daily_limit_max.setter
def daily_limit_max(self, value):
self.__daily_limit_max = value
@property
def monthly_limit_max(self):
"""Gets the monthly_limit_max of this CardLimitDetail.

"""
return self.__monthly_limit_max

@monthly_limit_max.setter
def monthly_limit_max(self, value):
self.__monthly_limit_max = value
@property
def per_transaction_limit_max(self):
"""Gets the per_transaction_limit_max of this CardLimitDetail.

"""
return self.__per_transaction_limit_max

@per_transaction_limit_max.setter
def per_transaction_limit_max(self, value):
self.__per_transaction_limit_max = value
@property
def per_card_limit_max(self):
"""Gets the per_card_limit_max of this CardLimitDetail.

"""
return self.__per_card_limit_max

@per_card_limit_max.setter
def per_card_limit_max(self, value):
self.__per_card_limit_max = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "per_transaction_limit") and self.per_transaction_limit is not None:
params['perTransactionLimit'] = self.per_transaction_limit
if hasattr(self, "daily_limit") and self.daily_limit is not None:
params['dailyLimit'] = self.daily_limit
if hasattr(self, "monthly_limit") and self.monthly_limit is not None:
params['monthlyLimit'] = self.monthly_limit
if hasattr(self, "per_card_limit") and self.per_card_limit is not None:
params['perCardLimit'] = self.per_card_limit
if hasattr(self, "daily_limit_max") and self.daily_limit_max is not None:
params['dailyLimitMax'] = self.daily_limit_max
if hasattr(self, "monthly_limit_max") and self.monthly_limit_max is not None:
params['monthlyLimitMax'] = self.monthly_limit_max
if hasattr(self, "per_transaction_limit_max") and self.per_transaction_limit_max is not None:
params['perTransactionLimitMax'] = self.per_transaction_limit_max
if hasattr(self, "per_card_limit_max") and self.per_card_limit_max is not None:
params['perCardLimitMax'] = self.per_card_limit_max
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'perTransactionLimit' in response_body:
self.__per_transaction_limit = Amount()
self.__per_transaction_limit.parse_rsp_body(response_body['perTransactionLimit'])
if 'dailyLimit' in response_body:
self.__daily_limit = Limit()
self.__daily_limit.parse_rsp_body(response_body['dailyLimit'])
if 'monthlyLimit' in response_body:
self.__monthly_limit = Limit()
self.__monthly_limit.parse_rsp_body(response_body['monthlyLimit'])
if 'perCardLimit' in response_body:
self.__per_card_limit = Limit()
self.__per_card_limit.parse_rsp_body(response_body['perCardLimit'])
if 'dailyLimitMax' in response_body:
self.__daily_limit_max = response_body['dailyLimitMax']
if 'monthlyLimitMax' in response_body:
self.__monthly_limit_max = response_body['monthlyLimitMax']
if 'perTransactionLimitMax' in response_body:
self.__per_transaction_limit_max = response_body['perTransactionLimitMax']
if 'perCardLimitMax' in response_body:
self.__per_card_limit_max = response_body['perCardLimitMax']
97 changes: 97 additions & 0 deletions com/alipay/ams/api/model/card_limit_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import json




class CardLimitInfo:
def __init__(self):

self.__currency = None # type: str
self.__daily_limit_max = None # type: str
self.__monthly_limit_max = None # type: str
self.__per_transaction_limit_max = None # type: str
self.__per_card_limit_max = None # type: str


@property
def currency(self):
"""Gets the currency of this CardLimitInfo.

"""
return self.__currency

@currency.setter
def currency(self, value):
self.__currency = value
@property
def daily_limit_max(self):
"""Gets the daily_limit_max of this CardLimitInfo.

"""
return self.__daily_limit_max

@daily_limit_max.setter
def daily_limit_max(self, value):
self.__daily_limit_max = value
@property
def monthly_limit_max(self):
"""Gets the monthly_limit_max of this CardLimitInfo.

"""
return self.__monthly_limit_max

@monthly_limit_max.setter
def monthly_limit_max(self, value):
self.__monthly_limit_max = value
@property
def per_transaction_limit_max(self):
"""Gets the per_transaction_limit_max of this CardLimitInfo.

"""
return self.__per_transaction_limit_max

@per_transaction_limit_max.setter
def per_transaction_limit_max(self, value):
self.__per_transaction_limit_max = value
@property
def per_card_limit_max(self):
"""Gets the per_card_limit_max of this CardLimitInfo.

"""
return self.__per_card_limit_max

@per_card_limit_max.setter
def per_card_limit_max(self, value):
self.__per_card_limit_max = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "currency") and self.currency is not None:
params['currency'] = self.currency
if hasattr(self, "daily_limit_max") and self.daily_limit_max is not None:
params['dailyLimitMax'] = self.daily_limit_max
if hasattr(self, "monthly_limit_max") and self.monthly_limit_max is not None:
params['monthlyLimitMax'] = self.monthly_limit_max
if hasattr(self, "per_transaction_limit_max") and self.per_transaction_limit_max is not None:
params['perTransactionLimitMax'] = self.per_transaction_limit_max
if hasattr(self, "per_card_limit_max") and self.per_card_limit_max is not None:
params['perCardLimitMax'] = self.per_card_limit_max
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'currency' in response_body:
self.__currency = response_body['currency']
if 'dailyLimitMax' in response_body:
self.__daily_limit_max = response_body['dailyLimitMax']
if 'monthlyLimitMax' in response_body:
self.__monthly_limit_max = response_body['monthlyLimitMax']
if 'perTransactionLimitMax' in response_body:
self.__per_transaction_limit_max = response_body['perTransactionLimitMax']
if 'perCardLimitMax' in response_body:
self.__per_card_limit_max = response_body['perCardLimitMax']
Loading