AlipayEcoCplifeCommunityCreateModel.py 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AlipayEcoCplifeCommunityCreateModel(object):
  6. def __init__(self):
  7. self._associated_pois = None
  8. self._city_code = None
  9. self._community_address = None
  10. self._community_locations = None
  11. self._community_name = None
  12. self._district_code = None
  13. self._hotline = None
  14. self._out_community_id = None
  15. self._province_code = None
  16. @property
  17. def associated_pois(self):
  18. return self._associated_pois
  19. @associated_pois.setter
  20. def associated_pois(self, value):
  21. if isinstance(value, list):
  22. self._associated_pois = list()
  23. for i in value:
  24. self._associated_pois.append(i)
  25. @property
  26. def city_code(self):
  27. return self._city_code
  28. @city_code.setter
  29. def city_code(self, value):
  30. self._city_code = value
  31. @property
  32. def community_address(self):
  33. return self._community_address
  34. @community_address.setter
  35. def community_address(self, value):
  36. self._community_address = value
  37. @property
  38. def community_locations(self):
  39. return self._community_locations
  40. @community_locations.setter
  41. def community_locations(self, value):
  42. if isinstance(value, list):
  43. self._community_locations = list()
  44. for i in value:
  45. self._community_locations.append(i)
  46. @property
  47. def community_name(self):
  48. return self._community_name
  49. @community_name.setter
  50. def community_name(self, value):
  51. self._community_name = value
  52. @property
  53. def district_code(self):
  54. return self._district_code
  55. @district_code.setter
  56. def district_code(self, value):
  57. self._district_code = value
  58. @property
  59. def hotline(self):
  60. return self._hotline
  61. @hotline.setter
  62. def hotline(self, value):
  63. self._hotline = value
  64. @property
  65. def out_community_id(self):
  66. return self._out_community_id
  67. @out_community_id.setter
  68. def out_community_id(self, value):
  69. self._out_community_id = value
  70. @property
  71. def province_code(self):
  72. return self._province_code
  73. @province_code.setter
  74. def province_code(self, value):
  75. self._province_code = value
  76. def to_alipay_dict(self):
  77. params = dict()
  78. if self.associated_pois:
  79. if isinstance(self.associated_pois, list):
  80. for i in range(0, len(self.associated_pois)):
  81. element = self.associated_pois[i]
  82. if hasattr(element, 'to_alipay_dict'):
  83. self.associated_pois[i] = element.to_alipay_dict()
  84. if hasattr(self.associated_pois, 'to_alipay_dict'):
  85. params['associated_pois'] = self.associated_pois.to_alipay_dict()
  86. else:
  87. params['associated_pois'] = self.associated_pois
  88. if self.city_code:
  89. if hasattr(self.city_code, 'to_alipay_dict'):
  90. params['city_code'] = self.city_code.to_alipay_dict()
  91. else:
  92. params['city_code'] = self.city_code
  93. if self.community_address:
  94. if hasattr(self.community_address, 'to_alipay_dict'):
  95. params['community_address'] = self.community_address.to_alipay_dict()
  96. else:
  97. params['community_address'] = self.community_address
  98. if self.community_locations:
  99. if isinstance(self.community_locations, list):
  100. for i in range(0, len(self.community_locations)):
  101. element = self.community_locations[i]
  102. if hasattr(element, 'to_alipay_dict'):
  103. self.community_locations[i] = element.to_alipay_dict()
  104. if hasattr(self.community_locations, 'to_alipay_dict'):
  105. params['community_locations'] = self.community_locations.to_alipay_dict()
  106. else:
  107. params['community_locations'] = self.community_locations
  108. if self.community_name:
  109. if hasattr(self.community_name, 'to_alipay_dict'):
  110. params['community_name'] = self.community_name.to_alipay_dict()
  111. else:
  112. params['community_name'] = self.community_name
  113. if self.district_code:
  114. if hasattr(self.district_code, 'to_alipay_dict'):
  115. params['district_code'] = self.district_code.to_alipay_dict()
  116. else:
  117. params['district_code'] = self.district_code
  118. if self.hotline:
  119. if hasattr(self.hotline, 'to_alipay_dict'):
  120. params['hotline'] = self.hotline.to_alipay_dict()
  121. else:
  122. params['hotline'] = self.hotline
  123. if self.out_community_id:
  124. if hasattr(self.out_community_id, 'to_alipay_dict'):
  125. params['out_community_id'] = self.out_community_id.to_alipay_dict()
  126. else:
  127. params['out_community_id'] = self.out_community_id
  128. if self.province_code:
  129. if hasattr(self.province_code, 'to_alipay_dict'):
  130. params['province_code'] = self.province_code.to_alipay_dict()
  131. else:
  132. params['province_code'] = self.province_code
  133. return params
  134. @staticmethod
  135. def from_alipay_dict(d):
  136. if not d:
  137. return None
  138. o = AlipayEcoCplifeCommunityCreateModel()
  139. if 'associated_pois' in d:
  140. o.associated_pois = d['associated_pois']
  141. if 'city_code' in d:
  142. o.city_code = d['city_code']
  143. if 'community_address' in d:
  144. o.community_address = d['community_address']
  145. if 'community_locations' in d:
  146. o.community_locations = d['community_locations']
  147. if 'community_name' in d:
  148. o.community_name = d['community_name']
  149. if 'district_code' in d:
  150. o.district_code = d['district_code']
  151. if 'hotline' in d:
  152. o.hotline = d['hotline']
  153. if 'out_community_id' in d:
  154. o.out_community_id = d['out_community_id']
  155. if 'province_code' in d:
  156. o.province_code = d['province_code']
  157. return o