text: #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  import json
  
  from alipay.aop.api.constant.ParamConstants import *
  
  
  class RegionInfo(object):
  
      def __init__(self):
          self._area_code = None
          self._area_name = None
          self._city_code = None
          self._city_name = None
          self._province_code = None
          self._province_name = None
  
      @property
      def area_code(self):
          return self._area_code
  
      @area_code.setter
      def area_code(self, value):
          self._area_code = value
      @property
      def area_name(self):
          return self._area_name
  
      @area_name.setter
      def area_name(self, value):
          self._area_name = value
      @property
      def city_code(self):
          return self._city_code
  
      @city_code.setter
      def city_code(self, value):
          self._city_code = value
      @property
      def city_name(self):
          return self._city_name
  
      @city_name.setter
      def city_name(self, value):
          self._city_name = value
      @property
      def province_code(self):
          return self._province_code
  
      @province_code.setter
      def province_code(self, value):
          self._province_code = value
      @property
      def province_name(self):
          return self._province_name
  
      @province_name.setter
      def province_name(self, value):
          self._province_name = value
  
  
      def to_alipay_dict(self):
          params = dict()
          if self.area_code:
              if hasattr(self.area_code, 'to_alipay_dict'):
                  params['area_code'] = self.area_code.to_alipay_dict()
              else:
                  params['area_code'] = self.area_code
          if self.area_name:
              if hasattr(self.area_name, 'to_alipay_dict'):
                  params['area_name'] = self.area_name.to_alipay_dict()
              else:
                  params['area_name'] = self.area_name
          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.city_name:
              if hasattr(self.city_name, 'to_alipay_dict'):
                  params['city_name'] = self.city_name.to_alipay_dict()
              else:
                  params['city_name'] = self.city_name
          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.province_name:
              if hasattr(self.province_name, 'to_alipay_dict'):
                  params['province_name'] = self.province_name.to_alipay_dict()
              else:
                  params['province_name'] = self.province_name
          return params
  
      @staticmethod
      def from_alipay_dict(d):
          if not d:
              return None
          o = RegionInfo()
          if 'area_code' in d:
              o.area_code = d['area_code']
          if 'area_name' in d:
              o.area_name = d['area_name']
          if 'city_code' in d:
              o.city_code = d['city_code']
          if 'city_name' in d:
              o.city_name = d['city_name']
          if 'province_code' in d:
              o.province_code = d['province_code']
          if 'province_name' in d:
              o.province_name = d['province_name']
          return o
  
  
  