StockShippingStepInfo.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class StockShippingStepInfo(object):
  6. def __init__(self):
  7. self._event_address = None
  8. self._event_time = None
  9. self._ext_info = None
  10. self._status = None
  11. @property
  12. def event_address(self):
  13. return self._event_address
  14. @event_address.setter
  15. def event_address(self, value):
  16. self._event_address = value
  17. @property
  18. def event_time(self):
  19. return self._event_time
  20. @event_time.setter
  21. def event_time(self, value):
  22. self._event_time = value
  23. @property
  24. def ext_info(self):
  25. return self._ext_info
  26. @ext_info.setter
  27. def ext_info(self, value):
  28. self._ext_info = value
  29. @property
  30. def status(self):
  31. return self._status
  32. @status.setter
  33. def status(self, value):
  34. self._status = value
  35. def to_alipay_dict(self):
  36. params = dict()
  37. if self.event_address:
  38. if hasattr(self.event_address, 'to_alipay_dict'):
  39. params['event_address'] = self.event_address.to_alipay_dict()
  40. else:
  41. params['event_address'] = self.event_address
  42. if self.event_time:
  43. if hasattr(self.event_time, 'to_alipay_dict'):
  44. params['event_time'] = self.event_time.to_alipay_dict()
  45. else:
  46. params['event_time'] = self.event_time
  47. if self.ext_info:
  48. if hasattr(self.ext_info, 'to_alipay_dict'):
  49. params['ext_info'] = self.ext_info.to_alipay_dict()
  50. else:
  51. params['ext_info'] = self.ext_info
  52. if self.status:
  53. if hasattr(self.status, 'to_alipay_dict'):
  54. params['status'] = self.status.to_alipay_dict()
  55. else:
  56. params['status'] = self.status
  57. return params
  58. @staticmethod
  59. def from_alipay_dict(d):
  60. if not d:
  61. return None
  62. o = StockShippingStepInfo()
  63. if 'event_address' in d:
  64. o.event_address = d['event_address']
  65. if 'event_time' in d:
  66. o.event_time = d['event_time']
  67. if 'ext_info' in d:
  68. o.ext_info = d['ext_info']
  69. if 'status' in d:
  70. o.status = d['status']
  71. return o