blob: 5e7b95960b8012363fe90607480e0770cd59f5ac [file] [log] [blame]
<?php
namespace metastore;
/**
* Autogenerated by Thrift Compiler (0.13.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;
class GetDatabaseRequest
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'name',
'isRequired' => false,
'type' => TType::STRING,
),
2 => array(
'var' => 'catalogName',
'isRequired' => false,
'type' => TType::STRING,
),
3 => array(
'var' => 'processorCapabilities',
'isRequired' => false,
'type' => TType::LST,
'etype' => TType::STRING,
'elem' => array(
'type' => TType::STRING,
),
),
4 => array(
'var' => 'processorIdentifier',
'isRequired' => false,
'type' => TType::STRING,
),
);
/**
* @var string
*/
public $name = null;
/**
* @var string
*/
public $catalogName = null;
/**
* @var string[]
*/
public $processorCapabilities = null;
/**
* @var string
*/
public $processorIdentifier = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['name'])) {
$this->name = $vals['name'];
}
if (isset($vals['catalogName'])) {
$this->catalogName = $vals['catalogName'];
}
if (isset($vals['processorCapabilities'])) {
$this->processorCapabilities = $vals['processorCapabilities'];
}
if (isset($vals['processorIdentifier'])) {
$this->processorIdentifier = $vals['processorIdentifier'];
}
}
}
public function getName()
{
return 'GetDatabaseRequest';
}
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::STRING) {
$xfer += $input->readString($this->name);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->catalogName);
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::LST) {
$this->processorCapabilities = array();
$_size931 = 0;
$_etype934 = 0;
$xfer += $input->readListBegin($_etype934, $_size931);
for ($_i935 = 0; $_i935 < $_size931; ++$_i935) {
$elem936 = null;
$xfer += $input->readString($elem936);
$this->processorCapabilities []= $elem936;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
case 4:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->processorIdentifier);
} 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('GetDatabaseRequest');
if ($this->name !== null) {
$xfer += $output->writeFieldBegin('name', TType::STRING, 1);
$xfer += $output->writeString($this->name);
$xfer += $output->writeFieldEnd();
}
if ($this->catalogName !== null) {
$xfer += $output->writeFieldBegin('catalogName', TType::STRING, 2);
$xfer += $output->writeString($this->catalogName);
$xfer += $output->writeFieldEnd();
}
if ($this->processorCapabilities !== null) {
if (!is_array($this->processorCapabilities)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('processorCapabilities', TType::LST, 3);
$output->writeListBegin(TType::STRING, count($this->processorCapabilities));
foreach ($this->processorCapabilities as $iter937) {
$xfer += $output->writeString($iter937);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
if ($this->processorIdentifier !== null) {
$xfer += $output->writeFieldBegin('processorIdentifier', TType::STRING, 4);
$xfer += $output->writeString($this->processorIdentifier);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}