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




class AbaCard:
def __init__(self):

self.__asset_id = None # type: str
self.__card_nick_name = None # type: str
self.__masked_card_no = None # type: str
self.__card_status = None # type: str
self.__card_brand = None # type: str
self.__created_time = None # type: str
self.__updated_time = None # type: str


@property
def asset_id(self):
"""
卡资产ID。 Card asset Id.
"""
return self.__asset_id

@asset_id.setter
def asset_id(self, value):
self.__asset_id = value
@property
def card_nick_name(self):
"""
由用户定义的卡昵称,可以帮助用户更方便地管理多张卡。 User-defined card nickname, designed to help users manage multiple cards more conveniently.
"""
return self.__card_nick_name

@card_nick_name.setter
def card_nick_name(self, value):
self.__card_nick_name = value
@property
def masked_card_no(self):
"""
脱敏卡号。 Masked card number.
"""
return self.__masked_card_no

@masked_card_no.setter
def masked_card_no(self, value):
self.__masked_card_no = value
@property
def card_status(self):
"""
卡状态。可取值范围: ACTIVE:可正常使用 FROZEN:已冻结 CANCEL:已注销 Card Status: Represents the current state of the card. Possible values include: ACTIVE: The card is active and can be used normally. FROZEN: The card has been frozen and cannot be used temporarily. CANCEL: The card has been canceled and is no longer valid.
"""
return self.__card_status

@card_status.setter
def card_status(self, value):
self.__card_status = value
@property
def card_brand(self):
"""
卡品牌。 可取值范围: MASTERCARD Card Brand: Indicates the brand or network of the card. Possible value: MASTERCARD: The card is part of the Mastercard network.
"""
return self.__card_brand

@card_brand.setter
def card_brand(self, value):
self.__card_brand = value
@property
def created_time(self):
"""
Card creation time ISO 8601
"""
return self.__created_time

@created_time.setter
def created_time(self, value):
self.__created_time = value
@property
def updated_time(self):
"""
Card update time ISO 8601
"""
return self.__updated_time

@updated_time.setter
def updated_time(self, value):
self.__updated_time = value




def to_ams_dict(self):
params = dict()
if hasattr(self, "asset_id") and self.asset_id is not None:
params['assetId'] = self.asset_id
if hasattr(self, "card_nick_name") and self.card_nick_name is not None:
params['cardNickName'] = self.card_nick_name
if hasattr(self, "masked_card_no") and self.masked_card_no is not None:
params['maskedCardNo'] = self.masked_card_no
if hasattr(self, "card_status") and self.card_status is not None:
params['cardStatus'] = self.card_status
if hasattr(self, "card_brand") and self.card_brand is not None:
params['cardBrand'] = self.card_brand
if hasattr(self, "created_time") and self.created_time is not None:
params['createdTime'] = self.created_time
if hasattr(self, "updated_time") and self.updated_time is not None:
params['updatedTime'] = self.updated_time
return params


def parse_rsp_body(self, response_body):
if isinstance(response_body, str):
response_body = json.loads(response_body)
if 'assetId' in response_body:
self.__asset_id = response_body['assetId']
if 'cardNickName' in response_body:
self.__card_nick_name = response_body['cardNickName']
if 'maskedCardNo' in response_body:
self.__masked_card_no = response_body['maskedCardNo']
if 'cardStatus' in response_body:
self.__card_status = response_body['cardStatus']
if 'cardBrand' in response_body:
self.__card_brand = response_body['cardBrand']
if 'createdTime' in response_body:
self.__created_time = response_body['createdTime']
if 'updatedTime' in response_body:
self.__updated_time = response_body['updatedTime']
131 changes: 131 additions & 0 deletions com/alipay/ams/api/model/authorization_control.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import json
from com.alipay.ams.api.model.card_limit_detail import CardLimitDetail
from com.alipay.ams.api.model.card_limit_info import CardLimitInfo




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
self.__card_limit_info = None # type: CardLimitInfo


@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
@property
def card_limit_info(self):
"""Gets the card_limit_info of this AuthorizationControl.

"""
return self.__card_limit_info

@card_limit_info.setter
def card_limit_info(self, value):
self.__card_limit_info = 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
if hasattr(self, "card_limit_info") and self.card_limit_info is not None:
params['cardLimitInfo'] = self.card_limit_info
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'])
if 'cardLimitInfo' in response_body:
self.__card_limit_info = CardLimitInfo()
self.__card_limit_info.parse_rsp_body(response_body['cardLimitInfo'])
Loading