AlipayOverseasTravelRateQueryModel.py 3.3 KB

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