public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('CloudHardDiskService_SetUserInfo_args');
     if ($this->token !== null) {
         $xfer += $output->writeFieldBegin('token', TType::STRING, 1);
         $xfer += $output->writeString($this->token);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->uinfo !== null) {
         if (!is_object($this->uinfo)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('uinfo', TType::STRUCT, 2);
         $xfer += $this->uinfo->write($output);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }
예제 #2
0
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('UserInfoResult');
     if ($this->result !== null) {
         if (!is_object($this->result)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('result', TType::STRUCT, 1);
         $xfer += $this->result->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->uinfo !== null) {
         if (!is_object($this->uinfo)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('uinfo', TType::STRUCT, 2);
         $xfer += $this->uinfo->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->userid !== null) {
         $xfer += $output->writeFieldBegin('userid', TType::I32, 3);
         $xfer += $output->writeI32($this->userid);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }