KoubeiCraftsmanDataProviderBatchqueryModel.py 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KoubeiCraftsmanDataProviderBatchqueryModel(object):
  6. def __init__(self):
  7. self._auth_code = None
  8. self._craftsman_ids = None
  9. self._out_craftsman_ids = None
  10. self._page_no = None
  11. self._page_size = None
  12. self._qr_code_shop_id = None
  13. self._recommend = None
  14. self._shop_id = None
  15. @property
  16. def auth_code(self):
  17. return self._auth_code
  18. @auth_code.setter
  19. def auth_code(self, value):
  20. self._auth_code = value
  21. @property
  22. def craftsman_ids(self):
  23. return self._craftsman_ids
  24. @craftsman_ids.setter
  25. def craftsman_ids(self, value):
  26. if isinstance(value, list):
  27. self._craftsman_ids = list()
  28. for i in value:
  29. self._craftsman_ids.append(i)
  30. @property
  31. def out_craftsman_ids(self):
  32. return self._out_craftsman_ids
  33. @out_craftsman_ids.setter
  34. def out_craftsman_ids(self, value):
  35. if isinstance(value, list):
  36. self._out_craftsman_ids = list()
  37. for i in value:
  38. self._out_craftsman_ids.append(i)
  39. @property
  40. def page_no(self):
  41. return self._page_no
  42. @page_no.setter
  43. def page_no(self, value):
  44. self._page_no = value
  45. @property
  46. def page_size(self):
  47. return self._page_size
  48. @page_size.setter
  49. def page_size(self, value):
  50. self._page_size = value
  51. @property
  52. def qr_code_shop_id(self):
  53. return self._qr_code_shop_id
  54. @qr_code_shop_id.setter
  55. def qr_code_shop_id(self, value):
  56. self._qr_code_shop_id = value
  57. @property
  58. def recommend(self):
  59. return self._recommend
  60. @recommend.setter
  61. def recommend(self, value):
  62. self._recommend = value
  63. @property
  64. def shop_id(self):
  65. return self._shop_id
  66. @shop_id.setter
  67. def shop_id(self, value):
  68. self._shop_id = value
  69. def to_alipay_dict(self):
  70. params = dict()
  71. if self.auth_code:
  72. if hasattr(self.auth_code, 'to_alipay_dict'):
  73. params['auth_code'] = self.auth_code.to_alipay_dict()
  74. else:
  75. params['auth_code'] = self.auth_code
  76. if self.craftsman_ids:
  77. if isinstance(self.craftsman_ids, list):
  78. for i in range(0, len(self.craftsman_ids)):
  79. element = self.craftsman_ids[i]
  80. if hasattr(element, 'to_alipay_dict'):
  81. self.craftsman_ids[i] = element.to_alipay_dict()
  82. if hasattr(self.craftsman_ids, 'to_alipay_dict'):
  83. params['craftsman_ids'] = self.craftsman_ids.to_alipay_dict()
  84. else:
  85. params['craftsman_ids'] = self.craftsman_ids
  86. if self.out_craftsman_ids:
  87. if isinstance(self.out_craftsman_ids, list):
  88. for i in range(0, len(self.out_craftsman_ids)):
  89. element = self.out_craftsman_ids[i]
  90. if hasattr(element, 'to_alipay_dict'):
  91. self.out_craftsman_ids[i] = element.to_alipay_dict()
  92. if hasattr(self.out_craftsman_ids, 'to_alipay_dict'):
  93. params['out_craftsman_ids'] = self.out_craftsman_ids.to_alipay_dict()
  94. else:
  95. params['out_craftsman_ids'] = self.out_craftsman_ids
  96. if self.page_no:
  97. if hasattr(self.page_no, 'to_alipay_dict'):
  98. params['page_no'] = self.page_no.to_alipay_dict()
  99. else:
  100. params['page_no'] = self.page_no
  101. if self.page_size:
  102. if hasattr(self.page_size, 'to_alipay_dict'):
  103. params['page_size'] = self.page_size.to_alipay_dict()
  104. else:
  105. params['page_size'] = self.page_size
  106. if self.qr_code_shop_id:
  107. if hasattr(self.qr_code_shop_id, 'to_alipay_dict'):
  108. params['qr_code_shop_id'] = self.qr_code_shop_id.to_alipay_dict()
  109. else:
  110. params['qr_code_shop_id'] = self.qr_code_shop_id
  111. if self.recommend:
  112. if hasattr(self.recommend, 'to_alipay_dict'):
  113. params['recommend'] = self.recommend.to_alipay_dict()
  114. else:
  115. params['recommend'] = self.recommend
  116. if self.shop_id:
  117. if hasattr(self.shop_id, 'to_alipay_dict'):
  118. params['shop_id'] = self.shop_id.to_alipay_dict()
  119. else:
  120. params['shop_id'] = self.shop_id
  121. return params
  122. @staticmethod
  123. def from_alipay_dict(d):
  124. if not d:
  125. return None
  126. o = KoubeiCraftsmanDataProviderBatchqueryModel()
  127. if 'auth_code' in d:
  128. o.auth_code = d['auth_code']
  129. if 'craftsman_ids' in d:
  130. o.craftsman_ids = d['craftsman_ids']
  131. if 'out_craftsman_ids' in d:
  132. o.out_craftsman_ids = d['out_craftsman_ids']
  133. if 'page_no' in d:
  134. o.page_no = d['page_no']
  135. if 'page_size' in d:
  136. o.page_size = d['page_size']
  137. if 'qr_code_shop_id' in d:
  138. o.qr_code_shop_id = d['qr_code_shop_id']
  139. if 'recommend' in d:
  140. o.recommend = d['recommend']
  141. if 'shop_id' in d:
  142. o.shop_id = d['shop_id']
  143. return o