AntMerchantExpandAutomatApplyModifyModel.py 6.6 KB

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