AlipayEcoMessageEntity.py 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayEcoMessageEntity(object):
  6. def __init__(self):
  7. self._alipay_user_id = None
  8. self._app_code = None
  9. self._certificate_number = None
  10. self._certificate_type = None
  11. self._certificate_username = None
  12. self._city_code = None
  13. self._ext_info = None
  14. self._industry_type = None
  15. self._msg_type = None
  16. self._target_url = None
  17. self._uuid = None
  18. @property
  19. def alipay_user_id(self):
  20. return self._alipay_user_id
  21. @alipay_user_id.setter
  22. def alipay_user_id(self, value):
  23. self._alipay_user_id = value
  24. @property
  25. def app_code(self):
  26. return self._app_code
  27. @app_code.setter
  28. def app_code(self, value):
  29. self._app_code = value
  30. @property
  31. def certificate_number(self):
  32. return self._certificate_number
  33. @certificate_number.setter
  34. def certificate_number(self, value):
  35. self._certificate_number = value
  36. @property
  37. def certificate_type(self):
  38. return self._certificate_type
  39. @certificate_type.setter
  40. def certificate_type(self, value):
  41. self._certificate_type = value
  42. @property
  43. def certificate_username(self):
  44. return self._certificate_username
  45. @certificate_username.setter
  46. def certificate_username(self, value):
  47. self._certificate_username = value
  48. @property
  49. def city_code(self):
  50. return self._city_code
  51. @city_code.setter
  52. def city_code(self, value):
  53. self._city_code = value
  54. @property
  55. def ext_info(self):
  56. return self._ext_info
  57. @ext_info.setter
  58. def ext_info(self, value):
  59. self._ext_info = value
  60. @property
  61. def industry_type(self):
  62. return self._industry_type
  63. @industry_type.setter
  64. def industry_type(self, value):
  65. self._industry_type = value
  66. @property
  67. def msg_type(self):
  68. return self._msg_type
  69. @msg_type.setter
  70. def msg_type(self, value):
  71. self._msg_type = value
  72. @property
  73. def target_url(self):
  74. return self._target_url
  75. @target_url.setter
  76. def target_url(self, value):
  77. self._target_url = value
  78. @property
  79. def uuid(self):
  80. return self._uuid
  81. @uuid.setter
  82. def uuid(self, value):
  83. self._uuid = value
  84. def to_alipay_dict(self):
  85. params = dict()
  86. if self.alipay_user_id:
  87. if hasattr(self.alipay_user_id, 'to_alipay_dict'):
  88. params['alipay_user_id'] = self.alipay_user_id.to_alipay_dict()
  89. else:
  90. params['alipay_user_id'] = self.alipay_user_id
  91. if self.app_code:
  92. if hasattr(self.app_code, 'to_alipay_dict'):
  93. params['app_code'] = self.app_code.to_alipay_dict()
  94. else:
  95. params['app_code'] = self.app_code
  96. if self.certificate_number:
  97. if hasattr(self.certificate_number, 'to_alipay_dict'):
  98. params['certificate_number'] = self.certificate_number.to_alipay_dict()
  99. else:
  100. params['certificate_number'] = self.certificate_number
  101. if self.certificate_type:
  102. if hasattr(self.certificate_type, 'to_alipay_dict'):
  103. params['certificate_type'] = self.certificate_type.to_alipay_dict()
  104. else:
  105. params['certificate_type'] = self.certificate_type
  106. if self.certificate_username:
  107. if hasattr(self.certificate_username, 'to_alipay_dict'):
  108. params['certificate_username'] = self.certificate_username.to_alipay_dict()
  109. else:
  110. params['certificate_username'] = self.certificate_username
  111. if self.city_code:
  112. if hasattr(self.city_code, 'to_alipay_dict'):
  113. params['city_code'] = self.city_code.to_alipay_dict()
  114. else:
  115. params['city_code'] = self.city_code
  116. if self.ext_info:
  117. if hasattr(self.ext_info, 'to_alipay_dict'):
  118. params['ext_info'] = self.ext_info.to_alipay_dict()
  119. else:
  120. params['ext_info'] = self.ext_info
  121. if self.industry_type:
  122. if hasattr(self.industry_type, 'to_alipay_dict'):
  123. params['industry_type'] = self.industry_type.to_alipay_dict()
  124. else:
  125. params['industry_type'] = self.industry_type
  126. if self.msg_type:
  127. if hasattr(self.msg_type, 'to_alipay_dict'):
  128. params['msg_type'] = self.msg_type.to_alipay_dict()
  129. else:
  130. params['msg_type'] = self.msg_type
  131. if self.target_url:
  132. if hasattr(self.target_url, 'to_alipay_dict'):
  133. params['target_url'] = self.target_url.to_alipay_dict()
  134. else:
  135. params['target_url'] = self.target_url
  136. if self.uuid:
  137. if hasattr(self.uuid, 'to_alipay_dict'):
  138. params['uuid'] = self.uuid.to_alipay_dict()
  139. else:
  140. params['uuid'] = self.uuid
  141. return params
  142. @staticmethod
  143. def from_alipay_dict(d):
  144. if not d:
  145. return None
  146. o = AlipayEcoMessageEntity()
  147. if 'alipay_user_id' in d:
  148. o.alipay_user_id = d['alipay_user_id']
  149. if 'app_code' in d:
  150. o.app_code = d['app_code']
  151. if 'certificate_number' in d:
  152. o.certificate_number = d['certificate_number']
  153. if 'certificate_type' in d:
  154. o.certificate_type = d['certificate_type']
  155. if 'certificate_username' in d:
  156. o.certificate_username = d['certificate_username']
  157. if 'city_code' in d:
  158. o.city_code = d['city_code']
  159. if 'ext_info' in d:
  160. o.ext_info = d['ext_info']
  161. if 'industry_type' in d:
  162. o.industry_type = d['industry_type']
  163. if 'msg_type' in d:
  164. o.msg_type = d['msg_type']
  165. if 'target_url' in d:
  166. o.target_url = d['target_url']
  167. if 'uuid' in d:
  168. o.uuid = d['uuid']
  169. return o