BlockChainAccountApiDO.py 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class BlockChainAccountApiDO(object):
  6. def __init__(self):
  7. self._account_hash = None
  8. self._account_index = None
  9. self._account_name = None
  10. self._account_status = None
  11. self._balance = None
  12. self._block_chain_id = None
  13. self._block_hash = None
  14. self._cid = None
  15. self._create_time = None
  16. self._parent_hash = None
  17. self._transaction_hash = None
  18. @property
  19. def account_hash(self):
  20. return self._account_hash
  21. @account_hash.setter
  22. def account_hash(self, value):
  23. self._account_hash = value
  24. @property
  25. def account_index(self):
  26. return self._account_index
  27. @account_index.setter
  28. def account_index(self, value):
  29. self._account_index = value
  30. @property
  31. def account_name(self):
  32. return self._account_name
  33. @account_name.setter
  34. def account_name(self, value):
  35. self._account_name = value
  36. @property
  37. def account_status(self):
  38. return self._account_status
  39. @account_status.setter
  40. def account_status(self, value):
  41. self._account_status = value
  42. @property
  43. def balance(self):
  44. return self._balance
  45. @balance.setter
  46. def balance(self, value):
  47. self._balance = value
  48. @property
  49. def block_chain_id(self):
  50. return self._block_chain_id
  51. @block_chain_id.setter
  52. def block_chain_id(self, value):
  53. self._block_chain_id = value
  54. @property
  55. def block_hash(self):
  56. return self._block_hash
  57. @block_hash.setter
  58. def block_hash(self, value):
  59. self._block_hash = value
  60. @property
  61. def cid(self):
  62. return self._cid
  63. @cid.setter
  64. def cid(self, value):
  65. self._cid = value
  66. @property
  67. def create_time(self):
  68. return self._create_time
  69. @create_time.setter
  70. def create_time(self, value):
  71. self._create_time = value
  72. @property
  73. def parent_hash(self):
  74. return self._parent_hash
  75. @parent_hash.setter
  76. def parent_hash(self, value):
  77. self._parent_hash = value
  78. @property
  79. def transaction_hash(self):
  80. return self._transaction_hash
  81. @transaction_hash.setter
  82. def transaction_hash(self, value):
  83. self._transaction_hash = value
  84. def to_alipay_dict(self):
  85. params = dict()
  86. if self.account_hash:
  87. if hasattr(self.account_hash, 'to_alipay_dict'):
  88. params['account_hash'] = self.account_hash.to_alipay_dict()
  89. else:
  90. params['account_hash'] = self.account_hash
  91. if self.account_index:
  92. if hasattr(self.account_index, 'to_alipay_dict'):
  93. params['account_index'] = self.account_index.to_alipay_dict()
  94. else:
  95. params['account_index'] = self.account_index
  96. if self.account_name:
  97. if hasattr(self.account_name, 'to_alipay_dict'):
  98. params['account_name'] = self.account_name.to_alipay_dict()
  99. else:
  100. params['account_name'] = self.account_name
  101. if self.account_status:
  102. if hasattr(self.account_status, 'to_alipay_dict'):
  103. params['account_status'] = self.account_status.to_alipay_dict()
  104. else:
  105. params['account_status'] = self.account_status
  106. if self.balance:
  107. if hasattr(self.balance, 'to_alipay_dict'):
  108. params['balance'] = self.balance.to_alipay_dict()
  109. else:
  110. params['balance'] = self.balance
  111. if self.block_chain_id:
  112. if hasattr(self.block_chain_id, 'to_alipay_dict'):
  113. params['block_chain_id'] = self.block_chain_id.to_alipay_dict()
  114. else:
  115. params['block_chain_id'] = self.block_chain_id
  116. if self.block_hash:
  117. if hasattr(self.block_hash, 'to_alipay_dict'):
  118. params['block_hash'] = self.block_hash.to_alipay_dict()
  119. else:
  120. params['block_hash'] = self.block_hash
  121. if self.cid:
  122. if hasattr(self.cid, 'to_alipay_dict'):
  123. params['cid'] = self.cid.to_alipay_dict()
  124. else:
  125. params['cid'] = self.cid
  126. if self.create_time:
  127. if hasattr(self.create_time, 'to_alipay_dict'):
  128. params['create_time'] = self.create_time.to_alipay_dict()
  129. else:
  130. params['create_time'] = self.create_time
  131. if self.parent_hash:
  132. if hasattr(self.parent_hash, 'to_alipay_dict'):
  133. params['parent_hash'] = self.parent_hash.to_alipay_dict()
  134. else:
  135. params['parent_hash'] = self.parent_hash
  136. if self.transaction_hash:
  137. if hasattr(self.transaction_hash, 'to_alipay_dict'):
  138. params['transaction_hash'] = self.transaction_hash.to_alipay_dict()
  139. else:
  140. params['transaction_hash'] = self.transaction_hash
  141. return params
  142. @staticmethod
  143. def from_alipay_dict(d):
  144. if not d:
  145. return None
  146. o = BlockChainAccountApiDO()
  147. if 'account_hash' in d:
  148. o.account_hash = d['account_hash']
  149. if 'account_index' in d:
  150. o.account_index = d['account_index']
  151. if 'account_name' in d:
  152. o.account_name = d['account_name']
  153. if 'account_status' in d:
  154. o.account_status = d['account_status']
  155. if 'balance' in d:
  156. o.balance = d['balance']
  157. if 'block_chain_id' in d:
  158. o.block_chain_id = d['block_chain_id']
  159. if 'block_hash' in d:
  160. o.block_hash = d['block_hash']
  161. if 'cid' in d:
  162. o.cid = d['cid']
  163. if 'create_time' in d:
  164. o.create_time = d['create_time']
  165. if 'parent_hash' in d:
  166. o.parent_hash = d['parent_hash']
  167. if 'transaction_hash' in d:
  168. o.transaction_hash = d['transaction_hash']
  169. return o