AntMerchantExpandAutomatApplyUploadModel.py 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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.SmartAutomatAssociate import SmartAutomatAssociate
  6. from alipay.aop.api.domain.SmartAddressInfo import SmartAddressInfo
  7. from alipay.aop.api.domain.SmartAddressInfo import SmartAddressInfo
  8. from alipay.aop.api.domain.SmartAutomatScene import SmartAutomatScene
  9. class AntMerchantExpandAutomatApplyUploadModel(object):
  10. def __init__(self):
  11. self._associate = None
  12. self._delivery_address = None
  13. self._machine_cooperation_type = None
  14. self._machine_delivery_date = None
  15. self._machine_name = None
  16. self._machine_type = None
  17. self._merchant_user_id = None
  18. self._merchant_user_type = None
  19. self._point_position = None
  20. self._product_user_id = None
  21. self._scene = None
  22. self._terminal_id = None
  23. self._trade_no = None
  24. @property
  25. def associate(self):
  26. return self._associate
  27. @associate.setter
  28. def associate(self, value):
  29. if isinstance(value, SmartAutomatAssociate):
  30. self._associate = value
  31. else:
  32. self._associate = SmartAutomatAssociate.from_alipay_dict(value)
  33. @property
  34. def delivery_address(self):
  35. return self._delivery_address
  36. @delivery_address.setter
  37. def delivery_address(self, value):
  38. if isinstance(value, SmartAddressInfo):
  39. self._delivery_address = value
  40. else:
  41. self._delivery_address = SmartAddressInfo.from_alipay_dict(value)
  42. @property
  43. def machine_cooperation_type(self):
  44. return self._machine_cooperation_type
  45. @machine_cooperation_type.setter
  46. def machine_cooperation_type(self, value):
  47. self._machine_cooperation_type = value
  48. @property
  49. def machine_delivery_date(self):
  50. return self._machine_delivery_date
  51. @machine_delivery_date.setter
  52. def machine_delivery_date(self, value):
  53. self._machine_delivery_date = value
  54. @property
  55. def machine_name(self):
  56. return self._machine_name
  57. @machine_name.setter
  58. def machine_name(self, value):
  59. self._machine_name = value
  60. @property
  61. def machine_type(self):
  62. return self._machine_type
  63. @machine_type.setter
  64. def machine_type(self, value):
  65. self._machine_type = value
  66. @property
  67. def merchant_user_id(self):
  68. return self._merchant_user_id
  69. @merchant_user_id.setter
  70. def merchant_user_id(self, value):
  71. self._merchant_user_id = value
  72. @property
  73. def merchant_user_type(self):
  74. return self._merchant_user_type
  75. @merchant_user_type.setter
  76. def merchant_user_type(self, value):
  77. self._merchant_user_type = value
  78. @property
  79. def point_position(self):
  80. return self._point_position
  81. @point_position.setter
  82. def point_position(self, value):
  83. if isinstance(value, SmartAddressInfo):
  84. self._point_position = value
  85. else:
  86. self._point_position = SmartAddressInfo.from_alipay_dict(value)
  87. @property
  88. def product_user_id(self):
  89. return self._product_user_id
  90. @product_user_id.setter
  91. def product_user_id(self, value):
  92. self._product_user_id = value
  93. @property
  94. def scene(self):
  95. return self._scene
  96. @scene.setter
  97. def scene(self, value):
  98. if isinstance(value, SmartAutomatScene):
  99. self._scene = value
  100. else:
  101. self._scene = SmartAutomatScene.from_alipay_dict(value)
  102. @property
  103. def terminal_id(self):
  104. return self._terminal_id
  105. @terminal_id.setter
  106. def terminal_id(self, value):
  107. self._terminal_id = value
  108. @property
  109. def trade_no(self):
  110. return self._trade_no
  111. @trade_no.setter
  112. def trade_no(self, value):
  113. self._trade_no = value
  114. def to_alipay_dict(self):
  115. params = dict()
  116. if self.associate:
  117. if hasattr(self.associate, 'to_alipay_dict'):
  118. params['associate'] = self.associate.to_alipay_dict()
  119. else:
  120. params['associate'] = self.associate
  121. if self.delivery_address:
  122. if hasattr(self.delivery_address, 'to_alipay_dict'):
  123. params['delivery_address'] = self.delivery_address.to_alipay_dict()
  124. else:
  125. params['delivery_address'] = self.delivery_address
  126. if self.machine_cooperation_type:
  127. if hasattr(self.machine_cooperation_type, 'to_alipay_dict'):
  128. params['machine_cooperation_type'] = self.machine_cooperation_type.to_alipay_dict()
  129. else:
  130. params['machine_cooperation_type'] = self.machine_cooperation_type
  131. if self.machine_delivery_date:
  132. if hasattr(self.machine_delivery_date, 'to_alipay_dict'):
  133. params['machine_delivery_date'] = self.machine_delivery_date.to_alipay_dict()
  134. else:
  135. params['machine_delivery_date'] = self.machine_delivery_date
  136. if self.machine_name:
  137. if hasattr(self.machine_name, 'to_alipay_dict'):
  138. params['machine_name'] = self.machine_name.to_alipay_dict()
  139. else:
  140. params['machine_name'] = self.machine_name
  141. if self.machine_type:
  142. if hasattr(self.machine_type, 'to_alipay_dict'):
  143. params['machine_type'] = self.machine_type.to_alipay_dict()
  144. else:
  145. params['machine_type'] = self.machine_type
  146. if self.merchant_user_id:
  147. if hasattr(self.merchant_user_id, 'to_alipay_dict'):
  148. params['merchant_user_id'] = self.merchant_user_id.to_alipay_dict()
  149. else:
  150. params['merchant_user_id'] = self.merchant_user_id
  151. if self.merchant_user_type:
  152. if hasattr(self.merchant_user_type, 'to_alipay_dict'):
  153. params['merchant_user_type'] = self.merchant_user_type.to_alipay_dict()
  154. else:
  155. params['merchant_user_type'] = self.merchant_user_type
  156. if self.point_position:
  157. if hasattr(self.point_position, 'to_alipay_dict'):
  158. params['point_position'] = self.point_position.to_alipay_dict()
  159. else:
  160. params['point_position'] = self.point_position
  161. if self.product_user_id:
  162. if hasattr(self.product_user_id, 'to_alipay_dict'):
  163. params['product_user_id'] = self.product_user_id.to_alipay_dict()
  164. else:
  165. params['product_user_id'] = self.product_user_id
  166. if self.scene:
  167. if hasattr(self.scene, 'to_alipay_dict'):
  168. params['scene'] = self.scene.to_alipay_dict()
  169. else:
  170. params['scene'] = self.scene
  171. if self.terminal_id:
  172. if hasattr(self.terminal_id, 'to_alipay_dict'):
  173. params['terminal_id'] = self.terminal_id.to_alipay_dict()
  174. else:
  175. params['terminal_id'] = self.terminal_id
  176. if self.trade_no:
  177. if hasattr(self.trade_no, 'to_alipay_dict'):
  178. params['trade_no'] = self.trade_no.to_alipay_dict()
  179. else:
  180. params['trade_no'] = self.trade_no
  181. return params
  182. @staticmethod
  183. def from_alipay_dict(d):
  184. if not d:
  185. return None
  186. o = AntMerchantExpandAutomatApplyUploadModel()
  187. if 'associate' in d:
  188. o.associate = d['associate']
  189. if 'delivery_address' in d:
  190. o.delivery_address = d['delivery_address']
  191. if 'machine_cooperation_type' in d:
  192. o.machine_cooperation_type = d['machine_cooperation_type']
  193. if 'machine_delivery_date' in d:
  194. o.machine_delivery_date = d['machine_delivery_date']
  195. if 'machine_name' in d:
  196. o.machine_name = d['machine_name']
  197. if 'machine_type' in d:
  198. o.machine_type = d['machine_type']
  199. if 'merchant_user_id' in d:
  200. o.merchant_user_id = d['merchant_user_id']
  201. if 'merchant_user_type' in d:
  202. o.merchant_user_type = d['merchant_user_type']
  203. if 'point_position' in d:
  204. o.point_position = d['point_position']
  205. if 'product_user_id' in d:
  206. o.product_user_id = d['product_user_id']
  207. if 'scene' in d:
  208. o.scene = d['scene']
  209. if 'terminal_id' in d:
  210. o.terminal_id = d['terminal_id']
  211. if 'trade_no' in d:
  212. o.trade_no = d['trade_no']
  213. return o