199 return \google\protobuf\DescriptorProto::fromArray([
200 'name' =>
'ChannelId',
202 \google\protobuf\FieldDescriptorProto::fromArray([
206 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()
208 \google\protobuf\FieldDescriptorProto::fromArray([
210 'name' =>
'isPrivate',
211 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_BOOL(),
212 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()
214 \google\protobuf\FieldDescriptorProto::fromArray([
216 'name' =>
'signature',
218 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()
242 public function writeTo(\Protobuf\WriteContext $context)
244 $stream = $context->getStream();
245 $writer = $context->getWriter();
246 $sizeContext = $context->getComputeSizeContext();
248 if ($this->
id !==
null) {
249 $writer->writeVarint($stream, 10);
250 $writer->writeByteStream($stream, $this->
id);
253 if ($this->isPrivate !==
null) {
254 $writer->writeVarint($stream, 16);
255 $writer->writeBool($stream, $this->isPrivate);
258 if ($this->signature !==
null) {
259 $writer->writeVarint($stream, 26);
260 $writer->writeByteStream($stream, $this->signature);
273 public function readFrom(\Protobuf\ReadContext $context)
275 $reader = $context->getReader();
276 $length = $context->getLength();
277 $stream = $context->getStream();
279 $limit = ($length !==
null)
280 ? ($stream->tell() + $length)
283 while ($limit ===
null || $stream->tell() < $limit) {
285 if ($stream->eof()) {
289 $key = $reader->readVarint($stream);
290 $wire = \Protobuf\WireFormat::getTagWireType($key);
291 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);
293 if ($stream->eof()) {
298 \Protobuf\WireFormat::assertWireType($wire, 12);
300 $this->
id = $reader->readByteStream($stream);
306 \Protobuf\WireFormat::assertWireType($wire, 8);
308 $this->isPrivate = $reader->readBool($stream);
314 \Protobuf\WireFormat::assertWireType($wire, 12);
316 $this->signature = $reader->readByteStream($stream);
324 if ($extension !==
null) {
325 $this->
extensions()->add($extension, $extension->readFrom($context, $wire));
334 $data = $reader->readUnknown($stream, $wire);
335 $unknown = new \Protobuf\Unknown($tag, $wire, $data);
347 $calculator = $context->getSizeCalculator();
350 if ($this->
id !==
null) {
352 $size += $calculator->computeByteStreamSize($this->
id);
355 if ($this->isPrivate !==
null) {
360 if ($this->signature !==
null) {
362 $size += $calculator->computeByteStreamSize($this->signature);
366 $size += $this->
extensions->serializedSize($context);
388 throw new \InvalidArgumentException(sprintf(
'Argument 1 passed to %s must be a %s, %s given', __METHOD__, __CLASS__, get_class($message)));
391 $this->
id = ($message->id !==
null) ? $message->id :
$this->id;
392 $this->isPrivate = ($message->isPrivate !==
null) ? $message->isPrivate :
$this->isPrivate;
393 $this->signature = ($message->signature !==
null) ? $message->signature :
$this->signature;