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

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


class AlipayTradeServiceFundTransferModel(object):

    def __init__(self):
        self._amount = None
        self._biz_type = None
        self._out_biz_no = None
        self._payee_open_id = None
        self._payee_user_id = None
        self._payer_open_id = None
        self._payer_user_id = None
        self._sub_biz_type = None

    @property
    def amount(self):
        return self._amount

    @amount.setter
    def amount(self, value):
        self._amount = value
    @property
    def biz_type(self):
        return self._biz_type

    @biz_type.setter
    def biz_type(self, value):
        self._biz_type = value
    @property
    def out_biz_no(self):
        return self._out_biz_no

    @out_biz_no.setter
    def out_biz_no(self, value):
        self._out_biz_no = value
    @property
    def payee_open_id(self):
        return self._payee_open_id

    @payee_open_id.setter
    def payee_open_id(self, value):
        self._payee_open_id = value
    @property
    def payee_user_id(self):
        return self._payee_user_id

    @payee_user_id.setter
    def payee_user_id(self, value):
        self._payee_user_id = value
    @property
    def payer_open_id(self):
        return self._payer_open_id

    @payer_open_id.setter
    def payer_open_id(self, value):
        self._payer_open_id = value
    @property
    def payer_user_id(self):
        return self._payer_user_id

    @payer_user_id.setter
    def payer_user_id(self, value):
        self._payer_user_id = value
    @property
    def sub_biz_type(self):
        return self._sub_biz_type

    @sub_biz_type.setter
    def sub_biz_type(self, value):
        self._sub_biz_type = value


    def to_alipay_dict(self):
        params = dict()
        if self.amount:
            if hasattr(self.amount, 'to_alipay_dict'):
                params['amount'] = self.amount.to_alipay_dict()
            else:
                params['amount'] = self.amount
        if self.biz_type:
            if hasattr(self.biz_type, 'to_alipay_dict'):
                params['biz_type'] = self.biz_type.to_alipay_dict()
            else:
                params['biz_type'] = self.biz_type
        if self.out_biz_no:
            if hasattr(self.out_biz_no, 'to_alipay_dict'):
                params['out_biz_no'] = self.out_biz_no.to_alipay_dict()
            else:
                params['out_biz_no'] = self.out_biz_no
        if self.payee_open_id:
            if hasattr(self.payee_open_id, 'to_alipay_dict'):
                params['payee_open_id'] = self.payee_open_id.to_alipay_dict()
            else:
                params['payee_open_id'] = self.payee_open_id
        if self.payee_user_id:
            if hasattr(self.payee_user_id, 'to_alipay_dict'):
                params['payee_user_id'] = self.payee_user_id.to_alipay_dict()
            else:
                params['payee_user_id'] = self.payee_user_id
        if self.payer_open_id:
            if hasattr(self.payer_open_id, 'to_alipay_dict'):
                params['payer_open_id'] = self.payer_open_id.to_alipay_dict()
            else:
                params['payer_open_id'] = self.payer_open_id
        if self.payer_user_id:
            if hasattr(self.payer_user_id, 'to_alipay_dict'):
                params['payer_user_id'] = self.payer_user_id.to_alipay_dict()
            else:
                params['payer_user_id'] = self.payer_user_id
        if self.sub_biz_type:
            if hasattr(self.sub_biz_type, 'to_alipay_dict'):
                params['sub_biz_type'] = self.sub_biz_type.to_alipay_dict()
            else:
                params['sub_biz_type'] = self.sub_biz_type
        return params

    @staticmethod
    def from_alipay_dict(d):
        if not d:
            return None
        o = AlipayTradeServiceFundTransferModel()
        if 'amount' in d:
            o.amount = d['amount']
        if 'biz_type' in d:
            o.biz_type = d['biz_type']
        if 'out_biz_no' in d:
            o.out_biz_no = d['out_biz_no']
        if 'payee_open_id' in d:
            o.payee_open_id = d['payee_open_id']
        if 'payee_user_id' in d:
            o.payee_user_id = d['payee_user_id']
        if 'payer_open_id' in d:
            o.payer_open_id = d['payer_open_id']
        if 'payer_user_id' in d:
            o.payer_user_id = d['payer_user_id']
        if 'sub_biz_type' in d:
            o.sub_biz_type = d['sub_biz_type']
        return o


