VoucherInfoDetail.py 3.5 KB

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