SettleDetailInfo.py 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class SettleDetailInfo(object):
  6. def __init__(self):
  7. self._amount = None
  8. self._settle_entity_id = None
  9. self._settle_entity_type = None
  10. self._summary_dimension = None
  11. self._trans_in = None
  12. self._trans_in_type = None
  13. @property
  14. def amount(self):
  15. return self._amount
  16. @amount.setter
  17. def amount(self, value):
  18. self._amount = value
  19. @property
  20. def settle_entity_id(self):
  21. return self._settle_entity_id
  22. @settle_entity_id.setter
  23. def settle_entity_id(self, value):
  24. self._settle_entity_id = value
  25. @property
  26. def settle_entity_type(self):
  27. return self._settle_entity_type
  28. @settle_entity_type.setter
  29. def settle_entity_type(self, value):
  30. self._settle_entity_type = value
  31. @property
  32. def summary_dimension(self):
  33. return self._summary_dimension
  34. @summary_dimension.setter
  35. def summary_dimension(self, value):
  36. self._summary_dimension = value
  37. @property
  38. def trans_in(self):
  39. return self._trans_in
  40. @trans_in.setter
  41. def trans_in(self, value):
  42. self._trans_in = value
  43. @property
  44. def trans_in_type(self):
  45. return self._trans_in_type
  46. @trans_in_type.setter
  47. def trans_in_type(self, value):
  48. self._trans_in_type = value
  49. def to_alipay_dict(self):
  50. params = dict()
  51. if self.amount:
  52. if hasattr(self.amount, 'to_alipay_dict'):
  53. params['amount'] = self.amount.to_alipay_dict()
  54. else:
  55. params['amount'] = self.amount
  56. if self.settle_entity_id:
  57. if hasattr(self.settle_entity_id, 'to_alipay_dict'):
  58. params['settle_entity_id'] = self.settle_entity_id.to_alipay_dict()
  59. else:
  60. params['settle_entity_id'] = self.settle_entity_id
  61. if self.settle_entity_type:
  62. if hasattr(self.settle_entity_type, 'to_alipay_dict'):
  63. params['settle_entity_type'] = self.settle_entity_type.to_alipay_dict()
  64. else:
  65. params['settle_entity_type'] = self.settle_entity_type
  66. if self.summary_dimension:
  67. if hasattr(self.summary_dimension, 'to_alipay_dict'):
  68. params['summary_dimension'] = self.summary_dimension.to_alipay_dict()
  69. else:
  70. params['summary_dimension'] = self.summary_dimension
  71. if self.trans_in:
  72. if hasattr(self.trans_in, 'to_alipay_dict'):
  73. params['trans_in'] = self.trans_in.to_alipay_dict()
  74. else:
  75. params['trans_in'] = self.trans_in
  76. if self.trans_in_type:
  77. if hasattr(self.trans_in_type, 'to_alipay_dict'):
  78. params['trans_in_type'] = self.trans_in_type.to_alipay_dict()
  79. else:
  80. params['trans_in_type'] = self.trans_in_type
  81. return params
  82. @staticmethod
  83. def from_alipay_dict(d):
  84. if not d:
  85. return None
  86. o = SettleDetailInfo()
  87. if 'amount' in d:
  88. o.amount = d['amount']
  89. if 'settle_entity_id' in d:
  90. o.settle_entity_id = d['settle_entity_id']
  91. if 'settle_entity_type' in d:
  92. o.settle_entity_type = d['settle_entity_type']
  93. if 'summary_dimension' in d:
  94. o.summary_dimension = d['summary_dimension']
  95. if 'trans_in' in d:
  96. o.trans_in = d['trans_in']
  97. if 'trans_in_type' in d:
  98. o.trans_in_type = d['trans_in_type']
  99. return o