public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('BoxalinoDataIntelligence_GetPageViews_args');
     if ($this->authentication !== null) {
         if (!is_object($this->authentication)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('authentication', TType::STRUCT, 1);
         $xfer += $this->authentication->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->configuration !== null) {
         if (!is_object($this->configuration)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('configuration', TType::STRUCT, 2);
         $xfer += $this->configuration->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->range !== null) {
         if (!is_object($this->range)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('range', TType::STRUCT, 3);
         $xfer += $this->range->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->precision !== null) {
         $xfer += $output->writeFieldBegin('precision', TType::I32, 4);
         $xfer += $output->writeI32($this->precision);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('BehaviorReportRequest');
     if ($this->metrics !== null) {
         if (!is_array($this->metrics)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('metrics', TType::LST, 1);
         $output->writeListBegin(TType::STRUCT, count($this->metrics));
         foreach ($this->metrics as $iter218) {
             $xfer += $iter218->write($output);
         }
         $output->writeListEnd();
         $xfer += $output->writeFieldEnd();
     }
     if ($this->dimensions !== null) {
         if (!is_array($this->dimensions)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('dimensions', TType::LST, 2);
         $output->writeListBegin(TType::STRUCT, count($this->dimensions));
         foreach ($this->dimensions as $iter219) {
             $xfer += $iter219->write($output);
         }
         $output->writeListEnd();
         $xfer += $output->writeFieldEnd();
     }
     if ($this->filter !== null) {
         if (!is_object($this->filter)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('filter', TType::STRUCT, 3);
         $xfer += $this->filter->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->sortBys !== null) {
         if (!is_array($this->sortBys)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('sortBys', TType::LST, 4);
         $output->writeListBegin(TType::STRUCT, count($this->sortBys));
         foreach ($this->sortBys as $iter220) {
             $xfer += $iter220->write($output);
         }
         $output->writeListEnd();
         $xfer += $output->writeFieldEnd();
     }
     if ($this->range !== null) {
         if (!is_object($this->range)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('range', TType::STRUCT, 5);
         $xfer += $this->range->write($output);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->precision !== null) {
         $xfer += $output->writeFieldBegin('precision', TType::I32, 6);
         $xfer += $output->writeI32($this->precision);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->startIndex !== null) {
         $xfer += $output->writeFieldBegin('startIndex', TType::I16, 7);
         $xfer += $output->writeI16($this->startIndex);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->maxResults !== null) {
         $xfer += $output->writeFieldBegin('maxResults', TType::I16, 8);
         $xfer += $output->writeI16($this->maxResults);
         $xfer += $output->writeFieldEnd();
     }
     if ($this->ignoreFillMissingTimeValuesWithZeros !== null) {
         $xfer += $output->writeFieldBegin('ignoreFillMissingTimeValuesWithZeros', TType::BOOL, 9);
         $xfer += $output->writeBool($this->ignoreFillMissingTimeValuesWithZeros);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }