FaceMerchantInfo.py 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class FaceMerchantInfo(object):
  6. def __init__(self):
  7. self._area_code = None
  8. self._brand_code = None
  9. self._device_mac = None
  10. self._device_num = None
  11. self._geo = None
  12. self._group = None
  13. self._merchant_id = None
  14. self._partner_id = None
  15. self._store_code = None
  16. self._wifimac = None
  17. self._wifiname = None
  18. @property
  19. def area_code(self):
  20. return self._area_code
  21. @area_code.setter
  22. def area_code(self, value):
  23. self._area_code = value
  24. @property
  25. def brand_code(self):
  26. return self._brand_code
  27. @brand_code.setter
  28. def brand_code(self, value):
  29. self._brand_code = value
  30. @property
  31. def device_mac(self):
  32. return self._device_mac
  33. @device_mac.setter
  34. def device_mac(self, value):
  35. self._device_mac = value
  36. @property
  37. def device_num(self):
  38. return self._device_num
  39. @device_num.setter
  40. def device_num(self, value):
  41. self._device_num = value
  42. @property
  43. def geo(self):
  44. return self._geo
  45. @geo.setter
  46. def geo(self, value):
  47. self._geo = value
  48. @property
  49. def group(self):
  50. return self._group
  51. @group.setter
  52. def group(self, value):
  53. self._group = value
  54. @property
  55. def merchant_id(self):
  56. return self._merchant_id
  57. @merchant_id.setter
  58. def merchant_id(self, value):
  59. self._merchant_id = value
  60. @property
  61. def partner_id(self):
  62. return self._partner_id
  63. @partner_id.setter
  64. def partner_id(self, value):
  65. self._partner_id = value
  66. @property
  67. def store_code(self):
  68. return self._store_code
  69. @store_code.setter
  70. def store_code(self, value):
  71. self._store_code = value
  72. @property
  73. def wifimac(self):
  74. return self._wifimac
  75. @wifimac.setter
  76. def wifimac(self, value):
  77. self._wifimac = value
  78. @property
  79. def wifiname(self):
  80. return self._wifiname
  81. @wifiname.setter
  82. def wifiname(self, value):
  83. self._wifiname = value
  84. def to_alipay_dict(self):
  85. params = dict()
  86. if self.area_code:
  87. if hasattr(self.area_code, 'to_alipay_dict'):
  88. params['area_code'] = self.area_code.to_alipay_dict()
  89. else:
  90. params['area_code'] = self.area_code
  91. if self.brand_code:
  92. if hasattr(self.brand_code, 'to_alipay_dict'):
  93. params['brand_code'] = self.brand_code.to_alipay_dict()
  94. else:
  95. params['brand_code'] = self.brand_code
  96. if self.device_mac:
  97. if hasattr(self.device_mac, 'to_alipay_dict'):
  98. params['device_mac'] = self.device_mac.to_alipay_dict()
  99. else:
  100. params['device_mac'] = self.device_mac
  101. if self.device_num:
  102. if hasattr(self.device_num, 'to_alipay_dict'):
  103. params['device_num'] = self.device_num.to_alipay_dict()
  104. else:
  105. params['device_num'] = self.device_num
  106. if self.geo:
  107. if hasattr(self.geo, 'to_alipay_dict'):
  108. params['geo'] = self.geo.to_alipay_dict()
  109. else:
  110. params['geo'] = self.geo
  111. if self.group:
  112. if hasattr(self.group, 'to_alipay_dict'):
  113. params['group'] = self.group.to_alipay_dict()
  114. else:
  115. params['group'] = self.group
  116. if self.merchant_id:
  117. if hasattr(self.merchant_id, 'to_alipay_dict'):
  118. params['merchant_id'] = self.merchant_id.to_alipay_dict()
  119. else:
  120. params['merchant_id'] = self.merchant_id
  121. if self.partner_id:
  122. if hasattr(self.partner_id, 'to_alipay_dict'):
  123. params['partner_id'] = self.partner_id.to_alipay_dict()
  124. else:
  125. params['partner_id'] = self.partner_id
  126. if self.store_code:
  127. if hasattr(self.store_code, 'to_alipay_dict'):
  128. params['store_code'] = self.store_code.to_alipay_dict()
  129. else:
  130. params['store_code'] = self.store_code
  131. if self.wifimac:
  132. if hasattr(self.wifimac, 'to_alipay_dict'):
  133. params['wifimac'] = self.wifimac.to_alipay_dict()
  134. else:
  135. params['wifimac'] = self.wifimac
  136. if self.wifiname:
  137. if hasattr(self.wifiname, 'to_alipay_dict'):
  138. params['wifiname'] = self.wifiname.to_alipay_dict()
  139. else:
  140. params['wifiname'] = self.wifiname
  141. return params
  142. @staticmethod
  143. def from_alipay_dict(d):
  144. if not d:
  145. return None
  146. o = FaceMerchantInfo()
  147. if 'area_code' in d:
  148. o.area_code = d['area_code']
  149. if 'brand_code' in d:
  150. o.brand_code = d['brand_code']
  151. if 'device_mac' in d:
  152. o.device_mac = d['device_mac']
  153. if 'device_num' in d:
  154. o.device_num = d['device_num']
  155. if 'geo' in d:
  156. o.geo = d['geo']
  157. if 'group' in d:
  158. o.group = d['group']
  159. if 'merchant_id' in d:
  160. o.merchant_id = d['merchant_id']
  161. if 'partner_id' in d:
  162. o.partner_id = d['partner_id']
  163. if 'store_code' in d:
  164. o.store_code = d['store_code']
  165. if 'wifimac' in d:
  166. o.wifimac = d['wifimac']
  167. if 'wifiname' in d:
  168. o.wifiname = d['wifiname']
  169. return o