<?php
/**
 * Autogenerated by Thrift Compiler (0.12.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;

/**
 * Clause Data Bundle
 */
class Data
{
    static public $isValidate = false;

    static public $_TSPEC = array(
        1 => array(
            'var' => 'rc',
            'isRequired' => false,
            'type' => TType::I32,
        ),
        2 => array(
            'var' => 'error',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        3 => array(
            'var' => 'msg',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        4 => array(
            'var' => 'id',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        5 => array(
            'var' => 'chatbotID',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
        6 => array(
            'var' => 'customdicts',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\Dict',
                ),
        ),
        7 => array(
            'var' => 'sysdicts',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\Dict',
                ),
        ),
        8 => array(
            'var' => 'botsysdicts',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\BotSysdict',
                ),
        ),
        9 => array(
            'var' => 'dictwords',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\DictWord',
                ),
        ),
        10 => array(
            'var' => 'customdict',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\Dict',
        ),
        11 => array(
            'var' => 'sysdict',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\Dict',
        ),
        12 => array(
            'var' => 'botsysdict',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\BotSysdict',
        ),
        13 => array(
            'var' => 'dictword',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\DictWord',
        ),
        14 => array(
            'var' => 'intents',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\Intent',
                ),
        ),
        15 => array(
            'var' => 'slots',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\IntentSlot',
                ),
        ),
        16 => array(
            'var' => 'utters',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\IntentUtter',
                ),
        ),
        17 => array(
            'var' => 'intent',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\Intent',
        ),
        18 => array(
            'var' => 'slot',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\IntentSlot',
        ),
        19 => array(
            'var' => 'utter',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\IntentUtter',
        ),
        20 => array(
            'var' => 'devvers',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\DevelopVersion',
                ),
        ),
        21 => array(
            'var' => 'provers',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\ProdVersion',
                ),
        ),
        22 => array(
            'var' => 'devver',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\DevelopVersion',
        ),
        23 => array(
            'var' => 'prover',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\ProdVersion',
        ),
        24 => array(
            'var' => 'sessions',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\ChatSession',
                ),
        ),
        25 => array(
            'var' => 'messages',
            'isRequired' => false,
            'type' => TType::LST,
            'etype' => TType::STRUCT,
            'elem' => array(
                'type' => TType::STRUCT,
                'class' => '\ChatMessage',
                ),
        ),
        26 => array(
            'var' => 'session',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\ChatSession',
        ),
        27 => array(
            'var' => 'message',
            'isRequired' => false,
            'type' => TType::STRUCT,
            'class' => '\ChatMessage',
        ),
        28 => array(
            'var' => 'currpage',
            'isRequired' => false,
            'type' => TType::I32,
        ),
        29 => array(
            'var' => 'totalpage',
            'isRequired' => false,
            'type' => TType::I32,
        ),
        30 => array(
            'var' => 'totalrows',
            'isRequired' => false,
            'type' => TType::I32,
        ),
        31 => array(
            'var' => 'pagesize',
            'isRequired' => false,
            'type' => TType::I32,
        ),
        32 => array(
            'var' => 'page',
            'isRequired' => false,
            'type' => TType::I32,
        ),
        33 => array(
            'var' => 'query',
            'isRequired' => false,
            'type' => TType::STRING,
        ),
    );

    /**
     * @var int
     */
    public $rc = null;
    /**
     * @var string
     */
    public $error = null;
    /**
     * @var string
     */
    public $msg = null;
    /**
     * @var string
     */
    public $id = null;
    /**
     * @var string
     */
    public $chatbotID = null;
    /**
     * @var \Dict[]
     */
    public $customdicts = null;
    /**
     * @var \Dict[]
     */
    public $sysdicts = null;
    /**
     * @var \BotSysdict[]
     */
    public $botsysdicts = null;
    /**
     * @var \DictWord[]
     */
    public $dictwords = null;
    /**
     * @var \Dict
     */
    public $customdict = null;
    /**
     * @var \Dict
     */
    public $sysdict = null;
    /**
     * @var \BotSysdict
     */
    public $botsysdict = null;
    /**
     * @var \DictWord
     */
    public $dictword = null;
    /**
     * @var \Intent[]
     */
    public $intents = null;
    /**
     * @var \IntentSlot[]
     */
    public $slots = null;
    /**
     * @var \IntentUtter[]
     */
    public $utters = null;
    /**
     * @var \Intent
     */
    public $intent = null;
    /**
     * @var \IntentSlot
     */
    public $slot = null;
    /**
     * @var \IntentUtter
     */
    public $utter = null;
    /**
     * @var \DevelopVersion[]
     */
    public $devvers = null;
    /**
     * @var \ProdVersion[]
     */
    public $provers = null;
    /**
     * @var \DevelopVersion
     */
    public $devver = null;
    /**
     * @var \ProdVersion
     */
    public $prover = null;
    /**
     * @var \ChatSession[]
     */
    public $sessions = null;
    /**
     * @var \ChatMessage[]
     */
    public $messages = null;
    /**
     * @var \ChatSession
     */
    public $session = null;
    /**
     * @var \ChatMessage
     */
    public $message = null;
    /**
     * @var int
     */
    public $currpage = null;
    /**
     * @var int
     */
    public $totalpage = null;
    /**
     * @var int
     */
    public $totalrows = null;
    /**
     * @var int
     */
    public $pagesize = null;
    /**
     * @var int
     */
    public $page = null;
    /**
     * @var string
     */
    public $query = null;

    public function __construct($vals = null)
    {
        if (is_array($vals)) {
            if (isset($vals['rc'])) {
                $this->rc = $vals['rc'];
            }
            if (isset($vals['error'])) {
                $this->error = $vals['error'];
            }
            if (isset($vals['msg'])) {
                $this->msg = $vals['msg'];
            }
            if (isset($vals['id'])) {
                $this->id = $vals['id'];
            }
            if (isset($vals['chatbotID'])) {
                $this->chatbotID = $vals['chatbotID'];
            }
            if (isset($vals['customdicts'])) {
                $this->customdicts = $vals['customdicts'];
            }
            if (isset($vals['sysdicts'])) {
                $this->sysdicts = $vals['sysdicts'];
            }
            if (isset($vals['botsysdicts'])) {
                $this->botsysdicts = $vals['botsysdicts'];
            }
            if (isset($vals['dictwords'])) {
                $this->dictwords = $vals['dictwords'];
            }
            if (isset($vals['customdict'])) {
                $this->customdict = $vals['customdict'];
            }
            if (isset($vals['sysdict'])) {
                $this->sysdict = $vals['sysdict'];
            }
            if (isset($vals['botsysdict'])) {
                $this->botsysdict = $vals['botsysdict'];
            }
            if (isset($vals['dictword'])) {
                $this->dictword = $vals['dictword'];
            }
            if (isset($vals['intents'])) {
                $this->intents = $vals['intents'];
            }
            if (isset($vals['slots'])) {
                $this->slots = $vals['slots'];
            }
            if (isset($vals['utters'])) {
                $this->utters = $vals['utters'];
            }
            if (isset($vals['intent'])) {
                $this->intent = $vals['intent'];
            }
            if (isset($vals['slot'])) {
                $this->slot = $vals['slot'];
            }
            if (isset($vals['utter'])) {
                $this->utter = $vals['utter'];
            }
            if (isset($vals['devvers'])) {
                $this->devvers = $vals['devvers'];
            }
            if (isset($vals['provers'])) {
                $this->provers = $vals['provers'];
            }
            if (isset($vals['devver'])) {
                $this->devver = $vals['devver'];
            }
            if (isset($vals['prover'])) {
                $this->prover = $vals['prover'];
            }
            if (isset($vals['sessions'])) {
                $this->sessions = $vals['sessions'];
            }
            if (isset($vals['messages'])) {
                $this->messages = $vals['messages'];
            }
            if (isset($vals['session'])) {
                $this->session = $vals['session'];
            }
            if (isset($vals['message'])) {
                $this->message = $vals['message'];
            }
            if (isset($vals['currpage'])) {
                $this->currpage = $vals['currpage'];
            }
            if (isset($vals['totalpage'])) {
                $this->totalpage = $vals['totalpage'];
            }
            if (isset($vals['totalrows'])) {
                $this->totalrows = $vals['totalrows'];
            }
            if (isset($vals['pagesize'])) {
                $this->pagesize = $vals['pagesize'];
            }
            if (isset($vals['page'])) {
                $this->page = $vals['page'];
            }
            if (isset($vals['query'])) {
                $this->query = $vals['query'];
            }
        }
    }

    public function getName()
    {
        return 'Data';
    }


    public function read($input)
    {
        $xfer = 0;
        $fname = null;
        $ftype = 0;
        $fid = 0;
        $xfer += $input->readStructBegin($fname);
        while (true) {
            $xfer += $input->readFieldBegin($fname, $ftype, $fid);
            if ($ftype == TType::STOP) {
                break;
            }
            switch ($fid) {
                case 1:
                    if ($ftype == TType::I32) {
                        $xfer += $input->readI32($this->rc);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 2:
                    if ($ftype == TType::STRING) {
                        $xfer += $input->readString($this->error);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 3:
                    if ($ftype == TType::STRING) {
                        $xfer += $input->readString($this->msg);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 4:
                    if ($ftype == TType::STRING) {
                        $xfer += $input->readString($this->id);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 5:
                    if ($ftype == TType::STRING) {
                        $xfer += $input->readString($this->chatbotID);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 6:
                    if ($ftype == TType::LST) {
                        $this->customdicts = array();
                        $_size21 = 0;
                        $_etype24 = 0;
                        $xfer += $input->readListBegin($_etype24, $_size21);
                        for ($_i25 = 0; $_i25 < $_size21; ++$_i25) {
                            $elem26 = null;
                            $elem26 = new \Dict();
                            $xfer += $elem26->read($input);
                            $this->customdicts []= $elem26;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 7:
                    if ($ftype == TType::LST) {
                        $this->sysdicts = array();
                        $_size27 = 0;
                        $_etype30 = 0;
                        $xfer += $input->readListBegin($_etype30, $_size27);
                        for ($_i31 = 0; $_i31 < $_size27; ++$_i31) {
                            $elem32 = null;
                            $elem32 = new \Dict();
                            $xfer += $elem32->read($input);
                            $this->sysdicts []= $elem32;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 8:
                    if ($ftype == TType::LST) {
                        $this->botsysdicts = array();
                        $_size33 = 0;
                        $_etype36 = 0;
                        $xfer += $input->readListBegin($_etype36, $_size33);
                        for ($_i37 = 0; $_i37 < $_size33; ++$_i37) {
                            $elem38 = null;
                            $elem38 = new \BotSysdict();
                            $xfer += $elem38->read($input);
                            $this->botsysdicts []= $elem38;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 9:
                    if ($ftype == TType::LST) {
                        $this->dictwords = array();
                        $_size39 = 0;
                        $_etype42 = 0;
                        $xfer += $input->readListBegin($_etype42, $_size39);
                        for ($_i43 = 0; $_i43 < $_size39; ++$_i43) {
                            $elem44 = null;
                            $elem44 = new \DictWord();
                            $xfer += $elem44->read($input);
                            $this->dictwords []= $elem44;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 10:
                    if ($ftype == TType::STRUCT) {
                        $this->customdict = new \Dict();
                        $xfer += $this->customdict->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 11:
                    if ($ftype == TType::STRUCT) {
                        $this->sysdict = new \Dict();
                        $xfer += $this->sysdict->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 12:
                    if ($ftype == TType::STRUCT) {
                        $this->botsysdict = new \BotSysdict();
                        $xfer += $this->botsysdict->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 13:
                    if ($ftype == TType::STRUCT) {
                        $this->dictword = new \DictWord();
                        $xfer += $this->dictword->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 14:
                    if ($ftype == TType::LST) {
                        $this->intents = array();
                        $_size45 = 0;
                        $_etype48 = 0;
                        $xfer += $input->readListBegin($_etype48, $_size45);
                        for ($_i49 = 0; $_i49 < $_size45; ++$_i49) {
                            $elem50 = null;
                            $elem50 = new \Intent();
                            $xfer += $elem50->read($input);
                            $this->intents []= $elem50;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 15:
                    if ($ftype == TType::LST) {
                        $this->slots = array();
                        $_size51 = 0;
                        $_etype54 = 0;
                        $xfer += $input->readListBegin($_etype54, $_size51);
                        for ($_i55 = 0; $_i55 < $_size51; ++$_i55) {
                            $elem56 = null;
                            $elem56 = new \IntentSlot();
                            $xfer += $elem56->read($input);
                            $this->slots []= $elem56;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 16:
                    if ($ftype == TType::LST) {
                        $this->utters = array();
                        $_size57 = 0;
                        $_etype60 = 0;
                        $xfer += $input->readListBegin($_etype60, $_size57);
                        for ($_i61 = 0; $_i61 < $_size57; ++$_i61) {
                            $elem62 = null;
                            $elem62 = new \IntentUtter();
                            $xfer += $elem62->read($input);
                            $this->utters []= $elem62;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 17:
                    if ($ftype == TType::STRUCT) {
                        $this->intent = new \Intent();
                        $xfer += $this->intent->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 18:
                    if ($ftype == TType::STRUCT) {
                        $this->slot = new \IntentSlot();
                        $xfer += $this->slot->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 19:
                    if ($ftype == TType::STRUCT) {
                        $this->utter = new \IntentUtter();
                        $xfer += $this->utter->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 20:
                    if ($ftype == TType::LST) {
                        $this->devvers = array();
                        $_size63 = 0;
                        $_etype66 = 0;
                        $xfer += $input->readListBegin($_etype66, $_size63);
                        for ($_i67 = 0; $_i67 < $_size63; ++$_i67) {
                            $elem68 = null;
                            $elem68 = new \DevelopVersion();
                            $xfer += $elem68->read($input);
                            $this->devvers []= $elem68;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 21:
                    if ($ftype == TType::LST) {
                        $this->provers = array();
                        $_size69 = 0;
                        $_etype72 = 0;
                        $xfer += $input->readListBegin($_etype72, $_size69);
                        for ($_i73 = 0; $_i73 < $_size69; ++$_i73) {
                            $elem74 = null;
                            $elem74 = new \ProdVersion();
                            $xfer += $elem74->read($input);
                            $this->provers []= $elem74;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 22:
                    if ($ftype == TType::STRUCT) {
                        $this->devver = new \DevelopVersion();
                        $xfer += $this->devver->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 23:
                    if ($ftype == TType::STRUCT) {
                        $this->prover = new \ProdVersion();
                        $xfer += $this->prover->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 24:
                    if ($ftype == TType::LST) {
                        $this->sessions = array();
                        $_size75 = 0;
                        $_etype78 = 0;
                        $xfer += $input->readListBegin($_etype78, $_size75);
                        for ($_i79 = 0; $_i79 < $_size75; ++$_i79) {
                            $elem80 = null;
                            $elem80 = new \ChatSession();
                            $xfer += $elem80->read($input);
                            $this->sessions []= $elem80;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 25:
                    if ($ftype == TType::LST) {
                        $this->messages = array();
                        $_size81 = 0;
                        $_etype84 = 0;
                        $xfer += $input->readListBegin($_etype84, $_size81);
                        for ($_i85 = 0; $_i85 < $_size81; ++$_i85) {
                            $elem86 = null;
                            $elem86 = new \ChatMessage();
                            $xfer += $elem86->read($input);
                            $this->messages []= $elem86;
                        }
                        $xfer += $input->readListEnd();
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 26:
                    if ($ftype == TType::STRUCT) {
                        $this->session = new \ChatSession();
                        $xfer += $this->session->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 27:
                    if ($ftype == TType::STRUCT) {
                        $this->message = new \ChatMessage();
                        $xfer += $this->message->read($input);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 28:
                    if ($ftype == TType::I32) {
                        $xfer += $input->readI32($this->currpage);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 29:
                    if ($ftype == TType::I32) {
                        $xfer += $input->readI32($this->totalpage);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 30:
                    if ($ftype == TType::I32) {
                        $xfer += $input->readI32($this->totalrows);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 31:
                    if ($ftype == TType::I32) {
                        $xfer += $input->readI32($this->pagesize);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 32:
                    if ($ftype == TType::I32) {
                        $xfer += $input->readI32($this->page);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                case 33:
                    if ($ftype == TType::STRING) {
                        $xfer += $input->readString($this->query);
                    } else {
                        $xfer += $input->skip($ftype);
                    }
                    break;
                default:
                    $xfer += $input->skip($ftype);
                    break;
            }
            $xfer += $input->readFieldEnd();
        }
        $xfer += $input->readStructEnd();
        return $xfer;
    }

    public function write($output)
    {
        $xfer = 0;
        $xfer += $output->writeStructBegin('Data');
        if ($this->rc !== null) {
            $xfer += $output->writeFieldBegin('rc', TType::I32, 1);
            $xfer += $output->writeI32($this->rc);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->error !== null) {
            $xfer += $output->writeFieldBegin('error', TType::STRING, 2);
            $xfer += $output->writeString($this->error);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->msg !== null) {
            $xfer += $output->writeFieldBegin('msg', TType::STRING, 3);
            $xfer += $output->writeString($this->msg);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->id !== null) {
            $xfer += $output->writeFieldBegin('id', TType::STRING, 4);
            $xfer += $output->writeString($this->id);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->chatbotID !== null) {
            $xfer += $output->writeFieldBegin('chatbotID', TType::STRING, 5);
            $xfer += $output->writeString($this->chatbotID);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->customdicts !== null) {
            if (!is_array($this->customdicts)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('customdicts', TType::LST, 6);
            $output->writeListBegin(TType::STRUCT, count($this->customdicts));
            foreach ($this->customdicts as $iter87) {
                $xfer += $iter87->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->sysdicts !== null) {
            if (!is_array($this->sysdicts)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('sysdicts', TType::LST, 7);
            $output->writeListBegin(TType::STRUCT, count($this->sysdicts));
            foreach ($this->sysdicts as $iter88) {
                $xfer += $iter88->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->botsysdicts !== null) {
            if (!is_array($this->botsysdicts)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('botsysdicts', TType::LST, 8);
            $output->writeListBegin(TType::STRUCT, count($this->botsysdicts));
            foreach ($this->botsysdicts as $iter89) {
                $xfer += $iter89->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->dictwords !== null) {
            if (!is_array($this->dictwords)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('dictwords', TType::LST, 9);
            $output->writeListBegin(TType::STRUCT, count($this->dictwords));
            foreach ($this->dictwords as $iter90) {
                $xfer += $iter90->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->customdict !== null) {
            if (!is_object($this->customdict)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('customdict', TType::STRUCT, 10);
            $xfer += $this->customdict->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->sysdict !== null) {
            if (!is_object($this->sysdict)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('sysdict', TType::STRUCT, 11);
            $xfer += $this->sysdict->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->botsysdict !== null) {
            if (!is_object($this->botsysdict)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('botsysdict', TType::STRUCT, 12);
            $xfer += $this->botsysdict->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->dictword !== null) {
            if (!is_object($this->dictword)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('dictword', TType::STRUCT, 13);
            $xfer += $this->dictword->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->intents !== null) {
            if (!is_array($this->intents)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('intents', TType::LST, 14);
            $output->writeListBegin(TType::STRUCT, count($this->intents));
            foreach ($this->intents as $iter91) {
                $xfer += $iter91->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->slots !== null) {
            if (!is_array($this->slots)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('slots', TType::LST, 15);
            $output->writeListBegin(TType::STRUCT, count($this->slots));
            foreach ($this->slots as $iter92) {
                $xfer += $iter92->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->utters !== null) {
            if (!is_array($this->utters)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('utters', TType::LST, 16);
            $output->writeListBegin(TType::STRUCT, count($this->utters));
            foreach ($this->utters as $iter93) {
                $xfer += $iter93->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->intent !== null) {
            if (!is_object($this->intent)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('intent', TType::STRUCT, 17);
            $xfer += $this->intent->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->slot !== null) {
            if (!is_object($this->slot)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('slot', TType::STRUCT, 18);
            $xfer += $this->slot->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->utter !== null) {
            if (!is_object($this->utter)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('utter', TType::STRUCT, 19);
            $xfer += $this->utter->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->devvers !== null) {
            if (!is_array($this->devvers)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('devvers', TType::LST, 20);
            $output->writeListBegin(TType::STRUCT, count($this->devvers));
            foreach ($this->devvers as $iter94) {
                $xfer += $iter94->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->provers !== null) {
            if (!is_array($this->provers)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('provers', TType::LST, 21);
            $output->writeListBegin(TType::STRUCT, count($this->provers));
            foreach ($this->provers as $iter95) {
                $xfer += $iter95->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->devver !== null) {
            if (!is_object($this->devver)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('devver', TType::STRUCT, 22);
            $xfer += $this->devver->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->prover !== null) {
            if (!is_object($this->prover)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('prover', TType::STRUCT, 23);
            $xfer += $this->prover->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->sessions !== null) {
            if (!is_array($this->sessions)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('sessions', TType::LST, 24);
            $output->writeListBegin(TType::STRUCT, count($this->sessions));
            foreach ($this->sessions as $iter96) {
                $xfer += $iter96->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->messages !== null) {
            if (!is_array($this->messages)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('messages', TType::LST, 25);
            $output->writeListBegin(TType::STRUCT, count($this->messages));
            foreach ($this->messages as $iter97) {
                $xfer += $iter97->write($output);
            }
            $output->writeListEnd();
            $xfer += $output->writeFieldEnd();
        }
        if ($this->session !== null) {
            if (!is_object($this->session)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('session', TType::STRUCT, 26);
            $xfer += $this->session->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->message !== null) {
            if (!is_object($this->message)) {
                throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
            }
            $xfer += $output->writeFieldBegin('message', TType::STRUCT, 27);
            $xfer += $this->message->write($output);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->currpage !== null) {
            $xfer += $output->writeFieldBegin('currpage', TType::I32, 28);
            $xfer += $output->writeI32($this->currpage);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->totalpage !== null) {
            $xfer += $output->writeFieldBegin('totalpage', TType::I32, 29);
            $xfer += $output->writeI32($this->totalpage);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->totalrows !== null) {
            $xfer += $output->writeFieldBegin('totalrows', TType::I32, 30);
            $xfer += $output->writeI32($this->totalrows);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->pagesize !== null) {
            $xfer += $output->writeFieldBegin('pagesize', TType::I32, 31);
            $xfer += $output->writeI32($this->pagesize);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->page !== null) {
            $xfer += $output->writeFieldBegin('page', TType::I32, 32);
            $xfer += $output->writeI32($this->page);
            $xfer += $output->writeFieldEnd();
        }
        if ($this->query !== null) {
            $xfer += $output->writeFieldBegin('query', TType::STRING, 33);
            $xfer += $output->writeString($this->query);
            $xfer += $output->writeFieldEnd();
        }
        $xfer += $output->writeFieldStop();
        $xfer += $output->writeStructEnd();
        return $xfer;
    }
}
