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

from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.HonorContractDTO import HonorContractDTO


class AlipayPcreditLoanHonorContractlistQueryResponse(AlipayResponse):

    def __init__(self):
        super(AlipayPcreditLoanHonorContractlistQueryResponse, self).__init__()
        self._agreement_consult_serial_no = None
        self._records = None
        self._total_num = None

    @property
    def agreement_consult_serial_no(self):
        return self._agreement_consult_serial_no

    @agreement_consult_serial_no.setter
    def agreement_consult_serial_no(self, value):
        self._agreement_consult_serial_no = value
    @property
    def records(self):
        return self._records

    @records.setter
    def records(self, value):
        if isinstance(value, list):
            self._records = list()
            for i in value:
                if isinstance(i, HonorContractDTO):
                    self._records.append(i)
                else:
                    self._records.append(HonorContractDTO.from_alipay_dict(i))
    @property
    def total_num(self):
        return self._total_num

    @total_num.setter
    def total_num(self, value):
        self._total_num = value

    def parse_response_content(self, response_content):
        response = super(AlipayPcreditLoanHonorContractlistQueryResponse, self).parse_response_content(response_content)
        if 'agreement_consult_serial_no' in response:
            self.agreement_consult_serial_no = response['agreement_consult_serial_no']
        if 'records' in response:
            self.records = response['records']
        if 'total_num' in response:
            self.total_num = response['total_num']
