#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json

from alipay.aop.api.constant.ParamConstants import *


class MiniReceiverAddressInfoDTO(object):

    def __init__(self):
        self._address = None
        self._area = None
        self._city = None
        self._detailed_address = None
        self._province = None
        self._receiver_division_code = None
        self._receiver_name = None
        self._receiver_zip = None
        self._tel_number = None

    @property
    def address(self):
        return self._address

    @address.setter
    def address(self, value):
        self._address = value
    @property
    def area(self):
        return self._area

    @area.setter
    def area(self, value):
        self._area = value
    @property
    def city(self):
        return self._city

    @city.setter
    def city(self, value):
        self._city = value
    @property
    def detailed_address(self):
        return self._detailed_address

    @detailed_address.setter
    def detailed_address(self, value):
        self._detailed_address = value
    @property
    def province(self):
        return self._province

    @province.setter
    def province(self, value):
        self._province = value
    @property
    def receiver_division_code(self):
        return self._receiver_division_code

    @receiver_division_code.setter
    def receiver_division_code(self, value):
        self._receiver_division_code = value
    @property
    def receiver_name(self):
        return self._receiver_name

    @receiver_name.setter
    def receiver_name(self, value):
        self._receiver_name = value
    @property
    def receiver_zip(self):
        return self._receiver_zip

    @receiver_zip.setter
    def receiver_zip(self, value):
        self._receiver_zip = value
    @property
    def tel_number(self):
        return self._tel_number

    @tel_number.setter
    def tel_number(self, value):
        self._tel_number = 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.area:
            if hasattr(self.area, 'to_alipay_dict'):
                params['area'] = self.area.to_alipay_dict()
            else:
                params['area'] = self.area
        if self.city:
            if hasattr(self.city, 'to_alipay_dict'):
                params['city'] = self.city.to_alipay_dict()
            else:
                params['city'] = self.city
        if self.detailed_address:
            if hasattr(self.detailed_address, 'to_alipay_dict'):
                params['detailed_address'] = self.detailed_address.to_alipay_dict()
            else:
                params['detailed_address'] = self.detailed_address
        if self.province:
            if hasattr(self.province, 'to_alipay_dict'):
                params['province'] = self.province.to_alipay_dict()
            else:
                params['province'] = self.province
        if self.receiver_division_code:
            if hasattr(self.receiver_division_code, 'to_alipay_dict'):
                params['receiver_division_code'] = self.receiver_division_code.to_alipay_dict()
            else:
                params['receiver_division_code'] = self.receiver_division_code
        if self.receiver_name:
            if hasattr(self.receiver_name, 'to_alipay_dict'):
                params['receiver_name'] = self.receiver_name.to_alipay_dict()
            else:
                params['receiver_name'] = self.receiver_name
        if self.receiver_zip:
            if hasattr(self.receiver_zip, 'to_alipay_dict'):
                params['receiver_zip'] = self.receiver_zip.to_alipay_dict()
            else:
                params['receiver_zip'] = self.receiver_zip
        if self.tel_number:
            if hasattr(self.tel_number, 'to_alipay_dict'):
                params['tel_number'] = self.tel_number.to_alipay_dict()
            else:
                params['tel_number'] = self.tel_number
        return params

    @staticmethod
    def from_alipay_dict(d):
        if not d:
            return None
        o = MiniReceiverAddressInfoDTO()
        if 'address' in d:
            o.address = d['address']
        if 'area' in d:
            o.area = d['area']
        if 'city' in d:
            o.city = d['city']
        if 'detailed_address' in d:
            o.detailed_address = d['detailed_address']
        if 'province' in d:
            o.province = d['province']
        if 'receiver_division_code' in d:
            o.receiver_division_code = d['receiver_division_code']
        if 'receiver_name' in d:
            o.receiver_name = d['receiver_name']
        if 'receiver_zip' in d:
            o.receiver_zip = d['receiver_zip']
        if 'tel_number' in d:
            o.tel_number = d['tel_number']
        return o


