#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AssetParams(object): def __init__(self): self._asset_type = None self._card_no = None self._inst_id = None @property def asset_type(self): return self._asset_type @asset_type.setter def asset_type(self, value): self._asset_type = value @property def card_no(self): return self._card_no @card_no.setter def card_no(self, value): self._card_no = value @property def inst_id(self): return self._inst_id @inst_id.setter def inst_id(self, value): self._inst_id = value def to_alipay_dict(self): params = dict() if self.asset_type: if hasattr(self.asset_type, 'to_alipay_dict'): params['asset_type'] = self.asset_type.to_alipay_dict() else: params['asset_type'] = self.asset_type if self.card_no: if hasattr(self.card_no, 'to_alipay_dict'): params['card_no'] = self.card_no.to_alipay_dict() else: params['card_no'] = self.card_no if self.inst_id: if hasattr(self.inst_id, 'to_alipay_dict'): params['inst_id'] = self.inst_id.to_alipay_dict() else: params['inst_id'] = self.inst_id return params @staticmethod def from_alipay_dict(d): if not d: return None o = AssetParams() if 'asset_type' in d: o.asset_type = d['asset_type'] if 'card_no' in d: o.card_no = d['card_no'] if 'inst_id' in d: o.inst_id = d['inst_id'] return o