CPBillResultSet.py 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class CPBillResultSet(object):
  6. def __init__(self):
  7. self._acct_period = None
  8. self._bill_entry_amount = None
  9. self._bill_entry_id = None
  10. self._cost_type = None
  11. self._deadline = None
  12. self._out_room_id = None
  13. self._release_day = None
  14. self._room_address = None
  15. self._status = None
  16. @property
  17. def acct_period(self):
  18. return self._acct_period
  19. @acct_period.setter
  20. def acct_period(self, value):
  21. self._acct_period = value
  22. @property
  23. def bill_entry_amount(self):
  24. return self._bill_entry_amount
  25. @bill_entry_amount.setter
  26. def bill_entry_amount(self, value):
  27. self._bill_entry_amount = value
  28. @property
  29. def bill_entry_id(self):
  30. return self._bill_entry_id
  31. @bill_entry_id.setter
  32. def bill_entry_id(self, value):
  33. self._bill_entry_id = value
  34. @property
  35. def cost_type(self):
  36. return self._cost_type
  37. @cost_type.setter
  38. def cost_type(self, value):
  39. self._cost_type = value
  40. @property
  41. def deadline(self):
  42. return self._deadline
  43. @deadline.setter
  44. def deadline(self, value):
  45. self._deadline = value
  46. @property
  47. def out_room_id(self):
  48. return self._out_room_id
  49. @out_room_id.setter
  50. def out_room_id(self, value):
  51. self._out_room_id = value
  52. @property
  53. def release_day(self):
  54. return self._release_day
  55. @release_day.setter
  56. def release_day(self, value):
  57. self._release_day = value
  58. @property
  59. def room_address(self):
  60. return self._room_address
  61. @room_address.setter
  62. def room_address(self, value):
  63. self._room_address = value
  64. @property
  65. def status(self):
  66. return self._status
  67. @status.setter
  68. def status(self, value):
  69. self._status = value
  70. def to_alipay_dict(self):
  71. params = dict()
  72. if self.acct_period:
  73. if hasattr(self.acct_period, 'to_alipay_dict'):
  74. params['acct_period'] = self.acct_period.to_alipay_dict()
  75. else:
  76. params['acct_period'] = self.acct_period
  77. if self.bill_entry_amount:
  78. if hasattr(self.bill_entry_amount, 'to_alipay_dict'):
  79. params['bill_entry_amount'] = self.bill_entry_amount.to_alipay_dict()
  80. else:
  81. params['bill_entry_amount'] = self.bill_entry_amount
  82. if self.bill_entry_id:
  83. if hasattr(self.bill_entry_id, 'to_alipay_dict'):
  84. params['bill_entry_id'] = self.bill_entry_id.to_alipay_dict()
  85. else:
  86. params['bill_entry_id'] = self.bill_entry_id
  87. if self.cost_type:
  88. if hasattr(self.cost_type, 'to_alipay_dict'):
  89. params['cost_type'] = self.cost_type.to_alipay_dict()
  90. else:
  91. params['cost_type'] = self.cost_type
  92. if self.deadline:
  93. if hasattr(self.deadline, 'to_alipay_dict'):
  94. params['deadline'] = self.deadline.to_alipay_dict()
  95. else:
  96. params['deadline'] = self.deadline
  97. if self.out_room_id:
  98. if hasattr(self.out_room_id, 'to_alipay_dict'):
  99. params['out_room_id'] = self.out_room_id.to_alipay_dict()
  100. else:
  101. params['out_room_id'] = self.out_room_id
  102. if self.release_day:
  103. if hasattr(self.release_day, 'to_alipay_dict'):
  104. params['release_day'] = self.release_day.to_alipay_dict()
  105. else:
  106. params['release_day'] = self.release_day
  107. if self.room_address:
  108. if hasattr(self.room_address, 'to_alipay_dict'):
  109. params['room_address'] = self.room_address.to_alipay_dict()
  110. else:
  111. params['room_address'] = self.room_address
  112. if self.status:
  113. if hasattr(self.status, 'to_alipay_dict'):
  114. params['status'] = self.status.to_alipay_dict()
  115. else:
  116. params['status'] = self.status
  117. return params
  118. @staticmethod
  119. def from_alipay_dict(d):
  120. if not d:
  121. return None
  122. o = CPBillResultSet()
  123. if 'acct_period' in d:
  124. o.acct_period = d['acct_period']
  125. if 'bill_entry_amount' in d:
  126. o.bill_entry_amount = d['bill_entry_amount']
  127. if 'bill_entry_id' in d:
  128. o.bill_entry_id = d['bill_entry_id']
  129. if 'cost_type' in d:
  130. o.cost_type = d['cost_type']
  131. if 'deadline' in d:
  132. o.deadline = d['deadline']
  133. if 'out_room_id' in d:
  134. o.out_room_id = d['out_room_id']
  135. if 'release_day' in d:
  136. o.release_day = d['release_day']
  137. if 'room_address' in d:
  138. o.room_address = d['room_address']
  139. if 'status' in d:
  140. o.status = d['status']
  141. return o