AlipayCommerceIotDapplyOrderCreateModel.py 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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.DeviceApplyOrderItemDto import DeviceApplyOrderItemDto
  6. class AlipayCommerceIotDapplyOrderCreateModel(object):
  7. def __init__(self):
  8. self._applicant_mobile = None
  9. self._applicant_name = None
  10. self._applicant_pid = None
  11. self._applicant_type = None
  12. self._apply_amount = None
  13. self._asset_apply_type = None
  14. self._creator = None
  15. self._device_apply_order_item_models = None
  16. self._ext_info = None
  17. self._memo = None
  18. self._merchant_name = None
  19. self._merchant_pid = None
  20. self._scene_code = None
  21. self._scene_name = None
  22. self._shop_id = None
  23. self._shop_name = None
  24. self._source_code = None
  25. @property
  26. def applicant_mobile(self):
  27. return self._applicant_mobile
  28. @applicant_mobile.setter
  29. def applicant_mobile(self, value):
  30. self._applicant_mobile = value
  31. @property
  32. def applicant_name(self):
  33. return self._applicant_name
  34. @applicant_name.setter
  35. def applicant_name(self, value):
  36. self._applicant_name = value
  37. @property
  38. def applicant_pid(self):
  39. return self._applicant_pid
  40. @applicant_pid.setter
  41. def applicant_pid(self, value):
  42. self._applicant_pid = value
  43. @property
  44. def applicant_type(self):
  45. return self._applicant_type
  46. @applicant_type.setter
  47. def applicant_type(self, value):
  48. self._applicant_type = value
  49. @property
  50. def apply_amount(self):
  51. return self._apply_amount
  52. @apply_amount.setter
  53. def apply_amount(self, value):
  54. self._apply_amount = value
  55. @property
  56. def asset_apply_type(self):
  57. return self._asset_apply_type
  58. @asset_apply_type.setter
  59. def asset_apply_type(self, value):
  60. self._asset_apply_type = value
  61. @property
  62. def creator(self):
  63. return self._creator
  64. @creator.setter
  65. def creator(self, value):
  66. self._creator = value
  67. @property
  68. def device_apply_order_item_models(self):
  69. return self._device_apply_order_item_models
  70. @device_apply_order_item_models.setter
  71. def device_apply_order_item_models(self, value):
  72. if isinstance(value, list):
  73. self._device_apply_order_item_models = list()
  74. for i in value:
  75. if isinstance(i, DeviceApplyOrderItemDto):
  76. self._device_apply_order_item_models.append(i)
  77. else:
  78. self._device_apply_order_item_models.append(DeviceApplyOrderItemDto.from_alipay_dict(i))
  79. @property
  80. def ext_info(self):
  81. return self._ext_info
  82. @ext_info.setter
  83. def ext_info(self, value):
  84. self._ext_info = value
  85. @property
  86. def memo(self):
  87. return self._memo
  88. @memo.setter
  89. def memo(self, value):
  90. self._memo = value
  91. @property
  92. def merchant_name(self):
  93. return self._merchant_name
  94. @merchant_name.setter
  95. def merchant_name(self, value):
  96. self._merchant_name = value
  97. @property
  98. def merchant_pid(self):
  99. return self._merchant_pid
  100. @merchant_pid.setter
  101. def merchant_pid(self, value):
  102. self._merchant_pid = value
  103. @property
  104. def scene_code(self):
  105. return self._scene_code
  106. @scene_code.setter
  107. def scene_code(self, value):
  108. self._scene_code = value
  109. @property
  110. def scene_name(self):
  111. return self._scene_name
  112. @scene_name.setter
  113. def scene_name(self, value):
  114. self._scene_name = value
  115. @property
  116. def shop_id(self):
  117. return self._shop_id
  118. @shop_id.setter
  119. def shop_id(self, value):
  120. self._shop_id = value
  121. @property
  122. def shop_name(self):
  123. return self._shop_name
  124. @shop_name.setter
  125. def shop_name(self, value):
  126. self._shop_name = value
  127. @property
  128. def source_code(self):
  129. return self._source_code
  130. @source_code.setter
  131. def source_code(self, value):
  132. self._source_code = value
  133. def to_alipay_dict(self):
  134. params = dict()
  135. if self.applicant_mobile:
  136. if hasattr(self.applicant_mobile, 'to_alipay_dict'):
  137. params['applicant_mobile'] = self.applicant_mobile.to_alipay_dict()
  138. else:
  139. params['applicant_mobile'] = self.applicant_mobile
  140. if self.applicant_name:
  141. if hasattr(self.applicant_name, 'to_alipay_dict'):
  142. params['applicant_name'] = self.applicant_name.to_alipay_dict()
  143. else:
  144. params['applicant_name'] = self.applicant_name
  145. if self.applicant_pid:
  146. if hasattr(self.applicant_pid, 'to_alipay_dict'):
  147. params['applicant_pid'] = self.applicant_pid.to_alipay_dict()
  148. else:
  149. params['applicant_pid'] = self.applicant_pid
  150. if self.applicant_type:
  151. if hasattr(self.applicant_type, 'to_alipay_dict'):
  152. params['applicant_type'] = self.applicant_type.to_alipay_dict()
  153. else:
  154. params['applicant_type'] = self.applicant_type
  155. if self.apply_amount:
  156. if hasattr(self.apply_amount, 'to_alipay_dict'):
  157. params['apply_amount'] = self.apply_amount.to_alipay_dict()
  158. else:
  159. params['apply_amount'] = self.apply_amount
  160. if self.asset_apply_type:
  161. if hasattr(self.asset_apply_type, 'to_alipay_dict'):
  162. params['asset_apply_type'] = self.asset_apply_type.to_alipay_dict()
  163. else:
  164. params['asset_apply_type'] = self.asset_apply_type
  165. if self.creator:
  166. if hasattr(self.creator, 'to_alipay_dict'):
  167. params['creator'] = self.creator.to_alipay_dict()
  168. else:
  169. params['creator'] = self.creator
  170. if self.device_apply_order_item_models:
  171. if isinstance(self.device_apply_order_item_models, list):
  172. for i in range(0, len(self.device_apply_order_item_models)):
  173. element = self.device_apply_order_item_models[i]
  174. if hasattr(element, 'to_alipay_dict'):
  175. self.device_apply_order_item_models[i] = element.to_alipay_dict()
  176. if hasattr(self.device_apply_order_item_models, 'to_alipay_dict'):
  177. params['device_apply_order_item_models'] = self.device_apply_order_item_models.to_alipay_dict()
  178. else:
  179. params['device_apply_order_item_models'] = self.device_apply_order_item_models
  180. if self.ext_info:
  181. if hasattr(self.ext_info, 'to_alipay_dict'):
  182. params['ext_info'] = self.ext_info.to_alipay_dict()
  183. else:
  184. params['ext_info'] = self.ext_info
  185. if self.memo:
  186. if hasattr(self.memo, 'to_alipay_dict'):
  187. params['memo'] = self.memo.to_alipay_dict()
  188. else:
  189. params['memo'] = self.memo
  190. if self.merchant_name:
  191. if hasattr(self.merchant_name, 'to_alipay_dict'):
  192. params['merchant_name'] = self.merchant_name.to_alipay_dict()
  193. else:
  194. params['merchant_name'] = self.merchant_name
  195. if self.merchant_pid:
  196. if hasattr(self.merchant_pid, 'to_alipay_dict'):
  197. params['merchant_pid'] = self.merchant_pid.to_alipay_dict()
  198. else:
  199. params['merchant_pid'] = self.merchant_pid
  200. if self.scene_code:
  201. if hasattr(self.scene_code, 'to_alipay_dict'):
  202. params['scene_code'] = self.scene_code.to_alipay_dict()
  203. else:
  204. params['scene_code'] = self.scene_code
  205. if self.scene_name:
  206. if hasattr(self.scene_name, 'to_alipay_dict'):
  207. params['scene_name'] = self.scene_name.to_alipay_dict()
  208. else:
  209. params['scene_name'] = self.scene_name
  210. if self.shop_id:
  211. if hasattr(self.shop_id, 'to_alipay_dict'):
  212. params['shop_id'] = self.shop_id.to_alipay_dict()
  213. else:
  214. params['shop_id'] = self.shop_id
  215. if self.shop_name:
  216. if hasattr(self.shop_name, 'to_alipay_dict'):
  217. params['shop_name'] = self.shop_name.to_alipay_dict()
  218. else:
  219. params['shop_name'] = self.shop_name
  220. if self.source_code:
  221. if hasattr(self.source_code, 'to_alipay_dict'):
  222. params['source_code'] = self.source_code.to_alipay_dict()
  223. else:
  224. params['source_code'] = self.source_code
  225. return params
  226. @staticmethod
  227. def from_alipay_dict(d):
  228. if not d:
  229. return None
  230. o = AlipayCommerceIotDapplyOrderCreateModel()
  231. if 'applicant_mobile' in d:
  232. o.applicant_mobile = d['applicant_mobile']
  233. if 'applicant_name' in d:
  234. o.applicant_name = d['applicant_name']
  235. if 'applicant_pid' in d:
  236. o.applicant_pid = d['applicant_pid']
  237. if 'applicant_type' in d:
  238. o.applicant_type = d['applicant_type']
  239. if 'apply_amount' in d:
  240. o.apply_amount = d['apply_amount']
  241. if 'asset_apply_type' in d:
  242. o.asset_apply_type = d['asset_apply_type']
  243. if 'creator' in d:
  244. o.creator = d['creator']
  245. if 'device_apply_order_item_models' in d:
  246. o.device_apply_order_item_models = d['device_apply_order_item_models']
  247. if 'ext_info' in d:
  248. o.ext_info = d['ext_info']
  249. if 'memo' in d:
  250. o.memo = d['memo']
  251. if 'merchant_name' in d:
  252. o.merchant_name = d['merchant_name']
  253. if 'merchant_pid' in d:
  254. o.merchant_pid = d['merchant_pid']
  255. if 'scene_code' in d:
  256. o.scene_code = d['scene_code']
  257. if 'scene_name' in d:
  258. o.scene_name = d['scene_name']
  259. if 'shop_id' in d:
  260. o.shop_id = d['shop_id']
  261. if 'shop_name' in d:
  262. o.shop_name = d['shop_name']
  263. if 'source_code' in d:
  264. o.source_code = d['source_code']
  265. return o