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

from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.ParticipantForm import ParticipantForm
from alipay.aop.api.domain.ValidateUserPrincipal import ValidateUserPrincipal


class AlipayFundWalletDepositorderCreateModel(object):

    def __init__(self):
        self._amount = None
        self._biz_scene = None
        self._effective_end_date = None
        self._expand_amount = None
        self._order_title = None
        self._out_biz_no = None
        self._payee_info = None
        self._platform = None
        self._product_code = None
        self._remark = None
        self._time_expire = None
        self._user_wallet_id = None
        self._valid_date = None
        self._validate_user_principal_list = None

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

    @amount.setter
    def amount(self, value):
        self._amount = value
    @property
    def biz_scene(self):
        return self._biz_scene

    @biz_scene.setter
    def biz_scene(self, value):
        self._biz_scene = value
    @property
    def effective_end_date(self):
        return self._effective_end_date

    @effective_end_date.setter
    def effective_end_date(self, value):
        self._effective_end_date = value
    @property
    def expand_amount(self):
        return self._expand_amount

    @expand_amount.setter
    def expand_amount(self, value):
        self._expand_amount = value
    @property
    def order_title(self):
        return self._order_title

    @order_title.setter
    def order_title(self, value):
        self._order_title = 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_info(self):
        return self._payee_info

    @payee_info.setter
    def payee_info(self, value):
        if isinstance(value, ParticipantForm):
            self._payee_info = value
        else:
            self._payee_info = ParticipantForm.from_alipay_dict(value)
    @property
    def platform(self):
        return self._platform

    @platform.setter
    def platform(self, value):
        self._platform = value
    @property
    def product_code(self):
        return self._product_code

    @product_code.setter
    def product_code(self, value):
        self._product_code = value
    @property
    def remark(self):
        return self._remark

    @remark.setter
    def remark(self, value):
        self._remark = value
    @property
    def time_expire(self):
        return self._time_expire

    @time_expire.setter
    def time_expire(self, value):
        self._time_expire = value
    @property
    def user_wallet_id(self):
        return self._user_wallet_id

    @user_wallet_id.setter
    def user_wallet_id(self, value):
        self._user_wallet_id = value
    @property
    def valid_date(self):
        return self._valid_date

    @valid_date.setter
    def valid_date(self, value):
        self._valid_date = value
    @property
    def validate_user_principal_list(self):
        return self._validate_user_principal_list

    @validate_user_principal_list.setter
    def validate_user_principal_list(self, value):
        if isinstance(value, list):
            self._validate_user_principal_list = list()
            for i in value:
                if isinstance(i, ValidateUserPrincipal):
                    self._validate_user_principal_list.append(i)
                else:
                    self._validate_user_principal_list.append(ValidateUserPrincipal.from_alipay_dict(i))


    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_scene:
            if hasattr(self.biz_scene, 'to_alipay_dict'):
                params['biz_scene'] = self.biz_scene.to_alipay_dict()
            else:
                params['biz_scene'] = self.biz_scene
        if self.effective_end_date:
            if hasattr(self.effective_end_date, 'to_alipay_dict'):
                params['effective_end_date'] = self.effective_end_date.to_alipay_dict()
            else:
                params['effective_end_date'] = self.effective_end_date
        if self.expand_amount:
            if hasattr(self.expand_amount, 'to_alipay_dict'):
                params['expand_amount'] = self.expand_amount.to_alipay_dict()
            else:
                params['expand_amount'] = self.expand_amount
        if self.order_title:
            if hasattr(self.order_title, 'to_alipay_dict'):
                params['order_title'] = self.order_title.to_alipay_dict()
            else:
                params['order_title'] = self.order_title
        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_info:
            if hasattr(self.payee_info, 'to_alipay_dict'):
                params['payee_info'] = self.payee_info.to_alipay_dict()
            else:
                params['payee_info'] = self.payee_info
        if self.platform:
            if hasattr(self.platform, 'to_alipay_dict'):
                params['platform'] = self.platform.to_alipay_dict()
            else:
                params['platform'] = self.platform
        if self.product_code:
            if hasattr(self.product_code, 'to_alipay_dict'):
                params['product_code'] = self.product_code.to_alipay_dict()
            else:
                params['product_code'] = self.product_code
        if self.remark:
            if hasattr(self.remark, 'to_alipay_dict'):
                params['remark'] = self.remark.to_alipay_dict()
            else:
                params['remark'] = self.remark
        if self.time_expire:
            if hasattr(self.time_expire, 'to_alipay_dict'):
                params['time_expire'] = self.time_expire.to_alipay_dict()
            else:
                params['time_expire'] = self.time_expire
        if self.user_wallet_id:
            if hasattr(self.user_wallet_id, 'to_alipay_dict'):
                params['user_wallet_id'] = self.user_wallet_id.to_alipay_dict()
            else:
                params['user_wallet_id'] = self.user_wallet_id
        if self.valid_date:
            if hasattr(self.valid_date, 'to_alipay_dict'):
                params['valid_date'] = self.valid_date.to_alipay_dict()
            else:
                params['valid_date'] = self.valid_date
        if self.validate_user_principal_list:
            if isinstance(self.validate_user_principal_list, list):
                for i in range(0, len(self.validate_user_principal_list)):
                    element = self.validate_user_principal_list[i]
                    if hasattr(element, 'to_alipay_dict'):
                        self.validate_user_principal_list[i] = element.to_alipay_dict()
            if hasattr(self.validate_user_principal_list, 'to_alipay_dict'):
                params['validate_user_principal_list'] = self.validate_user_principal_list.to_alipay_dict()
            else:
                params['validate_user_principal_list'] = self.validate_user_principal_list
        return params

    @staticmethod
    def from_alipay_dict(d):
        if not d:
            return None
        o = AlipayFundWalletDepositorderCreateModel()
        if 'amount' in d:
            o.amount = d['amount']
        if 'biz_scene' in d:
            o.biz_scene = d['biz_scene']
        if 'effective_end_date' in d:
            o.effective_end_date = d['effective_end_date']
        if 'expand_amount' in d:
            o.expand_amount = d['expand_amount']
        if 'order_title' in d:
            o.order_title = d['order_title']
        if 'out_biz_no' in d:
            o.out_biz_no = d['out_biz_no']
        if 'payee_info' in d:
            o.payee_info = d['payee_info']
        if 'platform' in d:
            o.platform = d['platform']
        if 'product_code' in d:
            o.product_code = d['product_code']
        if 'remark' in d:
            o.remark = d['remark']
        if 'time_expire' in d:
            o.time_expire = d['time_expire']
        if 'user_wallet_id' in d:
            o.user_wallet_id = d['user_wallet_id']
        if 'valid_date' in d:
            o.valid_date = d['valid_date']
        if 'validate_user_principal_list' in d:
            o.validate_user_principal_list = d['validate_user_principal_list']
        return o


