OpenApiRoyaltyDetailInfoPojo.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class OpenApiRoyaltyDetailInfoPojo(object):
  6. def __init__(self):
  7. self._amount = None
  8. self._amount_percentage = None
  9. self._desc = None
  10. self._royalty_type = None
  11. self._trans_in = None
  12. self._trans_in_type = None
  13. self._trans_out = None
  14. self._trans_out_type = None
  15. @property
  16. def amount(self):
  17. return self._amount
  18. @amount.setter
  19. def amount(self, value):
  20. self._amount = value
  21. @property
  22. def amount_percentage(self):
  23. return self._amount_percentage
  24. @amount_percentage.setter
  25. def amount_percentage(self, value):
  26. self._amount_percentage = value
  27. @property
  28. def desc(self):
  29. return self._desc
  30. @desc.setter
  31. def desc(self, value):
  32. self._desc = value
  33. @property
  34. def royalty_type(self):
  35. return self._royalty_type
  36. @royalty_type.setter
  37. def royalty_type(self, value):
  38. self._royalty_type = value
  39. @property
  40. def trans_in(self):
  41. return self._trans_in
  42. @trans_in.setter
  43. def trans_in(self, value):
  44. self._trans_in = value
  45. @property
  46. def trans_in_type(self):
  47. return self._trans_in_type
  48. @trans_in_type.setter
  49. def trans_in_type(self, value):
  50. self._trans_in_type = value
  51. @property
  52. def trans_out(self):
  53. return self._trans_out
  54. @trans_out.setter
  55. def trans_out(self, value):
  56. self._trans_out = value
  57. @property
  58. def trans_out_type(self):
  59. return self._trans_out_type
  60. @trans_out_type.setter
  61. def trans_out_type(self, value):
  62. self._trans_out_type = value
  63. def to_alipay_dict(self):
  64. params = dict()
  65. if self.amount:
  66. if hasattr(self.amount, 'to_alipay_dict'):
  67. params['amount'] = self.amount.to_alipay_dict()
  68. else:
  69. params['amount'] = self.amount
  70. if self.amount_percentage:
  71. if hasattr(self.amount_percentage, 'to_alipay_dict'):
  72. params['amount_percentage'] = self.amount_percentage.to_alipay_dict()
  73. else:
  74. params['amount_percentage'] = self.amount_percentage
  75. if self.desc:
  76. if hasattr(self.desc, 'to_alipay_dict'):
  77. params['desc'] = self.desc.to_alipay_dict()
  78. else:
  79. params['desc'] = self.desc
  80. if self.royalty_type:
  81. if hasattr(self.royalty_type, 'to_alipay_dict'):
  82. params['royalty_type'] = self.royalty_type.to_alipay_dict()
  83. else:
  84. params['royalty_type'] = self.royalty_type
  85. if self.trans_in:
  86. if hasattr(self.trans_in, 'to_alipay_dict'):
  87. params['trans_in'] = self.trans_in.to_alipay_dict()
  88. else:
  89. params['trans_in'] = self.trans_in
  90. if self.trans_in_type:
  91. if hasattr(self.trans_in_type, 'to_alipay_dict'):
  92. params['trans_in_type'] = self.trans_in_type.to_alipay_dict()
  93. else:
  94. params['trans_in_type'] = self.trans_in_type
  95. if self.trans_out:
  96. if hasattr(self.trans_out, 'to_alipay_dict'):
  97. params['trans_out'] = self.trans_out.to_alipay_dict()
  98. else:
  99. params['trans_out'] = self.trans_out
  100. if self.trans_out_type:
  101. if hasattr(self.trans_out_type, 'to_alipay_dict'):
  102. params['trans_out_type'] = self.trans_out_type.to_alipay_dict()
  103. else:
  104. params['trans_out_type'] = self.trans_out_type
  105. return params
  106. @staticmethod
  107. def from_alipay_dict(d):
  108. if not d:
  109. return None
  110. o = OpenApiRoyaltyDetailInfoPojo()
  111. if 'amount' in d:
  112. o.amount = d['amount']
  113. if 'amount_percentage' in d:
  114. o.amount_percentage = d['amount_percentage']
  115. if 'desc' in d:
  116. o.desc = d['desc']
  117. if 'royalty_type' in d:
  118. o.royalty_type = d['royalty_type']
  119. if 'trans_in' in d:
  120. o.trans_in = d['trans_in']
  121. if 'trans_in_type' in d:
  122. o.trans_in_type = d['trans_in_type']
  123. if 'trans_out' in d:
  124. o.trans_out = d['trans_out']
  125. if 'trans_out_type' in d:
  126. o.trans_out_type = d['trans_out_type']
  127. return o