ContactPersonInfo.py 2.5 KB

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