UserMailInfoOrder.py 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class UserMailInfoOrder(object):
  6. def __init__(self):
  7. self._city = None
  8. self._country = None
  9. self._county_district = None
  10. self._detail_address = None
  11. self._ip_role_id = None
  12. self._name = None
  13. self._province = None
  14. self._street = None
  15. self._telephone = None
  16. @property
  17. def city(self):
  18. return self._city
  19. @city.setter
  20. def city(self, value):
  21. self._city = value
  22. @property
  23. def country(self):
  24. return self._country
  25. @country.setter
  26. def country(self, value):
  27. self._country = value
  28. @property
  29. def county_district(self):
  30. return self._county_district
  31. @county_district.setter
  32. def county_district(self, value):
  33. self._county_district = value
  34. @property
  35. def detail_address(self):
  36. return self._detail_address
  37. @detail_address.setter
  38. def detail_address(self, value):
  39. self._detail_address = value
  40. @property
  41. def ip_role_id(self):
  42. return self._ip_role_id
  43. @ip_role_id.setter
  44. def ip_role_id(self, value):
  45. self._ip_role_id = value
  46. @property
  47. def name(self):
  48. return self._name
  49. @name.setter
  50. def name(self, value):
  51. self._name = value
  52. @property
  53. def province(self):
  54. return self._province
  55. @province.setter
  56. def province(self, value):
  57. self._province = value
  58. @property
  59. def street(self):
  60. return self._street
  61. @street.setter
  62. def street(self, value):
  63. self._street = value
  64. @property
  65. def telephone(self):
  66. return self._telephone
  67. @telephone.setter
  68. def telephone(self, value):
  69. self._telephone = value
  70. def to_alipay_dict(self):
  71. params = dict()
  72. if self.city:
  73. if hasattr(self.city, 'to_alipay_dict'):
  74. params['city'] = self.city.to_alipay_dict()
  75. else:
  76. params['city'] = self.city
  77. if self.country:
  78. if hasattr(self.country, 'to_alipay_dict'):
  79. params['country'] = self.country.to_alipay_dict()
  80. else:
  81. params['country'] = self.country
  82. if self.county_district:
  83. if hasattr(self.county_district, 'to_alipay_dict'):
  84. params['county_district'] = self.county_district.to_alipay_dict()
  85. else:
  86. params['county_district'] = self.county_district
  87. if self.detail_address:
  88. if hasattr(self.detail_address, 'to_alipay_dict'):
  89. params['detail_address'] = self.detail_address.to_alipay_dict()
  90. else:
  91. params['detail_address'] = self.detail_address
  92. if self.ip_role_id:
  93. if hasattr(self.ip_role_id, 'to_alipay_dict'):
  94. params['ip_role_id'] = self.ip_role_id.to_alipay_dict()
  95. else:
  96. params['ip_role_id'] = self.ip_role_id
  97. if self.name:
  98. if hasattr(self.name, 'to_alipay_dict'):
  99. params['name'] = self.name.to_alipay_dict()
  100. else:
  101. params['name'] = self.name
  102. if self.province:
  103. if hasattr(self.province, 'to_alipay_dict'):
  104. params['province'] = self.province.to_alipay_dict()
  105. else:
  106. params['province'] = self.province
  107. if self.street:
  108. if hasattr(self.street, 'to_alipay_dict'):
  109. params['street'] = self.street.to_alipay_dict()
  110. else:
  111. params['street'] = self.street
  112. if self.telephone:
  113. if hasattr(self.telephone, 'to_alipay_dict'):
  114. params['telephone'] = self.telephone.to_alipay_dict()
  115. else:
  116. params['telephone'] = self.telephone
  117. return params
  118. @staticmethod
  119. def from_alipay_dict(d):
  120. if not d:
  121. return None
  122. o = UserMailInfoOrder()
  123. if 'city' in d:
  124. o.city = d['city']
  125. if 'country' in d:
  126. o.country = d['country']
  127. if 'county_district' in d:
  128. o.county_district = d['county_district']
  129. if 'detail_address' in d:
  130. o.detail_address = d['detail_address']
  131. if 'ip_role_id' in d:
  132. o.ip_role_id = d['ip_role_id']
  133. if 'name' in d:
  134. o.name = d['name']
  135. if 'province' in d:
  136. o.province = d['province']
  137. if 'street' in d:
  138. o.street = d['street']
  139. if 'telephone' in d:
  140. o.telephone = d['telephone']
  141. return o