AntMemberBenefitInfo.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AntMemberBenefitInfo(object):
  6. def __init__(self):
  7. self._action_url = None
  8. self._icon_url = None
  9. self._status = None
  10. self._title = None
  11. self._value = None
  12. @property
  13. def action_url(self):
  14. return self._action_url
  15. @action_url.setter
  16. def action_url(self, value):
  17. self._action_url = value
  18. @property
  19. def icon_url(self):
  20. return self._icon_url
  21. @icon_url.setter
  22. def icon_url(self, value):
  23. self._icon_url = value
  24. @property
  25. def status(self):
  26. return self._status
  27. @status.setter
  28. def status(self, value):
  29. self._status = value
  30. @property
  31. def title(self):
  32. return self._title
  33. @title.setter
  34. def title(self, value):
  35. self._title = value
  36. @property
  37. def value(self):
  38. return self._value
  39. @value.setter
  40. def value(self, value):
  41. self._value = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.action_url:
  45. if hasattr(self.action_url, 'to_alipay_dict'):
  46. params['action_url'] = self.action_url.to_alipay_dict()
  47. else:
  48. params['action_url'] = self.action_url
  49. if self.icon_url:
  50. if hasattr(self.icon_url, 'to_alipay_dict'):
  51. params['icon_url'] = self.icon_url.to_alipay_dict()
  52. else:
  53. params['icon_url'] = self.icon_url
  54. if self.status:
  55. if hasattr(self.status, 'to_alipay_dict'):
  56. params['status'] = self.status.to_alipay_dict()
  57. else:
  58. params['status'] = self.status
  59. if self.title:
  60. if hasattr(self.title, 'to_alipay_dict'):
  61. params['title'] = self.title.to_alipay_dict()
  62. else:
  63. params['title'] = self.title
  64. if self.value:
  65. if hasattr(self.value, 'to_alipay_dict'):
  66. params['value'] = self.value.to_alipay_dict()
  67. else:
  68. params['value'] = self.value
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = AntMemberBenefitInfo()
  75. if 'action_url' in d:
  76. o.action_url = d['action_url']
  77. if 'icon_url' in d:
  78. o.icon_url = d['icon_url']
  79. if 'status' in d:
  80. o.status = d['status']
  81. if 'title' in d:
  82. o.title = d['title']
  83. if 'value' in d:
  84. o.value = d['value']
  85. return o