KoubeiMallScanpurchasePreorderCreateModel.py 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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.MallGoodsDetail import MallGoodsDetail
  6. class KoubeiMallScanpurchasePreorderCreateModel(object):
  7. def __init__(self):
  8. self._biz_scene = None
  9. self._body = None
  10. self._channel = None
  11. self._goods_detail = None
  12. self._operator_id = None
  13. self._out_order_no = None
  14. self._shop_id = None
  15. self._store_id = None
  16. self._store_name = None
  17. self._subject = None
  18. self._terminal_id = None
  19. self._total_amount = None
  20. @property
  21. def biz_scene(self):
  22. return self._biz_scene
  23. @biz_scene.setter
  24. def biz_scene(self, value):
  25. self._biz_scene = value
  26. @property
  27. def body(self):
  28. return self._body
  29. @body.setter
  30. def body(self, value):
  31. self._body = value
  32. @property
  33. def channel(self):
  34. return self._channel
  35. @channel.setter
  36. def channel(self, value):
  37. self._channel = value
  38. @property
  39. def goods_detail(self):
  40. return self._goods_detail
  41. @goods_detail.setter
  42. def goods_detail(self, value):
  43. if isinstance(value, list):
  44. self._goods_detail = list()
  45. for i in value:
  46. if isinstance(i, MallGoodsDetail):
  47. self._goods_detail.append(i)
  48. else:
  49. self._goods_detail.append(MallGoodsDetail.from_alipay_dict(i))
  50. @property
  51. def operator_id(self):
  52. return self._operator_id
  53. @operator_id.setter
  54. def operator_id(self, value):
  55. self._operator_id = value
  56. @property
  57. def out_order_no(self):
  58. return self._out_order_no
  59. @out_order_no.setter
  60. def out_order_no(self, value):
  61. self._out_order_no = value
  62. @property
  63. def shop_id(self):
  64. return self._shop_id
  65. @shop_id.setter
  66. def shop_id(self, value):
  67. self._shop_id = value
  68. @property
  69. def store_id(self):
  70. return self._store_id
  71. @store_id.setter
  72. def store_id(self, value):
  73. self._store_id = value
  74. @property
  75. def store_name(self):
  76. return self._store_name
  77. @store_name.setter
  78. def store_name(self, value):
  79. self._store_name = value
  80. @property
  81. def subject(self):
  82. return self._subject
  83. @subject.setter
  84. def subject(self, value):
  85. self._subject = value
  86. @property
  87. def terminal_id(self):
  88. return self._terminal_id
  89. @terminal_id.setter
  90. def terminal_id(self, value):
  91. self._terminal_id = value
  92. @property
  93. def total_amount(self):
  94. return self._total_amount
  95. @total_amount.setter
  96. def total_amount(self, value):
  97. self._total_amount = value
  98. def to_alipay_dict(self):
  99. params = dict()
  100. if self.biz_scene:
  101. if hasattr(self.biz_scene, 'to_alipay_dict'):
  102. params['biz_scene'] = self.biz_scene.to_alipay_dict()
  103. else:
  104. params['biz_scene'] = self.biz_scene
  105. if self.body:
  106. if hasattr(self.body, 'to_alipay_dict'):
  107. params['body'] = self.body.to_alipay_dict()
  108. else:
  109. params['body'] = self.body
  110. if self.channel:
  111. if hasattr(self.channel, 'to_alipay_dict'):
  112. params['channel'] = self.channel.to_alipay_dict()
  113. else:
  114. params['channel'] = self.channel
  115. if self.goods_detail:
  116. if isinstance(self.goods_detail, list):
  117. for i in range(0, len(self.goods_detail)):
  118. element = self.goods_detail[i]
  119. if hasattr(element, 'to_alipay_dict'):
  120. self.goods_detail[i] = element.to_alipay_dict()
  121. if hasattr(self.goods_detail, 'to_alipay_dict'):
  122. params['goods_detail'] = self.goods_detail.to_alipay_dict()
  123. else:
  124. params['goods_detail'] = self.goods_detail
  125. if self.operator_id:
  126. if hasattr(self.operator_id, 'to_alipay_dict'):
  127. params['operator_id'] = self.operator_id.to_alipay_dict()
  128. else:
  129. params['operator_id'] = self.operator_id
  130. if self.out_order_no:
  131. if hasattr(self.out_order_no, 'to_alipay_dict'):
  132. params['out_order_no'] = self.out_order_no.to_alipay_dict()
  133. else:
  134. params['out_order_no'] = self.out_order_no
  135. if self.shop_id:
  136. if hasattr(self.shop_id, 'to_alipay_dict'):
  137. params['shop_id'] = self.shop_id.to_alipay_dict()
  138. else:
  139. params['shop_id'] = self.shop_id
  140. if self.store_id:
  141. if hasattr(self.store_id, 'to_alipay_dict'):
  142. params['store_id'] = self.store_id.to_alipay_dict()
  143. else:
  144. params['store_id'] = self.store_id
  145. if self.store_name:
  146. if hasattr(self.store_name, 'to_alipay_dict'):
  147. params['store_name'] = self.store_name.to_alipay_dict()
  148. else:
  149. params['store_name'] = self.store_name
  150. if self.subject:
  151. if hasattr(self.subject, 'to_alipay_dict'):
  152. params['subject'] = self.subject.to_alipay_dict()
  153. else:
  154. params['subject'] = self.subject
  155. if self.terminal_id:
  156. if hasattr(self.terminal_id, 'to_alipay_dict'):
  157. params['terminal_id'] = self.terminal_id.to_alipay_dict()
  158. else:
  159. params['terminal_id'] = self.terminal_id
  160. if self.total_amount:
  161. if hasattr(self.total_amount, 'to_alipay_dict'):
  162. params['total_amount'] = self.total_amount.to_alipay_dict()
  163. else:
  164. params['total_amount'] = self.total_amount
  165. return params
  166. @staticmethod
  167. def from_alipay_dict(d):
  168. if not d:
  169. return None
  170. o = KoubeiMallScanpurchasePreorderCreateModel()
  171. if 'biz_scene' in d:
  172. o.biz_scene = d['biz_scene']
  173. if 'body' in d:
  174. o.body = d['body']
  175. if 'channel' in d:
  176. o.channel = d['channel']
  177. if 'goods_detail' in d:
  178. o.goods_detail = d['goods_detail']
  179. if 'operator_id' in d:
  180. o.operator_id = d['operator_id']
  181. if 'out_order_no' in d:
  182. o.out_order_no = d['out_order_no']
  183. if 'shop_id' in d:
  184. o.shop_id = d['shop_id']
  185. if 'store_id' in d:
  186. o.store_id = d['store_id']
  187. if 'store_name' in d:
  188. o.store_name = d['store_name']
  189. if 'subject' in d:
  190. o.subject = d['subject']
  191. if 'terminal_id' in d:
  192. o.terminal_id = d['terminal_id']
  193. if 'total_amount' in d:
  194. o.total_amount = d['total_amount']
  195. return o