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

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


class AlipayTradeSettleReceivablesQueryModel(object):

    def __init__(self):
        self._biz_product = None
        self._extend_params = None
        self._merchant_info = None
        self._out_request_no = None
        self._query_his_date = None
        self._trade_no = None

    @property
    def biz_product(self):
        return self._biz_product

    @biz_product.setter
    def biz_product(self, value):
        self._biz_product = value
    @property
    def extend_params(self):
        return self._extend_params

    @extend_params.setter
    def extend_params(self, value):
        self._extend_params = value
    @property
    def merchant_info(self):
        return self._merchant_info

    @merchant_info.setter
    def merchant_info(self, value):
        if isinstance(value, SettleEntity):
            self._merchant_info = value
        else:
            self._merchant_info = SettleEntity.from_alipay_dict(value)
    @property
    def out_request_no(self):
        return self._out_request_no

    @out_request_no.setter
    def out_request_no(self, value):
        self._out_request_no = value
    @property
    def query_his_date(self):
        return self._query_his_date

    @query_his_date.setter
    def query_his_date(self, value):
        self._query_his_date = value
    @property
    def trade_no(self):
        return self._trade_no

    @trade_no.setter
    def trade_no(self, value):
        self._trade_no = value


    def to_alipay_dict(self):
        params = dict()
        if self.biz_product:
            if hasattr(self.biz_product, 'to_alipay_dict'):
                params['biz_product'] = self.biz_product.to_alipay_dict()
            else:
                params['biz_product'] = self.biz_product
        if self.extend_params:
            if hasattr(self.extend_params, 'to_alipay_dict'):
                params['extend_params'] = self.extend_params.to_alipay_dict()
            else:
                params['extend_params'] = self.extend_params
        if self.merchant_info:
            if hasattr(self.merchant_info, 'to_alipay_dict'):
                params['merchant_info'] = self.merchant_info.to_alipay_dict()
            else:
                params['merchant_info'] = self.merchant_info
        if self.out_request_no:
            if hasattr(self.out_request_no, 'to_alipay_dict'):
                params['out_request_no'] = self.out_request_no.to_alipay_dict()
            else:
                params['out_request_no'] = self.out_request_no
        if self.query_his_date:
            if hasattr(self.query_his_date, 'to_alipay_dict'):
                params['query_his_date'] = self.query_his_date.to_alipay_dict()
            else:
                params['query_his_date'] = self.query_his_date
        if self.trade_no:
            if hasattr(self.trade_no, 'to_alipay_dict'):
                params['trade_no'] = self.trade_no.to_alipay_dict()
            else:
                params['trade_no'] = self.trade_no
        return params

    @staticmethod
    def from_alipay_dict(d):
        if not d:
            return None
        o = AlipayTradeSettleReceivablesQueryModel()
        if 'biz_product' in d:
            o.biz_product = d['biz_product']
        if 'extend_params' in d:
            o.extend_params = d['extend_params']
        if 'merchant_info' in d:
            o.merchant_info = d['merchant_info']
        if 'out_request_no' in d:
            o.out_request_no = d['out_request_no']
        if 'query_his_date' in d:
            o.query_his_date = d['query_his_date']
        if 'trade_no' in d:
            o.trade_no = d['trade_no']
        return o


