PropertyAuthInfo.py 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class PropertyAuthInfo(object):
  6. def __init__(self):
  7. self._area = None
  8. self._city = None
  9. self._community = None
  10. self._data_id = None
  11. self._latitude = None
  12. self._longitude = None
  13. self._property = None
  14. self._uid = None
  15. @property
  16. def area(self):
  17. return self._area
  18. @area.setter
  19. def area(self, value):
  20. self._area = value
  21. @property
  22. def city(self):
  23. return self._city
  24. @city.setter
  25. def city(self, value):
  26. self._city = value
  27. @property
  28. def community(self):
  29. return self._community
  30. @community.setter
  31. def community(self, value):
  32. self._community = value
  33. @property
  34. def data_id(self):
  35. return self._data_id
  36. @data_id.setter
  37. def data_id(self, value):
  38. self._data_id = value
  39. @property
  40. def latitude(self):
  41. return self._latitude
  42. @latitude.setter
  43. def latitude(self, value):
  44. self._latitude = value
  45. @property
  46. def longitude(self):
  47. return self._longitude
  48. @longitude.setter
  49. def longitude(self, value):
  50. self._longitude = value
  51. @property
  52. def property(self):
  53. return self._property
  54. @property.setter
  55. def property(self, value):
  56. self._property = value
  57. @property
  58. def uid(self):
  59. return self._uid
  60. @uid.setter
  61. def uid(self, value):
  62. self._uid = value
  63. def to_alipay_dict(self):
  64. params = dict()
  65. if self.area:
  66. if hasattr(self.area, 'to_alipay_dict'):
  67. params['area'] = self.area.to_alipay_dict()
  68. else:
  69. params['area'] = self.area
  70. if self.city:
  71. if hasattr(self.city, 'to_alipay_dict'):
  72. params['city'] = self.city.to_alipay_dict()
  73. else:
  74. params['city'] = self.city
  75. if self.community:
  76. if hasattr(self.community, 'to_alipay_dict'):
  77. params['community'] = self.community.to_alipay_dict()
  78. else:
  79. params['community'] = self.community
  80. if self.data_id:
  81. if hasattr(self.data_id, 'to_alipay_dict'):
  82. params['data_id'] = self.data_id.to_alipay_dict()
  83. else:
  84. params['data_id'] = self.data_id
  85. if self.latitude:
  86. if hasattr(self.latitude, 'to_alipay_dict'):
  87. params['latitude'] = self.latitude.to_alipay_dict()
  88. else:
  89. params['latitude'] = self.latitude
  90. if self.longitude:
  91. if hasattr(self.longitude, 'to_alipay_dict'):
  92. params['longitude'] = self.longitude.to_alipay_dict()
  93. else:
  94. params['longitude'] = self.longitude
  95. if self.property:
  96. if hasattr(self.property, 'to_alipay_dict'):
  97. params['property'] = self.property.to_alipay_dict()
  98. else:
  99. params['property'] = self.property
  100. if self.uid:
  101. if hasattr(self.uid, 'to_alipay_dict'):
  102. params['uid'] = self.uid.to_alipay_dict()
  103. else:
  104. params['uid'] = self.uid
  105. return params
  106. @staticmethod
  107. def from_alipay_dict(d):
  108. if not d:
  109. return None
  110. o = PropertyAuthInfo()
  111. if 'area' in d:
  112. o.area = d['area']
  113. if 'city' in d:
  114. o.city = d['city']
  115. if 'community' in d:
  116. o.community = d['community']
  117. if 'data_id' in d:
  118. o.data_id = d['data_id']
  119. if 'latitude' in d:
  120. o.latitude = d['latitude']
  121. if 'longitude' in d:
  122. o.longitude = d['longitude']
  123. if 'property' in d:
  124. o.property = d['property']
  125. if 'uid' in d:
  126. o.uid = d['uid']
  127. return o