AlipayCommerceIotDeviceGeofenceSetModel.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. from alipay.aop.api.domain.FenceEvent import FenceEvent
  6. class AlipayCommerceIotDeviceGeofenceSetModel(object):
  7. def __init__(self):
  8. self._fence_event = None
  9. self._operation_type = None
  10. self._route_code = None
  11. @property
  12. def fence_event(self):
  13. return self._fence_event
  14. @fence_event.setter
  15. def fence_event(self, value):
  16. if isinstance(value, FenceEvent):
  17. self._fence_event = value
  18. else:
  19. self._fence_event = FenceEvent.from_alipay_dict(value)
  20. @property
  21. def operation_type(self):
  22. return self._operation_type
  23. @operation_type.setter
  24. def operation_type(self, value):
  25. self._operation_type = value
  26. @property
  27. def route_code(self):
  28. return self._route_code
  29. @route_code.setter
  30. def route_code(self, value):
  31. self._route_code = value
  32. def to_alipay_dict(self):
  33. params = dict()
  34. if self.fence_event:
  35. if hasattr(self.fence_event, 'to_alipay_dict'):
  36. params['fence_event'] = self.fence_event.to_alipay_dict()
  37. else:
  38. params['fence_event'] = self.fence_event
  39. if self.operation_type:
  40. if hasattr(self.operation_type, 'to_alipay_dict'):
  41. params['operation_type'] = self.operation_type.to_alipay_dict()
  42. else:
  43. params['operation_type'] = self.operation_type
  44. if self.route_code:
  45. if hasattr(self.route_code, 'to_alipay_dict'):
  46. params['route_code'] = self.route_code.to_alipay_dict()
  47. else:
  48. params['route_code'] = self.route_code
  49. return params
  50. @staticmethod
  51. def from_alipay_dict(d):
  52. if not d:
  53. return None
  54. o = AlipayCommerceIotDeviceGeofenceSetModel()
  55. if 'fence_event' in d:
  56. o.fence_event = d['fence_event']
  57. if 'operation_type' in d:
  58. o.operation_type = d['operation_type']
  59. if 'route_code' in d:
  60. o.route_code = d['route_code']
  61. return o