123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- class MerchantModel(object):
- def __init__(self):
- self._alias_name = None
- self._contact_name = None
- self._contact_number = None
- self._name = None
- self._pid = None
- @property
- def alias_name(self):
- return self._alias_name
- @alias_name.setter
- def alias_name(self, value):
- self._alias_name = value
- @property
- def contact_name(self):
- return self._contact_name
- @contact_name.setter
- def contact_name(self, value):
- self._contact_name = value
- @property
- def contact_number(self):
- return self._contact_number
- @contact_number.setter
- def contact_number(self, value):
- self._contact_number = value
- @property
- def name(self):
- return self._name
- @name.setter
- def name(self, value):
- self._name = value
- @property
- def pid(self):
- return self._pid
- @pid.setter
- def pid(self, value):
- self._pid = value
- def to_alipay_dict(self):
- params = dict()
- if self.alias_name:
- if hasattr(self.alias_name, 'to_alipay_dict'):
- params['alias_name'] = self.alias_name.to_alipay_dict()
- else:
- params['alias_name'] = self.alias_name
- if self.contact_name:
- if hasattr(self.contact_name, 'to_alipay_dict'):
- params['contact_name'] = self.contact_name.to_alipay_dict()
- else:
- params['contact_name'] = self.contact_name
- if self.contact_number:
- if hasattr(self.contact_number, 'to_alipay_dict'):
- params['contact_number'] = self.contact_number.to_alipay_dict()
- else:
- params['contact_number'] = self.contact_number
- if self.name:
- if hasattr(self.name, 'to_alipay_dict'):
- params['name'] = self.name.to_alipay_dict()
- else:
- params['name'] = self.name
- if self.pid:
- if hasattr(self.pid, 'to_alipay_dict'):
- params['pid'] = self.pid.to_alipay_dict()
- else:
- params['pid'] = self.pid
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = MerchantModel()
- if 'alias_name' in d:
- o.alias_name = d['alias_name']
- if 'contact_name' in d:
- o.contact_name = d['contact_name']
- if 'contact_number' in d:
- o.contact_number = d['contact_number']
- if 'name' in d:
- o.name = d['name']
- if 'pid' in d:
- o.pid = d['pid']
- return o
|