AlipayEcoEduKtBillingSendModel.py 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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.ChargeItems import ChargeItems
  6. from alipay.aop.api.domain.BillSendExtInfo import BillSendExtInfo
  7. from alipay.aop.api.domain.UserDetails import UserDetails
  8. class AlipayEcoEduKtBillingSendModel(object):
  9. def __init__(self):
  10. self._amount = None
  11. self._charge_bill_title = None
  12. self._charge_item = None
  13. self._charge_type = None
  14. self._child_name = None
  15. self._class_in = None
  16. self._end_enable = None
  17. self._ext_info = None
  18. self._gmt_end = None
  19. self._grade = None
  20. self._out_trade_no = None
  21. self._partner_id = None
  22. self._school_no = None
  23. self._school_pid = None
  24. self._student_code = None
  25. self._student_identify = None
  26. self._users = None
  27. @property
  28. def amount(self):
  29. return self._amount
  30. @amount.setter
  31. def amount(self, value):
  32. self._amount = value
  33. @property
  34. def charge_bill_title(self):
  35. return self._charge_bill_title
  36. @charge_bill_title.setter
  37. def charge_bill_title(self, value):
  38. self._charge_bill_title = value
  39. @property
  40. def charge_item(self):
  41. return self._charge_item
  42. @charge_item.setter
  43. def charge_item(self, value):
  44. if isinstance(value, list):
  45. self._charge_item = list()
  46. for i in value:
  47. if isinstance(i, ChargeItems):
  48. self._charge_item.append(i)
  49. else:
  50. self._charge_item.append(ChargeItems.from_alipay_dict(i))
  51. @property
  52. def charge_type(self):
  53. return self._charge_type
  54. @charge_type.setter
  55. def charge_type(self, value):
  56. self._charge_type = value
  57. @property
  58. def child_name(self):
  59. return self._child_name
  60. @child_name.setter
  61. def child_name(self, value):
  62. self._child_name = value
  63. @property
  64. def class_in(self):
  65. return self._class_in
  66. @class_in.setter
  67. def class_in(self, value):
  68. self._class_in = value
  69. @property
  70. def end_enable(self):
  71. return self._end_enable
  72. @end_enable.setter
  73. def end_enable(self, value):
  74. self._end_enable = value
  75. @property
  76. def ext_info(self):
  77. return self._ext_info
  78. @ext_info.setter
  79. def ext_info(self, value):
  80. if isinstance(value, BillSendExtInfo):
  81. self._ext_info = value
  82. else:
  83. self._ext_info = BillSendExtInfo.from_alipay_dict(value)
  84. @property
  85. def gmt_end(self):
  86. return self._gmt_end
  87. @gmt_end.setter
  88. def gmt_end(self, value):
  89. self._gmt_end = value
  90. @property
  91. def grade(self):
  92. return self._grade
  93. @grade.setter
  94. def grade(self, value):
  95. self._grade = value
  96. @property
  97. def out_trade_no(self):
  98. return self._out_trade_no
  99. @out_trade_no.setter
  100. def out_trade_no(self, value):
  101. self._out_trade_no = value
  102. @property
  103. def partner_id(self):
  104. return self._partner_id
  105. @partner_id.setter
  106. def partner_id(self, value):
  107. self._partner_id = value
  108. @property
  109. def school_no(self):
  110. return self._school_no
  111. @school_no.setter
  112. def school_no(self, value):
  113. self._school_no = value
  114. @property
  115. def school_pid(self):
  116. return self._school_pid
  117. @school_pid.setter
  118. def school_pid(self, value):
  119. self._school_pid = value
  120. @property
  121. def student_code(self):
  122. return self._student_code
  123. @student_code.setter
  124. def student_code(self, value):
  125. self._student_code = value
  126. @property
  127. def student_identify(self):
  128. return self._student_identify
  129. @student_identify.setter
  130. def student_identify(self, value):
  131. self._student_identify = value
  132. @property
  133. def users(self):
  134. return self._users
  135. @users.setter
  136. def users(self, value):
  137. if isinstance(value, list):
  138. self._users = list()
  139. for i in value:
  140. if isinstance(i, UserDetails):
  141. self._users.append(i)
  142. else:
  143. self._users.append(UserDetails.from_alipay_dict(i))
  144. def to_alipay_dict(self):
  145. params = dict()
  146. if self.amount:
  147. if hasattr(self.amount, 'to_alipay_dict'):
  148. params['amount'] = self.amount.to_alipay_dict()
  149. else:
  150. params['amount'] = self.amount
  151. if self.charge_bill_title:
  152. if hasattr(self.charge_bill_title, 'to_alipay_dict'):
  153. params['charge_bill_title'] = self.charge_bill_title.to_alipay_dict()
  154. else:
  155. params['charge_bill_title'] = self.charge_bill_title
  156. if self.charge_item:
  157. if isinstance(self.charge_item, list):
  158. for i in range(0, len(self.charge_item)):
  159. element = self.charge_item[i]
  160. if hasattr(element, 'to_alipay_dict'):
  161. self.charge_item[i] = element.to_alipay_dict()
  162. if hasattr(self.charge_item, 'to_alipay_dict'):
  163. params['charge_item'] = self.charge_item.to_alipay_dict()
  164. else:
  165. params['charge_item'] = self.charge_item
  166. if self.charge_type:
  167. if hasattr(self.charge_type, 'to_alipay_dict'):
  168. params['charge_type'] = self.charge_type.to_alipay_dict()
  169. else:
  170. params['charge_type'] = self.charge_type
  171. if self.child_name:
  172. if hasattr(self.child_name, 'to_alipay_dict'):
  173. params['child_name'] = self.child_name.to_alipay_dict()
  174. else:
  175. params['child_name'] = self.child_name
  176. if self.class_in:
  177. if hasattr(self.class_in, 'to_alipay_dict'):
  178. params['class_in'] = self.class_in.to_alipay_dict()
  179. else:
  180. params['class_in'] = self.class_in
  181. if self.end_enable:
  182. if hasattr(self.end_enable, 'to_alipay_dict'):
  183. params['end_enable'] = self.end_enable.to_alipay_dict()
  184. else:
  185. params['end_enable'] = self.end_enable
  186. if self.ext_info:
  187. if hasattr(self.ext_info, 'to_alipay_dict'):
  188. params['ext_info'] = self.ext_info.to_alipay_dict()
  189. else:
  190. params['ext_info'] = self.ext_info
  191. if self.gmt_end:
  192. if hasattr(self.gmt_end, 'to_alipay_dict'):
  193. params['gmt_end'] = self.gmt_end.to_alipay_dict()
  194. else:
  195. params['gmt_end'] = self.gmt_end
  196. if self.grade:
  197. if hasattr(self.grade, 'to_alipay_dict'):
  198. params['grade'] = self.grade.to_alipay_dict()
  199. else:
  200. params['grade'] = self.grade
  201. if self.out_trade_no:
  202. if hasattr(self.out_trade_no, 'to_alipay_dict'):
  203. params['out_trade_no'] = self.out_trade_no.to_alipay_dict()
  204. else:
  205. params['out_trade_no'] = self.out_trade_no
  206. if self.partner_id:
  207. if hasattr(self.partner_id, 'to_alipay_dict'):
  208. params['partner_id'] = self.partner_id.to_alipay_dict()
  209. else:
  210. params['partner_id'] = self.partner_id
  211. if self.school_no:
  212. if hasattr(self.school_no, 'to_alipay_dict'):
  213. params['school_no'] = self.school_no.to_alipay_dict()
  214. else:
  215. params['school_no'] = self.school_no
  216. if self.school_pid:
  217. if hasattr(self.school_pid, 'to_alipay_dict'):
  218. params['school_pid'] = self.school_pid.to_alipay_dict()
  219. else:
  220. params['school_pid'] = self.school_pid
  221. if self.student_code:
  222. if hasattr(self.student_code, 'to_alipay_dict'):
  223. params['student_code'] = self.student_code.to_alipay_dict()
  224. else:
  225. params['student_code'] = self.student_code
  226. if self.student_identify:
  227. if hasattr(self.student_identify, 'to_alipay_dict'):
  228. params['student_identify'] = self.student_identify.to_alipay_dict()
  229. else:
  230. params['student_identify'] = self.student_identify
  231. if self.users:
  232. if isinstance(self.users, list):
  233. for i in range(0, len(self.users)):
  234. element = self.users[i]
  235. if hasattr(element, 'to_alipay_dict'):
  236. self.users[i] = element.to_alipay_dict()
  237. if hasattr(self.users, 'to_alipay_dict'):
  238. params['users'] = self.users.to_alipay_dict()
  239. else:
  240. params['users'] = self.users
  241. return params
  242. @staticmethod
  243. def from_alipay_dict(d):
  244. if not d:
  245. return None
  246. o = AlipayEcoEduKtBillingSendModel()
  247. if 'amount' in d:
  248. o.amount = d['amount']
  249. if 'charge_bill_title' in d:
  250. o.charge_bill_title = d['charge_bill_title']
  251. if 'charge_item' in d:
  252. o.charge_item = d['charge_item']
  253. if 'charge_type' in d:
  254. o.charge_type = d['charge_type']
  255. if 'child_name' in d:
  256. o.child_name = d['child_name']
  257. if 'class_in' in d:
  258. o.class_in = d['class_in']
  259. if 'end_enable' in d:
  260. o.end_enable = d['end_enable']
  261. if 'ext_info' in d:
  262. o.ext_info = d['ext_info']
  263. if 'gmt_end' in d:
  264. o.gmt_end = d['gmt_end']
  265. if 'grade' in d:
  266. o.grade = d['grade']
  267. if 'out_trade_no' in d:
  268. o.out_trade_no = d['out_trade_no']
  269. if 'partner_id' in d:
  270. o.partner_id = d['partner_id']
  271. if 'school_no' in d:
  272. o.school_no = d['school_no']
  273. if 'school_pid' in d:
  274. o.school_pid = d['school_pid']
  275. if 'student_code' in d:
  276. o.student_code = d['student_code']
  277. if 'student_identify' in d:
  278. o.student_identify = d['student_identify']
  279. if 'users' in d:
  280. o.users = d['users']
  281. return o