ActivityShop.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class ActivityShop(object):
  6. def __init__(self):
  7. self._shop_address = None
  8. self._shop_id = None
  9. self._shop_latitude = None
  10. self._shop_longitude = None
  11. self._shop_name = None
  12. @property
  13. def shop_address(self):
  14. return self._shop_address
  15. @shop_address.setter
  16. def shop_address(self, value):
  17. self._shop_address = value
  18. @property
  19. def shop_id(self):
  20. return self._shop_id
  21. @shop_id.setter
  22. def shop_id(self, value):
  23. self._shop_id = value
  24. @property
  25. def shop_latitude(self):
  26. return self._shop_latitude
  27. @shop_latitude.setter
  28. def shop_latitude(self, value):
  29. self._shop_latitude = value
  30. @property
  31. def shop_longitude(self):
  32. return self._shop_longitude
  33. @shop_longitude.setter
  34. def shop_longitude(self, value):
  35. self._shop_longitude = value
  36. @property
  37. def shop_name(self):
  38. return self._shop_name
  39. @shop_name.setter
  40. def shop_name(self, value):
  41. self._shop_name = value
  42. def to_alipay_dict(self):
  43. params = dict()
  44. if self.shop_address:
  45. if hasattr(self.shop_address, 'to_alipay_dict'):
  46. params['shop_address'] = self.shop_address.to_alipay_dict()
  47. else:
  48. params['shop_address'] = self.shop_address
  49. if self.shop_id:
  50. if hasattr(self.shop_id, 'to_alipay_dict'):
  51. params['shop_id'] = self.shop_id.to_alipay_dict()
  52. else:
  53. params['shop_id'] = self.shop_id
  54. if self.shop_latitude:
  55. if hasattr(self.shop_latitude, 'to_alipay_dict'):
  56. params['shop_latitude'] = self.shop_latitude.to_alipay_dict()
  57. else:
  58. params['shop_latitude'] = self.shop_latitude
  59. if self.shop_longitude:
  60. if hasattr(self.shop_longitude, 'to_alipay_dict'):
  61. params['shop_longitude'] = self.shop_longitude.to_alipay_dict()
  62. else:
  63. params['shop_longitude'] = self.shop_longitude
  64. if self.shop_name:
  65. if hasattr(self.shop_name, 'to_alipay_dict'):
  66. params['shop_name'] = self.shop_name.to_alipay_dict()
  67. else:
  68. params['shop_name'] = self.shop_name
  69. return params
  70. @staticmethod
  71. def from_alipay_dict(d):
  72. if not d:
  73. return None
  74. o = ActivityShop()
  75. if 'shop_address' in d:
  76. o.shop_address = d['shop_address']
  77. if 'shop_id' in d:
  78. o.shop_id = d['shop_id']
  79. if 'shop_latitude' in d:
  80. o.shop_latitude = d['shop_latitude']
  81. if 'shop_longitude' in d:
  82. o.shop_longitude = d['shop_longitude']
  83. if 'shop_name' in d:
  84. o.shop_name = d['shop_name']
  85. return o