12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- class OtherAmountInfos(object):
- def __init__(self):
- self._price = None
- self._type = None
- @property
- def price(self):
- return self._price
- @price.setter
- def price(self, value):
- self._price = value
- @property
- def type(self):
- return self._type
- @type.setter
- def type(self, value):
- self._type = value
- def to_alipay_dict(self):
- params = dict()
- if self.price:
- if hasattr(self.price, 'to_alipay_dict'):
- params['price'] = self.price.to_alipay_dict()
- else:
- params['price'] = self.price
- if self.type:
- if hasattr(self.type, 'to_alipay_dict'):
- params['type'] = self.type.to_alipay_dict()
- else:
- params['type'] = self.type
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = OtherAmountInfos()
- if 'price' in d:
- o.price = d['price']
- if 'type' in d:
- o.type = d['type']
- return o
|