123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- import json
- from alipay.aop.api.constant.ParamConstants import *
- class AddressInfo(object):
- def __init__(self):
- self._address = None
- self._city_code = None
- self._district_code = None
- self._latitude = None
- self._longitude = None
- self._poiid = None
- self._province_code = None
- self._type = None
- @property
- def address(self):
- return self._address
- @address.setter
- def address(self, value):
- self._address = value
- @property
- def city_code(self):
- return self._city_code
- @city_code.setter
- def city_code(self, value):
- self._city_code = value
- @property
- def district_code(self):
- return self._district_code
- @district_code.setter
- def district_code(self, value):
- self._district_code = value
- @property
- def latitude(self):
- return self._latitude
- @latitude.setter
- def latitude(self, value):
- self._latitude = value
- @property
- def longitude(self):
- return self._longitude
- @longitude.setter
- def longitude(self, value):
- self._longitude = value
- @property
- def poiid(self):
- return self._poiid
- @poiid.setter
- def poiid(self, value):
- self._poiid = value
- @property
- def province_code(self):
- return self._province_code
- @province_code.setter
- def province_code(self, value):
- self._province_code = value
- @property
- def type(self):
- return self._type
- @type.setter
- def type(self, value):
- self._type = value
- def to_alipay_dict(self):
- params = dict()
- if self.address:
- if hasattr(self.address, 'to_alipay_dict'):
- params['address'] = self.address.to_alipay_dict()
- else:
- params['address'] = self.address
- if self.city_code:
- if hasattr(self.city_code, 'to_alipay_dict'):
- params['city_code'] = self.city_code.to_alipay_dict()
- else:
- params['city_code'] = self.city_code
- if self.district_code:
- if hasattr(self.district_code, 'to_alipay_dict'):
- params['district_code'] = self.district_code.to_alipay_dict()
- else:
- params['district_code'] = self.district_code
- if self.latitude:
- if hasattr(self.latitude, 'to_alipay_dict'):
- params['latitude'] = self.latitude.to_alipay_dict()
- else:
- params['latitude'] = self.latitude
- if self.longitude:
- if hasattr(self.longitude, 'to_alipay_dict'):
- params['longitude'] = self.longitude.to_alipay_dict()
- else:
- params['longitude'] = self.longitude
- if self.poiid:
- if hasattr(self.poiid, 'to_alipay_dict'):
- params['poiid'] = self.poiid.to_alipay_dict()
- else:
- params['poiid'] = self.poiid
- if self.province_code:
- if hasattr(self.province_code, 'to_alipay_dict'):
- params['province_code'] = self.province_code.to_alipay_dict()
- else:
- params['province_code'] = self.province_code
- if self.type:
- if hasattr(self.type, 'to_alipay_dict'):
- params['type'] = self.type.to_alipay_dict()
- else:
- params['type'] = self.type
- return params
- @staticmethod
- def from_alipay_dict(d):
- if not d:
- return None
- o = AddressInfo()
- if 'address' in d:
- o.address = d['address']
- if 'city_code' in d:
- o.city_code = d['city_code']
- if 'district_code' in d:
- o.district_code = d['district_code']
- if 'latitude' in d:
- o.latitude = d['latitude']
- if 'longitude' in d:
- o.longitude = d['longitude']
- if 'poiid' in d:
- o.poiid = d['poiid']
- if 'province_code' in d:
- o.province_code = d['province_code']
- if 'type' in d:
- o.type = d['type']
- return o
|