DxVerifyResultItem.py 3.9 KB

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