AlipayOpenAppTestTestCreateModel.py 2.0 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.AccessParams import AccessParams
  6. class AlipayOpenAppTestTestCreateModel(object):
  7. def __init__(self):
  8. self._address = None
  9. self._latitude = None
  10. self._longitude = None
  11. @property
  12. def address(self):
  13. return self._address
  14. @address.setter
  15. def address(self, value):
  16. self._address = value
  17. @property
  18. def latitude(self):
  19. return self._latitude
  20. @latitude.setter
  21. def latitude(self, value):
  22. if isinstance(value, AccessParams):
  23. self._latitude = value
  24. else:
  25. self._latitude = AccessParams.from_alipay_dict(value)
  26. @property
  27. def longitude(self):
  28. return self._longitude
  29. @longitude.setter
  30. def longitude(self, value):
  31. self._longitude = value
  32. def to_alipay_dict(self):
  33. params = dict()
  34. if self.address:
  35. if hasattr(self.address, 'to_alipay_dict'):
  36. params['address'] = self.address.to_alipay_dict()
  37. else:
  38. params['address'] = self.address
  39. if self.latitude:
  40. if hasattr(self.latitude, 'to_alipay_dict'):
  41. params['latitude'] = self.latitude.to_alipay_dict()
  42. else:
  43. params['latitude'] = self.latitude
  44. if self.longitude:
  45. if hasattr(self.longitude, 'to_alipay_dict'):
  46. params['longitude'] = self.longitude.to_alipay_dict()
  47. else:
  48. params['longitude'] = self.longitude
  49. return params
  50. @staticmethod
  51. def from_alipay_dict(d):
  52. if not d:
  53. return None
  54. o = AlipayOpenAppTestTestCreateModel()
  55. if 'address' in d:
  56. o.address = d['address']
  57. if 'latitude' in d:
  58. o.latitude = d['latitude']
  59. if 'longitude' in d:
  60. o.longitude = d['longitude']
  61. return o