273 return \google\protobuf\DescriptorProto::fromArray([
274 'name' =>
'OutgoingMessage',
276 \google\protobuf\FieldDescriptorProto::fromArray([
280 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()
282 \google\protobuf\FieldDescriptorProto::fromArray([
285 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_STRING(),
286 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()
288 \google\protobuf\FieldDescriptorProto::fromArray([
292 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()
294 \google\protobuf\FieldDescriptorProto::fromArray([
298 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()
300 \google\protobuf\FieldDescriptorProto::fromArray([
303 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_MESSAGE(),
304 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL(),
305 'type_name' =>
'.Sender'
329 public function writeTo(\Protobuf\WriteContext $context)
331 $stream = $context->getStream();
332 $writer = $context->getWriter();
333 $sizeContext = $context->getComputeSizeContext();
335 if ($this->
id !==
null) {
336 $writer->writeVarint($stream, 10);
337 $writer->writeByteStream($stream, $this->
id);
340 if ($this->body !==
null) {
341 $writer->writeVarint($stream, 18);
342 $writer->writeString($stream, $this->body);
345 if ($this->expiry !==
null) {
346 $writer->writeVarint($stream, 24);
347 $writer->writeVarint($stream, $this->expiry);
350 if ($this->created !==
null) {
351 $writer->writeVarint($stream, 37);
352 $writer->writeFixed32($stream, $this->created);
355 if ($this->sender !==
null) {
356 $writer->writeVarint($stream, 42);
357 $writer->writeVarint($stream, $this->sender->serializedSize($sizeContext));
358 $this->sender->writeTo($context);
371 public function readFrom(\Protobuf\ReadContext $context)
373 $reader = $context->getReader();
374 $length = $context->getLength();
375 $stream = $context->getStream();
377 $limit = ($length !==
null)
378 ? ($stream->tell() + $length)
381 while ($limit ===
null || $stream->tell() < $limit) {
383 if ($stream->eof()) {
387 $key = $reader->readVarint($stream);
388 $wire = \Protobuf\WireFormat::getTagWireType($key);
389 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);
391 if ($stream->eof()) {
396 \Protobuf\WireFormat::assertWireType($wire, 12);
398 $this->
id = $reader->readByteStream($stream);
404 \Protobuf\WireFormat::assertWireType($wire, 9);
406 $this->body = $reader->readString($stream);
412 \Protobuf\WireFormat::assertWireType($wire, 13);
414 $this->expiry = $reader->readVarint($stream);
420 \Protobuf\WireFormat::assertWireType($wire, 7);
422 $this->created = $reader->readFixed32($stream);
428 \Protobuf\WireFormat::assertWireType($wire, 11);
430 $innerSize = $reader->readVarint($stream);
431 $innerMessage = new \Bitrix\Pull\Protobuf\Sender();
433 $this->sender = $innerMessage;
435 $context->setLength($innerSize);
436 $innerMessage->readFrom($context);
437 $context->setLength($length);
445 if ($extension !==
null) {
446 $this->
extensions()->add($extension, $extension->readFrom($context, $wire));
455 $data = $reader->readUnknown($stream, $wire);
456 $unknown = new \Protobuf\Unknown($tag, $wire, $data);
468 $calculator = $context->getSizeCalculator();
471 if ($this->
id !==
null) {
473 $size += $calculator->computeByteStreamSize($this->
id);
476 if ($this->body !==
null) {
478 $size += $calculator->computeStringSize($this->body);
481 if ($this->expiry !==
null) {
483 $size += $calculator->computeVarintSize($this->expiry);
486 if ($this->created !==
null) {
491 if ($this->sender !==
null) {
492 $innerSize = $this->sender->serializedSize($context);
496 $size += $calculator->computeVarintSize($innerSize);
500 $size += $this->
extensions->serializedSize($context);
524 throw new \InvalidArgumentException(sprintf(
'Argument 1 passed to %s must be a %s, %s given', __METHOD__, __CLASS__, get_class($message)));
527 $this->
id = ($message->id !==
null) ? $message->id :
$this->id;
528 $this->body = ($message->body !==
null) ? $message->body :
$this->body;
529 $this->expiry = ($message->expiry !==
null) ? $message->expiry :
$this->expiry;
530 $this->created = ($message->created !==
null) ? $message->created :
$this->created;
531 $this->sender = ($message->sender !==
null) ? $message->sender :
$this->sender;