AlipayEcoMedicalcareCommonTpcardNotifyModel.py 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.MedicalSvTpCardActionInfo import MedicalSvTpCardActionInfo
  6. from alipay.aop.api.domain.MedicalSvTpCardBodyInfo import MedicalSvTpCardBodyInfo
  7. from alipay.aop.api.domain.MedicalSvTpCardHeadInfo import MedicalSvTpCardHeadInfo
  8. class AlipayEcoMedicalcareCommonTpcardNotifyModel(object):
  9. def __init__(self):
  10. self._action_info = None
  11. self._body_info = None
  12. self._extend_params = None
  13. self._header_info = None
  14. self._notify_time = None
  15. self._operate = None
  16. self._template_code = None
  17. self._third_no = None
  18. self._user_id = None
  19. @property
  20. def action_info(self):
  21. return self._action_info
  22. @action_info.setter
  23. def action_info(self, value):
  24. if isinstance(value, list):
  25. self._action_info = list()
  26. for i in value:
  27. if isinstance(i, MedicalSvTpCardActionInfo):
  28. self._action_info.append(i)
  29. else:
  30. self._action_info.append(MedicalSvTpCardActionInfo.from_alipay_dict(i))
  31. @property
  32. def body_info(self):
  33. return self._body_info
  34. @body_info.setter
  35. def body_info(self, value):
  36. if isinstance(value, list):
  37. self._body_info = list()
  38. for i in value:
  39. if isinstance(i, MedicalSvTpCardBodyInfo):
  40. self._body_info.append(i)
  41. else:
  42. self._body_info.append(MedicalSvTpCardBodyInfo.from_alipay_dict(i))
  43. @property
  44. def extend_params(self):
  45. return self._extend_params
  46. @extend_params.setter
  47. def extend_params(self, value):
  48. self._extend_params = value
  49. @property
  50. def header_info(self):
  51. return self._header_info
  52. @header_info.setter
  53. def header_info(self, value):
  54. if isinstance(value, MedicalSvTpCardHeadInfo):
  55. self._header_info = value
  56. else:
  57. self._header_info = MedicalSvTpCardHeadInfo.from_alipay_dict(value)
  58. @property
  59. def notify_time(self):
  60. return self._notify_time
  61. @notify_time.setter
  62. def notify_time(self, value):
  63. self._notify_time = value
  64. @property
  65. def operate(self):
  66. return self._operate
  67. @operate.setter
  68. def operate(self, value):
  69. self._operate = value
  70. @property
  71. def template_code(self):
  72. return self._template_code
  73. @template_code.setter
  74. def template_code(self, value):
  75. self._template_code = value
  76. @property
  77. def third_no(self):
  78. return self._third_no
  79. @third_no.setter
  80. def third_no(self, value):
  81. self._third_no = value
  82. @property
  83. def user_id(self):
  84. return self._user_id
  85. @user_id.setter
  86. def user_id(self, value):
  87. self._user_id = value
  88. def to_alipay_dict(self):
  89. params = dict()
  90. if self.action_info:
  91. if isinstance(self.action_info, list):
  92. for i in range(0, len(self.action_info)):
  93. element = self.action_info[i]
  94. if hasattr(element, 'to_alipay_dict'):
  95. self.action_info[i] = element.to_alipay_dict()
  96. if hasattr(self.action_info, 'to_alipay_dict'):
  97. params['action_info'] = self.action_info.to_alipay_dict()
  98. else:
  99. params['action_info'] = self.action_info
  100. if self.body_info:
  101. if isinstance(self.body_info, list):
  102. for i in range(0, len(self.body_info)):
  103. element = self.body_info[i]
  104. if hasattr(element, 'to_alipay_dict'):
  105. self.body_info[i] = element.to_alipay_dict()
  106. if hasattr(self.body_info, 'to_alipay_dict'):
  107. params['body_info'] = self.body_info.to_alipay_dict()
  108. else:
  109. params['body_info'] = self.body_info
  110. if self.extend_params:
  111. if hasattr(self.extend_params, 'to_alipay_dict'):
  112. params['extend_params'] = self.extend_params.to_alipay_dict()
  113. else:
  114. params['extend_params'] = self.extend_params
  115. if self.header_info:
  116. if hasattr(self.header_info, 'to_alipay_dict'):
  117. params['header_info'] = self.header_info.to_alipay_dict()
  118. else:
  119. params['header_info'] = self.header_info
  120. if self.notify_time:
  121. if hasattr(self.notify_time, 'to_alipay_dict'):
  122. params['notify_time'] = self.notify_time.to_alipay_dict()
  123. else:
  124. params['notify_time'] = self.notify_time
  125. if self.operate:
  126. if hasattr(self.operate, 'to_alipay_dict'):
  127. params['operate'] = self.operate.to_alipay_dict()
  128. else:
  129. params['operate'] = self.operate
  130. if self.template_code:
  131. if hasattr(self.template_code, 'to_alipay_dict'):
  132. params['template_code'] = self.template_code.to_alipay_dict()
  133. else:
  134. params['template_code'] = self.template_code
  135. if self.third_no:
  136. if hasattr(self.third_no, 'to_alipay_dict'):
  137. params['third_no'] = self.third_no.to_alipay_dict()
  138. else:
  139. params['third_no'] = self.third_no
  140. if self.user_id:
  141. if hasattr(self.user_id, 'to_alipay_dict'):
  142. params['user_id'] = self.user_id.to_alipay_dict()
  143. else:
  144. params['user_id'] = self.user_id
  145. return params
  146. @staticmethod
  147. def from_alipay_dict(d):
  148. if not d:
  149. return None
  150. o = AlipayEcoMedicalcareCommonTpcardNotifyModel()
  151. if 'action_info' in d:
  152. o.action_info = d['action_info']
  153. if 'body_info' in d:
  154. o.body_info = d['body_info']
  155. if 'extend_params' in d:
  156. o.extend_params = d['extend_params']
  157. if 'header_info' in d:
  158. o.header_info = d['header_info']
  159. if 'notify_time' in d:
  160. o.notify_time = d['notify_time']
  161. if 'operate' in d:
  162. o.operate = d['operate']
  163. if 'template_code' in d:
  164. o.template_code = d['template_code']
  165. if 'third_no' in d:
  166. o.third_no = d['third_no']
  167. if 'user_id' in d:
  168. o.user_id = d['user_id']
  169. return o