AlipayMarketingVoucherQueryResponse.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.response.AlipayResponse import AlipayResponse
  5. from alipay.aop.api.domain.VoucherBillDetail import VoucherBillDetail
  6. class AlipayMarketingVoucherQueryResponse(AlipayResponse):
  7. def __init__(self):
  8. super(AlipayMarketingVoucherQueryResponse, self).__init__()
  9. self._available_amount = None
  10. self._bill_details = None
  11. self._extend_info = None
  12. self._gmt_active = None
  13. self._gmt_create = None
  14. self._gmt_expired = None
  15. self._name = None
  16. self._status = None
  17. self._template_id = None
  18. self._total_amount = None
  19. self._user_id = None
  20. self._voucher_id = None
  21. @property
  22. def available_amount(self):
  23. return self._available_amount
  24. @available_amount.setter
  25. def available_amount(self, value):
  26. self._available_amount = value
  27. @property
  28. def bill_details(self):
  29. return self._bill_details
  30. @bill_details.setter
  31. def bill_details(self, value):
  32. if isinstance(value, list):
  33. self._bill_details = list()
  34. for i in value:
  35. if isinstance(i, VoucherBillDetail):
  36. self._bill_details.append(i)
  37. else:
  38. self._bill_details.append(VoucherBillDetail.from_alipay_dict(i))
  39. @property
  40. def extend_info(self):
  41. return self._extend_info
  42. @extend_info.setter
  43. def extend_info(self, value):
  44. self._extend_info = value
  45. @property
  46. def gmt_active(self):
  47. return self._gmt_active
  48. @gmt_active.setter
  49. def gmt_active(self, value):
  50. self._gmt_active = value
  51. @property
  52. def gmt_create(self):
  53. return self._gmt_create
  54. @gmt_create.setter
  55. def gmt_create(self, value):
  56. self._gmt_create = value
  57. @property
  58. def gmt_expired(self):
  59. return self._gmt_expired
  60. @gmt_expired.setter
  61. def gmt_expired(self, value):
  62. self._gmt_expired = value
  63. @property
  64. def name(self):
  65. return self._name
  66. @name.setter
  67. def name(self, value):
  68. self._name = value
  69. @property
  70. def status(self):
  71. return self._status
  72. @status.setter
  73. def status(self, value):
  74. self._status = value
  75. @property
  76. def template_id(self):
  77. return self._template_id
  78. @template_id.setter
  79. def template_id(self, value):
  80. self._template_id = value
  81. @property
  82. def total_amount(self):
  83. return self._total_amount
  84. @total_amount.setter
  85. def total_amount(self, value):
  86. self._total_amount = value
  87. @property
  88. def user_id(self):
  89. return self._user_id
  90. @user_id.setter
  91. def user_id(self, value):
  92. self._user_id = value
  93. @property
  94. def voucher_id(self):
  95. return self._voucher_id
  96. @voucher_id.setter
  97. def voucher_id(self, value):
  98. self._voucher_id = value
  99. def parse_response_content(self, response_content):
  100. response = super(AlipayMarketingVoucherQueryResponse, self).parse_response_content(response_content)
  101. if 'available_amount' in response:
  102. self.available_amount = response['available_amount']
  103. if 'bill_details' in response:
  104. self.bill_details = response['bill_details']
  105. if 'extend_info' in response:
  106. self.extend_info = response['extend_info']
  107. if 'gmt_active' in response:
  108. self.gmt_active = response['gmt_active']
  109. if 'gmt_create' in response:
  110. self.gmt_create = response['gmt_create']
  111. if 'gmt_expired' in response:
  112. self.gmt_expired = response['gmt_expired']
  113. if 'name' in response:
  114. self.name = response['name']
  115. if 'status' in response:
  116. self.status = response['status']
  117. if 'template_id' in response:
  118. self.template_id = response['template_id']
  119. if 'total_amount' in response:
  120. self.total_amount = response['total_amount']
  121. if 'user_id' in response:
  122. self.user_id = response['user_id']
  123. if 'voucher_id' in response:
  124. self.voucher_id = response['voucher_id']