VoucherQueryInfo.py 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class VoucherQueryInfo(object):
  6. def __init__(self):
  7. self._active_time = None
  8. self._amount = None
  9. self._available_amount = None
  10. self._expired_time = None
  11. self._send_time = None
  12. self._template_id = None
  13. self._used_count = None
  14. self._voucher_id = None
  15. self._voucher_status = None
  16. self._voucher_type = None
  17. @property
  18. def active_time(self):
  19. return self._active_time
  20. @active_time.setter
  21. def active_time(self, value):
  22. self._active_time = value
  23. @property
  24. def amount(self):
  25. return self._amount
  26. @amount.setter
  27. def amount(self, value):
  28. self._amount = value
  29. @property
  30. def available_amount(self):
  31. return self._available_amount
  32. @available_amount.setter
  33. def available_amount(self, value):
  34. self._available_amount = value
  35. @property
  36. def expired_time(self):
  37. return self._expired_time
  38. @expired_time.setter
  39. def expired_time(self, value):
  40. self._expired_time = value
  41. @property
  42. def send_time(self):
  43. return self._send_time
  44. @send_time.setter
  45. def send_time(self, value):
  46. self._send_time = value
  47. @property
  48. def template_id(self):
  49. return self._template_id
  50. @template_id.setter
  51. def template_id(self, value):
  52. self._template_id = value
  53. @property
  54. def used_count(self):
  55. return self._used_count
  56. @used_count.setter
  57. def used_count(self, value):
  58. self._used_count = value
  59. @property
  60. def voucher_id(self):
  61. return self._voucher_id
  62. @voucher_id.setter
  63. def voucher_id(self, value):
  64. self._voucher_id = value
  65. @property
  66. def voucher_status(self):
  67. return self._voucher_status
  68. @voucher_status.setter
  69. def voucher_status(self, value):
  70. self._voucher_status = value
  71. @property
  72. def voucher_type(self):
  73. return self._voucher_type
  74. @voucher_type.setter
  75. def voucher_type(self, value):
  76. self._voucher_type = value
  77. def to_alipay_dict(self):
  78. params = dict()
  79. if self.active_time:
  80. if hasattr(self.active_time, 'to_alipay_dict'):
  81. params['active_time'] = self.active_time.to_alipay_dict()
  82. else:
  83. params['active_time'] = self.active_time
  84. if self.amount:
  85. if hasattr(self.amount, 'to_alipay_dict'):
  86. params['amount'] = self.amount.to_alipay_dict()
  87. else:
  88. params['amount'] = self.amount
  89. if self.available_amount:
  90. if hasattr(self.available_amount, 'to_alipay_dict'):
  91. params['available_amount'] = self.available_amount.to_alipay_dict()
  92. else:
  93. params['available_amount'] = self.available_amount
  94. if self.expired_time:
  95. if hasattr(self.expired_time, 'to_alipay_dict'):
  96. params['expired_time'] = self.expired_time.to_alipay_dict()
  97. else:
  98. params['expired_time'] = self.expired_time
  99. if self.send_time:
  100. if hasattr(self.send_time, 'to_alipay_dict'):
  101. params['send_time'] = self.send_time.to_alipay_dict()
  102. else:
  103. params['send_time'] = self.send_time
  104. if self.template_id:
  105. if hasattr(self.template_id, 'to_alipay_dict'):
  106. params['template_id'] = self.template_id.to_alipay_dict()
  107. else:
  108. params['template_id'] = self.template_id
  109. if self.used_count:
  110. if hasattr(self.used_count, 'to_alipay_dict'):
  111. params['used_count'] = self.used_count.to_alipay_dict()
  112. else:
  113. params['used_count'] = self.used_count
  114. if self.voucher_id:
  115. if hasattr(self.voucher_id, 'to_alipay_dict'):
  116. params['voucher_id'] = self.voucher_id.to_alipay_dict()
  117. else:
  118. params['voucher_id'] = self.voucher_id
  119. if self.voucher_status:
  120. if hasattr(self.voucher_status, 'to_alipay_dict'):
  121. params['voucher_status'] = self.voucher_status.to_alipay_dict()
  122. else:
  123. params['voucher_status'] = self.voucher_status
  124. if self.voucher_type:
  125. if hasattr(self.voucher_type, 'to_alipay_dict'):
  126. params['voucher_type'] = self.voucher_type.to_alipay_dict()
  127. else:
  128. params['voucher_type'] = self.voucher_type
  129. return params
  130. @staticmethod
  131. def from_alipay_dict(d):
  132. if not d:
  133. return None
  134. o = VoucherQueryInfo()
  135. if 'active_time' in d:
  136. o.active_time = d['active_time']
  137. if 'amount' in d:
  138. o.amount = d['amount']
  139. if 'available_amount' in d:
  140. o.available_amount = d['available_amount']
  141. if 'expired_time' in d:
  142. o.expired_time = d['expired_time']
  143. if 'send_time' in d:
  144. o.send_time = d['send_time']
  145. if 'template_id' in d:
  146. o.template_id = d['template_id']
  147. if 'used_count' in d:
  148. o.used_count = d['used_count']
  149. if 'voucher_id' in d:
  150. o.voucher_id = d['voucher_id']
  151. if 'voucher_status' in d:
  152. o.voucher_status = d['voucher_status']
  153. if 'voucher_type' in d:
  154. o.voucher_type = d['voucher_type']
  155. return o