AlipayInsSceneCouponSendResponse.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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.InsCertificate import InsCertificate
  6. from alipay.aop.api.domain.InsProduct import InsProduct
  7. class AlipayInsSceneCouponSendResponse(AlipayResponse):
  8. def __init__(self):
  9. super(AlipayInsSceneCouponSendResponse, self).__init__()
  10. self._certificate = None
  11. self._compaign_id = None
  12. self._flow_id = None
  13. self._product = None
  14. @property
  15. def certificate(self):
  16. return self._certificate
  17. @certificate.setter
  18. def certificate(self, value):
  19. if isinstance(value, InsCertificate):
  20. self._certificate = value
  21. else:
  22. self._certificate = InsCertificate.from_alipay_dict(value)
  23. @property
  24. def compaign_id(self):
  25. return self._compaign_id
  26. @compaign_id.setter
  27. def compaign_id(self, value):
  28. self._compaign_id = value
  29. @property
  30. def flow_id(self):
  31. return self._flow_id
  32. @flow_id.setter
  33. def flow_id(self, value):
  34. self._flow_id = value
  35. @property
  36. def product(self):
  37. return self._product
  38. @product.setter
  39. def product(self, value):
  40. if isinstance(value, InsProduct):
  41. self._product = value
  42. else:
  43. self._product = InsProduct.from_alipay_dict(value)
  44. def parse_response_content(self, response_content):
  45. response = super(AlipayInsSceneCouponSendResponse, self).parse_response_content(response_content)
  46. if 'certificate' in response:
  47. self.certificate = response['certificate']
  48. if 'compaign_id' in response:
  49. self.compaign_id = response['compaign_id']
  50. if 'flow_id' in response:
  51. self.flow_id = response['flow_id']
  52. if 'product' in response:
  53. self.product = response['product']