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

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


class FundAccountApiDTO(object):

    def __init__(self):
        self._account_book_id = None
        self._account_card_info = None
        self._available_amount = None
        self._enable_status = None
        self._scene = None

    @property
    def account_book_id(self):
        return self._account_book_id

    @account_book_id.setter
    def account_book_id(self, value):
        self._account_book_id = value
    @property
    def account_card_info(self):
        return self._account_card_info

    @account_card_info.setter
    def account_card_info(self, value):
        if isinstance(value, TransInCardInfo):
            self._account_card_info = value
        else:
            self._account_card_info = TransInCardInfo.from_alipay_dict(value)
    @property
    def available_amount(self):
        return self._available_amount

    @available_amount.setter
    def available_amount(self, value):
        self._available_amount = value
    @property
    def enable_status(self):
        return self._enable_status

    @enable_status.setter
    def enable_status(self, value):
        self._enable_status = value
    @property
    def scene(self):
        return self._scene

    @scene.setter
    def scene(self, value):
        self._scene = value


    def to_alipay_dict(self):
        params = dict()
        if self.account_book_id:
            if hasattr(self.account_book_id, 'to_alipay_dict'):
                params['account_book_id'] = self.account_book_id.to_alipay_dict()
            else:
                params['account_book_id'] = self.account_book_id
        if self.account_card_info:
            if hasattr(self.account_card_info, 'to_alipay_dict'):
                params['account_card_info'] = self.account_card_info.to_alipay_dict()
            else:
                params['account_card_info'] = self.account_card_info
        if self.available_amount:
            if hasattr(self.available_amount, 'to_alipay_dict'):
                params['available_amount'] = self.available_amount.to_alipay_dict()
            else:
                params['available_amount'] = self.available_amount
        if self.enable_status:
            if hasattr(self.enable_status, 'to_alipay_dict'):
                params['enable_status'] = self.enable_status.to_alipay_dict()
            else:
                params['enable_status'] = self.enable_status
        if self.scene:
            if hasattr(self.scene, 'to_alipay_dict'):
                params['scene'] = self.scene.to_alipay_dict()
            else:
                params['scene'] = self.scene
        return params

    @staticmethod
    def from_alipay_dict(d):
        if not d:
            return None
        o = FundAccountApiDTO()
        if 'account_book_id' in d:
            o.account_book_id = d['account_book_id']
        if 'account_card_info' in d:
            o.account_card_info = d['account_card_info']
        if 'available_amount' in d:
            o.available_amount = d['available_amount']
        if 'enable_status' in d:
            o.enable_status = d['enable_status']
        if 'scene' in d:
            o.scene = d['scene']
        return o


