113 return \google\protobuf\DescriptorProto::fromArray([
114 'name' =>
'JsonResponse',
116 \google\protobuf\FieldDescriptorProto::fromArray([
119 'type' => \google\protobuf\FieldDescriptorProto\Type::TYPE_STRING(),
120 'label' => \google\protobuf\FieldDescriptorProto\Label::LABEL_OPTIONAL()
144 public function writeTo(\Protobuf\WriteContext $context)
146 $stream = $context->getStream();
147 $writer = $context->getWriter();
148 $sizeContext = $context->getComputeSizeContext();
150 if ($this->json !==
null) {
151 $writer->writeVarint($stream, 10);
152 $writer->writeString($stream, $this->json);
165 public function readFrom(\Protobuf\ReadContext $context)
167 $reader = $context->getReader();
168 $length = $context->getLength();
169 $stream = $context->getStream();
171 $limit = ($length !==
null)
172 ? ($stream->tell() + $length)
175 while ($limit ===
null || $stream->tell() < $limit) {
177 if ($stream->eof()) {
181 $key = $reader->readVarint($stream);
182 $wire = \Protobuf\WireFormat::getTagWireType($key);
183 $tag = \Protobuf\WireFormat::getTagFieldNumber($key);
185 if ($stream->eof()) {
190 \Protobuf\WireFormat::assertWireType($wire, 9);
192 $this->json = $reader->readString($stream);
200 if ($extension !==
null) {
201 $this->
extensions()->add($extension, $extension->readFrom($context, $wire));
210 $data = $reader->readUnknown($stream, $wire);
211 $unknown = new \Protobuf\Unknown($tag, $wire, $data);