AnttechDataCollectBlockchainSyncModel.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 AnttechDataCollectBlockchainSyncModel(object):
  6. def __init__(self):
  7. self._account_data = None
  8. self._block_chain_id = None
  9. self._contract_data = None
  10. self._end_height = None
  11. self._start_height = None
  12. self._transaction_data = None
  13. @property
  14. def account_data(self):
  15. return self._account_data
  16. @account_data.setter
  17. def account_data(self, value):
  18. self._account_data = value
  19. @property
  20. def block_chain_id(self):
  21. return self._block_chain_id
  22. @block_chain_id.setter
  23. def block_chain_id(self, value):
  24. self._block_chain_id = value
  25. @property
  26. def contract_data(self):
  27. return self._contract_data
  28. @contract_data.setter
  29. def contract_data(self, value):
  30. self._contract_data = value
  31. @property
  32. def end_height(self):
  33. return self._end_height
  34. @end_height.setter
  35. def end_height(self, value):
  36. self._end_height = value
  37. @property
  38. def start_height(self):
  39. return self._start_height
  40. @start_height.setter
  41. def start_height(self, value):
  42. self._start_height = value
  43. @property
  44. def transaction_data(self):
  45. return self._transaction_data
  46. @transaction_data.setter
  47. def transaction_data(self, value):
  48. self._transaction_data = value
  49. def to_alipay_dict(self):
  50. params = dict()
  51. if self.account_data:
  52. if hasattr(self.account_data, 'to_alipay_dict'):
  53. params['account_data'] = self.account_data.to_alipay_dict()
  54. else:
  55. params['account_data'] = self.account_data
  56. if self.block_chain_id:
  57. if hasattr(self.block_chain_id, 'to_alipay_dict'):
  58. params['block_chain_id'] = self.block_chain_id.to_alipay_dict()
  59. else:
  60. params['block_chain_id'] = self.block_chain_id
  61. if self.contract_data:
  62. if hasattr(self.contract_data, 'to_alipay_dict'):
  63. params['contract_data'] = self.contract_data.to_alipay_dict()
  64. else:
  65. params['contract_data'] = self.contract_data
  66. if self.end_height:
  67. if hasattr(self.end_height, 'to_alipay_dict'):
  68. params['end_height'] = self.end_height.to_alipay_dict()
  69. else:
  70. params['end_height'] = self.end_height
  71. if self.start_height:
  72. if hasattr(self.start_height, 'to_alipay_dict'):
  73. params['start_height'] = self.start_height.to_alipay_dict()
  74. else:
  75. params['start_height'] = self.start_height
  76. if self.transaction_data:
  77. if hasattr(self.transaction_data, 'to_alipay_dict'):
  78. params['transaction_data'] = self.transaction_data.to_alipay_dict()
  79. else:
  80. params['transaction_data'] = self.transaction_data
  81. return params
  82. @staticmethod
  83. def from_alipay_dict(d):
  84. if not d:
  85. return None
  86. o = AnttechDataCollectBlockchainSyncModel()
  87. if 'account_data' in d:
  88. o.account_data = d['account_data']
  89. if 'block_chain_id' in d:
  90. o.block_chain_id = d['block_chain_id']
  91. if 'contract_data' in d:
  92. o.contract_data = d['contract_data']
  93. if 'end_height' in d:
  94. o.end_height = d['end_height']
  95. if 'start_height' in d:
  96. o.start_height = d['start_height']
  97. if 'transaction_data' in d:
  98. o.transaction_data = d['transaction_data']
  99. return o