ISVLogSync.py 5.0 KB

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