| <?php |
| namespace Airavata\Model\Data\Metadata; |
| |
| /** |
| * Autogenerated by Thrift Compiler (0.9.3) |
| * |
| * 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; |
| |
| |
| final class MetadataType { |
| const FILE = 0; |
| const COLLECTION = 1; |
| static public $__names = array( |
| 0 => 'FILE', |
| 1 => 'COLLECTION', |
| ); |
| } |
| |
| class MetadataModel { |
| static $_TSPEC; |
| |
| /** |
| * @var string |
| */ |
| public $metadataId = null; |
| /** |
| * @var string |
| */ |
| public $gatewayId = null; |
| /** |
| * @var string |
| */ |
| public $username = null; |
| /** |
| * @var double |
| */ |
| public $size = null; |
| /** |
| * @var string[] |
| */ |
| public $sharedUsers = null; |
| /** |
| * @var bool |
| */ |
| public $sharedPublic = null; |
| /** |
| * @var string |
| */ |
| public $userFriendlyName = null; |
| /** |
| * @var string |
| */ |
| public $userFriendlyDescription = null; |
| /** |
| * @var int |
| */ |
| public $metadataType = null; |
| /** |
| * @var string |
| */ |
| public $associatedEntityId = null; |
| /** |
| * @var array |
| */ |
| public $customInformation = null; |
| /** |
| * @var int |
| */ |
| public $creationTime = null; |
| /** |
| * @var int |
| */ |
| public $lastModifiedTime = null; |
| |
| public function __construct($vals=null) { |
| if (!isset(self::$_TSPEC)) { |
| self::$_TSPEC = array( |
| 1 => array( |
| 'var' => 'metadataId', |
| 'type' => TType::STRING, |
| ), |
| 2 => array( |
| 'var' => 'gatewayId', |
| 'type' => TType::STRING, |
| ), |
| 3 => array( |
| 'var' => 'username', |
| 'type' => TType::STRING, |
| ), |
| 4 => array( |
| 'var' => 'size', |
| 'type' => TType::DOUBLE, |
| ), |
| 5 => array( |
| 'var' => 'sharedUsers', |
| 'type' => TType::LST, |
| 'etype' => TType::STRING, |
| 'elem' => array( |
| 'type' => TType::STRING, |
| ), |
| ), |
| 6 => array( |
| 'var' => 'sharedPublic', |
| 'type' => TType::BOOL, |
| ), |
| 7 => array( |
| 'var' => 'userFriendlyName', |
| 'type' => TType::STRING, |
| ), |
| 8 => array( |
| 'var' => 'userFriendlyDescription', |
| 'type' => TType::STRING, |
| ), |
| 9 => array( |
| 'var' => 'metadataType', |
| 'type' => TType::I32, |
| ), |
| 10 => array( |
| 'var' => 'associatedEntityId', |
| 'type' => TType::STRING, |
| ), |
| 11 => array( |
| 'var' => 'customInformation', |
| 'type' => TType::MAP, |
| 'ktype' => TType::STRING, |
| 'vtype' => TType::STRING, |
| 'key' => array( |
| 'type' => TType::STRING, |
| ), |
| 'val' => array( |
| 'type' => TType::STRING, |
| ), |
| ), |
| 12 => array( |
| 'var' => 'creationTime', |
| 'type' => TType::I64, |
| ), |
| 13 => array( |
| 'var' => 'lastModifiedTime', |
| 'type' => TType::I64, |
| ), |
| ); |
| } |
| if (is_array($vals)) { |
| if (isset($vals['metadataId'])) { |
| $this->metadataId = $vals['metadataId']; |
| } |
| if (isset($vals['gatewayId'])) { |
| $this->gatewayId = $vals['gatewayId']; |
| } |
| if (isset($vals['username'])) { |
| $this->username = $vals['username']; |
| } |
| if (isset($vals['size'])) { |
| $this->size = $vals['size']; |
| } |
| if (isset($vals['sharedUsers'])) { |
| $this->sharedUsers = $vals['sharedUsers']; |
| } |
| if (isset($vals['sharedPublic'])) { |
| $this->sharedPublic = $vals['sharedPublic']; |
| } |
| if (isset($vals['userFriendlyName'])) { |
| $this->userFriendlyName = $vals['userFriendlyName']; |
| } |
| if (isset($vals['userFriendlyDescription'])) { |
| $this->userFriendlyDescription = $vals['userFriendlyDescription']; |
| } |
| if (isset($vals['metadataType'])) { |
| $this->metadataType = $vals['metadataType']; |
| } |
| if (isset($vals['associatedEntityId'])) { |
| $this->associatedEntityId = $vals['associatedEntityId']; |
| } |
| if (isset($vals['customInformation'])) { |
| $this->customInformation = $vals['customInformation']; |
| } |
| if (isset($vals['creationTime'])) { |
| $this->creationTime = $vals['creationTime']; |
| } |
| if (isset($vals['lastModifiedTime'])) { |
| $this->lastModifiedTime = $vals['lastModifiedTime']; |
| } |
| } |
| } |
| |
| public function getName() { |
| return 'MetadataModel'; |
| } |
| |
| 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->metadataId); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 2: |
| if ($ftype == TType::STRING) { |
| $xfer += $input->readString($this->gatewayId); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 3: |
| if ($ftype == TType::STRING) { |
| $xfer += $input->readString($this->username); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 4: |
| if ($ftype == TType::DOUBLE) { |
| $xfer += $input->readDouble($this->size); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 5: |
| if ($ftype == TType::LST) { |
| $this->sharedUsers = array(); |
| $_size0 = 0; |
| $_etype3 = 0; |
| $xfer += $input->readListBegin($_etype3, $_size0); |
| for ($_i4 = 0; $_i4 < $_size0; ++$_i4) |
| { |
| $elem5 = null; |
| $xfer += $input->readString($elem5); |
| $this->sharedUsers []= $elem5; |
| } |
| $xfer += $input->readListEnd(); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 6: |
| if ($ftype == TType::BOOL) { |
| $xfer += $input->readBool($this->sharedPublic); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 7: |
| if ($ftype == TType::STRING) { |
| $xfer += $input->readString($this->userFriendlyName); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 8: |
| if ($ftype == TType::STRING) { |
| $xfer += $input->readString($this->userFriendlyDescription); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 9: |
| if ($ftype == TType::I32) { |
| $xfer += $input->readI32($this->metadataType); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 10: |
| if ($ftype == TType::STRING) { |
| $xfer += $input->readString($this->associatedEntityId); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 11: |
| if ($ftype == TType::MAP) { |
| $this->customInformation = array(); |
| $_size6 = 0; |
| $_ktype7 = 0; |
| $_vtype8 = 0; |
| $xfer += $input->readMapBegin($_ktype7, $_vtype8, $_size6); |
| for ($_i10 = 0; $_i10 < $_size6; ++$_i10) |
| { |
| $key11 = ''; |
| $val12 = ''; |
| $xfer += $input->readString($key11); |
| $xfer += $input->readString($val12); |
| $this->customInformation[$key11] = $val12; |
| } |
| $xfer += $input->readMapEnd(); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 12: |
| if ($ftype == TType::I64) { |
| $xfer += $input->readI64($this->creationTime); |
| } else { |
| $xfer += $input->skip($ftype); |
| } |
| break; |
| case 13: |
| if ($ftype == TType::I64) { |
| $xfer += $input->readI64($this->lastModifiedTime); |
| } 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('MetadataModel'); |
| if ($this->metadataId !== null) { |
| $xfer += $output->writeFieldBegin('metadataId', TType::STRING, 1); |
| $xfer += $output->writeString($this->metadataId); |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->gatewayId !== null) { |
| $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 2); |
| $xfer += $output->writeString($this->gatewayId); |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->username !== null) { |
| $xfer += $output->writeFieldBegin('username', TType::STRING, 3); |
| $xfer += $output->writeString($this->username); |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->size !== null) { |
| $xfer += $output->writeFieldBegin('size', TType::DOUBLE, 4); |
| $xfer += $output->writeDouble($this->size); |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->sharedUsers !== null) { |
| if (!is_array($this->sharedUsers)) { |
| throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); |
| } |
| $xfer += $output->writeFieldBegin('sharedUsers', TType::LST, 5); |
| { |
| $output->writeListBegin(TType::STRING, count($this->sharedUsers)); |
| { |
| foreach ($this->sharedUsers as $iter13) |
| { |
| $xfer += $output->writeString($iter13); |
| } |
| } |
| $output->writeListEnd(); |
| } |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->sharedPublic !== null) { |
| $xfer += $output->writeFieldBegin('sharedPublic', TType::BOOL, 6); |
| $xfer += $output->writeBool($this->sharedPublic); |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->userFriendlyName !== null) { |
| $xfer += $output->writeFieldBegin('userFriendlyName', TType::STRING, 7); |
| $xfer += $output->writeString($this->userFriendlyName); |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->userFriendlyDescription !== null) { |
| $xfer += $output->writeFieldBegin('userFriendlyDescription', TType::STRING, 8); |
| $xfer += $output->writeString($this->userFriendlyDescription); |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->metadataType !== null) { |
| $xfer += $output->writeFieldBegin('metadataType', TType::I32, 9); |
| $xfer += $output->writeI32($this->metadataType); |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->associatedEntityId !== null) { |
| $xfer += $output->writeFieldBegin('associatedEntityId', TType::STRING, 10); |
| $xfer += $output->writeString($this->associatedEntityId); |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->customInformation !== null) { |
| if (!is_array($this->customInformation)) { |
| throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); |
| } |
| $xfer += $output->writeFieldBegin('customInformation', TType::MAP, 11); |
| { |
| $output->writeMapBegin(TType::STRING, TType::STRING, count($this->customInformation)); |
| { |
| foreach ($this->customInformation as $kiter14 => $viter15) |
| { |
| $xfer += $output->writeString($kiter14); |
| $xfer += $output->writeString($viter15); |
| } |
| } |
| $output->writeMapEnd(); |
| } |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->creationTime !== null) { |
| $xfer += $output->writeFieldBegin('creationTime', TType::I64, 12); |
| $xfer += $output->writeI64($this->creationTime); |
| $xfer += $output->writeFieldEnd(); |
| } |
| if ($this->lastModifiedTime !== null) { |
| $xfer += $output->writeFieldBegin('lastModifiedTime', TType::I64, 13); |
| $xfer += $output->writeI64($this->lastModifiedTime); |
| $xfer += $output->writeFieldEnd(); |
| } |
| $xfer += $output->writeFieldStop(); |
| $xfer += $output->writeStructEnd(); |
| return $xfer; |
| } |
| |
| } |
| |
| |