KoubeiMemberDataItemBigbuyQueryModel.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KoubeiMemberDataItemBigbuyQueryModel(object):
  6. def __init__(self):
  7. self._city_code = None
  8. self._latitude = None
  9. self._longitude = None
  10. self._space_code_list = None
  11. self._user_id = None
  12. @property
  13. def city_code(self):
  14. return self._city_code
  15. @city_code.setter
  16. def city_code(self, value):
  17. self._city_code = value
  18. @property
  19. def latitude(self):
  20. return self._latitude
  21. @latitude.setter
  22. def latitude(self, value):
  23. self._latitude = value
  24. @property
  25. def longitude(self):
  26. return self._longitude
  27. @longitude.setter
  28. def longitude(self, value):
  29. self._longitude = value
  30. @property
  31. def space_code_list(self):
  32. return self._space_code_list
  33. @space_code_list.setter
  34. def space_code_list(self, value):
  35. if isinstance(value, list):
  36. self._space_code_list = list()
  37. for i in value:
  38. self._space_code_list.append(i)
  39. @property
  40. def user_id(self):
  41. return self._user_id
  42. @user_id.setter
  43. def user_id(self, value):
  44. self._user_id = value
  45. def to_alipay_dict(self):
  46. params = dict()
  47. if self.city_code:
  48. if hasattr(self.city_code, 'to_alipay_dict'):
  49. params['city_code'] = self.city_code.to_alipay_dict()
  50. else:
  51. params['city_code'] = self.city_code
  52. if self.latitude:
  53. if hasattr(self.latitude, 'to_alipay_dict'):
  54. params['latitude'] = self.latitude.to_alipay_dict()
  55. else:
  56. params['latitude'] = self.latitude
  57. if self.longitude:
  58. if hasattr(self.longitude, 'to_alipay_dict'):
  59. params['longitude'] = self.longitude.to_alipay_dict()
  60. else:
  61. params['longitude'] = self.longitude
  62. if self.space_code_list:
  63. if isinstance(self.space_code_list, list):
  64. for i in range(0, len(self.space_code_list)):
  65. element = self.space_code_list[i]
  66. if hasattr(element, 'to_alipay_dict'):
  67. self.space_code_list[i] = element.to_alipay_dict()
  68. if hasattr(self.space_code_list, 'to_alipay_dict'):
  69. params['space_code_list'] = self.space_code_list.to_alipay_dict()
  70. else:
  71. params['space_code_list'] = self.space_code_list
  72. if self.user_id:
  73. if hasattr(self.user_id, 'to_alipay_dict'):
  74. params['user_id'] = self.user_id.to_alipay_dict()
  75. else:
  76. params['user_id'] = self.user_id
  77. return params
  78. @staticmethod
  79. def from_alipay_dict(d):
  80. if not d:
  81. return None
  82. o = KoubeiMemberDataItemBigbuyQueryModel()
  83. if 'city_code' in d:
  84. o.city_code = d['city_code']
  85. if 'latitude' in d:
  86. o.latitude = d['latitude']
  87. if 'longitude' in d:
  88. o.longitude = d['longitude']
  89. if 'space_code_list' in d:
  90. o.space_code_list = d['space_code_list']
  91. if 'user_id' in d:
  92. o.user_id = d['user_id']
  93. return o