ServiceContactSimpleVO.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class ServiceContactSimpleVO(object):
  6. def __init__(self):
  7. self._contact_email = None
  8. self._contact_name = None
  9. self._contact_tele = None
  10. @property
  11. def contact_email(self):
  12. return self._contact_email
  13. @contact_email.setter
  14. def contact_email(self, value):
  15. self._contact_email = value
  16. @property
  17. def contact_name(self):
  18. return self._contact_name
  19. @contact_name.setter
  20. def contact_name(self, value):
  21. self._contact_name = value
  22. @property
  23. def contact_tele(self):
  24. return self._contact_tele
  25. @contact_tele.setter
  26. def contact_tele(self, value):
  27. self._contact_tele = value
  28. def to_alipay_dict(self):
  29. params = dict()
  30. if self.contact_email:
  31. if hasattr(self.contact_email, 'to_alipay_dict'):
  32. params['contact_email'] = self.contact_email.to_alipay_dict()
  33. else:
  34. params['contact_email'] = self.contact_email
  35. if self.contact_name:
  36. if hasattr(self.contact_name, 'to_alipay_dict'):
  37. params['contact_name'] = self.contact_name.to_alipay_dict()
  38. else:
  39. params['contact_name'] = self.contact_name
  40. if self.contact_tele:
  41. if hasattr(self.contact_tele, 'to_alipay_dict'):
  42. params['contact_tele'] = self.contact_tele.to_alipay_dict()
  43. else:
  44. params['contact_tele'] = self.contact_tele
  45. return params
  46. @staticmethod
  47. def from_alipay_dict(d):
  48. if not d:
  49. return None
  50. o = ServiceContactSimpleVO()
  51. if 'contact_email' in d:
  52. o.contact_email = d['contact_email']
  53. if 'contact_name' in d:
  54. o.contact_name = d['contact_name']
  55. if 'contact_tele' in d:
  56. o.contact_tele = d['contact_tele']
  57. return o