RequestExtShopItemQuery.py 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class RequestExtShopItemQuery(object):
  6. def __init__(self):
  7. self._brand_code = None
  8. self._category_code = None
  9. self._description = None
  10. self._item_code = None
  11. self._kb_shop_id = None
  12. self._price = None
  13. self._title = None
  14. @property
  15. def brand_code(self):
  16. return self._brand_code
  17. @brand_code.setter
  18. def brand_code(self, value):
  19. self._brand_code = value
  20. @property
  21. def category_code(self):
  22. return self._category_code
  23. @category_code.setter
  24. def category_code(self, value):
  25. self._category_code = value
  26. @property
  27. def description(self):
  28. return self._description
  29. @description.setter
  30. def description(self, value):
  31. self._description = value
  32. @property
  33. def item_code(self):
  34. return self._item_code
  35. @item_code.setter
  36. def item_code(self, value):
  37. self._item_code = value
  38. @property
  39. def kb_shop_id(self):
  40. return self._kb_shop_id
  41. @kb_shop_id.setter
  42. def kb_shop_id(self, value):
  43. self._kb_shop_id = value
  44. @property
  45. def price(self):
  46. return self._price
  47. @price.setter
  48. def price(self, value):
  49. self._price = value
  50. @property
  51. def title(self):
  52. return self._title
  53. @title.setter
  54. def title(self, value):
  55. self._title = value
  56. def to_alipay_dict(self):
  57. params = dict()
  58. if self.brand_code:
  59. if hasattr(self.brand_code, 'to_alipay_dict'):
  60. params['brand_code'] = self.brand_code.to_alipay_dict()
  61. else:
  62. params['brand_code'] = self.brand_code
  63. if self.category_code:
  64. if hasattr(self.category_code, 'to_alipay_dict'):
  65. params['category_code'] = self.category_code.to_alipay_dict()
  66. else:
  67. params['category_code'] = self.category_code
  68. if self.description:
  69. if hasattr(self.description, 'to_alipay_dict'):
  70. params['description'] = self.description.to_alipay_dict()
  71. else:
  72. params['description'] = self.description
  73. if self.item_code:
  74. if hasattr(self.item_code, 'to_alipay_dict'):
  75. params['item_code'] = self.item_code.to_alipay_dict()
  76. else:
  77. params['item_code'] = self.item_code
  78. if self.kb_shop_id:
  79. if hasattr(self.kb_shop_id, 'to_alipay_dict'):
  80. params['kb_shop_id'] = self.kb_shop_id.to_alipay_dict()
  81. else:
  82. params['kb_shop_id'] = self.kb_shop_id
  83. if self.price:
  84. if hasattr(self.price, 'to_alipay_dict'):
  85. params['price'] = self.price.to_alipay_dict()
  86. else:
  87. params['price'] = self.price
  88. if self.title:
  89. if hasattr(self.title, 'to_alipay_dict'):
  90. params['title'] = self.title.to_alipay_dict()
  91. else:
  92. params['title'] = self.title
  93. return params
  94. @staticmethod
  95. def from_alipay_dict(d):
  96. if not d:
  97. return None
  98. o = RequestExtShopItemQuery()
  99. if 'brand_code' in d:
  100. o.brand_code = d['brand_code']
  101. if 'category_code' in d:
  102. o.category_code = d['category_code']
  103. if 'description' in d:
  104. o.description = d['description']
  105. if 'item_code' in d:
  106. o.item_code = d['item_code']
  107. if 'kb_shop_id' in d:
  108. o.kb_shop_id = d['kb_shop_id']
  109. if 'price' in d:
  110. o.price = d['price']
  111. if 'title' in d:
  112. o.title = d['title']
  113. return o