12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- class AlipayUserPrincipalInfo(object):
- def __init__(self):
- self._email = None
- self._mobile = None
- self._user_id = None
- @property
- def email(self):
- return self._email
- @email.setter
- def email(self, value):
- self._email = value
- @property
- def mobile(self):
- return self._mobile
- @mobile.setter
- def mobile(self, value):
- self._mobile = value
- @property
- def user_id(self):
- return self._user_id
- @user_id.setter
- def user_id(self, value):
- self._user_id = value
- def to_alipay_dict(self):
- params = dict()
- if self.email:
- if hasattr(self.email, 'to_alipay_dict'):
- params['email'] = self.email.to_alipay_dict()
- else:
- params['email'] = self.email
- if self.mobile:
- if hasattr(self.mobile, 'to_alipay_dict'):
- params['mobile'] = self.mobile.to_alipay_dict()
- else:
- params['mobile'] = self.mobile
- if self.user_id:
- if hasattr(self.user_id, 'to_alipay_dict'):
- params['user_id'] = self.user_id.to_alipay_dict()
- else:
- params['user_id'] = self.user_id
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = AlipayUserPrincipalInfo()
- if 'email' in d:
- o.email = d['email']
- if 'mobile' in d:
- o.mobile = d['mobile']
- if 'user_id' in d:
- o.user_id = d['user_id']
- return o
|