App Engine Python SDK version 1.9.9
[gae.git] / python / php / sdk / google / appengine / datastore / datastore_v4_pb.php
blobfe8f371bffc5b74355b9be27af7efe1d75bbd541
1 <?php
2 /**
3 * Copyright 2007 Google Inc.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 # Generated by the protocol buffer compiler. DO NOT EDIT!
18 # source: google/appengine/datastore/datastore_v4.proto
20 namespace dummy {
21 require_once 'google/appengine/runtime/proto/ProtocolMessage.php';
22 require_once 'google/appengine/datastore/entity_v4_pb.php';
24 namespace google\appengine\datastore\v4\Error {
25 class ErrorCode {
26 const BAD_REQUEST = 1;
27 const CONCURRENT_TRANSACTION = 2;
28 const INTERNAL_ERROR = 3;
29 const NEED_INDEX = 4;
30 const TIMEOUT = 5;
31 const PERMISSION_DENIED = 6;
32 const BIGTABLE_ERROR = 7;
33 const COMMITTED_BUT_STILL_APPLYING = 8;
34 const CAPABILITY_DISABLED = 9;
35 const TRY_ALTERNATE_BACKEND = 10;
36 const SAFE_TIME_TOO_OLD = 11;
39 namespace google\appengine\datastore\v4 {
40 class Error extends \google\net\ProtocolMessage {
41 public function clear() {
43 public function byteSizePartial() {
44 $res = 0;
45 return $res;
47 public function outputPartial($out) {
49 public function tryMerge($d) {
50 while($d->avail() > 0) {
51 $tt = $d->getVarInt32();
52 switch ($tt) {
53 case 0:
54 throw new \google\net\ProtocolBufferDecodeError();
55 break;
56 default:
57 $d->skipData($tt);
61 public function checkInitialized() {
62 return null;
64 public function mergeFrom($x) {
65 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
67 public function equals($x) {
68 if ($x === $this) { return true; }
69 return true;
71 public function shortDebugString($prefix = "") {
72 $res = '';
73 return $res;
77 namespace google\appengine\datastore\v4\EntityResult {
78 class ResultType {
79 const FULL = 1;
80 const PROJECTION = 2;
81 const KEY_ONLY = 3;
84 namespace google\appengine\datastore\v4 {
85 class EntityResult extends \google\net\ProtocolMessage {
86 public function getEntity() {
87 if (!isset($this->entity)) {
88 return new \google\appengine\datastore\v4\Entity();
90 return $this->entity;
92 public function mutableEntity() {
93 if (!isset($this->entity)) {
94 $res = new \google\appengine\datastore\v4\Entity();
95 $this->entity = $res;
96 return $res;
98 return $this->entity;
100 public function clearEntity() {
101 if (isset($this->entity)) {
102 unset($this->entity);
105 public function hasEntity() {
106 return isset($this->entity);
108 public function getVersion() {
109 if (!isset($this->version)) {
110 return "0";
112 return $this->version;
114 public function setVersion($val) {
115 if (is_double($val)) {
116 $this->version = sprintf('%0.0F', $val);
117 } else {
118 $this->version = $val;
120 return $this;
122 public function clearVersion() {
123 unset($this->version);
124 return $this;
126 public function hasVersion() {
127 return isset($this->version);
129 public function clear() {
130 $this->clearEntity();
131 $this->clearVersion();
133 public function byteSizePartial() {
134 $res = 0;
135 if (isset($this->entity)) {
136 $res += 1;
137 $res += $this->lengthString($this->entity->byteSizePartial());
139 if (isset($this->version)) {
140 $res += 1;
141 $res += $this->lengthVarInt64($this->version);
143 return $res;
145 public function outputPartial($out) {
146 if (isset($this->entity)) {
147 $out->putVarInt32(10);
148 $out->putVarInt32($this->entity->byteSizePartial());
149 $this->entity->outputPartial($out);
151 if (isset($this->version)) {
152 $out->putVarInt32(16);
153 $out->putVarInt64($this->version);
156 public function tryMerge($d) {
157 while($d->avail() > 0) {
158 $tt = $d->getVarInt32();
159 switch ($tt) {
160 case 10:
161 $length = $d->getVarInt32();
162 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
163 $d->skip($length);
164 $this->mutableEntity()->tryMerge($tmp);
165 break;
166 case 16:
167 $this->setVersion($d->getVarInt64());
168 break;
169 case 0:
170 throw new \google\net\ProtocolBufferDecodeError();
171 break;
172 default:
173 $d->skipData($tt);
177 public function checkInitialized() {
178 if ((!isset($this->entity)) || (!$this->entity->isInitialized())) return 'entity';
179 return null;
181 public function mergeFrom($x) {
182 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
183 if ($x->hasEntity()) {
184 $this->mutableEntity()->mergeFrom($x->getEntity());
186 if ($x->hasVersion()) {
187 $this->setVersion($x->getVersion());
190 public function equals($x) {
191 if ($x === $this) { return true; }
192 if (isset($this->entity) !== isset($x->entity)) return false;
193 if (isset($this->entity) && !$this->entity->equals($x->entity)) return false;
194 if (isset($this->version) !== isset($x->version)) return false;
195 if (isset($this->version) && !$this->integerEquals($this->version, $x->version)) return false;
196 return true;
198 public function shortDebugString($prefix = "") {
199 $res = '';
200 if (isset($this->entity)) {
201 $res .= $prefix . "entity <\n" . $this->entity->shortDebugString($prefix . " ") . $prefix . ">\n";
203 if (isset($this->version)) {
204 $res .= $prefix . "version: " . $this->debugFormatInt64($this->version) . "\n";
206 return $res;
210 namespace google\appengine\datastore\v4 {
211 class Query extends \google\net\ProtocolMessage {
212 private $projection = array();
213 private $kind = array();
214 private $order = array();
215 private $group_by = array();
216 public function getProjectionSize() {
217 return sizeof($this->projection);
219 public function getProjectionList() {
220 return $this->projection;
222 public function mutableProjection($idx) {
223 if (!isset($this->projection[$idx])) {
224 $val = new \google\appengine\datastore\v4\PropertyExpression();
225 $this->projection[$idx] = $val;
226 return $val;
228 return $this->projection[$idx];
230 public function getProjection($idx) {
231 if (isset($this->projection[$idx])) {
232 return $this->projection[$idx];
234 if ($idx >= end(array_keys($this->projection))) {
235 throw new \OutOfRangeException('index out of range: ' + $idx);
237 return new \google\appengine\datastore\v4\PropertyExpression();
239 public function addProjection() {
240 $val = new \google\appengine\datastore\v4\PropertyExpression();
241 $this->projection[] = $val;
242 return $val;
244 public function clearProjection() {
245 $this->projection = array();
247 public function getKindSize() {
248 return sizeof($this->kind);
250 public function getKindList() {
251 return $this->kind;
253 public function mutableKind($idx) {
254 if (!isset($this->kind[$idx])) {
255 $val = new \google\appengine\datastore\v4\KindExpression();
256 $this->kind[$idx] = $val;
257 return $val;
259 return $this->kind[$idx];
261 public function getKind($idx) {
262 if (isset($this->kind[$idx])) {
263 return $this->kind[$idx];
265 if ($idx >= end(array_keys($this->kind))) {
266 throw new \OutOfRangeException('index out of range: ' + $idx);
268 return new \google\appengine\datastore\v4\KindExpression();
270 public function addKind() {
271 $val = new \google\appengine\datastore\v4\KindExpression();
272 $this->kind[] = $val;
273 return $val;
275 public function clearKind() {
276 $this->kind = array();
278 public function getFilter() {
279 if (!isset($this->filter)) {
280 return new \google\appengine\datastore\v4\Filter();
282 return $this->filter;
284 public function mutableFilter() {
285 if (!isset($this->filter)) {
286 $res = new \google\appengine\datastore\v4\Filter();
287 $this->filter = $res;
288 return $res;
290 return $this->filter;
292 public function clearFilter() {
293 if (isset($this->filter)) {
294 unset($this->filter);
297 public function hasFilter() {
298 return isset($this->filter);
300 public function getOrderSize() {
301 return sizeof($this->order);
303 public function getOrderList() {
304 return $this->order;
306 public function mutableOrder($idx) {
307 if (!isset($this->order[$idx])) {
308 $val = new \google\appengine\datastore\v4\PropertyOrder();
309 $this->order[$idx] = $val;
310 return $val;
312 return $this->order[$idx];
314 public function getOrder($idx) {
315 if (isset($this->order[$idx])) {
316 return $this->order[$idx];
318 if ($idx >= end(array_keys($this->order))) {
319 throw new \OutOfRangeException('index out of range: ' + $idx);
321 return new \google\appengine\datastore\v4\PropertyOrder();
323 public function addOrder() {
324 $val = new \google\appengine\datastore\v4\PropertyOrder();
325 $this->order[] = $val;
326 return $val;
328 public function clearOrder() {
329 $this->order = array();
331 public function getGroupBySize() {
332 return sizeof($this->group_by);
334 public function getGroupByList() {
335 return $this->group_by;
337 public function mutableGroupBy($idx) {
338 if (!isset($this->group_by[$idx])) {
339 $val = new \google\appengine\datastore\v4\PropertyReference();
340 $this->group_by[$idx] = $val;
341 return $val;
343 return $this->group_by[$idx];
345 public function getGroupBy($idx) {
346 if (isset($this->group_by[$idx])) {
347 return $this->group_by[$idx];
349 if ($idx >= end(array_keys($this->group_by))) {
350 throw new \OutOfRangeException('index out of range: ' + $idx);
352 return new \google\appengine\datastore\v4\PropertyReference();
354 public function addGroupBy() {
355 $val = new \google\appengine\datastore\v4\PropertyReference();
356 $this->group_by[] = $val;
357 return $val;
359 public function clearGroupBy() {
360 $this->group_by = array();
362 public function getStartCursor() {
363 if (!isset($this->start_cursor)) {
364 return '';
366 return $this->start_cursor;
368 public function setStartCursor($val) {
369 $this->start_cursor = $val;
370 return $this;
372 public function clearStartCursor() {
373 unset($this->start_cursor);
374 return $this;
376 public function hasStartCursor() {
377 return isset($this->start_cursor);
379 public function getEndCursor() {
380 if (!isset($this->end_cursor)) {
381 return '';
383 return $this->end_cursor;
385 public function setEndCursor($val) {
386 $this->end_cursor = $val;
387 return $this;
389 public function clearEndCursor() {
390 unset($this->end_cursor);
391 return $this;
393 public function hasEndCursor() {
394 return isset($this->end_cursor);
396 public function getOffset() {
397 if (!isset($this->offset)) {
398 return 0;
400 return $this->offset;
402 public function setOffset($val) {
403 $this->offset = $val;
404 return $this;
406 public function clearOffset() {
407 unset($this->offset);
408 return $this;
410 public function hasOffset() {
411 return isset($this->offset);
413 public function getLimit() {
414 if (!isset($this->limit)) {
415 return 0;
417 return $this->limit;
419 public function setLimit($val) {
420 $this->limit = $val;
421 return $this;
423 public function clearLimit() {
424 unset($this->limit);
425 return $this;
427 public function hasLimit() {
428 return isset($this->limit);
430 public function clear() {
431 $this->clearProjection();
432 $this->clearKind();
433 $this->clearFilter();
434 $this->clearOrder();
435 $this->clearGroupBy();
436 $this->clearStartCursor();
437 $this->clearEndCursor();
438 $this->clearOffset();
439 $this->clearLimit();
441 public function byteSizePartial() {
442 $res = 0;
443 $this->checkProtoArray($this->projection);
444 $res += 1 * sizeof($this->projection);
445 foreach ($this->projection as $value) {
446 $res += $this->lengthString($value->byteSizePartial());
448 $this->checkProtoArray($this->kind);
449 $res += 1 * sizeof($this->kind);
450 foreach ($this->kind as $value) {
451 $res += $this->lengthString($value->byteSizePartial());
453 if (isset($this->filter)) {
454 $res += 1;
455 $res += $this->lengthString($this->filter->byteSizePartial());
457 $this->checkProtoArray($this->order);
458 $res += 1 * sizeof($this->order);
459 foreach ($this->order as $value) {
460 $res += $this->lengthString($value->byteSizePartial());
462 $this->checkProtoArray($this->group_by);
463 $res += 1 * sizeof($this->group_by);
464 foreach ($this->group_by as $value) {
465 $res += $this->lengthString($value->byteSizePartial());
467 if (isset($this->start_cursor)) {
468 $res += 1;
469 $res += $this->lengthString(strlen($this->start_cursor));
471 if (isset($this->end_cursor)) {
472 $res += 1;
473 $res += $this->lengthString(strlen($this->end_cursor));
475 if (isset($this->offset)) {
476 $res += 1;
477 $res += $this->lengthVarInt64($this->offset);
479 if (isset($this->limit)) {
480 $res += 1;
481 $res += $this->lengthVarInt64($this->limit);
483 return $res;
485 public function outputPartial($out) {
486 $this->checkProtoArray($this->projection);
487 foreach ($this->projection as $value) {
488 $out->putVarInt32(18);
489 $out->putVarInt32($value->byteSizePartial());
490 $value->outputPartial($out);
492 $this->checkProtoArray($this->kind);
493 foreach ($this->kind as $value) {
494 $out->putVarInt32(26);
495 $out->putVarInt32($value->byteSizePartial());
496 $value->outputPartial($out);
498 if (isset($this->filter)) {
499 $out->putVarInt32(34);
500 $out->putVarInt32($this->filter->byteSizePartial());
501 $this->filter->outputPartial($out);
503 $this->checkProtoArray($this->order);
504 foreach ($this->order as $value) {
505 $out->putVarInt32(42);
506 $out->putVarInt32($value->byteSizePartial());
507 $value->outputPartial($out);
509 $this->checkProtoArray($this->group_by);
510 foreach ($this->group_by as $value) {
511 $out->putVarInt32(50);
512 $out->putVarInt32($value->byteSizePartial());
513 $value->outputPartial($out);
515 if (isset($this->start_cursor)) {
516 $out->putVarInt32(58);
517 $out->putPrefixedString($this->start_cursor);
519 if (isset($this->end_cursor)) {
520 $out->putVarInt32(66);
521 $out->putPrefixedString($this->end_cursor);
523 if (isset($this->offset)) {
524 $out->putVarInt32(80);
525 $out->putVarInt32($this->offset);
527 if (isset($this->limit)) {
528 $out->putVarInt32(88);
529 $out->putVarInt32($this->limit);
532 public function tryMerge($d) {
533 while($d->avail() > 0) {
534 $tt = $d->getVarInt32();
535 switch ($tt) {
536 case 18:
537 $length = $d->getVarInt32();
538 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
539 $d->skip($length);
540 $this->addProjection()->tryMerge($tmp);
541 break;
542 case 26:
543 $length = $d->getVarInt32();
544 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
545 $d->skip($length);
546 $this->addKind()->tryMerge($tmp);
547 break;
548 case 34:
549 $length = $d->getVarInt32();
550 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
551 $d->skip($length);
552 $this->mutableFilter()->tryMerge($tmp);
553 break;
554 case 42:
555 $length = $d->getVarInt32();
556 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
557 $d->skip($length);
558 $this->addOrder()->tryMerge($tmp);
559 break;
560 case 50:
561 $length = $d->getVarInt32();
562 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
563 $d->skip($length);
564 $this->addGroupBy()->tryMerge($tmp);
565 break;
566 case 58:
567 $length = $d->getVarInt32();
568 $this->setStartCursor(substr($d->buffer(), $d->pos(), $length));
569 $d->skip($length);
570 break;
571 case 66:
572 $length = $d->getVarInt32();
573 $this->setEndCursor(substr($d->buffer(), $d->pos(), $length));
574 $d->skip($length);
575 break;
576 case 80:
577 $this->setOffset($d->getVarInt32());
578 break;
579 case 88:
580 $this->setLimit($d->getVarInt32());
581 break;
582 case 0:
583 throw new \google\net\ProtocolBufferDecodeError();
584 break;
585 default:
586 $d->skipData($tt);
590 public function checkInitialized() {
591 foreach ($this->projection as $value) {
592 if (!$value->isInitialized()) return 'projection';
594 foreach ($this->kind as $value) {
595 if (!$value->isInitialized()) return 'kind';
597 if (isset($this->filter) && (!$this->filter->isInitialized())) return 'filter';
598 foreach ($this->order as $value) {
599 if (!$value->isInitialized()) return 'order';
601 foreach ($this->group_by as $value) {
602 if (!$value->isInitialized()) return 'group_by';
604 return null;
606 public function mergeFrom($x) {
607 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
608 foreach ($x->getProjectionList() as $v) {
609 $this->addProjection()->copyFrom($v);
611 foreach ($x->getKindList() as $v) {
612 $this->addKind()->copyFrom($v);
614 if ($x->hasFilter()) {
615 $this->mutableFilter()->mergeFrom($x->getFilter());
617 foreach ($x->getOrderList() as $v) {
618 $this->addOrder()->copyFrom($v);
620 foreach ($x->getGroupByList() as $v) {
621 $this->addGroupBy()->copyFrom($v);
623 if ($x->hasStartCursor()) {
624 $this->setStartCursor($x->getStartCursor());
626 if ($x->hasEndCursor()) {
627 $this->setEndCursor($x->getEndCursor());
629 if ($x->hasOffset()) {
630 $this->setOffset($x->getOffset());
632 if ($x->hasLimit()) {
633 $this->setLimit($x->getLimit());
636 public function equals($x) {
637 if ($x === $this) { return true; }
638 if (sizeof($this->projection) !== sizeof($x->projection)) return false;
639 foreach (array_map(null, $this->projection, $x->projection) as $v) {
640 if (!$v[0]->equals($v[1])) return false;
642 if (sizeof($this->kind) !== sizeof($x->kind)) return false;
643 foreach (array_map(null, $this->kind, $x->kind) as $v) {
644 if (!$v[0]->equals($v[1])) return false;
646 if (isset($this->filter) !== isset($x->filter)) return false;
647 if (isset($this->filter) && !$this->filter->equals($x->filter)) return false;
648 if (sizeof($this->order) !== sizeof($x->order)) return false;
649 foreach (array_map(null, $this->order, $x->order) as $v) {
650 if (!$v[0]->equals($v[1])) return false;
652 if (sizeof($this->group_by) !== sizeof($x->group_by)) return false;
653 foreach (array_map(null, $this->group_by, $x->group_by) as $v) {
654 if (!$v[0]->equals($v[1])) return false;
656 if (isset($this->start_cursor) !== isset($x->start_cursor)) return false;
657 if (isset($this->start_cursor) && $this->start_cursor !== $x->start_cursor) return false;
658 if (isset($this->end_cursor) !== isset($x->end_cursor)) return false;
659 if (isset($this->end_cursor) && $this->end_cursor !== $x->end_cursor) return false;
660 if (isset($this->offset) !== isset($x->offset)) return false;
661 if (isset($this->offset) && !$this->integerEquals($this->offset, $x->offset)) return false;
662 if (isset($this->limit) !== isset($x->limit)) return false;
663 if (isset($this->limit) && !$this->integerEquals($this->limit, $x->limit)) return false;
664 return true;
666 public function shortDebugString($prefix = "") {
667 $res = '';
668 foreach ($this->projection as $value) {
669 $res .= $prefix . "projection <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
671 foreach ($this->kind as $value) {
672 $res .= $prefix . "kind <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
674 if (isset($this->filter)) {
675 $res .= $prefix . "filter <\n" . $this->filter->shortDebugString($prefix . " ") . $prefix . ">\n";
677 foreach ($this->order as $value) {
678 $res .= $prefix . "order <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
680 foreach ($this->group_by as $value) {
681 $res .= $prefix . "group_by <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
683 if (isset($this->start_cursor)) {
684 $res .= $prefix . "start_cursor: " . $this->debugFormatString($this->start_cursor) . "\n";
686 if (isset($this->end_cursor)) {
687 $res .= $prefix . "end_cursor: " . $this->debugFormatString($this->end_cursor) . "\n";
689 if (isset($this->offset)) {
690 $res .= $prefix . "offset: " . $this->debugFormatInt32($this->offset) . "\n";
692 if (isset($this->limit)) {
693 $res .= $prefix . "limit: " . $this->debugFormatInt32($this->limit) . "\n";
695 return $res;
699 namespace google\appengine\datastore\v4 {
700 class KindExpression extends \google\net\ProtocolMessage {
701 public function getName() {
702 if (!isset($this->name)) {
703 return '';
705 return $this->name;
707 public function setName($val) {
708 $this->name = $val;
709 return $this;
711 public function clearName() {
712 unset($this->name);
713 return $this;
715 public function hasName() {
716 return isset($this->name);
718 public function clear() {
719 $this->clearName();
721 public function byteSizePartial() {
722 $res = 0;
723 if (isset($this->name)) {
724 $res += 1;
725 $res += $this->lengthString(strlen($this->name));
727 return $res;
729 public function outputPartial($out) {
730 if (isset($this->name)) {
731 $out->putVarInt32(10);
732 $out->putPrefixedString($this->name);
735 public function tryMerge($d) {
736 while($d->avail() > 0) {
737 $tt = $d->getVarInt32();
738 switch ($tt) {
739 case 10:
740 $length = $d->getVarInt32();
741 $this->setName(substr($d->buffer(), $d->pos(), $length));
742 $d->skip($length);
743 break;
744 case 0:
745 throw new \google\net\ProtocolBufferDecodeError();
746 break;
747 default:
748 $d->skipData($tt);
752 public function checkInitialized() {
753 if (!isset($this->name)) return 'name';
754 return null;
756 public function mergeFrom($x) {
757 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
758 if ($x->hasName()) {
759 $this->setName($x->getName());
762 public function equals($x) {
763 if ($x === $this) { return true; }
764 if (isset($this->name) !== isset($x->name)) return false;
765 if (isset($this->name) && $this->name !== $x->name) return false;
766 return true;
768 public function shortDebugString($prefix = "") {
769 $res = '';
770 if (isset($this->name)) {
771 $res .= $prefix . "name: " . $this->debugFormatString($this->name) . "\n";
773 return $res;
777 namespace google\appengine\datastore\v4 {
778 class PropertyReference extends \google\net\ProtocolMessage {
779 public function getName() {
780 if (!isset($this->name)) {
781 return '';
783 return $this->name;
785 public function setName($val) {
786 $this->name = $val;
787 return $this;
789 public function clearName() {
790 unset($this->name);
791 return $this;
793 public function hasName() {
794 return isset($this->name);
796 public function clear() {
797 $this->clearName();
799 public function byteSizePartial() {
800 $res = 0;
801 if (isset($this->name)) {
802 $res += 1;
803 $res += $this->lengthString(strlen($this->name));
805 return $res;
807 public function outputPartial($out) {
808 if (isset($this->name)) {
809 $out->putVarInt32(18);
810 $out->putPrefixedString($this->name);
813 public function tryMerge($d) {
814 while($d->avail() > 0) {
815 $tt = $d->getVarInt32();
816 switch ($tt) {
817 case 18:
818 $length = $d->getVarInt32();
819 $this->setName(substr($d->buffer(), $d->pos(), $length));
820 $d->skip($length);
821 break;
822 case 0:
823 throw new \google\net\ProtocolBufferDecodeError();
824 break;
825 default:
826 $d->skipData($tt);
830 public function checkInitialized() {
831 if (!isset($this->name)) return 'name';
832 return null;
834 public function mergeFrom($x) {
835 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
836 if ($x->hasName()) {
837 $this->setName($x->getName());
840 public function equals($x) {
841 if ($x === $this) { return true; }
842 if (isset($this->name) !== isset($x->name)) return false;
843 if (isset($this->name) && $this->name !== $x->name) return false;
844 return true;
846 public function shortDebugString($prefix = "") {
847 $res = '';
848 if (isset($this->name)) {
849 $res .= $prefix . "name: " . $this->debugFormatString($this->name) . "\n";
851 return $res;
855 namespace google\appengine\datastore\v4\PropertyExpression {
856 class AggregationFunction {
857 const FIRST = 1;
860 namespace google\appengine\datastore\v4 {
861 class PropertyExpression extends \google\net\ProtocolMessage {
862 public function getProperty() {
863 if (!isset($this->property)) {
864 return new \google\appengine\datastore\v4\PropertyReference();
866 return $this->property;
868 public function mutableProperty() {
869 if (!isset($this->property)) {
870 $res = new \google\appengine\datastore\v4\PropertyReference();
871 $this->property = $res;
872 return $res;
874 return $this->property;
876 public function clearProperty() {
877 if (isset($this->property)) {
878 unset($this->property);
881 public function hasProperty() {
882 return isset($this->property);
884 public function getAggregationFunction() {
885 if (!isset($this->aggregation_function)) {
886 return 1;
888 return $this->aggregation_function;
890 public function setAggregationFunction($val) {
891 $this->aggregation_function = $val;
892 return $this;
894 public function clearAggregationFunction() {
895 unset($this->aggregation_function);
896 return $this;
898 public function hasAggregationFunction() {
899 return isset($this->aggregation_function);
901 public function clear() {
902 $this->clearProperty();
903 $this->clearAggregationFunction();
905 public function byteSizePartial() {
906 $res = 0;
907 if (isset($this->property)) {
908 $res += 1;
909 $res += $this->lengthString($this->property->byteSizePartial());
911 if (isset($this->aggregation_function)) {
912 $res += 1;
913 $res += $this->lengthVarInt64($this->aggregation_function);
915 return $res;
917 public function outputPartial($out) {
918 if (isset($this->property)) {
919 $out->putVarInt32(10);
920 $out->putVarInt32($this->property->byteSizePartial());
921 $this->property->outputPartial($out);
923 if (isset($this->aggregation_function)) {
924 $out->putVarInt32(16);
925 $out->putVarInt32($this->aggregation_function);
928 public function tryMerge($d) {
929 while($d->avail() > 0) {
930 $tt = $d->getVarInt32();
931 switch ($tt) {
932 case 10:
933 $length = $d->getVarInt32();
934 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
935 $d->skip($length);
936 $this->mutableProperty()->tryMerge($tmp);
937 break;
938 case 16:
939 $this->setAggregationFunction($d->getVarInt32());
940 break;
941 case 0:
942 throw new \google\net\ProtocolBufferDecodeError();
943 break;
944 default:
945 $d->skipData($tt);
949 public function checkInitialized() {
950 if ((!isset($this->property)) || (!$this->property->isInitialized())) return 'property';
951 return null;
953 public function mergeFrom($x) {
954 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
955 if ($x->hasProperty()) {
956 $this->mutableProperty()->mergeFrom($x->getProperty());
958 if ($x->hasAggregationFunction()) {
959 $this->setAggregationFunction($x->getAggregationFunction());
962 public function equals($x) {
963 if ($x === $this) { return true; }
964 if (isset($this->property) !== isset($x->property)) return false;
965 if (isset($this->property) && !$this->property->equals($x->property)) return false;
966 if (isset($this->aggregation_function) !== isset($x->aggregation_function)) return false;
967 if (isset($this->aggregation_function) && $this->aggregation_function !== $x->aggregation_function) return false;
968 return true;
970 public function shortDebugString($prefix = "") {
971 $res = '';
972 if (isset($this->property)) {
973 $res .= $prefix . "property <\n" . $this->property->shortDebugString($prefix . " ") . $prefix . ">\n";
975 if (isset($this->aggregation_function)) {
976 $res .= $prefix . "aggregation_function: " . ($this->aggregation_function) . "\n";
978 return $res;
982 namespace google\appengine\datastore\v4\PropertyOrder {
983 class Direction {
984 const ASCENDING = 1;
985 const DESCENDING = 2;
988 namespace google\appengine\datastore\v4 {
989 class PropertyOrder extends \google\net\ProtocolMessage {
990 public function getProperty() {
991 if (!isset($this->property)) {
992 return new \google\appengine\datastore\v4\PropertyReference();
994 return $this->property;
996 public function mutableProperty() {
997 if (!isset($this->property)) {
998 $res = new \google\appengine\datastore\v4\PropertyReference();
999 $this->property = $res;
1000 return $res;
1002 return $this->property;
1004 public function clearProperty() {
1005 if (isset($this->property)) {
1006 unset($this->property);
1009 public function hasProperty() {
1010 return isset($this->property);
1012 public function getDirection() {
1013 if (!isset($this->direction)) {
1014 return 1;
1016 return $this->direction;
1018 public function setDirection($val) {
1019 $this->direction = $val;
1020 return $this;
1022 public function clearDirection() {
1023 unset($this->direction);
1024 return $this;
1026 public function hasDirection() {
1027 return isset($this->direction);
1029 public function clear() {
1030 $this->clearProperty();
1031 $this->clearDirection();
1033 public function byteSizePartial() {
1034 $res = 0;
1035 if (isset($this->property)) {
1036 $res += 1;
1037 $res += $this->lengthString($this->property->byteSizePartial());
1039 if (isset($this->direction)) {
1040 $res += 1;
1041 $res += $this->lengthVarInt64($this->direction);
1043 return $res;
1045 public function outputPartial($out) {
1046 if (isset($this->property)) {
1047 $out->putVarInt32(10);
1048 $out->putVarInt32($this->property->byteSizePartial());
1049 $this->property->outputPartial($out);
1051 if (isset($this->direction)) {
1052 $out->putVarInt32(16);
1053 $out->putVarInt32($this->direction);
1056 public function tryMerge($d) {
1057 while($d->avail() > 0) {
1058 $tt = $d->getVarInt32();
1059 switch ($tt) {
1060 case 10:
1061 $length = $d->getVarInt32();
1062 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1063 $d->skip($length);
1064 $this->mutableProperty()->tryMerge($tmp);
1065 break;
1066 case 16:
1067 $this->setDirection($d->getVarInt32());
1068 break;
1069 case 0:
1070 throw new \google\net\ProtocolBufferDecodeError();
1071 break;
1072 default:
1073 $d->skipData($tt);
1077 public function checkInitialized() {
1078 if ((!isset($this->property)) || (!$this->property->isInitialized())) return 'property';
1079 return null;
1081 public function mergeFrom($x) {
1082 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
1083 if ($x->hasProperty()) {
1084 $this->mutableProperty()->mergeFrom($x->getProperty());
1086 if ($x->hasDirection()) {
1087 $this->setDirection($x->getDirection());
1090 public function equals($x) {
1091 if ($x === $this) { return true; }
1092 if (isset($this->property) !== isset($x->property)) return false;
1093 if (isset($this->property) && !$this->property->equals($x->property)) return false;
1094 if (isset($this->direction) !== isset($x->direction)) return false;
1095 if (isset($this->direction) && $this->direction !== $x->direction) return false;
1096 return true;
1098 public function shortDebugString($prefix = "") {
1099 $res = '';
1100 if (isset($this->property)) {
1101 $res .= $prefix . "property <\n" . $this->property->shortDebugString($prefix . " ") . $prefix . ">\n";
1103 if (isset($this->direction)) {
1104 $res .= $prefix . "direction: " . ($this->direction) . "\n";
1106 return $res;
1110 namespace google\appengine\datastore\v4 {
1111 class Filter extends \google\net\ProtocolMessage {
1112 public function getCompositeFilter() {
1113 if (!isset($this->composite_filter)) {
1114 return new \google\appengine\datastore\v4\CompositeFilter();
1116 return $this->composite_filter;
1118 public function mutableCompositeFilter() {
1119 if (!isset($this->composite_filter)) {
1120 $res = new \google\appengine\datastore\v4\CompositeFilter();
1121 $this->composite_filter = $res;
1122 return $res;
1124 return $this->composite_filter;
1126 public function clearCompositeFilter() {
1127 if (isset($this->composite_filter)) {
1128 unset($this->composite_filter);
1131 public function hasCompositeFilter() {
1132 return isset($this->composite_filter);
1134 public function getPropertyFilter() {
1135 if (!isset($this->property_filter)) {
1136 return new \google\appengine\datastore\v4\PropertyFilter();
1138 return $this->property_filter;
1140 public function mutablePropertyFilter() {
1141 if (!isset($this->property_filter)) {
1142 $res = new \google\appengine\datastore\v4\PropertyFilter();
1143 $this->property_filter = $res;
1144 return $res;
1146 return $this->property_filter;
1148 public function clearPropertyFilter() {
1149 if (isset($this->property_filter)) {
1150 unset($this->property_filter);
1153 public function hasPropertyFilter() {
1154 return isset($this->property_filter);
1156 public function getBoundingCircleFilter() {
1157 if (!isset($this->bounding_circle_filter)) {
1158 return new \google\appengine\datastore\v4\BoundingCircleFilter();
1160 return $this->bounding_circle_filter;
1162 public function mutableBoundingCircleFilter() {
1163 if (!isset($this->bounding_circle_filter)) {
1164 $res = new \google\appengine\datastore\v4\BoundingCircleFilter();
1165 $this->bounding_circle_filter = $res;
1166 return $res;
1168 return $this->bounding_circle_filter;
1170 public function clearBoundingCircleFilter() {
1171 if (isset($this->bounding_circle_filter)) {
1172 unset($this->bounding_circle_filter);
1175 public function hasBoundingCircleFilter() {
1176 return isset($this->bounding_circle_filter);
1178 public function getBoundingBoxFilter() {
1179 if (!isset($this->bounding_box_filter)) {
1180 return new \google\appengine\datastore\v4\BoundingBoxFilter();
1182 return $this->bounding_box_filter;
1184 public function mutableBoundingBoxFilter() {
1185 if (!isset($this->bounding_box_filter)) {
1186 $res = new \google\appengine\datastore\v4\BoundingBoxFilter();
1187 $this->bounding_box_filter = $res;
1188 return $res;
1190 return $this->bounding_box_filter;
1192 public function clearBoundingBoxFilter() {
1193 if (isset($this->bounding_box_filter)) {
1194 unset($this->bounding_box_filter);
1197 public function hasBoundingBoxFilter() {
1198 return isset($this->bounding_box_filter);
1200 public function clear() {
1201 $this->clearCompositeFilter();
1202 $this->clearPropertyFilter();
1203 $this->clearBoundingCircleFilter();
1204 $this->clearBoundingBoxFilter();
1206 public function byteSizePartial() {
1207 $res = 0;
1208 if (isset($this->composite_filter)) {
1209 $res += 1;
1210 $res += $this->lengthString($this->composite_filter->byteSizePartial());
1212 if (isset($this->property_filter)) {
1213 $res += 1;
1214 $res += $this->lengthString($this->property_filter->byteSizePartial());
1216 if (isset($this->bounding_circle_filter)) {
1217 $res += 1;
1218 $res += $this->lengthString($this->bounding_circle_filter->byteSizePartial());
1220 if (isset($this->bounding_box_filter)) {
1221 $res += 1;
1222 $res += $this->lengthString($this->bounding_box_filter->byteSizePartial());
1224 return $res;
1226 public function outputPartial($out) {
1227 if (isset($this->composite_filter)) {
1228 $out->putVarInt32(10);
1229 $out->putVarInt32($this->composite_filter->byteSizePartial());
1230 $this->composite_filter->outputPartial($out);
1232 if (isset($this->property_filter)) {
1233 $out->putVarInt32(18);
1234 $out->putVarInt32($this->property_filter->byteSizePartial());
1235 $this->property_filter->outputPartial($out);
1237 if (isset($this->bounding_circle_filter)) {
1238 $out->putVarInt32(26);
1239 $out->putVarInt32($this->bounding_circle_filter->byteSizePartial());
1240 $this->bounding_circle_filter->outputPartial($out);
1242 if (isset($this->bounding_box_filter)) {
1243 $out->putVarInt32(34);
1244 $out->putVarInt32($this->bounding_box_filter->byteSizePartial());
1245 $this->bounding_box_filter->outputPartial($out);
1248 public function tryMerge($d) {
1249 while($d->avail() > 0) {
1250 $tt = $d->getVarInt32();
1251 switch ($tt) {
1252 case 10:
1253 $length = $d->getVarInt32();
1254 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1255 $d->skip($length);
1256 $this->mutableCompositeFilter()->tryMerge($tmp);
1257 break;
1258 case 18:
1259 $length = $d->getVarInt32();
1260 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1261 $d->skip($length);
1262 $this->mutablePropertyFilter()->tryMerge($tmp);
1263 break;
1264 case 26:
1265 $length = $d->getVarInt32();
1266 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1267 $d->skip($length);
1268 $this->mutableBoundingCircleFilter()->tryMerge($tmp);
1269 break;
1270 case 34:
1271 $length = $d->getVarInt32();
1272 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1273 $d->skip($length);
1274 $this->mutableBoundingBoxFilter()->tryMerge($tmp);
1275 break;
1276 case 0:
1277 throw new \google\net\ProtocolBufferDecodeError();
1278 break;
1279 default:
1280 $d->skipData($tt);
1284 public function checkInitialized() {
1285 if (isset($this->composite_filter) && (!$this->composite_filter->isInitialized())) return 'composite_filter';
1286 if (isset($this->property_filter) && (!$this->property_filter->isInitialized())) return 'property_filter';
1287 if (isset($this->bounding_circle_filter) && (!$this->bounding_circle_filter->isInitialized())) return 'bounding_circle_filter';
1288 if (isset($this->bounding_box_filter) && (!$this->bounding_box_filter->isInitialized())) return 'bounding_box_filter';
1289 return null;
1291 public function mergeFrom($x) {
1292 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
1293 if ($x->hasCompositeFilter()) {
1294 $this->mutableCompositeFilter()->mergeFrom($x->getCompositeFilter());
1296 if ($x->hasPropertyFilter()) {
1297 $this->mutablePropertyFilter()->mergeFrom($x->getPropertyFilter());
1299 if ($x->hasBoundingCircleFilter()) {
1300 $this->mutableBoundingCircleFilter()->mergeFrom($x->getBoundingCircleFilter());
1302 if ($x->hasBoundingBoxFilter()) {
1303 $this->mutableBoundingBoxFilter()->mergeFrom($x->getBoundingBoxFilter());
1306 public function equals($x) {
1307 if ($x === $this) { return true; }
1308 if (isset($this->composite_filter) !== isset($x->composite_filter)) return false;
1309 if (isset($this->composite_filter) && !$this->composite_filter->equals($x->composite_filter)) return false;
1310 if (isset($this->property_filter) !== isset($x->property_filter)) return false;
1311 if (isset($this->property_filter) && !$this->property_filter->equals($x->property_filter)) return false;
1312 if (isset($this->bounding_circle_filter) !== isset($x->bounding_circle_filter)) return false;
1313 if (isset($this->bounding_circle_filter) && !$this->bounding_circle_filter->equals($x->bounding_circle_filter)) return false;
1314 if (isset($this->bounding_box_filter) !== isset($x->bounding_box_filter)) return false;
1315 if (isset($this->bounding_box_filter) && !$this->bounding_box_filter->equals($x->bounding_box_filter)) return false;
1316 return true;
1318 public function shortDebugString($prefix = "") {
1319 $res = '';
1320 if (isset($this->composite_filter)) {
1321 $res .= $prefix . "composite_filter <\n" . $this->composite_filter->shortDebugString($prefix . " ") . $prefix . ">\n";
1323 if (isset($this->property_filter)) {
1324 $res .= $prefix . "property_filter <\n" . $this->property_filter->shortDebugString($prefix . " ") . $prefix . ">\n";
1326 if (isset($this->bounding_circle_filter)) {
1327 $res .= $prefix . "bounding_circle_filter <\n" . $this->bounding_circle_filter->shortDebugString($prefix . " ") . $prefix . ">\n";
1329 if (isset($this->bounding_box_filter)) {
1330 $res .= $prefix . "bounding_box_filter <\n" . $this->bounding_box_filter->shortDebugString($prefix . " ") . $prefix . ">\n";
1332 return $res;
1336 namespace google\appengine\datastore\v4\CompositeFilter {
1337 class Operator {
1338 const AND_ = 1;
1341 namespace google\appengine\datastore\v4 {
1342 class CompositeFilter extends \google\net\ProtocolMessage {
1343 private $filter = array();
1344 public function getOperator() {
1345 if (!isset($this->operator)) {
1346 return 1;
1348 return $this->operator;
1350 public function setOperator($val) {
1351 $this->operator = $val;
1352 return $this;
1354 public function clearOperator() {
1355 unset($this->operator);
1356 return $this;
1358 public function hasOperator() {
1359 return isset($this->operator);
1361 public function getFilterSize() {
1362 return sizeof($this->filter);
1364 public function getFilterList() {
1365 return $this->filter;
1367 public function mutableFilter($idx) {
1368 if (!isset($this->filter[$idx])) {
1369 $val = new \google\appengine\datastore\v4\Filter();
1370 $this->filter[$idx] = $val;
1371 return $val;
1373 return $this->filter[$idx];
1375 public function getFilter($idx) {
1376 if (isset($this->filter[$idx])) {
1377 return $this->filter[$idx];
1379 if ($idx >= end(array_keys($this->filter))) {
1380 throw new \OutOfRangeException('index out of range: ' + $idx);
1382 return new \google\appengine\datastore\v4\Filter();
1384 public function addFilter() {
1385 $val = new \google\appengine\datastore\v4\Filter();
1386 $this->filter[] = $val;
1387 return $val;
1389 public function clearFilter() {
1390 $this->filter = array();
1392 public function clear() {
1393 $this->clearOperator();
1394 $this->clearFilter();
1396 public function byteSizePartial() {
1397 $res = 0;
1398 if (isset($this->operator)) {
1399 $res += 1;
1400 $res += $this->lengthVarInt64($this->operator);
1402 $this->checkProtoArray($this->filter);
1403 $res += 1 * sizeof($this->filter);
1404 foreach ($this->filter as $value) {
1405 $res += $this->lengthString($value->byteSizePartial());
1407 return $res;
1409 public function outputPartial($out) {
1410 if (isset($this->operator)) {
1411 $out->putVarInt32(8);
1412 $out->putVarInt32($this->operator);
1414 $this->checkProtoArray($this->filter);
1415 foreach ($this->filter as $value) {
1416 $out->putVarInt32(18);
1417 $out->putVarInt32($value->byteSizePartial());
1418 $value->outputPartial($out);
1421 public function tryMerge($d) {
1422 while($d->avail() > 0) {
1423 $tt = $d->getVarInt32();
1424 switch ($tt) {
1425 case 8:
1426 $this->setOperator($d->getVarInt32());
1427 break;
1428 case 18:
1429 $length = $d->getVarInt32();
1430 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1431 $d->skip($length);
1432 $this->addFilter()->tryMerge($tmp);
1433 break;
1434 case 0:
1435 throw new \google\net\ProtocolBufferDecodeError();
1436 break;
1437 default:
1438 $d->skipData($tt);
1442 public function checkInitialized() {
1443 if (!isset($this->operator)) return 'operator';
1444 foreach ($this->filter as $value) {
1445 if (!$value->isInitialized()) return 'filter';
1447 return null;
1449 public function mergeFrom($x) {
1450 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
1451 if ($x->hasOperator()) {
1452 $this->setOperator($x->getOperator());
1454 foreach ($x->getFilterList() as $v) {
1455 $this->addFilter()->copyFrom($v);
1458 public function equals($x) {
1459 if ($x === $this) { return true; }
1460 if (isset($this->operator) !== isset($x->operator)) return false;
1461 if (isset($this->operator) && $this->operator !== $x->operator) return false;
1462 if (sizeof($this->filter) !== sizeof($x->filter)) return false;
1463 foreach (array_map(null, $this->filter, $x->filter) as $v) {
1464 if (!$v[0]->equals($v[1])) return false;
1466 return true;
1468 public function shortDebugString($prefix = "") {
1469 $res = '';
1470 if (isset($this->operator)) {
1471 $res .= $prefix . "operator: " . ($this->operator) . "\n";
1473 foreach ($this->filter as $value) {
1474 $res .= $prefix . "filter <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
1476 return $res;
1480 namespace google\appengine\datastore\v4\PropertyFilter {
1481 class Operator {
1482 const LESS_THAN = 1;
1483 const LESS_THAN_OR_EQUAL = 2;
1484 const GREATER_THAN = 3;
1485 const GREATER_THAN_OR_EQUAL = 4;
1486 const EQUAL = 5;
1487 const HAS_ANCESTOR = 11;
1490 namespace google\appengine\datastore\v4 {
1491 class PropertyFilter extends \google\net\ProtocolMessage {
1492 public function getProperty() {
1493 if (!isset($this->property)) {
1494 return new \google\appengine\datastore\v4\PropertyReference();
1496 return $this->property;
1498 public function mutableProperty() {
1499 if (!isset($this->property)) {
1500 $res = new \google\appengine\datastore\v4\PropertyReference();
1501 $this->property = $res;
1502 return $res;
1504 return $this->property;
1506 public function clearProperty() {
1507 if (isset($this->property)) {
1508 unset($this->property);
1511 public function hasProperty() {
1512 return isset($this->property);
1514 public function getOperator() {
1515 if (!isset($this->operator)) {
1516 return 1;
1518 return $this->operator;
1520 public function setOperator($val) {
1521 $this->operator = $val;
1522 return $this;
1524 public function clearOperator() {
1525 unset($this->operator);
1526 return $this;
1528 public function hasOperator() {
1529 return isset($this->operator);
1531 public function getValue() {
1532 if (!isset($this->value)) {
1533 return new \google\appengine\datastore\v4\Value();
1535 return $this->value;
1537 public function mutableValue() {
1538 if (!isset($this->value)) {
1539 $res = new \google\appengine\datastore\v4\Value();
1540 $this->value = $res;
1541 return $res;
1543 return $this->value;
1545 public function clearValue() {
1546 if (isset($this->value)) {
1547 unset($this->value);
1550 public function hasValue() {
1551 return isset($this->value);
1553 public function clear() {
1554 $this->clearProperty();
1555 $this->clearOperator();
1556 $this->clearValue();
1558 public function byteSizePartial() {
1559 $res = 0;
1560 if (isset($this->property)) {
1561 $res += 1;
1562 $res += $this->lengthString($this->property->byteSizePartial());
1564 if (isset($this->operator)) {
1565 $res += 1;
1566 $res += $this->lengthVarInt64($this->operator);
1568 if (isset($this->value)) {
1569 $res += 1;
1570 $res += $this->lengthString($this->value->byteSizePartial());
1572 return $res;
1574 public function outputPartial($out) {
1575 if (isset($this->property)) {
1576 $out->putVarInt32(10);
1577 $out->putVarInt32($this->property->byteSizePartial());
1578 $this->property->outputPartial($out);
1580 if (isset($this->operator)) {
1581 $out->putVarInt32(16);
1582 $out->putVarInt32($this->operator);
1584 if (isset($this->value)) {
1585 $out->putVarInt32(26);
1586 $out->putVarInt32($this->value->byteSizePartial());
1587 $this->value->outputPartial($out);
1590 public function tryMerge($d) {
1591 while($d->avail() > 0) {
1592 $tt = $d->getVarInt32();
1593 switch ($tt) {
1594 case 10:
1595 $length = $d->getVarInt32();
1596 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1597 $d->skip($length);
1598 $this->mutableProperty()->tryMerge($tmp);
1599 break;
1600 case 16:
1601 $this->setOperator($d->getVarInt32());
1602 break;
1603 case 26:
1604 $length = $d->getVarInt32();
1605 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1606 $d->skip($length);
1607 $this->mutableValue()->tryMerge($tmp);
1608 break;
1609 case 0:
1610 throw new \google\net\ProtocolBufferDecodeError();
1611 break;
1612 default:
1613 $d->skipData($tt);
1617 public function checkInitialized() {
1618 if ((!isset($this->property)) || (!$this->property->isInitialized())) return 'property';
1619 if (!isset($this->operator)) return 'operator';
1620 if ((!isset($this->value)) || (!$this->value->isInitialized())) return 'value';
1621 return null;
1623 public function mergeFrom($x) {
1624 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
1625 if ($x->hasProperty()) {
1626 $this->mutableProperty()->mergeFrom($x->getProperty());
1628 if ($x->hasOperator()) {
1629 $this->setOperator($x->getOperator());
1631 if ($x->hasValue()) {
1632 $this->mutableValue()->mergeFrom($x->getValue());
1635 public function equals($x) {
1636 if ($x === $this) { return true; }
1637 if (isset($this->property) !== isset($x->property)) return false;
1638 if (isset($this->property) && !$this->property->equals($x->property)) return false;
1639 if (isset($this->operator) !== isset($x->operator)) return false;
1640 if (isset($this->operator) && $this->operator !== $x->operator) return false;
1641 if (isset($this->value) !== isset($x->value)) return false;
1642 if (isset($this->value) && !$this->value->equals($x->value)) return false;
1643 return true;
1645 public function shortDebugString($prefix = "") {
1646 $res = '';
1647 if (isset($this->property)) {
1648 $res .= $prefix . "property <\n" . $this->property->shortDebugString($prefix . " ") . $prefix . ">\n";
1650 if (isset($this->operator)) {
1651 $res .= $prefix . "operator: " . ($this->operator) . "\n";
1653 if (isset($this->value)) {
1654 $res .= $prefix . "value <\n" . $this->value->shortDebugString($prefix . " ") . $prefix . ">\n";
1656 return $res;
1660 namespace google\appengine\datastore\v4 {
1661 class BoundingCircleFilter extends \google\net\ProtocolMessage {
1662 public function getProperty() {
1663 if (!isset($this->property)) {
1664 return new \google\appengine\datastore\v4\PropertyReference();
1666 return $this->property;
1668 public function mutableProperty() {
1669 if (!isset($this->property)) {
1670 $res = new \google\appengine\datastore\v4\PropertyReference();
1671 $this->property = $res;
1672 return $res;
1674 return $this->property;
1676 public function clearProperty() {
1677 if (isset($this->property)) {
1678 unset($this->property);
1681 public function hasProperty() {
1682 return isset($this->property);
1684 public function getCenter() {
1685 if (!isset($this->center)) {
1686 return new \google\appengine\datastore\v4\GeoPoint();
1688 return $this->center;
1690 public function mutableCenter() {
1691 if (!isset($this->center)) {
1692 $res = new \google\appengine\datastore\v4\GeoPoint();
1693 $this->center = $res;
1694 return $res;
1696 return $this->center;
1698 public function clearCenter() {
1699 if (isset($this->center)) {
1700 unset($this->center);
1703 public function hasCenter() {
1704 return isset($this->center);
1706 public function getRadiusMeters() {
1707 if (!isset($this->radius_meters)) {
1708 return 0.0;
1710 return $this->radius_meters;
1712 public function setRadiusMeters($val) {
1713 $this->radius_meters = $val;
1714 return $this;
1716 public function clearRadiusMeters() {
1717 unset($this->radius_meters);
1718 return $this;
1720 public function hasRadiusMeters() {
1721 return isset($this->radius_meters);
1723 public function clear() {
1724 $this->clearProperty();
1725 $this->clearCenter();
1726 $this->clearRadiusMeters();
1728 public function byteSizePartial() {
1729 $res = 0;
1730 if (isset($this->property)) {
1731 $res += 1;
1732 $res += $this->lengthString($this->property->byteSizePartial());
1734 if (isset($this->center)) {
1735 $res += 1;
1736 $res += $this->lengthString($this->center->byteSizePartial());
1738 if (isset($this->radius_meters)) {
1739 $res += 9;
1741 return $res;
1743 public function outputPartial($out) {
1744 if (isset($this->property)) {
1745 $out->putVarInt32(10);
1746 $out->putVarInt32($this->property->byteSizePartial());
1747 $this->property->outputPartial($out);
1749 if (isset($this->center)) {
1750 $out->putVarInt32(18);
1751 $out->putVarInt32($this->center->byteSizePartial());
1752 $this->center->outputPartial($out);
1754 if (isset($this->radius_meters)) {
1755 $out->putVarInt32(25);
1756 $out->putDouble($this->radius_meters);
1759 public function tryMerge($d) {
1760 while($d->avail() > 0) {
1761 $tt = $d->getVarInt32();
1762 switch ($tt) {
1763 case 10:
1764 $length = $d->getVarInt32();
1765 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1766 $d->skip($length);
1767 $this->mutableProperty()->tryMerge($tmp);
1768 break;
1769 case 18:
1770 $length = $d->getVarInt32();
1771 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1772 $d->skip($length);
1773 $this->mutableCenter()->tryMerge($tmp);
1774 break;
1775 case 25:
1776 $this->setRadiusMeters($d->getDouble());
1777 break;
1778 case 0:
1779 throw new \google\net\ProtocolBufferDecodeError();
1780 break;
1781 default:
1782 $d->skipData($tt);
1786 public function checkInitialized() {
1787 if ((!isset($this->property)) || (!$this->property->isInitialized())) return 'property';
1788 if ((!isset($this->center)) || (!$this->center->isInitialized())) return 'center';
1789 if (!isset($this->radius_meters)) return 'radius_meters';
1790 return null;
1792 public function mergeFrom($x) {
1793 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
1794 if ($x->hasProperty()) {
1795 $this->mutableProperty()->mergeFrom($x->getProperty());
1797 if ($x->hasCenter()) {
1798 $this->mutableCenter()->mergeFrom($x->getCenter());
1800 if ($x->hasRadiusMeters()) {
1801 $this->setRadiusMeters($x->getRadiusMeters());
1804 public function equals($x) {
1805 if ($x === $this) { return true; }
1806 if (isset($this->property) !== isset($x->property)) return false;
1807 if (isset($this->property) && !$this->property->equals($x->property)) return false;
1808 if (isset($this->center) !== isset($x->center)) return false;
1809 if (isset($this->center) && !$this->center->equals($x->center)) return false;
1810 if (isset($this->radius_meters) !== isset($x->radius_meters)) return false;
1811 if (isset($this->radius_meters) && $this->radius_meters !== $x->radius_meters) return false;
1812 return true;
1814 public function shortDebugString($prefix = "") {
1815 $res = '';
1816 if (isset($this->property)) {
1817 $res .= $prefix . "property <\n" . $this->property->shortDebugString($prefix . " ") . $prefix . ">\n";
1819 if (isset($this->center)) {
1820 $res .= $prefix . "center <\n" . $this->center->shortDebugString($prefix . " ") . $prefix . ">\n";
1822 if (isset($this->radius_meters)) {
1823 $res .= $prefix . "radius_meters: " . $this->debugFormatDouble($this->radius_meters) . "\n";
1825 return $res;
1829 namespace google\appengine\datastore\v4 {
1830 class BoundingBoxFilter extends \google\net\ProtocolMessage {
1831 public function getProperty() {
1832 if (!isset($this->property)) {
1833 return new \google\appengine\datastore\v4\PropertyReference();
1835 return $this->property;
1837 public function mutableProperty() {
1838 if (!isset($this->property)) {
1839 $res = new \google\appengine\datastore\v4\PropertyReference();
1840 $this->property = $res;
1841 return $res;
1843 return $this->property;
1845 public function clearProperty() {
1846 if (isset($this->property)) {
1847 unset($this->property);
1850 public function hasProperty() {
1851 return isset($this->property);
1853 public function getSouthwest() {
1854 if (!isset($this->southwest)) {
1855 return new \google\appengine\datastore\v4\GeoPoint();
1857 return $this->southwest;
1859 public function mutableSouthwest() {
1860 if (!isset($this->southwest)) {
1861 $res = new \google\appengine\datastore\v4\GeoPoint();
1862 $this->southwest = $res;
1863 return $res;
1865 return $this->southwest;
1867 public function clearSouthwest() {
1868 if (isset($this->southwest)) {
1869 unset($this->southwest);
1872 public function hasSouthwest() {
1873 return isset($this->southwest);
1875 public function getNortheast() {
1876 if (!isset($this->northeast)) {
1877 return new \google\appengine\datastore\v4\GeoPoint();
1879 return $this->northeast;
1881 public function mutableNortheast() {
1882 if (!isset($this->northeast)) {
1883 $res = new \google\appengine\datastore\v4\GeoPoint();
1884 $this->northeast = $res;
1885 return $res;
1887 return $this->northeast;
1889 public function clearNortheast() {
1890 if (isset($this->northeast)) {
1891 unset($this->northeast);
1894 public function hasNortheast() {
1895 return isset($this->northeast);
1897 public function clear() {
1898 $this->clearProperty();
1899 $this->clearSouthwest();
1900 $this->clearNortheast();
1902 public function byteSizePartial() {
1903 $res = 0;
1904 if (isset($this->property)) {
1905 $res += 1;
1906 $res += $this->lengthString($this->property->byteSizePartial());
1908 if (isset($this->southwest)) {
1909 $res += 1;
1910 $res += $this->lengthString($this->southwest->byteSizePartial());
1912 if (isset($this->northeast)) {
1913 $res += 1;
1914 $res += $this->lengthString($this->northeast->byteSizePartial());
1916 return $res;
1918 public function outputPartial($out) {
1919 if (isset($this->property)) {
1920 $out->putVarInt32(10);
1921 $out->putVarInt32($this->property->byteSizePartial());
1922 $this->property->outputPartial($out);
1924 if (isset($this->southwest)) {
1925 $out->putVarInt32(18);
1926 $out->putVarInt32($this->southwest->byteSizePartial());
1927 $this->southwest->outputPartial($out);
1929 if (isset($this->northeast)) {
1930 $out->putVarInt32(26);
1931 $out->putVarInt32($this->northeast->byteSizePartial());
1932 $this->northeast->outputPartial($out);
1935 public function tryMerge($d) {
1936 while($d->avail() > 0) {
1937 $tt = $d->getVarInt32();
1938 switch ($tt) {
1939 case 10:
1940 $length = $d->getVarInt32();
1941 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1942 $d->skip($length);
1943 $this->mutableProperty()->tryMerge($tmp);
1944 break;
1945 case 18:
1946 $length = $d->getVarInt32();
1947 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1948 $d->skip($length);
1949 $this->mutableSouthwest()->tryMerge($tmp);
1950 break;
1951 case 26:
1952 $length = $d->getVarInt32();
1953 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
1954 $d->skip($length);
1955 $this->mutableNortheast()->tryMerge($tmp);
1956 break;
1957 case 0:
1958 throw new \google\net\ProtocolBufferDecodeError();
1959 break;
1960 default:
1961 $d->skipData($tt);
1965 public function checkInitialized() {
1966 if ((!isset($this->property)) || (!$this->property->isInitialized())) return 'property';
1967 if ((!isset($this->southwest)) || (!$this->southwest->isInitialized())) return 'southwest';
1968 if ((!isset($this->northeast)) || (!$this->northeast->isInitialized())) return 'northeast';
1969 return null;
1971 public function mergeFrom($x) {
1972 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
1973 if ($x->hasProperty()) {
1974 $this->mutableProperty()->mergeFrom($x->getProperty());
1976 if ($x->hasSouthwest()) {
1977 $this->mutableSouthwest()->mergeFrom($x->getSouthwest());
1979 if ($x->hasNortheast()) {
1980 $this->mutableNortheast()->mergeFrom($x->getNortheast());
1983 public function equals($x) {
1984 if ($x === $this) { return true; }
1985 if (isset($this->property) !== isset($x->property)) return false;
1986 if (isset($this->property) && !$this->property->equals($x->property)) return false;
1987 if (isset($this->southwest) !== isset($x->southwest)) return false;
1988 if (isset($this->southwest) && !$this->southwest->equals($x->southwest)) return false;
1989 if (isset($this->northeast) !== isset($x->northeast)) return false;
1990 if (isset($this->northeast) && !$this->northeast->equals($x->northeast)) return false;
1991 return true;
1993 public function shortDebugString($prefix = "") {
1994 $res = '';
1995 if (isset($this->property)) {
1996 $res .= $prefix . "property <\n" . $this->property->shortDebugString($prefix . " ") . $prefix . ">\n";
1998 if (isset($this->southwest)) {
1999 $res .= $prefix . "southwest <\n" . $this->southwest->shortDebugString($prefix . " ") . $prefix . ">\n";
2001 if (isset($this->northeast)) {
2002 $res .= $prefix . "northeast <\n" . $this->northeast->shortDebugString($prefix . " ") . $prefix . ">\n";
2004 return $res;
2008 namespace google\appengine\datastore\v4 {
2009 class GqlQuery extends \google\net\ProtocolMessage {
2010 private $name_arg = array();
2011 private $number_arg = array();
2012 public function getQueryString() {
2013 if (!isset($this->query_string)) {
2014 return '';
2016 return $this->query_string;
2018 public function setQueryString($val) {
2019 $this->query_string = $val;
2020 return $this;
2022 public function clearQueryString() {
2023 unset($this->query_string);
2024 return $this;
2026 public function hasQueryString() {
2027 return isset($this->query_string);
2029 public function getAllowLiteral() {
2030 if (!isset($this->allow_literal)) {
2031 return false;
2033 return $this->allow_literal;
2035 public function setAllowLiteral($val) {
2036 $this->allow_literal = $val;
2037 return $this;
2039 public function clearAllowLiteral() {
2040 unset($this->allow_literal);
2041 return $this;
2043 public function hasAllowLiteral() {
2044 return isset($this->allow_literal);
2046 public function getNameArgSize() {
2047 return sizeof($this->name_arg);
2049 public function getNameArgList() {
2050 return $this->name_arg;
2052 public function mutableNameArg($idx) {
2053 if (!isset($this->name_arg[$idx])) {
2054 $val = new \google\appengine\datastore\v4\GqlQueryArg();
2055 $this->name_arg[$idx] = $val;
2056 return $val;
2058 return $this->name_arg[$idx];
2060 public function getNameArg($idx) {
2061 if (isset($this->name_arg[$idx])) {
2062 return $this->name_arg[$idx];
2064 if ($idx >= end(array_keys($this->name_arg))) {
2065 throw new \OutOfRangeException('index out of range: ' + $idx);
2067 return new \google\appengine\datastore\v4\GqlQueryArg();
2069 public function addNameArg() {
2070 $val = new \google\appengine\datastore\v4\GqlQueryArg();
2071 $this->name_arg[] = $val;
2072 return $val;
2074 public function clearNameArg() {
2075 $this->name_arg = array();
2077 public function getNumberArgSize() {
2078 return sizeof($this->number_arg);
2080 public function getNumberArgList() {
2081 return $this->number_arg;
2083 public function mutableNumberArg($idx) {
2084 if (!isset($this->number_arg[$idx])) {
2085 $val = new \google\appengine\datastore\v4\GqlQueryArg();
2086 $this->number_arg[$idx] = $val;
2087 return $val;
2089 return $this->number_arg[$idx];
2091 public function getNumberArg($idx) {
2092 if (isset($this->number_arg[$idx])) {
2093 return $this->number_arg[$idx];
2095 if ($idx >= end(array_keys($this->number_arg))) {
2096 throw new \OutOfRangeException('index out of range: ' + $idx);
2098 return new \google\appengine\datastore\v4\GqlQueryArg();
2100 public function addNumberArg() {
2101 $val = new \google\appengine\datastore\v4\GqlQueryArg();
2102 $this->number_arg[] = $val;
2103 return $val;
2105 public function clearNumberArg() {
2106 $this->number_arg = array();
2108 public function clear() {
2109 $this->clearQueryString();
2110 $this->clearAllowLiteral();
2111 $this->clearNameArg();
2112 $this->clearNumberArg();
2114 public function byteSizePartial() {
2115 $res = 0;
2116 if (isset($this->query_string)) {
2117 $res += 1;
2118 $res += $this->lengthString(strlen($this->query_string));
2120 if (isset($this->allow_literal)) {
2121 $res += 2;
2123 $this->checkProtoArray($this->name_arg);
2124 $res += 1 * sizeof($this->name_arg);
2125 foreach ($this->name_arg as $value) {
2126 $res += $this->lengthString($value->byteSizePartial());
2128 $this->checkProtoArray($this->number_arg);
2129 $res += 1 * sizeof($this->number_arg);
2130 foreach ($this->number_arg as $value) {
2131 $res += $this->lengthString($value->byteSizePartial());
2133 return $res;
2135 public function outputPartial($out) {
2136 if (isset($this->query_string)) {
2137 $out->putVarInt32(10);
2138 $out->putPrefixedString($this->query_string);
2140 if (isset($this->allow_literal)) {
2141 $out->putVarInt32(16);
2142 $out->putBoolean($this->allow_literal);
2144 $this->checkProtoArray($this->name_arg);
2145 foreach ($this->name_arg as $value) {
2146 $out->putVarInt32(26);
2147 $out->putVarInt32($value->byteSizePartial());
2148 $value->outputPartial($out);
2150 $this->checkProtoArray($this->number_arg);
2151 foreach ($this->number_arg as $value) {
2152 $out->putVarInt32(34);
2153 $out->putVarInt32($value->byteSizePartial());
2154 $value->outputPartial($out);
2157 public function tryMerge($d) {
2158 while($d->avail() > 0) {
2159 $tt = $d->getVarInt32();
2160 switch ($tt) {
2161 case 10:
2162 $length = $d->getVarInt32();
2163 $this->setQueryString(substr($d->buffer(), $d->pos(), $length));
2164 $d->skip($length);
2165 break;
2166 case 16:
2167 $this->setAllowLiteral($d->getBoolean());
2168 break;
2169 case 26:
2170 $length = $d->getVarInt32();
2171 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
2172 $d->skip($length);
2173 $this->addNameArg()->tryMerge($tmp);
2174 break;
2175 case 34:
2176 $length = $d->getVarInt32();
2177 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
2178 $d->skip($length);
2179 $this->addNumberArg()->tryMerge($tmp);
2180 break;
2181 case 0:
2182 throw new \google\net\ProtocolBufferDecodeError();
2183 break;
2184 default:
2185 $d->skipData($tt);
2189 public function checkInitialized() {
2190 if (!isset($this->query_string)) return 'query_string';
2191 foreach ($this->name_arg as $value) {
2192 if (!$value->isInitialized()) return 'name_arg';
2194 foreach ($this->number_arg as $value) {
2195 if (!$value->isInitialized()) return 'number_arg';
2197 return null;
2199 public function mergeFrom($x) {
2200 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
2201 if ($x->hasQueryString()) {
2202 $this->setQueryString($x->getQueryString());
2204 if ($x->hasAllowLiteral()) {
2205 $this->setAllowLiteral($x->getAllowLiteral());
2207 foreach ($x->getNameArgList() as $v) {
2208 $this->addNameArg()->copyFrom($v);
2210 foreach ($x->getNumberArgList() as $v) {
2211 $this->addNumberArg()->copyFrom($v);
2214 public function equals($x) {
2215 if ($x === $this) { return true; }
2216 if (isset($this->query_string) !== isset($x->query_string)) return false;
2217 if (isset($this->query_string) && $this->query_string !== $x->query_string) return false;
2218 if (isset($this->allow_literal) !== isset($x->allow_literal)) return false;
2219 if (isset($this->allow_literal) && $this->allow_literal !== $x->allow_literal) return false;
2220 if (sizeof($this->name_arg) !== sizeof($x->name_arg)) return false;
2221 foreach (array_map(null, $this->name_arg, $x->name_arg) as $v) {
2222 if (!$v[0]->equals($v[1])) return false;
2224 if (sizeof($this->number_arg) !== sizeof($x->number_arg)) return false;
2225 foreach (array_map(null, $this->number_arg, $x->number_arg) as $v) {
2226 if (!$v[0]->equals($v[1])) return false;
2228 return true;
2230 public function shortDebugString($prefix = "") {
2231 $res = '';
2232 if (isset($this->query_string)) {
2233 $res .= $prefix . "query_string: " . $this->debugFormatString($this->query_string) . "\n";
2235 if (isset($this->allow_literal)) {
2236 $res .= $prefix . "allow_literal: " . $this->debugFormatBool($this->allow_literal) . "\n";
2238 foreach ($this->name_arg as $value) {
2239 $res .= $prefix . "name_arg <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
2241 foreach ($this->number_arg as $value) {
2242 $res .= $prefix . "number_arg <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
2244 return $res;
2248 namespace google\appengine\datastore\v4 {
2249 class GqlQueryArg extends \google\net\ProtocolMessage {
2250 public function getName() {
2251 if (!isset($this->name)) {
2252 return '';
2254 return $this->name;
2256 public function setName($val) {
2257 $this->name = $val;
2258 return $this;
2260 public function clearName() {
2261 unset($this->name);
2262 return $this;
2264 public function hasName() {
2265 return isset($this->name);
2267 public function getValue() {
2268 if (!isset($this->value)) {
2269 return new \google\appengine\datastore\v4\Value();
2271 return $this->value;
2273 public function mutableValue() {
2274 if (!isset($this->value)) {
2275 $res = new \google\appengine\datastore\v4\Value();
2276 $this->value = $res;
2277 return $res;
2279 return $this->value;
2281 public function clearValue() {
2282 if (isset($this->value)) {
2283 unset($this->value);
2286 public function hasValue() {
2287 return isset($this->value);
2289 public function getCursor() {
2290 if (!isset($this->cursor)) {
2291 return '';
2293 return $this->cursor;
2295 public function setCursor($val) {
2296 $this->cursor = $val;
2297 return $this;
2299 public function clearCursor() {
2300 unset($this->cursor);
2301 return $this;
2303 public function hasCursor() {
2304 return isset($this->cursor);
2306 public function clear() {
2307 $this->clearName();
2308 $this->clearValue();
2309 $this->clearCursor();
2311 public function byteSizePartial() {
2312 $res = 0;
2313 if (isset($this->name)) {
2314 $res += 1;
2315 $res += $this->lengthString(strlen($this->name));
2317 if (isset($this->value)) {
2318 $res += 1;
2319 $res += $this->lengthString($this->value->byteSizePartial());
2321 if (isset($this->cursor)) {
2322 $res += 1;
2323 $res += $this->lengthString(strlen($this->cursor));
2325 return $res;
2327 public function outputPartial($out) {
2328 if (isset($this->name)) {
2329 $out->putVarInt32(10);
2330 $out->putPrefixedString($this->name);
2332 if (isset($this->value)) {
2333 $out->putVarInt32(18);
2334 $out->putVarInt32($this->value->byteSizePartial());
2335 $this->value->outputPartial($out);
2337 if (isset($this->cursor)) {
2338 $out->putVarInt32(26);
2339 $out->putPrefixedString($this->cursor);
2342 public function tryMerge($d) {
2343 while($d->avail() > 0) {
2344 $tt = $d->getVarInt32();
2345 switch ($tt) {
2346 case 10:
2347 $length = $d->getVarInt32();
2348 $this->setName(substr($d->buffer(), $d->pos(), $length));
2349 $d->skip($length);
2350 break;
2351 case 18:
2352 $length = $d->getVarInt32();
2353 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
2354 $d->skip($length);
2355 $this->mutableValue()->tryMerge($tmp);
2356 break;
2357 case 26:
2358 $length = $d->getVarInt32();
2359 $this->setCursor(substr($d->buffer(), $d->pos(), $length));
2360 $d->skip($length);
2361 break;
2362 case 0:
2363 throw new \google\net\ProtocolBufferDecodeError();
2364 break;
2365 default:
2366 $d->skipData($tt);
2370 public function checkInitialized() {
2371 if (isset($this->value) && (!$this->value->isInitialized())) return 'value';
2372 return null;
2374 public function mergeFrom($x) {
2375 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
2376 if ($x->hasName()) {
2377 $this->setName($x->getName());
2379 if ($x->hasValue()) {
2380 $this->mutableValue()->mergeFrom($x->getValue());
2382 if ($x->hasCursor()) {
2383 $this->setCursor($x->getCursor());
2386 public function equals($x) {
2387 if ($x === $this) { return true; }
2388 if (isset($this->name) !== isset($x->name)) return false;
2389 if (isset($this->name) && $this->name !== $x->name) return false;
2390 if (isset($this->value) !== isset($x->value)) return false;
2391 if (isset($this->value) && !$this->value->equals($x->value)) return false;
2392 if (isset($this->cursor) !== isset($x->cursor)) return false;
2393 if (isset($this->cursor) && $this->cursor !== $x->cursor) return false;
2394 return true;
2396 public function shortDebugString($prefix = "") {
2397 $res = '';
2398 if (isset($this->name)) {
2399 $res .= $prefix . "name: " . $this->debugFormatString($this->name) . "\n";
2401 if (isset($this->value)) {
2402 $res .= $prefix . "value <\n" . $this->value->shortDebugString($prefix . " ") . $prefix . ">\n";
2404 if (isset($this->cursor)) {
2405 $res .= $prefix . "cursor: " . $this->debugFormatString($this->cursor) . "\n";
2407 return $res;
2411 namespace google\appengine\datastore\v4\QueryResultBatch {
2412 class MoreResultsType {
2413 const NOT_FINISHED = 1;
2414 const MORE_RESULTS_AFTER_LIMIT = 2;
2415 const NO_MORE_RESULTS = 3;
2418 namespace google\appengine\datastore\v4 {
2419 class QueryResultBatch extends \google\net\ProtocolMessage {
2420 private $entity_result = array();
2421 public function getEntityResultType() {
2422 if (!isset($this->entity_result_type)) {
2423 return 1;
2425 return $this->entity_result_type;
2427 public function setEntityResultType($val) {
2428 $this->entity_result_type = $val;
2429 return $this;
2431 public function clearEntityResultType() {
2432 unset($this->entity_result_type);
2433 return $this;
2435 public function hasEntityResultType() {
2436 return isset($this->entity_result_type);
2438 public function getEntityResultSize() {
2439 return sizeof($this->entity_result);
2441 public function getEntityResultList() {
2442 return $this->entity_result;
2444 public function mutableEntityResult($idx) {
2445 if (!isset($this->entity_result[$idx])) {
2446 $val = new \google\appengine\datastore\v4\EntityResult();
2447 $this->entity_result[$idx] = $val;
2448 return $val;
2450 return $this->entity_result[$idx];
2452 public function getEntityResult($idx) {
2453 if (isset($this->entity_result[$idx])) {
2454 return $this->entity_result[$idx];
2456 if ($idx >= end(array_keys($this->entity_result))) {
2457 throw new \OutOfRangeException('index out of range: ' + $idx);
2459 return new \google\appengine\datastore\v4\EntityResult();
2461 public function addEntityResult() {
2462 $val = new \google\appengine\datastore\v4\EntityResult();
2463 $this->entity_result[] = $val;
2464 return $val;
2466 public function clearEntityResult() {
2467 $this->entity_result = array();
2469 public function getEndCursor() {
2470 if (!isset($this->end_cursor)) {
2471 return '';
2473 return $this->end_cursor;
2475 public function setEndCursor($val) {
2476 $this->end_cursor = $val;
2477 return $this;
2479 public function clearEndCursor() {
2480 unset($this->end_cursor);
2481 return $this;
2483 public function hasEndCursor() {
2484 return isset($this->end_cursor);
2486 public function getMoreResults() {
2487 if (!isset($this->more_results)) {
2488 return 1;
2490 return $this->more_results;
2492 public function setMoreResults($val) {
2493 $this->more_results = $val;
2494 return $this;
2496 public function clearMoreResults() {
2497 unset($this->more_results);
2498 return $this;
2500 public function hasMoreResults() {
2501 return isset($this->more_results);
2503 public function getSkippedResults() {
2504 if (!isset($this->skipped_results)) {
2505 return 0;
2507 return $this->skipped_results;
2509 public function setSkippedResults($val) {
2510 $this->skipped_results = $val;
2511 return $this;
2513 public function clearSkippedResults() {
2514 unset($this->skipped_results);
2515 return $this;
2517 public function hasSkippedResults() {
2518 return isset($this->skipped_results);
2520 public function getSnapshotVersion() {
2521 if (!isset($this->snapshot_version)) {
2522 return "0";
2524 return $this->snapshot_version;
2526 public function setSnapshotVersion($val) {
2527 if (is_double($val)) {
2528 $this->snapshot_version = sprintf('%0.0F', $val);
2529 } else {
2530 $this->snapshot_version = $val;
2532 return $this;
2534 public function clearSnapshotVersion() {
2535 unset($this->snapshot_version);
2536 return $this;
2538 public function hasSnapshotVersion() {
2539 return isset($this->snapshot_version);
2541 public function clear() {
2542 $this->clearEntityResultType();
2543 $this->clearEntityResult();
2544 $this->clearEndCursor();
2545 $this->clearMoreResults();
2546 $this->clearSkippedResults();
2547 $this->clearSnapshotVersion();
2549 public function byteSizePartial() {
2550 $res = 0;
2551 if (isset($this->entity_result_type)) {
2552 $res += 1;
2553 $res += $this->lengthVarInt64($this->entity_result_type);
2555 $this->checkProtoArray($this->entity_result);
2556 $res += 1 * sizeof($this->entity_result);
2557 foreach ($this->entity_result as $value) {
2558 $res += $this->lengthString($value->byteSizePartial());
2560 if (isset($this->end_cursor)) {
2561 $res += 1;
2562 $res += $this->lengthString(strlen($this->end_cursor));
2564 if (isset($this->more_results)) {
2565 $res += 1;
2566 $res += $this->lengthVarInt64($this->more_results);
2568 if (isset($this->skipped_results)) {
2569 $res += 1;
2570 $res += $this->lengthVarInt64($this->skipped_results);
2572 if (isset($this->snapshot_version)) {
2573 $res += 1;
2574 $res += $this->lengthVarInt64($this->snapshot_version);
2576 return $res;
2578 public function outputPartial($out) {
2579 if (isset($this->entity_result_type)) {
2580 $out->putVarInt32(8);
2581 $out->putVarInt32($this->entity_result_type);
2583 $this->checkProtoArray($this->entity_result);
2584 foreach ($this->entity_result as $value) {
2585 $out->putVarInt32(18);
2586 $out->putVarInt32($value->byteSizePartial());
2587 $value->outputPartial($out);
2589 if (isset($this->end_cursor)) {
2590 $out->putVarInt32(34);
2591 $out->putPrefixedString($this->end_cursor);
2593 if (isset($this->more_results)) {
2594 $out->putVarInt32(40);
2595 $out->putVarInt32($this->more_results);
2597 if (isset($this->skipped_results)) {
2598 $out->putVarInt32(48);
2599 $out->putVarInt32($this->skipped_results);
2601 if (isset($this->snapshot_version)) {
2602 $out->putVarInt32(56);
2603 $out->putVarInt64($this->snapshot_version);
2606 public function tryMerge($d) {
2607 while($d->avail() > 0) {
2608 $tt = $d->getVarInt32();
2609 switch ($tt) {
2610 case 8:
2611 $this->setEntityResultType($d->getVarInt32());
2612 break;
2613 case 18:
2614 $length = $d->getVarInt32();
2615 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
2616 $d->skip($length);
2617 $this->addEntityResult()->tryMerge($tmp);
2618 break;
2619 case 34:
2620 $length = $d->getVarInt32();
2621 $this->setEndCursor(substr($d->buffer(), $d->pos(), $length));
2622 $d->skip($length);
2623 break;
2624 case 40:
2625 $this->setMoreResults($d->getVarInt32());
2626 break;
2627 case 48:
2628 $this->setSkippedResults($d->getVarInt32());
2629 break;
2630 case 56:
2631 $this->setSnapshotVersion($d->getVarInt64());
2632 break;
2633 case 0:
2634 throw new \google\net\ProtocolBufferDecodeError();
2635 break;
2636 default:
2637 $d->skipData($tt);
2641 public function checkInitialized() {
2642 if (!isset($this->entity_result_type)) return 'entity_result_type';
2643 foreach ($this->entity_result as $value) {
2644 if (!$value->isInitialized()) return 'entity_result';
2646 if (!isset($this->more_results)) return 'more_results';
2647 return null;
2649 public function mergeFrom($x) {
2650 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
2651 if ($x->hasEntityResultType()) {
2652 $this->setEntityResultType($x->getEntityResultType());
2654 foreach ($x->getEntityResultList() as $v) {
2655 $this->addEntityResult()->copyFrom($v);
2657 if ($x->hasEndCursor()) {
2658 $this->setEndCursor($x->getEndCursor());
2660 if ($x->hasMoreResults()) {
2661 $this->setMoreResults($x->getMoreResults());
2663 if ($x->hasSkippedResults()) {
2664 $this->setSkippedResults($x->getSkippedResults());
2666 if ($x->hasSnapshotVersion()) {
2667 $this->setSnapshotVersion($x->getSnapshotVersion());
2670 public function equals($x) {
2671 if ($x === $this) { return true; }
2672 if (isset($this->entity_result_type) !== isset($x->entity_result_type)) return false;
2673 if (isset($this->entity_result_type) && $this->entity_result_type !== $x->entity_result_type) return false;
2674 if (sizeof($this->entity_result) !== sizeof($x->entity_result)) return false;
2675 foreach (array_map(null, $this->entity_result, $x->entity_result) as $v) {
2676 if (!$v[0]->equals($v[1])) return false;
2678 if (isset($this->end_cursor) !== isset($x->end_cursor)) return false;
2679 if (isset($this->end_cursor) && $this->end_cursor !== $x->end_cursor) return false;
2680 if (isset($this->more_results) !== isset($x->more_results)) return false;
2681 if (isset($this->more_results) && $this->more_results !== $x->more_results) return false;
2682 if (isset($this->skipped_results) !== isset($x->skipped_results)) return false;
2683 if (isset($this->skipped_results) && !$this->integerEquals($this->skipped_results, $x->skipped_results)) return false;
2684 if (isset($this->snapshot_version) !== isset($x->snapshot_version)) return false;
2685 if (isset($this->snapshot_version) && !$this->integerEquals($this->snapshot_version, $x->snapshot_version)) return false;
2686 return true;
2688 public function shortDebugString($prefix = "") {
2689 $res = '';
2690 if (isset($this->entity_result_type)) {
2691 $res .= $prefix . "entity_result_type: " . ($this->entity_result_type) . "\n";
2693 foreach ($this->entity_result as $value) {
2694 $res .= $prefix . "entity_result <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
2696 if (isset($this->end_cursor)) {
2697 $res .= $prefix . "end_cursor: " . $this->debugFormatString($this->end_cursor) . "\n";
2699 if (isset($this->more_results)) {
2700 $res .= $prefix . "more_results: " . ($this->more_results) . "\n";
2702 if (isset($this->skipped_results)) {
2703 $res .= $prefix . "skipped_results: " . $this->debugFormatInt32($this->skipped_results) . "\n";
2705 if (isset($this->snapshot_version)) {
2706 $res .= $prefix . "snapshot_version: " . $this->debugFormatInt64($this->snapshot_version) . "\n";
2708 return $res;
2712 namespace google\appengine\datastore\v4\Mutation {
2713 class Operation {
2714 const UNKNOWN = 0;
2715 const INSERT = 1;
2716 const UPDATE = 2;
2717 const UPSERT = 3;
2718 const DELETE = 4;
2721 namespace google\appengine\datastore\v4 {
2722 class Mutation extends \google\net\ProtocolMessage {
2723 public function getOp() {
2724 if (!isset($this->op)) {
2725 return 0;
2727 return $this->op;
2729 public function setOp($val) {
2730 $this->op = $val;
2731 return $this;
2733 public function clearOp() {
2734 unset($this->op);
2735 return $this;
2737 public function hasOp() {
2738 return isset($this->op);
2740 public function getKey() {
2741 if (!isset($this->key)) {
2742 return new \google\appengine\datastore\v4\Key();
2744 return $this->key;
2746 public function mutableKey() {
2747 if (!isset($this->key)) {
2748 $res = new \google\appengine\datastore\v4\Key();
2749 $this->key = $res;
2750 return $res;
2752 return $this->key;
2754 public function clearKey() {
2755 if (isset($this->key)) {
2756 unset($this->key);
2759 public function hasKey() {
2760 return isset($this->key);
2762 public function getEntity() {
2763 if (!isset($this->entity)) {
2764 return new \google\appengine\datastore\v4\Entity();
2766 return $this->entity;
2768 public function mutableEntity() {
2769 if (!isset($this->entity)) {
2770 $res = new \google\appengine\datastore\v4\Entity();
2771 $this->entity = $res;
2772 return $res;
2774 return $this->entity;
2776 public function clearEntity() {
2777 if (isset($this->entity)) {
2778 unset($this->entity);
2781 public function hasEntity() {
2782 return isset($this->entity);
2784 public function clear() {
2785 $this->clearOp();
2786 $this->clearKey();
2787 $this->clearEntity();
2789 public function byteSizePartial() {
2790 $res = 0;
2791 if (isset($this->op)) {
2792 $res += 1;
2793 $res += $this->lengthVarInt64($this->op);
2795 if (isset($this->key)) {
2796 $res += 1;
2797 $res += $this->lengthString($this->key->byteSizePartial());
2799 if (isset($this->entity)) {
2800 $res += 1;
2801 $res += $this->lengthString($this->entity->byteSizePartial());
2803 return $res;
2805 public function outputPartial($out) {
2806 if (isset($this->op)) {
2807 $out->putVarInt32(8);
2808 $out->putVarInt32($this->op);
2810 if (isset($this->key)) {
2811 $out->putVarInt32(18);
2812 $out->putVarInt32($this->key->byteSizePartial());
2813 $this->key->outputPartial($out);
2815 if (isset($this->entity)) {
2816 $out->putVarInt32(26);
2817 $out->putVarInt32($this->entity->byteSizePartial());
2818 $this->entity->outputPartial($out);
2821 public function tryMerge($d) {
2822 while($d->avail() > 0) {
2823 $tt = $d->getVarInt32();
2824 switch ($tt) {
2825 case 8:
2826 $this->setOp($d->getVarInt32());
2827 break;
2828 case 18:
2829 $length = $d->getVarInt32();
2830 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
2831 $d->skip($length);
2832 $this->mutableKey()->tryMerge($tmp);
2833 break;
2834 case 26:
2835 $length = $d->getVarInt32();
2836 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
2837 $d->skip($length);
2838 $this->mutableEntity()->tryMerge($tmp);
2839 break;
2840 case 0:
2841 throw new \google\net\ProtocolBufferDecodeError();
2842 break;
2843 default:
2844 $d->skipData($tt);
2848 public function checkInitialized() {
2849 if (isset($this->key) && (!$this->key->isInitialized())) return 'key';
2850 if (isset($this->entity) && (!$this->entity->isInitialized())) return 'entity';
2851 return null;
2853 public function mergeFrom($x) {
2854 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
2855 if ($x->hasOp()) {
2856 $this->setOp($x->getOp());
2858 if ($x->hasKey()) {
2859 $this->mutableKey()->mergeFrom($x->getKey());
2861 if ($x->hasEntity()) {
2862 $this->mutableEntity()->mergeFrom($x->getEntity());
2865 public function equals($x) {
2866 if ($x === $this) { return true; }
2867 if (isset($this->op) !== isset($x->op)) return false;
2868 if (isset($this->op) && $this->op !== $x->op) return false;
2869 if (isset($this->key) !== isset($x->key)) return false;
2870 if (isset($this->key) && !$this->key->equals($x->key)) return false;
2871 if (isset($this->entity) !== isset($x->entity)) return false;
2872 if (isset($this->entity) && !$this->entity->equals($x->entity)) return false;
2873 return true;
2875 public function shortDebugString($prefix = "") {
2876 $res = '';
2877 if (isset($this->op)) {
2878 $res .= $prefix . "op: " . ($this->op) . "\n";
2880 if (isset($this->key)) {
2881 $res .= $prefix . "key <\n" . $this->key->shortDebugString($prefix . " ") . $prefix . ">\n";
2883 if (isset($this->entity)) {
2884 $res .= $prefix . "entity <\n" . $this->entity->shortDebugString($prefix . " ") . $prefix . ">\n";
2886 return $res;
2890 namespace google\appengine\datastore\v4 {
2891 class MutationResult extends \google\net\ProtocolMessage {
2892 public function getKey() {
2893 if (!isset($this->key)) {
2894 return new \google\appengine\datastore\v4\Key();
2896 return $this->key;
2898 public function mutableKey() {
2899 if (!isset($this->key)) {
2900 $res = new \google\appengine\datastore\v4\Key();
2901 $this->key = $res;
2902 return $res;
2904 return $this->key;
2906 public function clearKey() {
2907 if (isset($this->key)) {
2908 unset($this->key);
2911 public function hasKey() {
2912 return isset($this->key);
2914 public function getNewVersion() {
2915 if (!isset($this->new_version)) {
2916 return '0';
2918 return $this->new_version;
2920 public function setNewVersion($val) {
2921 if (is_double($val)) {
2922 $this->new_version = sprintf('%0.0F', $val);
2923 } else {
2924 $this->new_version = $val;
2926 return $this;
2928 public function clearNewVersion() {
2929 unset($this->new_version);
2930 return $this;
2932 public function hasNewVersion() {
2933 return isset($this->new_version);
2935 public function clear() {
2936 $this->clearKey();
2937 $this->clearNewVersion();
2939 public function byteSizePartial() {
2940 $res = 0;
2941 if (isset($this->key)) {
2942 $res += 1;
2943 $res += $this->lengthString($this->key->byteSizePartial());
2945 if (isset($this->new_version)) {
2946 $res += 1;
2947 $res += $this->lengthVarInt64($this->new_version);
2949 return $res;
2951 public function outputPartial($out) {
2952 if (isset($this->key)) {
2953 $out->putVarInt32(26);
2954 $out->putVarInt32($this->key->byteSizePartial());
2955 $this->key->outputPartial($out);
2957 if (isset($this->new_version)) {
2958 $out->putVarInt32(32);
2959 $out->putVarInt64($this->new_version);
2962 public function tryMerge($d) {
2963 while($d->avail() > 0) {
2964 $tt = $d->getVarInt32();
2965 switch ($tt) {
2966 case 26:
2967 $length = $d->getVarInt32();
2968 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
2969 $d->skip($length);
2970 $this->mutableKey()->tryMerge($tmp);
2971 break;
2972 case 32:
2973 $this->setNewVersion($d->getVarInt64());
2974 break;
2975 case 0:
2976 throw new \google\net\ProtocolBufferDecodeError();
2977 break;
2978 default:
2979 $d->skipData($tt);
2983 public function checkInitialized() {
2984 if (isset($this->key) && (!$this->key->isInitialized())) return 'key';
2985 return null;
2987 public function mergeFrom($x) {
2988 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
2989 if ($x->hasKey()) {
2990 $this->mutableKey()->mergeFrom($x->getKey());
2992 if ($x->hasNewVersion()) {
2993 $this->setNewVersion($x->getNewVersion());
2996 public function equals($x) {
2997 if ($x === $this) { return true; }
2998 if (isset($this->key) !== isset($x->key)) return false;
2999 if (isset($this->key) && !$this->key->equals($x->key)) return false;
3000 if (isset($this->new_version) !== isset($x->new_version)) return false;
3001 if (isset($this->new_version) && !$this->integerEquals($this->new_version, $x->new_version)) return false;
3002 return true;
3004 public function shortDebugString($prefix = "") {
3005 $res = '';
3006 if (isset($this->key)) {
3007 $res .= $prefix . "key <\n" . $this->key->shortDebugString($prefix . " ") . $prefix . ">\n";
3009 if (isset($this->new_version)) {
3010 $res .= $prefix . "new_version: " . $this->debugFormatInt64($this->new_version) . "\n";
3012 return $res;
3016 namespace google\appengine\datastore\v4 {
3017 class DeprecatedMutation extends \google\net\ProtocolMessage {
3018 private $upsert = array();
3019 private $update = array();
3020 private $insert = array();
3021 private $insert_auto_id = array();
3022 private $delete = array();
3023 public function getUpsertSize() {
3024 return sizeof($this->upsert);
3026 public function getUpsertList() {
3027 return $this->upsert;
3029 public function mutableUpsert($idx) {
3030 if (!isset($this->upsert[$idx])) {
3031 $val = new \google\appengine\datastore\v4\Entity();
3032 $this->upsert[$idx] = $val;
3033 return $val;
3035 return $this->upsert[$idx];
3037 public function getUpsert($idx) {
3038 if (isset($this->upsert[$idx])) {
3039 return $this->upsert[$idx];
3041 if ($idx >= end(array_keys($this->upsert))) {
3042 throw new \OutOfRangeException('index out of range: ' + $idx);
3044 return new \google\appengine\datastore\v4\Entity();
3046 public function addUpsert() {
3047 $val = new \google\appengine\datastore\v4\Entity();
3048 $this->upsert[] = $val;
3049 return $val;
3051 public function clearUpsert() {
3052 $this->upsert = array();
3054 public function getUpdateSize() {
3055 return sizeof($this->update);
3057 public function getUpdateList() {
3058 return $this->update;
3060 public function mutableUpdate($idx) {
3061 if (!isset($this->update[$idx])) {
3062 $val = new \google\appengine\datastore\v4\Entity();
3063 $this->update[$idx] = $val;
3064 return $val;
3066 return $this->update[$idx];
3068 public function getUpdate($idx) {
3069 if (isset($this->update[$idx])) {
3070 return $this->update[$idx];
3072 if ($idx >= end(array_keys($this->update))) {
3073 throw new \OutOfRangeException('index out of range: ' + $idx);
3075 return new \google\appengine\datastore\v4\Entity();
3077 public function addUpdate() {
3078 $val = new \google\appengine\datastore\v4\Entity();
3079 $this->update[] = $val;
3080 return $val;
3082 public function clearUpdate() {
3083 $this->update = array();
3085 public function getInsertSize() {
3086 return sizeof($this->insert);
3088 public function getInsertList() {
3089 return $this->insert;
3091 public function mutableInsert($idx) {
3092 if (!isset($this->insert[$idx])) {
3093 $val = new \google\appengine\datastore\v4\Entity();
3094 $this->insert[$idx] = $val;
3095 return $val;
3097 return $this->insert[$idx];
3099 public function getInsert($idx) {
3100 if (isset($this->insert[$idx])) {
3101 return $this->insert[$idx];
3103 if ($idx >= end(array_keys($this->insert))) {
3104 throw new \OutOfRangeException('index out of range: ' + $idx);
3106 return new \google\appengine\datastore\v4\Entity();
3108 public function addInsert() {
3109 $val = new \google\appengine\datastore\v4\Entity();
3110 $this->insert[] = $val;
3111 return $val;
3113 public function clearInsert() {
3114 $this->insert = array();
3116 public function getInsertAutoIdSize() {
3117 return sizeof($this->insert_auto_id);
3119 public function getInsertAutoIdList() {
3120 return $this->insert_auto_id;
3122 public function mutableInsertAutoId($idx) {
3123 if (!isset($this->insert_auto_id[$idx])) {
3124 $val = new \google\appengine\datastore\v4\Entity();
3125 $this->insert_auto_id[$idx] = $val;
3126 return $val;
3128 return $this->insert_auto_id[$idx];
3130 public function getInsertAutoId($idx) {
3131 if (isset($this->insert_auto_id[$idx])) {
3132 return $this->insert_auto_id[$idx];
3134 if ($idx >= end(array_keys($this->insert_auto_id))) {
3135 throw new \OutOfRangeException('index out of range: ' + $idx);
3137 return new \google\appengine\datastore\v4\Entity();
3139 public function addInsertAutoId() {
3140 $val = new \google\appengine\datastore\v4\Entity();
3141 $this->insert_auto_id[] = $val;
3142 return $val;
3144 public function clearInsertAutoId() {
3145 $this->insert_auto_id = array();
3147 public function getDeleteSize() {
3148 return sizeof($this->delete);
3150 public function getDeleteList() {
3151 return $this->delete;
3153 public function mutableDelete($idx) {
3154 if (!isset($this->delete[$idx])) {
3155 $val = new \google\appengine\datastore\v4\Key();
3156 $this->delete[$idx] = $val;
3157 return $val;
3159 return $this->delete[$idx];
3161 public function getDelete($idx) {
3162 if (isset($this->delete[$idx])) {
3163 return $this->delete[$idx];
3165 if ($idx >= end(array_keys($this->delete))) {
3166 throw new \OutOfRangeException('index out of range: ' + $idx);
3168 return new \google\appengine\datastore\v4\Key();
3170 public function addDelete() {
3171 $val = new \google\appengine\datastore\v4\Key();
3172 $this->delete[] = $val;
3173 return $val;
3175 public function clearDelete() {
3176 $this->delete = array();
3178 public function getForce() {
3179 if (!isset($this->force)) {
3180 return false;
3182 return $this->force;
3184 public function setForce($val) {
3185 $this->force = $val;
3186 return $this;
3188 public function clearForce() {
3189 unset($this->force);
3190 return $this;
3192 public function hasForce() {
3193 return isset($this->force);
3195 public function clear() {
3196 $this->clearUpsert();
3197 $this->clearUpdate();
3198 $this->clearInsert();
3199 $this->clearInsertAutoId();
3200 $this->clearDelete();
3201 $this->clearForce();
3203 public function byteSizePartial() {
3204 $res = 0;
3205 $this->checkProtoArray($this->upsert);
3206 $res += 1 * sizeof($this->upsert);
3207 foreach ($this->upsert as $value) {
3208 $res += $this->lengthString($value->byteSizePartial());
3210 $this->checkProtoArray($this->update);
3211 $res += 1 * sizeof($this->update);
3212 foreach ($this->update as $value) {
3213 $res += $this->lengthString($value->byteSizePartial());
3215 $this->checkProtoArray($this->insert);
3216 $res += 1 * sizeof($this->insert);
3217 foreach ($this->insert as $value) {
3218 $res += $this->lengthString($value->byteSizePartial());
3220 $this->checkProtoArray($this->insert_auto_id);
3221 $res += 1 * sizeof($this->insert_auto_id);
3222 foreach ($this->insert_auto_id as $value) {
3223 $res += $this->lengthString($value->byteSizePartial());
3225 $this->checkProtoArray($this->delete);
3226 $res += 1 * sizeof($this->delete);
3227 foreach ($this->delete as $value) {
3228 $res += $this->lengthString($value->byteSizePartial());
3230 if (isset($this->force)) {
3231 $res += 2;
3233 return $res;
3235 public function outputPartial($out) {
3236 $this->checkProtoArray($this->upsert);
3237 foreach ($this->upsert as $value) {
3238 $out->putVarInt32(10);
3239 $out->putVarInt32($value->byteSizePartial());
3240 $value->outputPartial($out);
3242 $this->checkProtoArray($this->update);
3243 foreach ($this->update as $value) {
3244 $out->putVarInt32(18);
3245 $out->putVarInt32($value->byteSizePartial());
3246 $value->outputPartial($out);
3248 $this->checkProtoArray($this->insert);
3249 foreach ($this->insert as $value) {
3250 $out->putVarInt32(26);
3251 $out->putVarInt32($value->byteSizePartial());
3252 $value->outputPartial($out);
3254 $this->checkProtoArray($this->insert_auto_id);
3255 foreach ($this->insert_auto_id as $value) {
3256 $out->putVarInt32(34);
3257 $out->putVarInt32($value->byteSizePartial());
3258 $value->outputPartial($out);
3260 $this->checkProtoArray($this->delete);
3261 foreach ($this->delete as $value) {
3262 $out->putVarInt32(42);
3263 $out->putVarInt32($value->byteSizePartial());
3264 $value->outputPartial($out);
3266 if (isset($this->force)) {
3267 $out->putVarInt32(48);
3268 $out->putBoolean($this->force);
3271 public function tryMerge($d) {
3272 while($d->avail() > 0) {
3273 $tt = $d->getVarInt32();
3274 switch ($tt) {
3275 case 10:
3276 $length = $d->getVarInt32();
3277 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
3278 $d->skip($length);
3279 $this->addUpsert()->tryMerge($tmp);
3280 break;
3281 case 18:
3282 $length = $d->getVarInt32();
3283 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
3284 $d->skip($length);
3285 $this->addUpdate()->tryMerge($tmp);
3286 break;
3287 case 26:
3288 $length = $d->getVarInt32();
3289 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
3290 $d->skip($length);
3291 $this->addInsert()->tryMerge($tmp);
3292 break;
3293 case 34:
3294 $length = $d->getVarInt32();
3295 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
3296 $d->skip($length);
3297 $this->addInsertAutoId()->tryMerge($tmp);
3298 break;
3299 case 42:
3300 $length = $d->getVarInt32();
3301 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
3302 $d->skip($length);
3303 $this->addDelete()->tryMerge($tmp);
3304 break;
3305 case 48:
3306 $this->setForce($d->getBoolean());
3307 break;
3308 case 0:
3309 throw new \google\net\ProtocolBufferDecodeError();
3310 break;
3311 default:
3312 $d->skipData($tt);
3316 public function checkInitialized() {
3317 foreach ($this->upsert as $value) {
3318 if (!$value->isInitialized()) return 'upsert';
3320 foreach ($this->update as $value) {
3321 if (!$value->isInitialized()) return 'update';
3323 foreach ($this->insert as $value) {
3324 if (!$value->isInitialized()) return 'insert';
3326 foreach ($this->insert_auto_id as $value) {
3327 if (!$value->isInitialized()) return 'insert_auto_id';
3329 foreach ($this->delete as $value) {
3330 if (!$value->isInitialized()) return 'delete';
3332 return null;
3334 public function mergeFrom($x) {
3335 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
3336 foreach ($x->getUpsertList() as $v) {
3337 $this->addUpsert()->copyFrom($v);
3339 foreach ($x->getUpdateList() as $v) {
3340 $this->addUpdate()->copyFrom($v);
3342 foreach ($x->getInsertList() as $v) {
3343 $this->addInsert()->copyFrom($v);
3345 foreach ($x->getInsertAutoIdList() as $v) {
3346 $this->addInsertAutoId()->copyFrom($v);
3348 foreach ($x->getDeleteList() as $v) {
3349 $this->addDelete()->copyFrom($v);
3351 if ($x->hasForce()) {
3352 $this->setForce($x->getForce());
3355 public function equals($x) {
3356 if ($x === $this) { return true; }
3357 if (sizeof($this->upsert) !== sizeof($x->upsert)) return false;
3358 foreach (array_map(null, $this->upsert, $x->upsert) as $v) {
3359 if (!$v[0]->equals($v[1])) return false;
3361 if (sizeof($this->update) !== sizeof($x->update)) return false;
3362 foreach (array_map(null, $this->update, $x->update) as $v) {
3363 if (!$v[0]->equals($v[1])) return false;
3365 if (sizeof($this->insert) !== sizeof($x->insert)) return false;
3366 foreach (array_map(null, $this->insert, $x->insert) as $v) {
3367 if (!$v[0]->equals($v[1])) return false;
3369 if (sizeof($this->insert_auto_id) !== sizeof($x->insert_auto_id)) return false;
3370 foreach (array_map(null, $this->insert_auto_id, $x->insert_auto_id) as $v) {
3371 if (!$v[0]->equals($v[1])) return false;
3373 if (sizeof($this->delete) !== sizeof($x->delete)) return false;
3374 foreach (array_map(null, $this->delete, $x->delete) as $v) {
3375 if (!$v[0]->equals($v[1])) return false;
3377 if (isset($this->force) !== isset($x->force)) return false;
3378 if (isset($this->force) && $this->force !== $x->force) return false;
3379 return true;
3381 public function shortDebugString($prefix = "") {
3382 $res = '';
3383 foreach ($this->upsert as $value) {
3384 $res .= $prefix . "upsert <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
3386 foreach ($this->update as $value) {
3387 $res .= $prefix . "update <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
3389 foreach ($this->insert as $value) {
3390 $res .= $prefix . "insert <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
3392 foreach ($this->insert_auto_id as $value) {
3393 $res .= $prefix . "insert_auto_id <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
3395 foreach ($this->delete as $value) {
3396 $res .= $prefix . "delete <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
3398 if (isset($this->force)) {
3399 $res .= $prefix . "force: " . $this->debugFormatBool($this->force) . "\n";
3401 return $res;
3405 namespace google\appengine\datastore\v4 {
3406 class DeprecatedMutationResult extends \google\net\ProtocolMessage {
3407 private $insert_auto_id_key = array();
3408 private $upsert_version = array();
3409 private $update_version = array();
3410 private $insert_version = array();
3411 private $insert_auto_id_version = array();
3412 private $delete_version = array();
3413 public function getIndexUpdates() {
3414 if (!isset($this->index_updates)) {
3415 return 0;
3417 return $this->index_updates;
3419 public function setIndexUpdates($val) {
3420 $this->index_updates = $val;
3421 return $this;
3423 public function clearIndexUpdates() {
3424 unset($this->index_updates);
3425 return $this;
3427 public function hasIndexUpdates() {
3428 return isset($this->index_updates);
3430 public function getInsertAutoIdKeySize() {
3431 return sizeof($this->insert_auto_id_key);
3433 public function getInsertAutoIdKeyList() {
3434 return $this->insert_auto_id_key;
3436 public function mutableInsertAutoIdKey($idx) {
3437 if (!isset($this->insert_auto_id_key[$idx])) {
3438 $val = new \google\appengine\datastore\v4\Key();
3439 $this->insert_auto_id_key[$idx] = $val;
3440 return $val;
3442 return $this->insert_auto_id_key[$idx];
3444 public function getInsertAutoIdKey($idx) {
3445 if (isset($this->insert_auto_id_key[$idx])) {
3446 return $this->insert_auto_id_key[$idx];
3448 if ($idx >= end(array_keys($this->insert_auto_id_key))) {
3449 throw new \OutOfRangeException('index out of range: ' + $idx);
3451 return new \google\appengine\datastore\v4\Key();
3453 public function addInsertAutoIdKey() {
3454 $val = new \google\appengine\datastore\v4\Key();
3455 $this->insert_auto_id_key[] = $val;
3456 return $val;
3458 public function clearInsertAutoIdKey() {
3459 $this->insert_auto_id_key = array();
3461 public function getUpsertVersionSize() {
3462 return sizeof($this->upsert_version);
3464 public function getUpsertVersionList() {
3465 return $this->upsert_version;
3467 public function getUpsertVersion($idx) {
3468 return $this->upsert_version[$idx];
3470 public function setUpsertVersion($idx, $val) {
3471 if (is_double($val)) {
3472 $this->upsert_version[$idx] = sprintf('%0.0F', $val);
3473 } else {
3474 $this->upsert_version[$idx] = $val;
3476 return $this;
3478 public function addUpsertVersion($val) {
3479 if (is_double($val)) {
3480 $this->upsert_version[] = sprintf('%0.0F', $val);
3481 } else {
3482 $this->upsert_version[] = $val;
3484 return $this;
3486 public function clearUpsertVersion() {
3487 $this->upsert_version = array();
3489 public function getUpdateVersionSize() {
3490 return sizeof($this->update_version);
3492 public function getUpdateVersionList() {
3493 return $this->update_version;
3495 public function getUpdateVersion($idx) {
3496 return $this->update_version[$idx];
3498 public function setUpdateVersion($idx, $val) {
3499 if (is_double($val)) {
3500 $this->update_version[$idx] = sprintf('%0.0F', $val);
3501 } else {
3502 $this->update_version[$idx] = $val;
3504 return $this;
3506 public function addUpdateVersion($val) {
3507 if (is_double($val)) {
3508 $this->update_version[] = sprintf('%0.0F', $val);
3509 } else {
3510 $this->update_version[] = $val;
3512 return $this;
3514 public function clearUpdateVersion() {
3515 $this->update_version = array();
3517 public function getInsertVersionSize() {
3518 return sizeof($this->insert_version);
3520 public function getInsertVersionList() {
3521 return $this->insert_version;
3523 public function getInsertVersion($idx) {
3524 return $this->insert_version[$idx];
3526 public function setInsertVersion($idx, $val) {
3527 if (is_double($val)) {
3528 $this->insert_version[$idx] = sprintf('%0.0F', $val);
3529 } else {
3530 $this->insert_version[$idx] = $val;
3532 return $this;
3534 public function addInsertVersion($val) {
3535 if (is_double($val)) {
3536 $this->insert_version[] = sprintf('%0.0F', $val);
3537 } else {
3538 $this->insert_version[] = $val;
3540 return $this;
3542 public function clearInsertVersion() {
3543 $this->insert_version = array();
3545 public function getInsertAutoIdVersionSize() {
3546 return sizeof($this->insert_auto_id_version);
3548 public function getInsertAutoIdVersionList() {
3549 return $this->insert_auto_id_version;
3551 public function getInsertAutoIdVersion($idx) {
3552 return $this->insert_auto_id_version[$idx];
3554 public function setInsertAutoIdVersion($idx, $val) {
3555 if (is_double($val)) {
3556 $this->insert_auto_id_version[$idx] = sprintf('%0.0F', $val);
3557 } else {
3558 $this->insert_auto_id_version[$idx] = $val;
3560 return $this;
3562 public function addInsertAutoIdVersion($val) {
3563 if (is_double($val)) {
3564 $this->insert_auto_id_version[] = sprintf('%0.0F', $val);
3565 } else {
3566 $this->insert_auto_id_version[] = $val;
3568 return $this;
3570 public function clearInsertAutoIdVersion() {
3571 $this->insert_auto_id_version = array();
3573 public function getDeleteVersionSize() {
3574 return sizeof($this->delete_version);
3576 public function getDeleteVersionList() {
3577 return $this->delete_version;
3579 public function getDeleteVersion($idx) {
3580 return $this->delete_version[$idx];
3582 public function setDeleteVersion($idx, $val) {
3583 if (is_double($val)) {
3584 $this->delete_version[$idx] = sprintf('%0.0F', $val);
3585 } else {
3586 $this->delete_version[$idx] = $val;
3588 return $this;
3590 public function addDeleteVersion($val) {
3591 if (is_double($val)) {
3592 $this->delete_version[] = sprintf('%0.0F', $val);
3593 } else {
3594 $this->delete_version[] = $val;
3596 return $this;
3598 public function clearDeleteVersion() {
3599 $this->delete_version = array();
3601 public function clear() {
3602 $this->clearIndexUpdates();
3603 $this->clearInsertAutoIdKey();
3604 $this->clearUpsertVersion();
3605 $this->clearUpdateVersion();
3606 $this->clearInsertVersion();
3607 $this->clearInsertAutoIdVersion();
3608 $this->clearDeleteVersion();
3610 public function byteSizePartial() {
3611 $res = 0;
3612 if (isset($this->index_updates)) {
3613 $res += 1;
3614 $res += $this->lengthVarInt64($this->index_updates);
3616 $this->checkProtoArray($this->insert_auto_id_key);
3617 $res += 1 * sizeof($this->insert_auto_id_key);
3618 foreach ($this->insert_auto_id_key as $value) {
3619 $res += $this->lengthString($value->byteSizePartial());
3621 $this->checkProtoArray($this->upsert_version);
3622 $res += 1 * sizeof($this->upsert_version);
3623 foreach ($this->upsert_version as $value) {
3624 $res += $this->lengthVarInt64($value);
3626 $this->checkProtoArray($this->update_version);
3627 $res += 1 * sizeof($this->update_version);
3628 foreach ($this->update_version as $value) {
3629 $res += $this->lengthVarInt64($value);
3631 $this->checkProtoArray($this->insert_version);
3632 $res += 1 * sizeof($this->insert_version);
3633 foreach ($this->insert_version as $value) {
3634 $res += $this->lengthVarInt64($value);
3636 $this->checkProtoArray($this->insert_auto_id_version);
3637 $res += 1 * sizeof($this->insert_auto_id_version);
3638 foreach ($this->insert_auto_id_version as $value) {
3639 $res += $this->lengthVarInt64($value);
3641 $this->checkProtoArray($this->delete_version);
3642 $res += 1 * sizeof($this->delete_version);
3643 foreach ($this->delete_version as $value) {
3644 $res += $this->lengthVarInt64($value);
3646 return $res;
3648 public function outputPartial($out) {
3649 if (isset($this->index_updates)) {
3650 $out->putVarInt32(8);
3651 $out->putVarInt32($this->index_updates);
3653 $this->checkProtoArray($this->insert_auto_id_key);
3654 foreach ($this->insert_auto_id_key as $value) {
3655 $out->putVarInt32(18);
3656 $out->putVarInt32($value->byteSizePartial());
3657 $value->outputPartial($out);
3659 $this->checkProtoArray($this->upsert_version);
3660 foreach ($this->upsert_version as $value) {
3661 $out->putVarInt32(24);
3662 $out->putVarInt64($value);
3664 $this->checkProtoArray($this->update_version);
3665 foreach ($this->update_version as $value) {
3666 $out->putVarInt32(32);
3667 $out->putVarInt64($value);
3669 $this->checkProtoArray($this->insert_version);
3670 foreach ($this->insert_version as $value) {
3671 $out->putVarInt32(40);
3672 $out->putVarInt64($value);
3674 $this->checkProtoArray($this->insert_auto_id_version);
3675 foreach ($this->insert_auto_id_version as $value) {
3676 $out->putVarInt32(48);
3677 $out->putVarInt64($value);
3679 $this->checkProtoArray($this->delete_version);
3680 foreach ($this->delete_version as $value) {
3681 $out->putVarInt32(56);
3682 $out->putVarInt64($value);
3685 public function tryMerge($d) {
3686 while($d->avail() > 0) {
3687 $tt = $d->getVarInt32();
3688 switch ($tt) {
3689 case 8:
3690 $this->setIndexUpdates($d->getVarInt32());
3691 break;
3692 case 18:
3693 $length = $d->getVarInt32();
3694 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
3695 $d->skip($length);
3696 $this->addInsertAutoIdKey()->tryMerge($tmp);
3697 break;
3698 case 24:
3699 $this->addUpsertVersion($d->getVarInt64());
3700 break;
3701 case 32:
3702 $this->addUpdateVersion($d->getVarInt64());
3703 break;
3704 case 40:
3705 $this->addInsertVersion($d->getVarInt64());
3706 break;
3707 case 48:
3708 $this->addInsertAutoIdVersion($d->getVarInt64());
3709 break;
3710 case 56:
3711 $this->addDeleteVersion($d->getVarInt64());
3712 break;
3713 case 0:
3714 throw new \google\net\ProtocolBufferDecodeError();
3715 break;
3716 default:
3717 $d->skipData($tt);
3721 public function checkInitialized() {
3722 if (!isset($this->index_updates)) return 'index_updates';
3723 foreach ($this->insert_auto_id_key as $value) {
3724 if (!$value->isInitialized()) return 'insert_auto_id_key';
3726 return null;
3728 public function mergeFrom($x) {
3729 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
3730 if ($x->hasIndexUpdates()) {
3731 $this->setIndexUpdates($x->getIndexUpdates());
3733 foreach ($x->getInsertAutoIdKeyList() as $v) {
3734 $this->addInsertAutoIdKey()->copyFrom($v);
3736 foreach ($x->getUpsertVersionList() as $v) {
3737 $this->addUpsertVersion($v);
3739 foreach ($x->getUpdateVersionList() as $v) {
3740 $this->addUpdateVersion($v);
3742 foreach ($x->getInsertVersionList() as $v) {
3743 $this->addInsertVersion($v);
3745 foreach ($x->getInsertAutoIdVersionList() as $v) {
3746 $this->addInsertAutoIdVersion($v);
3748 foreach ($x->getDeleteVersionList() as $v) {
3749 $this->addDeleteVersion($v);
3752 public function equals($x) {
3753 if ($x === $this) { return true; }
3754 if (isset($this->index_updates) !== isset($x->index_updates)) return false;
3755 if (isset($this->index_updates) && !$this->integerEquals($this->index_updates, $x->index_updates)) return false;
3756 if (sizeof($this->insert_auto_id_key) !== sizeof($x->insert_auto_id_key)) return false;
3757 foreach (array_map(null, $this->insert_auto_id_key, $x->insert_auto_id_key) as $v) {
3758 if (!$v[0]->equals($v[1])) return false;
3760 if (sizeof($this->upsert_version) !== sizeof($x->upsert_version)) return false;
3761 foreach (array_map(null, $this->upsert_version, $x->upsert_version) as $v) {
3762 if (!$this->integerEquals($v[0], $v[1])) return false;
3764 if (sizeof($this->update_version) !== sizeof($x->update_version)) return false;
3765 foreach (array_map(null, $this->update_version, $x->update_version) as $v) {
3766 if (!$this->integerEquals($v[0], $v[1])) return false;
3768 if (sizeof($this->insert_version) !== sizeof($x->insert_version)) return false;
3769 foreach (array_map(null, $this->insert_version, $x->insert_version) as $v) {
3770 if (!$this->integerEquals($v[0], $v[1])) return false;
3772 if (sizeof($this->insert_auto_id_version) !== sizeof($x->insert_auto_id_version)) return false;
3773 foreach (array_map(null, $this->insert_auto_id_version, $x->insert_auto_id_version) as $v) {
3774 if (!$this->integerEquals($v[0], $v[1])) return false;
3776 if (sizeof($this->delete_version) !== sizeof($x->delete_version)) return false;
3777 foreach (array_map(null, $this->delete_version, $x->delete_version) as $v) {
3778 if (!$this->integerEquals($v[0], $v[1])) return false;
3780 return true;
3782 public function shortDebugString($prefix = "") {
3783 $res = '';
3784 if (isset($this->index_updates)) {
3785 $res .= $prefix . "index_updates: " . $this->debugFormatInt32($this->index_updates) . "\n";
3787 foreach ($this->insert_auto_id_key as $value) {
3788 $res .= $prefix . "insert_auto_id_key <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
3790 foreach ($this->upsert_version as $value) {
3791 $res .= $prefix . "upsert_version: " . $this->debugFormatInt64($value) . "\n";
3793 foreach ($this->update_version as $value) {
3794 $res .= $prefix . "update_version: " . $this->debugFormatInt64($value) . "\n";
3796 foreach ($this->insert_version as $value) {
3797 $res .= $prefix . "insert_version: " . $this->debugFormatInt64($value) . "\n";
3799 foreach ($this->insert_auto_id_version as $value) {
3800 $res .= $prefix . "insert_auto_id_version: " . $this->debugFormatInt64($value) . "\n";
3802 foreach ($this->delete_version as $value) {
3803 $res .= $prefix . "delete_version: " . $this->debugFormatInt64($value) . "\n";
3805 return $res;
3809 namespace google\appengine\datastore\v4\ReadOptions {
3810 class ReadConsistency {
3811 const DEFAULT_ = 0;
3812 const STRONG = 1;
3813 const EVENTUAL = 2;
3816 namespace google\appengine\datastore\v4 {
3817 class ReadOptions extends \google\net\ProtocolMessage {
3818 public function getReadConsistency() {
3819 if (!isset($this->read_consistency)) {
3820 return 0;
3822 return $this->read_consistency;
3824 public function setReadConsistency($val) {
3825 $this->read_consistency = $val;
3826 return $this;
3828 public function clearReadConsistency() {
3829 unset($this->read_consistency);
3830 return $this;
3832 public function hasReadConsistency() {
3833 return isset($this->read_consistency);
3835 public function getTransaction() {
3836 if (!isset($this->transaction)) {
3837 return '';
3839 return $this->transaction;
3841 public function setTransaction($val) {
3842 $this->transaction = $val;
3843 return $this;
3845 public function clearTransaction() {
3846 unset($this->transaction);
3847 return $this;
3849 public function hasTransaction() {
3850 return isset($this->transaction);
3852 public function clear() {
3853 $this->clearReadConsistency();
3854 $this->clearTransaction();
3856 public function byteSizePartial() {
3857 $res = 0;
3858 if (isset($this->read_consistency)) {
3859 $res += 1;
3860 $res += $this->lengthVarInt64($this->read_consistency);
3862 if (isset($this->transaction)) {
3863 $res += 1;
3864 $res += $this->lengthString(strlen($this->transaction));
3866 return $res;
3868 public function outputPartial($out) {
3869 if (isset($this->read_consistency)) {
3870 $out->putVarInt32(8);
3871 $out->putVarInt32($this->read_consistency);
3873 if (isset($this->transaction)) {
3874 $out->putVarInt32(18);
3875 $out->putPrefixedString($this->transaction);
3878 public function tryMerge($d) {
3879 while($d->avail() > 0) {
3880 $tt = $d->getVarInt32();
3881 switch ($tt) {
3882 case 8:
3883 $this->setReadConsistency($d->getVarInt32());
3884 break;
3885 case 18:
3886 $length = $d->getVarInt32();
3887 $this->setTransaction(substr($d->buffer(), $d->pos(), $length));
3888 $d->skip($length);
3889 break;
3890 case 0:
3891 throw new \google\net\ProtocolBufferDecodeError();
3892 break;
3893 default:
3894 $d->skipData($tt);
3898 public function checkInitialized() {
3899 return null;
3901 public function mergeFrom($x) {
3902 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
3903 if ($x->hasReadConsistency()) {
3904 $this->setReadConsistency($x->getReadConsistency());
3906 if ($x->hasTransaction()) {
3907 $this->setTransaction($x->getTransaction());
3910 public function equals($x) {
3911 if ($x === $this) { return true; }
3912 if (isset($this->read_consistency) !== isset($x->read_consistency)) return false;
3913 if (isset($this->read_consistency) && $this->read_consistency !== $x->read_consistency) return false;
3914 if (isset($this->transaction) !== isset($x->transaction)) return false;
3915 if (isset($this->transaction) && $this->transaction !== $x->transaction) return false;
3916 return true;
3918 public function shortDebugString($prefix = "") {
3919 $res = '';
3920 if (isset($this->read_consistency)) {
3921 $res .= $prefix . "read_consistency: " . ($this->read_consistency) . "\n";
3923 if (isset($this->transaction)) {
3924 $res .= $prefix . "transaction: " . $this->debugFormatString($this->transaction) . "\n";
3926 return $res;
3930 namespace google\appengine\datastore\v4 {
3931 class LookupRequest extends \google\net\ProtocolMessage {
3932 private $key = array();
3933 public function getReadOptions() {
3934 if (!isset($this->read_options)) {
3935 return new \google\appengine\datastore\v4\ReadOptions();
3937 return $this->read_options;
3939 public function mutableReadOptions() {
3940 if (!isset($this->read_options)) {
3941 $res = new \google\appengine\datastore\v4\ReadOptions();
3942 $this->read_options = $res;
3943 return $res;
3945 return $this->read_options;
3947 public function clearReadOptions() {
3948 if (isset($this->read_options)) {
3949 unset($this->read_options);
3952 public function hasReadOptions() {
3953 return isset($this->read_options);
3955 public function getKeySize() {
3956 return sizeof($this->key);
3958 public function getKeyList() {
3959 return $this->key;
3961 public function mutableKey($idx) {
3962 if (!isset($this->key[$idx])) {
3963 $val = new \google\appengine\datastore\v4\Key();
3964 $this->key[$idx] = $val;
3965 return $val;
3967 return $this->key[$idx];
3969 public function getKey($idx) {
3970 if (isset($this->key[$idx])) {
3971 return $this->key[$idx];
3973 if ($idx >= end(array_keys($this->key))) {
3974 throw new \OutOfRangeException('index out of range: ' + $idx);
3976 return new \google\appengine\datastore\v4\Key();
3978 public function addKey() {
3979 $val = new \google\appengine\datastore\v4\Key();
3980 $this->key[] = $val;
3981 return $val;
3983 public function clearKey() {
3984 $this->key = array();
3986 public function clear() {
3987 $this->clearReadOptions();
3988 $this->clearKey();
3990 public function byteSizePartial() {
3991 $res = 0;
3992 if (isset($this->read_options)) {
3993 $res += 1;
3994 $res += $this->lengthString($this->read_options->byteSizePartial());
3996 $this->checkProtoArray($this->key);
3997 $res += 1 * sizeof($this->key);
3998 foreach ($this->key as $value) {
3999 $res += $this->lengthString($value->byteSizePartial());
4001 return $res;
4003 public function outputPartial($out) {
4004 if (isset($this->read_options)) {
4005 $out->putVarInt32(10);
4006 $out->putVarInt32($this->read_options->byteSizePartial());
4007 $this->read_options->outputPartial($out);
4009 $this->checkProtoArray($this->key);
4010 foreach ($this->key as $value) {
4011 $out->putVarInt32(26);
4012 $out->putVarInt32($value->byteSizePartial());
4013 $value->outputPartial($out);
4016 public function tryMerge($d) {
4017 while($d->avail() > 0) {
4018 $tt = $d->getVarInt32();
4019 switch ($tt) {
4020 case 10:
4021 $length = $d->getVarInt32();
4022 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4023 $d->skip($length);
4024 $this->mutableReadOptions()->tryMerge($tmp);
4025 break;
4026 case 26:
4027 $length = $d->getVarInt32();
4028 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4029 $d->skip($length);
4030 $this->addKey()->tryMerge($tmp);
4031 break;
4032 case 0:
4033 throw new \google\net\ProtocolBufferDecodeError();
4034 break;
4035 default:
4036 $d->skipData($tt);
4040 public function checkInitialized() {
4041 if (isset($this->read_options) && (!$this->read_options->isInitialized())) return 'read_options';
4042 foreach ($this->key as $value) {
4043 if (!$value->isInitialized()) return 'key';
4045 return null;
4047 public function mergeFrom($x) {
4048 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
4049 if ($x->hasReadOptions()) {
4050 $this->mutableReadOptions()->mergeFrom($x->getReadOptions());
4052 foreach ($x->getKeyList() as $v) {
4053 $this->addKey()->copyFrom($v);
4056 public function equals($x) {
4057 if ($x === $this) { return true; }
4058 if (isset($this->read_options) !== isset($x->read_options)) return false;
4059 if (isset($this->read_options) && !$this->read_options->equals($x->read_options)) return false;
4060 if (sizeof($this->key) !== sizeof($x->key)) return false;
4061 foreach (array_map(null, $this->key, $x->key) as $v) {
4062 if (!$v[0]->equals($v[1])) return false;
4064 return true;
4066 public function shortDebugString($prefix = "") {
4067 $res = '';
4068 if (isset($this->read_options)) {
4069 $res .= $prefix . "read_options <\n" . $this->read_options->shortDebugString($prefix . " ") . $prefix . ">\n";
4071 foreach ($this->key as $value) {
4072 $res .= $prefix . "key <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
4074 return $res;
4078 namespace google\appengine\datastore\v4 {
4079 class LookupResponse extends \google\net\ProtocolMessage {
4080 private $found = array();
4081 private $missing = array();
4082 private $deferred = array();
4083 public function getFoundSize() {
4084 return sizeof($this->found);
4086 public function getFoundList() {
4087 return $this->found;
4089 public function mutableFound($idx) {
4090 if (!isset($this->found[$idx])) {
4091 $val = new \google\appengine\datastore\v4\EntityResult();
4092 $this->found[$idx] = $val;
4093 return $val;
4095 return $this->found[$idx];
4097 public function getFound($idx) {
4098 if (isset($this->found[$idx])) {
4099 return $this->found[$idx];
4101 if ($idx >= end(array_keys($this->found))) {
4102 throw new \OutOfRangeException('index out of range: ' + $idx);
4104 return new \google\appengine\datastore\v4\EntityResult();
4106 public function addFound() {
4107 $val = new \google\appengine\datastore\v4\EntityResult();
4108 $this->found[] = $val;
4109 return $val;
4111 public function clearFound() {
4112 $this->found = array();
4114 public function getMissingSize() {
4115 return sizeof($this->missing);
4117 public function getMissingList() {
4118 return $this->missing;
4120 public function mutableMissing($idx) {
4121 if (!isset($this->missing[$idx])) {
4122 $val = new \google\appengine\datastore\v4\EntityResult();
4123 $this->missing[$idx] = $val;
4124 return $val;
4126 return $this->missing[$idx];
4128 public function getMissing($idx) {
4129 if (isset($this->missing[$idx])) {
4130 return $this->missing[$idx];
4132 if ($idx >= end(array_keys($this->missing))) {
4133 throw new \OutOfRangeException('index out of range: ' + $idx);
4135 return new \google\appengine\datastore\v4\EntityResult();
4137 public function addMissing() {
4138 $val = new \google\appengine\datastore\v4\EntityResult();
4139 $this->missing[] = $val;
4140 return $val;
4142 public function clearMissing() {
4143 $this->missing = array();
4145 public function getDeferredSize() {
4146 return sizeof($this->deferred);
4148 public function getDeferredList() {
4149 return $this->deferred;
4151 public function mutableDeferred($idx) {
4152 if (!isset($this->deferred[$idx])) {
4153 $val = new \google\appengine\datastore\v4\Key();
4154 $this->deferred[$idx] = $val;
4155 return $val;
4157 return $this->deferred[$idx];
4159 public function getDeferred($idx) {
4160 if (isset($this->deferred[$idx])) {
4161 return $this->deferred[$idx];
4163 if ($idx >= end(array_keys($this->deferred))) {
4164 throw new \OutOfRangeException('index out of range: ' + $idx);
4166 return new \google\appengine\datastore\v4\Key();
4168 public function addDeferred() {
4169 $val = new \google\appengine\datastore\v4\Key();
4170 $this->deferred[] = $val;
4171 return $val;
4173 public function clearDeferred() {
4174 $this->deferred = array();
4176 public function clear() {
4177 $this->clearFound();
4178 $this->clearMissing();
4179 $this->clearDeferred();
4181 public function byteSizePartial() {
4182 $res = 0;
4183 $this->checkProtoArray($this->found);
4184 $res += 1 * sizeof($this->found);
4185 foreach ($this->found as $value) {
4186 $res += $this->lengthString($value->byteSizePartial());
4188 $this->checkProtoArray($this->missing);
4189 $res += 1 * sizeof($this->missing);
4190 foreach ($this->missing as $value) {
4191 $res += $this->lengthString($value->byteSizePartial());
4193 $this->checkProtoArray($this->deferred);
4194 $res += 1 * sizeof($this->deferred);
4195 foreach ($this->deferred as $value) {
4196 $res += $this->lengthString($value->byteSizePartial());
4198 return $res;
4200 public function outputPartial($out) {
4201 $this->checkProtoArray($this->found);
4202 foreach ($this->found as $value) {
4203 $out->putVarInt32(10);
4204 $out->putVarInt32($value->byteSizePartial());
4205 $value->outputPartial($out);
4207 $this->checkProtoArray($this->missing);
4208 foreach ($this->missing as $value) {
4209 $out->putVarInt32(18);
4210 $out->putVarInt32($value->byteSizePartial());
4211 $value->outputPartial($out);
4213 $this->checkProtoArray($this->deferred);
4214 foreach ($this->deferred as $value) {
4215 $out->putVarInt32(26);
4216 $out->putVarInt32($value->byteSizePartial());
4217 $value->outputPartial($out);
4220 public function tryMerge($d) {
4221 while($d->avail() > 0) {
4222 $tt = $d->getVarInt32();
4223 switch ($tt) {
4224 case 10:
4225 $length = $d->getVarInt32();
4226 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4227 $d->skip($length);
4228 $this->addFound()->tryMerge($tmp);
4229 break;
4230 case 18:
4231 $length = $d->getVarInt32();
4232 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4233 $d->skip($length);
4234 $this->addMissing()->tryMerge($tmp);
4235 break;
4236 case 26:
4237 $length = $d->getVarInt32();
4238 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4239 $d->skip($length);
4240 $this->addDeferred()->tryMerge($tmp);
4241 break;
4242 case 0:
4243 throw new \google\net\ProtocolBufferDecodeError();
4244 break;
4245 default:
4246 $d->skipData($tt);
4250 public function checkInitialized() {
4251 foreach ($this->found as $value) {
4252 if (!$value->isInitialized()) return 'found';
4254 foreach ($this->missing as $value) {
4255 if (!$value->isInitialized()) return 'missing';
4257 foreach ($this->deferred as $value) {
4258 if (!$value->isInitialized()) return 'deferred';
4260 return null;
4262 public function mergeFrom($x) {
4263 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
4264 foreach ($x->getFoundList() as $v) {
4265 $this->addFound()->copyFrom($v);
4267 foreach ($x->getMissingList() as $v) {
4268 $this->addMissing()->copyFrom($v);
4270 foreach ($x->getDeferredList() as $v) {
4271 $this->addDeferred()->copyFrom($v);
4274 public function equals($x) {
4275 if ($x === $this) { return true; }
4276 if (sizeof($this->found) !== sizeof($x->found)) return false;
4277 foreach (array_map(null, $this->found, $x->found) as $v) {
4278 if (!$v[0]->equals($v[1])) return false;
4280 if (sizeof($this->missing) !== sizeof($x->missing)) return false;
4281 foreach (array_map(null, $this->missing, $x->missing) as $v) {
4282 if (!$v[0]->equals($v[1])) return false;
4284 if (sizeof($this->deferred) !== sizeof($x->deferred)) return false;
4285 foreach (array_map(null, $this->deferred, $x->deferred) as $v) {
4286 if (!$v[0]->equals($v[1])) return false;
4288 return true;
4290 public function shortDebugString($prefix = "") {
4291 $res = '';
4292 foreach ($this->found as $value) {
4293 $res .= $prefix . "found <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
4295 foreach ($this->missing as $value) {
4296 $res .= $prefix . "missing <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
4298 foreach ($this->deferred as $value) {
4299 $res .= $prefix . "deferred <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
4301 return $res;
4305 namespace google\appengine\datastore\v4 {
4306 class RunQueryRequest extends \google\net\ProtocolMessage {
4307 public function getReadOptions() {
4308 if (!isset($this->read_options)) {
4309 return new \google\appengine\datastore\v4\ReadOptions();
4311 return $this->read_options;
4313 public function mutableReadOptions() {
4314 if (!isset($this->read_options)) {
4315 $res = new \google\appengine\datastore\v4\ReadOptions();
4316 $this->read_options = $res;
4317 return $res;
4319 return $this->read_options;
4321 public function clearReadOptions() {
4322 if (isset($this->read_options)) {
4323 unset($this->read_options);
4326 public function hasReadOptions() {
4327 return isset($this->read_options);
4329 public function getPartitionId() {
4330 if (!isset($this->partition_id)) {
4331 return new \google\appengine\datastore\v4\PartitionId();
4333 return $this->partition_id;
4335 public function mutablePartitionId() {
4336 if (!isset($this->partition_id)) {
4337 $res = new \google\appengine\datastore\v4\PartitionId();
4338 $this->partition_id = $res;
4339 return $res;
4341 return $this->partition_id;
4343 public function clearPartitionId() {
4344 if (isset($this->partition_id)) {
4345 unset($this->partition_id);
4348 public function hasPartitionId() {
4349 return isset($this->partition_id);
4351 public function getQuery() {
4352 if (!isset($this->query)) {
4353 return new \google\appengine\datastore\v4\Query();
4355 return $this->query;
4357 public function mutableQuery() {
4358 if (!isset($this->query)) {
4359 $res = new \google\appengine\datastore\v4\Query();
4360 $this->query = $res;
4361 return $res;
4363 return $this->query;
4365 public function clearQuery() {
4366 if (isset($this->query)) {
4367 unset($this->query);
4370 public function hasQuery() {
4371 return isset($this->query);
4373 public function getMinSafeTimeSeconds() {
4374 if (!isset($this->min_safe_time_seconds)) {
4375 return "0";
4377 return $this->min_safe_time_seconds;
4379 public function setMinSafeTimeSeconds($val) {
4380 if (is_double($val)) {
4381 $this->min_safe_time_seconds = sprintf('%0.0F', $val);
4382 } else {
4383 $this->min_safe_time_seconds = $val;
4385 return $this;
4387 public function clearMinSafeTimeSeconds() {
4388 unset($this->min_safe_time_seconds);
4389 return $this;
4391 public function hasMinSafeTimeSeconds() {
4392 return isset($this->min_safe_time_seconds);
4394 public function getSuggestedBatchSize() {
4395 if (!isset($this->suggested_batch_size)) {
4396 return 0;
4398 return $this->suggested_batch_size;
4400 public function setSuggestedBatchSize($val) {
4401 $this->suggested_batch_size = $val;
4402 return $this;
4404 public function clearSuggestedBatchSize() {
4405 unset($this->suggested_batch_size);
4406 return $this;
4408 public function hasSuggestedBatchSize() {
4409 return isset($this->suggested_batch_size);
4411 public function getGqlQuery() {
4412 if (!isset($this->gql_query)) {
4413 return new \google\appengine\datastore\v4\GqlQuery();
4415 return $this->gql_query;
4417 public function mutableGqlQuery() {
4418 if (!isset($this->gql_query)) {
4419 $res = new \google\appengine\datastore\v4\GqlQuery();
4420 $this->gql_query = $res;
4421 return $res;
4423 return $this->gql_query;
4425 public function clearGqlQuery() {
4426 if (isset($this->gql_query)) {
4427 unset($this->gql_query);
4430 public function hasGqlQuery() {
4431 return isset($this->gql_query);
4433 public function clear() {
4434 $this->clearReadOptions();
4435 $this->clearPartitionId();
4436 $this->clearQuery();
4437 $this->clearMinSafeTimeSeconds();
4438 $this->clearSuggestedBatchSize();
4439 $this->clearGqlQuery();
4441 public function byteSizePartial() {
4442 $res = 0;
4443 if (isset($this->read_options)) {
4444 $res += 1;
4445 $res += $this->lengthString($this->read_options->byteSizePartial());
4447 if (isset($this->partition_id)) {
4448 $res += 1;
4449 $res += $this->lengthString($this->partition_id->byteSizePartial());
4451 if (isset($this->query)) {
4452 $res += 1;
4453 $res += $this->lengthString($this->query->byteSizePartial());
4455 if (isset($this->min_safe_time_seconds)) {
4456 $res += 1;
4457 $res += $this->lengthVarInt64($this->min_safe_time_seconds);
4459 if (isset($this->suggested_batch_size)) {
4460 $res += 1;
4461 $res += $this->lengthVarInt64($this->suggested_batch_size);
4463 if (isset($this->gql_query)) {
4464 $res += 1;
4465 $res += $this->lengthString($this->gql_query->byteSizePartial());
4467 return $res;
4469 public function outputPartial($out) {
4470 if (isset($this->read_options)) {
4471 $out->putVarInt32(10);
4472 $out->putVarInt32($this->read_options->byteSizePartial());
4473 $this->read_options->outputPartial($out);
4475 if (isset($this->partition_id)) {
4476 $out->putVarInt32(18);
4477 $out->putVarInt32($this->partition_id->byteSizePartial());
4478 $this->partition_id->outputPartial($out);
4480 if (isset($this->query)) {
4481 $out->putVarInt32(26);
4482 $out->putVarInt32($this->query->byteSizePartial());
4483 $this->query->outputPartial($out);
4485 if (isset($this->min_safe_time_seconds)) {
4486 $out->putVarInt32(32);
4487 $out->putVarInt64($this->min_safe_time_seconds);
4489 if (isset($this->suggested_batch_size)) {
4490 $out->putVarInt32(40);
4491 $out->putVarInt32($this->suggested_batch_size);
4493 if (isset($this->gql_query)) {
4494 $out->putVarInt32(58);
4495 $out->putVarInt32($this->gql_query->byteSizePartial());
4496 $this->gql_query->outputPartial($out);
4499 public function tryMerge($d) {
4500 while($d->avail() > 0) {
4501 $tt = $d->getVarInt32();
4502 switch ($tt) {
4503 case 10:
4504 $length = $d->getVarInt32();
4505 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4506 $d->skip($length);
4507 $this->mutableReadOptions()->tryMerge($tmp);
4508 break;
4509 case 18:
4510 $length = $d->getVarInt32();
4511 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4512 $d->skip($length);
4513 $this->mutablePartitionId()->tryMerge($tmp);
4514 break;
4515 case 26:
4516 $length = $d->getVarInt32();
4517 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4518 $d->skip($length);
4519 $this->mutableQuery()->tryMerge($tmp);
4520 break;
4521 case 32:
4522 $this->setMinSafeTimeSeconds($d->getVarInt64());
4523 break;
4524 case 40:
4525 $this->setSuggestedBatchSize($d->getVarInt32());
4526 break;
4527 case 58:
4528 $length = $d->getVarInt32();
4529 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4530 $d->skip($length);
4531 $this->mutableGqlQuery()->tryMerge($tmp);
4532 break;
4533 case 0:
4534 throw new \google\net\ProtocolBufferDecodeError();
4535 break;
4536 default:
4537 $d->skipData($tt);
4541 public function checkInitialized() {
4542 if (isset($this->read_options) && (!$this->read_options->isInitialized())) return 'read_options';
4543 if (isset($this->partition_id) && (!$this->partition_id->isInitialized())) return 'partition_id';
4544 if (isset($this->query) && (!$this->query->isInitialized())) return 'query';
4545 if (isset($this->gql_query) && (!$this->gql_query->isInitialized())) return 'gql_query';
4546 return null;
4548 public function mergeFrom($x) {
4549 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
4550 if ($x->hasReadOptions()) {
4551 $this->mutableReadOptions()->mergeFrom($x->getReadOptions());
4553 if ($x->hasPartitionId()) {
4554 $this->mutablePartitionId()->mergeFrom($x->getPartitionId());
4556 if ($x->hasQuery()) {
4557 $this->mutableQuery()->mergeFrom($x->getQuery());
4559 if ($x->hasMinSafeTimeSeconds()) {
4560 $this->setMinSafeTimeSeconds($x->getMinSafeTimeSeconds());
4562 if ($x->hasSuggestedBatchSize()) {
4563 $this->setSuggestedBatchSize($x->getSuggestedBatchSize());
4565 if ($x->hasGqlQuery()) {
4566 $this->mutableGqlQuery()->mergeFrom($x->getGqlQuery());
4569 public function equals($x) {
4570 if ($x === $this) { return true; }
4571 if (isset($this->read_options) !== isset($x->read_options)) return false;
4572 if (isset($this->read_options) && !$this->read_options->equals($x->read_options)) return false;
4573 if (isset($this->partition_id) !== isset($x->partition_id)) return false;
4574 if (isset($this->partition_id) && !$this->partition_id->equals($x->partition_id)) return false;
4575 if (isset($this->query) !== isset($x->query)) return false;
4576 if (isset($this->query) && !$this->query->equals($x->query)) return false;
4577 if (isset($this->min_safe_time_seconds) !== isset($x->min_safe_time_seconds)) return false;
4578 if (isset($this->min_safe_time_seconds) && !$this->integerEquals($this->min_safe_time_seconds, $x->min_safe_time_seconds)) return false;
4579 if (isset($this->suggested_batch_size) !== isset($x->suggested_batch_size)) return false;
4580 if (isset($this->suggested_batch_size) && !$this->integerEquals($this->suggested_batch_size, $x->suggested_batch_size)) return false;
4581 if (isset($this->gql_query) !== isset($x->gql_query)) return false;
4582 if (isset($this->gql_query) && !$this->gql_query->equals($x->gql_query)) return false;
4583 return true;
4585 public function shortDebugString($prefix = "") {
4586 $res = '';
4587 if (isset($this->read_options)) {
4588 $res .= $prefix . "read_options <\n" . $this->read_options->shortDebugString($prefix . " ") . $prefix . ">\n";
4590 if (isset($this->partition_id)) {
4591 $res .= $prefix . "partition_id <\n" . $this->partition_id->shortDebugString($prefix . " ") . $prefix . ">\n";
4593 if (isset($this->query)) {
4594 $res .= $prefix . "query <\n" . $this->query->shortDebugString($prefix . " ") . $prefix . ">\n";
4596 if (isset($this->min_safe_time_seconds)) {
4597 $res .= $prefix . "min_safe_time_seconds: " . $this->debugFormatInt64($this->min_safe_time_seconds) . "\n";
4599 if (isset($this->suggested_batch_size)) {
4600 $res .= $prefix . "suggested_batch_size: " . $this->debugFormatInt32($this->suggested_batch_size) . "\n";
4602 if (isset($this->gql_query)) {
4603 $res .= $prefix . "gql_query <\n" . $this->gql_query->shortDebugString($prefix . " ") . $prefix . ">\n";
4605 return $res;
4609 namespace google\appengine\datastore\v4 {
4610 class RunQueryResponse extends \google\net\ProtocolMessage {
4611 public function getBatch() {
4612 if (!isset($this->batch)) {
4613 return new \google\appengine\datastore\v4\QueryResultBatch();
4615 return $this->batch;
4617 public function mutableBatch() {
4618 if (!isset($this->batch)) {
4619 $res = new \google\appengine\datastore\v4\QueryResultBatch();
4620 $this->batch = $res;
4621 return $res;
4623 return $this->batch;
4625 public function clearBatch() {
4626 if (isset($this->batch)) {
4627 unset($this->batch);
4630 public function hasBatch() {
4631 return isset($this->batch);
4633 public function getQueryHandle() {
4634 if (!isset($this->query_handle)) {
4635 return '';
4637 return $this->query_handle;
4639 public function setQueryHandle($val) {
4640 $this->query_handle = $val;
4641 return $this;
4643 public function clearQueryHandle() {
4644 unset($this->query_handle);
4645 return $this;
4647 public function hasQueryHandle() {
4648 return isset($this->query_handle);
4650 public function clear() {
4651 $this->clearBatch();
4652 $this->clearQueryHandle();
4654 public function byteSizePartial() {
4655 $res = 0;
4656 if (isset($this->batch)) {
4657 $res += 1;
4658 $res += $this->lengthString($this->batch->byteSizePartial());
4660 if (isset($this->query_handle)) {
4661 $res += 1;
4662 $res += $this->lengthString(strlen($this->query_handle));
4664 return $res;
4666 public function outputPartial($out) {
4667 if (isset($this->batch)) {
4668 $out->putVarInt32(10);
4669 $out->putVarInt32($this->batch->byteSizePartial());
4670 $this->batch->outputPartial($out);
4672 if (isset($this->query_handle)) {
4673 $out->putVarInt32(18);
4674 $out->putPrefixedString($this->query_handle);
4677 public function tryMerge($d) {
4678 while($d->avail() > 0) {
4679 $tt = $d->getVarInt32();
4680 switch ($tt) {
4681 case 10:
4682 $length = $d->getVarInt32();
4683 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4684 $d->skip($length);
4685 $this->mutableBatch()->tryMerge($tmp);
4686 break;
4687 case 18:
4688 $length = $d->getVarInt32();
4689 $this->setQueryHandle(substr($d->buffer(), $d->pos(), $length));
4690 $d->skip($length);
4691 break;
4692 case 0:
4693 throw new \google\net\ProtocolBufferDecodeError();
4694 break;
4695 default:
4696 $d->skipData($tt);
4700 public function checkInitialized() {
4701 if ((!isset($this->batch)) || (!$this->batch->isInitialized())) return 'batch';
4702 return null;
4704 public function mergeFrom($x) {
4705 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
4706 if ($x->hasBatch()) {
4707 $this->mutableBatch()->mergeFrom($x->getBatch());
4709 if ($x->hasQueryHandle()) {
4710 $this->setQueryHandle($x->getQueryHandle());
4713 public function equals($x) {
4714 if ($x === $this) { return true; }
4715 if (isset($this->batch) !== isset($x->batch)) return false;
4716 if (isset($this->batch) && !$this->batch->equals($x->batch)) return false;
4717 if (isset($this->query_handle) !== isset($x->query_handle)) return false;
4718 if (isset($this->query_handle) && $this->query_handle !== $x->query_handle) return false;
4719 return true;
4721 public function shortDebugString($prefix = "") {
4722 $res = '';
4723 if (isset($this->batch)) {
4724 $res .= $prefix . "batch <\n" . $this->batch->shortDebugString($prefix . " ") . $prefix . ">\n";
4726 if (isset($this->query_handle)) {
4727 $res .= $prefix . "query_handle: " . $this->debugFormatString($this->query_handle) . "\n";
4729 return $res;
4733 namespace google\appengine\datastore\v4 {
4734 class ContinueQueryRequest extends \google\net\ProtocolMessage {
4735 public function getQueryHandle() {
4736 if (!isset($this->query_handle)) {
4737 return '';
4739 return $this->query_handle;
4741 public function setQueryHandle($val) {
4742 $this->query_handle = $val;
4743 return $this;
4745 public function clearQueryHandle() {
4746 unset($this->query_handle);
4747 return $this;
4749 public function hasQueryHandle() {
4750 return isset($this->query_handle);
4752 public function clear() {
4753 $this->clearQueryHandle();
4755 public function byteSizePartial() {
4756 $res = 0;
4757 if (isset($this->query_handle)) {
4758 $res += 1;
4759 $res += $this->lengthString(strlen($this->query_handle));
4761 return $res;
4763 public function outputPartial($out) {
4764 if (isset($this->query_handle)) {
4765 $out->putVarInt32(10);
4766 $out->putPrefixedString($this->query_handle);
4769 public function tryMerge($d) {
4770 while($d->avail() > 0) {
4771 $tt = $d->getVarInt32();
4772 switch ($tt) {
4773 case 10:
4774 $length = $d->getVarInt32();
4775 $this->setQueryHandle(substr($d->buffer(), $d->pos(), $length));
4776 $d->skip($length);
4777 break;
4778 case 0:
4779 throw new \google\net\ProtocolBufferDecodeError();
4780 break;
4781 default:
4782 $d->skipData($tt);
4786 public function checkInitialized() {
4787 if (!isset($this->query_handle)) return 'query_handle';
4788 return null;
4790 public function mergeFrom($x) {
4791 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
4792 if ($x->hasQueryHandle()) {
4793 $this->setQueryHandle($x->getQueryHandle());
4796 public function equals($x) {
4797 if ($x === $this) { return true; }
4798 if (isset($this->query_handle) !== isset($x->query_handle)) return false;
4799 if (isset($this->query_handle) && $this->query_handle !== $x->query_handle) return false;
4800 return true;
4802 public function shortDebugString($prefix = "") {
4803 $res = '';
4804 if (isset($this->query_handle)) {
4805 $res .= $prefix . "query_handle: " . $this->debugFormatString($this->query_handle) . "\n";
4807 return $res;
4811 namespace google\appengine\datastore\v4 {
4812 class ContinueQueryResponse extends \google\net\ProtocolMessage {
4813 public function getBatch() {
4814 if (!isset($this->batch)) {
4815 return new \google\appengine\datastore\v4\QueryResultBatch();
4817 return $this->batch;
4819 public function mutableBatch() {
4820 if (!isset($this->batch)) {
4821 $res = new \google\appengine\datastore\v4\QueryResultBatch();
4822 $this->batch = $res;
4823 return $res;
4825 return $this->batch;
4827 public function clearBatch() {
4828 if (isset($this->batch)) {
4829 unset($this->batch);
4832 public function hasBatch() {
4833 return isset($this->batch);
4835 public function clear() {
4836 $this->clearBatch();
4838 public function byteSizePartial() {
4839 $res = 0;
4840 if (isset($this->batch)) {
4841 $res += 1;
4842 $res += $this->lengthString($this->batch->byteSizePartial());
4844 return $res;
4846 public function outputPartial($out) {
4847 if (isset($this->batch)) {
4848 $out->putVarInt32(10);
4849 $out->putVarInt32($this->batch->byteSizePartial());
4850 $this->batch->outputPartial($out);
4853 public function tryMerge($d) {
4854 while($d->avail() > 0) {
4855 $tt = $d->getVarInt32();
4856 switch ($tt) {
4857 case 10:
4858 $length = $d->getVarInt32();
4859 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
4860 $d->skip($length);
4861 $this->mutableBatch()->tryMerge($tmp);
4862 break;
4863 case 0:
4864 throw new \google\net\ProtocolBufferDecodeError();
4865 break;
4866 default:
4867 $d->skipData($tt);
4871 public function checkInitialized() {
4872 if ((!isset($this->batch)) || (!$this->batch->isInitialized())) return 'batch';
4873 return null;
4875 public function mergeFrom($x) {
4876 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
4877 if ($x->hasBatch()) {
4878 $this->mutableBatch()->mergeFrom($x->getBatch());
4881 public function equals($x) {
4882 if ($x === $this) { return true; }
4883 if (isset($this->batch) !== isset($x->batch)) return false;
4884 if (isset($this->batch) && !$this->batch->equals($x->batch)) return false;
4885 return true;
4887 public function shortDebugString($prefix = "") {
4888 $res = '';
4889 if (isset($this->batch)) {
4890 $res .= $prefix . "batch <\n" . $this->batch->shortDebugString($prefix . " ") . $prefix . ">\n";
4892 return $res;
4896 namespace google\appengine\datastore\v4 {
4897 class BeginTransactionRequest extends \google\net\ProtocolMessage {
4898 public function getCrossGroup() {
4899 if (!isset($this->cross_group)) {
4900 return false;
4902 return $this->cross_group;
4904 public function setCrossGroup($val) {
4905 $this->cross_group = $val;
4906 return $this;
4908 public function clearCrossGroup() {
4909 unset($this->cross_group);
4910 return $this;
4912 public function hasCrossGroup() {
4913 return isset($this->cross_group);
4915 public function getCrossRequest() {
4916 if (!isset($this->cross_request)) {
4917 return false;
4919 return $this->cross_request;
4921 public function setCrossRequest($val) {
4922 $this->cross_request = $val;
4923 return $this;
4925 public function clearCrossRequest() {
4926 unset($this->cross_request);
4927 return $this;
4929 public function hasCrossRequest() {
4930 return isset($this->cross_request);
4932 public function clear() {
4933 $this->clearCrossGroup();
4934 $this->clearCrossRequest();
4936 public function byteSizePartial() {
4937 $res = 0;
4938 if (isset($this->cross_group)) {
4939 $res += 2;
4941 if (isset($this->cross_request)) {
4942 $res += 2;
4944 return $res;
4946 public function outputPartial($out) {
4947 if (isset($this->cross_group)) {
4948 $out->putVarInt32(8);
4949 $out->putBoolean($this->cross_group);
4951 if (isset($this->cross_request)) {
4952 $out->putVarInt32(16);
4953 $out->putBoolean($this->cross_request);
4956 public function tryMerge($d) {
4957 while($d->avail() > 0) {
4958 $tt = $d->getVarInt32();
4959 switch ($tt) {
4960 case 8:
4961 $this->setCrossGroup($d->getBoolean());
4962 break;
4963 case 16:
4964 $this->setCrossRequest($d->getBoolean());
4965 break;
4966 case 0:
4967 throw new \google\net\ProtocolBufferDecodeError();
4968 break;
4969 default:
4970 $d->skipData($tt);
4974 public function checkInitialized() {
4975 return null;
4977 public function mergeFrom($x) {
4978 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
4979 if ($x->hasCrossGroup()) {
4980 $this->setCrossGroup($x->getCrossGroup());
4982 if ($x->hasCrossRequest()) {
4983 $this->setCrossRequest($x->getCrossRequest());
4986 public function equals($x) {
4987 if ($x === $this) { return true; }
4988 if (isset($this->cross_group) !== isset($x->cross_group)) return false;
4989 if (isset($this->cross_group) && $this->cross_group !== $x->cross_group) return false;
4990 if (isset($this->cross_request) !== isset($x->cross_request)) return false;
4991 if (isset($this->cross_request) && $this->cross_request !== $x->cross_request) return false;
4992 return true;
4994 public function shortDebugString($prefix = "") {
4995 $res = '';
4996 if (isset($this->cross_group)) {
4997 $res .= $prefix . "cross_group: " . $this->debugFormatBool($this->cross_group) . "\n";
4999 if (isset($this->cross_request)) {
5000 $res .= $prefix . "cross_request: " . $this->debugFormatBool($this->cross_request) . "\n";
5002 return $res;
5006 namespace google\appengine\datastore\v4 {
5007 class BeginTransactionResponse extends \google\net\ProtocolMessage {
5008 public function getTransaction() {
5009 if (!isset($this->transaction)) {
5010 return '';
5012 return $this->transaction;
5014 public function setTransaction($val) {
5015 $this->transaction = $val;
5016 return $this;
5018 public function clearTransaction() {
5019 unset($this->transaction);
5020 return $this;
5022 public function hasTransaction() {
5023 return isset($this->transaction);
5025 public function clear() {
5026 $this->clearTransaction();
5028 public function byteSizePartial() {
5029 $res = 0;
5030 if (isset($this->transaction)) {
5031 $res += 1;
5032 $res += $this->lengthString(strlen($this->transaction));
5034 return $res;
5036 public function outputPartial($out) {
5037 if (isset($this->transaction)) {
5038 $out->putVarInt32(10);
5039 $out->putPrefixedString($this->transaction);
5042 public function tryMerge($d) {
5043 while($d->avail() > 0) {
5044 $tt = $d->getVarInt32();
5045 switch ($tt) {
5046 case 10:
5047 $length = $d->getVarInt32();
5048 $this->setTransaction(substr($d->buffer(), $d->pos(), $length));
5049 $d->skip($length);
5050 break;
5051 case 0:
5052 throw new \google\net\ProtocolBufferDecodeError();
5053 break;
5054 default:
5055 $d->skipData($tt);
5059 public function checkInitialized() {
5060 if (!isset($this->transaction)) return 'transaction';
5061 return null;
5063 public function mergeFrom($x) {
5064 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
5065 if ($x->hasTransaction()) {
5066 $this->setTransaction($x->getTransaction());
5069 public function equals($x) {
5070 if ($x === $this) { return true; }
5071 if (isset($this->transaction) !== isset($x->transaction)) return false;
5072 if (isset($this->transaction) && $this->transaction !== $x->transaction) return false;
5073 return true;
5075 public function shortDebugString($prefix = "") {
5076 $res = '';
5077 if (isset($this->transaction)) {
5078 $res .= $prefix . "transaction: " . $this->debugFormatString($this->transaction) . "\n";
5080 return $res;
5084 namespace google\appengine\datastore\v4 {
5085 class RollbackRequest extends \google\net\ProtocolMessage {
5086 public function getTransaction() {
5087 if (!isset($this->transaction)) {
5088 return '';
5090 return $this->transaction;
5092 public function setTransaction($val) {
5093 $this->transaction = $val;
5094 return $this;
5096 public function clearTransaction() {
5097 unset($this->transaction);
5098 return $this;
5100 public function hasTransaction() {
5101 return isset($this->transaction);
5103 public function clear() {
5104 $this->clearTransaction();
5106 public function byteSizePartial() {
5107 $res = 0;
5108 if (isset($this->transaction)) {
5109 $res += 1;
5110 $res += $this->lengthString(strlen($this->transaction));
5112 return $res;
5114 public function outputPartial($out) {
5115 if (isset($this->transaction)) {
5116 $out->putVarInt32(10);
5117 $out->putPrefixedString($this->transaction);
5120 public function tryMerge($d) {
5121 while($d->avail() > 0) {
5122 $tt = $d->getVarInt32();
5123 switch ($tt) {
5124 case 10:
5125 $length = $d->getVarInt32();
5126 $this->setTransaction(substr($d->buffer(), $d->pos(), $length));
5127 $d->skip($length);
5128 break;
5129 case 0:
5130 throw new \google\net\ProtocolBufferDecodeError();
5131 break;
5132 default:
5133 $d->skipData($tt);
5137 public function checkInitialized() {
5138 if (!isset($this->transaction)) return 'transaction';
5139 return null;
5141 public function mergeFrom($x) {
5142 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
5143 if ($x->hasTransaction()) {
5144 $this->setTransaction($x->getTransaction());
5147 public function equals($x) {
5148 if ($x === $this) { return true; }
5149 if (isset($this->transaction) !== isset($x->transaction)) return false;
5150 if (isset($this->transaction) && $this->transaction !== $x->transaction) return false;
5151 return true;
5153 public function shortDebugString($prefix = "") {
5154 $res = '';
5155 if (isset($this->transaction)) {
5156 $res .= $prefix . "transaction: " . $this->debugFormatString($this->transaction) . "\n";
5158 return $res;
5162 namespace google\appengine\datastore\v4 {
5163 class RollbackResponse extends \google\net\ProtocolMessage {
5164 public function clear() {
5166 public function byteSizePartial() {
5167 $res = 0;
5168 return $res;
5170 public function outputPartial($out) {
5172 public function tryMerge($d) {
5173 while($d->avail() > 0) {
5174 $tt = $d->getVarInt32();
5175 switch ($tt) {
5176 case 0:
5177 throw new \google\net\ProtocolBufferDecodeError();
5178 break;
5179 default:
5180 $d->skipData($tt);
5184 public function checkInitialized() {
5185 return null;
5187 public function mergeFrom($x) {
5188 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
5190 public function equals($x) {
5191 if ($x === $this) { return true; }
5192 return true;
5194 public function shortDebugString($prefix = "") {
5195 $res = '';
5196 return $res;
5200 namespace google\appengine\datastore\v4\CommitRequest {
5201 class Mode {
5202 const TRANSACTIONAL = 1;
5203 const NON_TRANSACTIONAL = 2;
5206 namespace google\appengine\datastore\v4 {
5207 class CommitRequest extends \google\net\ProtocolMessage {
5208 private $mutation = array();
5209 public function getTransaction() {
5210 if (!isset($this->transaction)) {
5211 return '';
5213 return $this->transaction;
5215 public function setTransaction($val) {
5216 $this->transaction = $val;
5217 return $this;
5219 public function clearTransaction() {
5220 unset($this->transaction);
5221 return $this;
5223 public function hasTransaction() {
5224 return isset($this->transaction);
5226 public function getDeprecatedMutation() {
5227 if (!isset($this->deprecated_mutation)) {
5228 return new \google\appengine\datastore\v4\DeprecatedMutation();
5230 return $this->deprecated_mutation;
5232 public function mutableDeprecatedMutation() {
5233 if (!isset($this->deprecated_mutation)) {
5234 $res = new \google\appengine\datastore\v4\DeprecatedMutation();
5235 $this->deprecated_mutation = $res;
5236 return $res;
5238 return $this->deprecated_mutation;
5240 public function clearDeprecatedMutation() {
5241 if (isset($this->deprecated_mutation)) {
5242 unset($this->deprecated_mutation);
5245 public function hasDeprecatedMutation() {
5246 return isset($this->deprecated_mutation);
5248 public function getMode() {
5249 if (!isset($this->mode)) {
5250 return 1;
5252 return $this->mode;
5254 public function setMode($val) {
5255 $this->mode = $val;
5256 return $this;
5258 public function clearMode() {
5259 unset($this->mode);
5260 return $this;
5262 public function hasMode() {
5263 return isset($this->mode);
5265 public function getMutationSize() {
5266 return sizeof($this->mutation);
5268 public function getMutationList() {
5269 return $this->mutation;
5271 public function mutableMutation($idx) {
5272 if (!isset($this->mutation[$idx])) {
5273 $val = new \google\appengine\datastore\v4\Mutation();
5274 $this->mutation[$idx] = $val;
5275 return $val;
5277 return $this->mutation[$idx];
5279 public function getMutation($idx) {
5280 if (isset($this->mutation[$idx])) {
5281 return $this->mutation[$idx];
5283 if ($idx >= end(array_keys($this->mutation))) {
5284 throw new \OutOfRangeException('index out of range: ' + $idx);
5286 return new \google\appengine\datastore\v4\Mutation();
5288 public function addMutation() {
5289 $val = new \google\appengine\datastore\v4\Mutation();
5290 $this->mutation[] = $val;
5291 return $val;
5293 public function clearMutation() {
5294 $this->mutation = array();
5296 public function getIgnoreReadOnly() {
5297 if (!isset($this->ignore_read_only)) {
5298 return false;
5300 return $this->ignore_read_only;
5302 public function setIgnoreReadOnly($val) {
5303 $this->ignore_read_only = $val;
5304 return $this;
5306 public function clearIgnoreReadOnly() {
5307 unset($this->ignore_read_only);
5308 return $this;
5310 public function hasIgnoreReadOnly() {
5311 return isset($this->ignore_read_only);
5313 public function clear() {
5314 $this->clearTransaction();
5315 $this->clearDeprecatedMutation();
5316 $this->clearMode();
5317 $this->clearMutation();
5318 $this->clearIgnoreReadOnly();
5320 public function byteSizePartial() {
5321 $res = 0;
5322 if (isset($this->transaction)) {
5323 $res += 1;
5324 $res += $this->lengthString(strlen($this->transaction));
5326 if (isset($this->deprecated_mutation)) {
5327 $res += 1;
5328 $res += $this->lengthString($this->deprecated_mutation->byteSizePartial());
5330 if (isset($this->mode)) {
5331 $res += 1;
5332 $res += $this->lengthVarInt64($this->mode);
5334 $this->checkProtoArray($this->mutation);
5335 $res += 1 * sizeof($this->mutation);
5336 foreach ($this->mutation as $value) {
5337 $res += $this->lengthString($value->byteSizePartial());
5339 if (isset($this->ignore_read_only)) {
5340 $res += 2;
5342 return $res;
5344 public function outputPartial($out) {
5345 if (isset($this->transaction)) {
5346 $out->putVarInt32(10);
5347 $out->putPrefixedString($this->transaction);
5349 if (isset($this->deprecated_mutation)) {
5350 $out->putVarInt32(18);
5351 $out->putVarInt32($this->deprecated_mutation->byteSizePartial());
5352 $this->deprecated_mutation->outputPartial($out);
5354 if (isset($this->mode)) {
5355 $out->putVarInt32(32);
5356 $out->putVarInt32($this->mode);
5358 $this->checkProtoArray($this->mutation);
5359 foreach ($this->mutation as $value) {
5360 $out->putVarInt32(42);
5361 $out->putVarInt32($value->byteSizePartial());
5362 $value->outputPartial($out);
5364 if (isset($this->ignore_read_only)) {
5365 $out->putVarInt32(48);
5366 $out->putBoolean($this->ignore_read_only);
5369 public function tryMerge($d) {
5370 while($d->avail() > 0) {
5371 $tt = $d->getVarInt32();
5372 switch ($tt) {
5373 case 10:
5374 $length = $d->getVarInt32();
5375 $this->setTransaction(substr($d->buffer(), $d->pos(), $length));
5376 $d->skip($length);
5377 break;
5378 case 18:
5379 $length = $d->getVarInt32();
5380 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
5381 $d->skip($length);
5382 $this->mutableDeprecatedMutation()->tryMerge($tmp);
5383 break;
5384 case 32:
5385 $this->setMode($d->getVarInt32());
5386 break;
5387 case 42:
5388 $length = $d->getVarInt32();
5389 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
5390 $d->skip($length);
5391 $this->addMutation()->tryMerge($tmp);
5392 break;
5393 case 48:
5394 $this->setIgnoreReadOnly($d->getBoolean());
5395 break;
5396 case 0:
5397 throw new \google\net\ProtocolBufferDecodeError();
5398 break;
5399 default:
5400 $d->skipData($tt);
5404 public function checkInitialized() {
5405 if (isset($this->deprecated_mutation) && (!$this->deprecated_mutation->isInitialized())) return 'deprecated_mutation';
5406 foreach ($this->mutation as $value) {
5407 if (!$value->isInitialized()) return 'mutation';
5409 return null;
5411 public function mergeFrom($x) {
5412 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
5413 if ($x->hasTransaction()) {
5414 $this->setTransaction($x->getTransaction());
5416 if ($x->hasDeprecatedMutation()) {
5417 $this->mutableDeprecatedMutation()->mergeFrom($x->getDeprecatedMutation());
5419 if ($x->hasMode()) {
5420 $this->setMode($x->getMode());
5422 foreach ($x->getMutationList() as $v) {
5423 $this->addMutation()->copyFrom($v);
5425 if ($x->hasIgnoreReadOnly()) {
5426 $this->setIgnoreReadOnly($x->getIgnoreReadOnly());
5429 public function equals($x) {
5430 if ($x === $this) { return true; }
5431 if (isset($this->transaction) !== isset($x->transaction)) return false;
5432 if (isset($this->transaction) && $this->transaction !== $x->transaction) return false;
5433 if (isset($this->deprecated_mutation) !== isset($x->deprecated_mutation)) return false;
5434 if (isset($this->deprecated_mutation) && !$this->deprecated_mutation->equals($x->deprecated_mutation)) return false;
5435 if (isset($this->mode) !== isset($x->mode)) return false;
5436 if (isset($this->mode) && $this->mode !== $x->mode) return false;
5437 if (sizeof($this->mutation) !== sizeof($x->mutation)) return false;
5438 foreach (array_map(null, $this->mutation, $x->mutation) as $v) {
5439 if (!$v[0]->equals($v[1])) return false;
5441 if (isset($this->ignore_read_only) !== isset($x->ignore_read_only)) return false;
5442 if (isset($this->ignore_read_only) && $this->ignore_read_only !== $x->ignore_read_only) return false;
5443 return true;
5445 public function shortDebugString($prefix = "") {
5446 $res = '';
5447 if (isset($this->transaction)) {
5448 $res .= $prefix . "transaction: " . $this->debugFormatString($this->transaction) . "\n";
5450 if (isset($this->deprecated_mutation)) {
5451 $res .= $prefix . "deprecated_mutation <\n" . $this->deprecated_mutation->shortDebugString($prefix . " ") . $prefix . ">\n";
5453 if (isset($this->mode)) {
5454 $res .= $prefix . "mode: " . ($this->mode) . "\n";
5456 foreach ($this->mutation as $value) {
5457 $res .= $prefix . "mutation <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
5459 if (isset($this->ignore_read_only)) {
5460 $res .= $prefix . "ignore_read_only: " . $this->debugFormatBool($this->ignore_read_only) . "\n";
5462 return $res;
5466 namespace google\appengine\datastore\v4 {
5467 class CommitResponse extends \google\net\ProtocolMessage {
5468 private $mutation_result = array();
5469 public function getDeprecatedMutationResult() {
5470 if (!isset($this->deprecated_mutation_result)) {
5471 return new \google\appengine\datastore\v4\DeprecatedMutationResult();
5473 return $this->deprecated_mutation_result;
5475 public function mutableDeprecatedMutationResult() {
5476 if (!isset($this->deprecated_mutation_result)) {
5477 $res = new \google\appengine\datastore\v4\DeprecatedMutationResult();
5478 $this->deprecated_mutation_result = $res;
5479 return $res;
5481 return $this->deprecated_mutation_result;
5483 public function clearDeprecatedMutationResult() {
5484 if (isset($this->deprecated_mutation_result)) {
5485 unset($this->deprecated_mutation_result);
5488 public function hasDeprecatedMutationResult() {
5489 return isset($this->deprecated_mutation_result);
5491 public function getMutationResultSize() {
5492 return sizeof($this->mutation_result);
5494 public function getMutationResultList() {
5495 return $this->mutation_result;
5497 public function mutableMutationResult($idx) {
5498 if (!isset($this->mutation_result[$idx])) {
5499 $val = new \google\appengine\datastore\v4\MutationResult();
5500 $this->mutation_result[$idx] = $val;
5501 return $val;
5503 return $this->mutation_result[$idx];
5505 public function getMutationResult($idx) {
5506 if (isset($this->mutation_result[$idx])) {
5507 return $this->mutation_result[$idx];
5509 if ($idx >= end(array_keys($this->mutation_result))) {
5510 throw new \OutOfRangeException('index out of range: ' + $idx);
5512 return new \google\appengine\datastore\v4\MutationResult();
5514 public function addMutationResult() {
5515 $val = new \google\appengine\datastore\v4\MutationResult();
5516 $this->mutation_result[] = $val;
5517 return $val;
5519 public function clearMutationResult() {
5520 $this->mutation_result = array();
5522 public function getIndexUpdates() {
5523 if (!isset($this->index_updates)) {
5524 return 0;
5526 return $this->index_updates;
5528 public function setIndexUpdates($val) {
5529 $this->index_updates = $val;
5530 return $this;
5532 public function clearIndexUpdates() {
5533 unset($this->index_updates);
5534 return $this;
5536 public function hasIndexUpdates() {
5537 return isset($this->index_updates);
5539 public function clear() {
5540 $this->clearDeprecatedMutationResult();
5541 $this->clearMutationResult();
5542 $this->clearIndexUpdates();
5544 public function byteSizePartial() {
5545 $res = 0;
5546 if (isset($this->deprecated_mutation_result)) {
5547 $res += 1;
5548 $res += $this->lengthString($this->deprecated_mutation_result->byteSizePartial());
5550 $this->checkProtoArray($this->mutation_result);
5551 $res += 1 * sizeof($this->mutation_result);
5552 foreach ($this->mutation_result as $value) {
5553 $res += $this->lengthString($value->byteSizePartial());
5555 if (isset($this->index_updates)) {
5556 $res += 1;
5557 $res += $this->lengthVarInt64($this->index_updates);
5559 return $res;
5561 public function outputPartial($out) {
5562 if (isset($this->deprecated_mutation_result)) {
5563 $out->putVarInt32(10);
5564 $out->putVarInt32($this->deprecated_mutation_result->byteSizePartial());
5565 $this->deprecated_mutation_result->outputPartial($out);
5567 $this->checkProtoArray($this->mutation_result);
5568 foreach ($this->mutation_result as $value) {
5569 $out->putVarInt32(26);
5570 $out->putVarInt32($value->byteSizePartial());
5571 $value->outputPartial($out);
5573 if (isset($this->index_updates)) {
5574 $out->putVarInt32(32);
5575 $out->putVarInt32($this->index_updates);
5578 public function tryMerge($d) {
5579 while($d->avail() > 0) {
5580 $tt = $d->getVarInt32();
5581 switch ($tt) {
5582 case 10:
5583 $length = $d->getVarInt32();
5584 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
5585 $d->skip($length);
5586 $this->mutableDeprecatedMutationResult()->tryMerge($tmp);
5587 break;
5588 case 26:
5589 $length = $d->getVarInt32();
5590 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
5591 $d->skip($length);
5592 $this->addMutationResult()->tryMerge($tmp);
5593 break;
5594 case 32:
5595 $this->setIndexUpdates($d->getVarInt32());
5596 break;
5597 case 0:
5598 throw new \google\net\ProtocolBufferDecodeError();
5599 break;
5600 default:
5601 $d->skipData($tt);
5605 public function checkInitialized() {
5606 if (isset($this->deprecated_mutation_result) && (!$this->deprecated_mutation_result->isInitialized())) return 'deprecated_mutation_result';
5607 foreach ($this->mutation_result as $value) {
5608 if (!$value->isInitialized()) return 'mutation_result';
5610 return null;
5612 public function mergeFrom($x) {
5613 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
5614 if ($x->hasDeprecatedMutationResult()) {
5615 $this->mutableDeprecatedMutationResult()->mergeFrom($x->getDeprecatedMutationResult());
5617 foreach ($x->getMutationResultList() as $v) {
5618 $this->addMutationResult()->copyFrom($v);
5620 if ($x->hasIndexUpdates()) {
5621 $this->setIndexUpdates($x->getIndexUpdates());
5624 public function equals($x) {
5625 if ($x === $this) { return true; }
5626 if (isset($this->deprecated_mutation_result) !== isset($x->deprecated_mutation_result)) return false;
5627 if (isset($this->deprecated_mutation_result) && !$this->deprecated_mutation_result->equals($x->deprecated_mutation_result)) return false;
5628 if (sizeof($this->mutation_result) !== sizeof($x->mutation_result)) return false;
5629 foreach (array_map(null, $this->mutation_result, $x->mutation_result) as $v) {
5630 if (!$v[0]->equals($v[1])) return false;
5632 if (isset($this->index_updates) !== isset($x->index_updates)) return false;
5633 if (isset($this->index_updates) && !$this->integerEquals($this->index_updates, $x->index_updates)) return false;
5634 return true;
5636 public function shortDebugString($prefix = "") {
5637 $res = '';
5638 if (isset($this->deprecated_mutation_result)) {
5639 $res .= $prefix . "deprecated_mutation_result <\n" . $this->deprecated_mutation_result->shortDebugString($prefix . " ") . $prefix . ">\n";
5641 foreach ($this->mutation_result as $value) {
5642 $res .= $prefix . "mutation_result <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
5644 if (isset($this->index_updates)) {
5645 $res .= $prefix . "index_updates: " . $this->debugFormatInt32($this->index_updates) . "\n";
5647 return $res;
5651 namespace google\appengine\datastore\v4 {
5652 class AllocateIdsRequest extends \google\net\ProtocolMessage {
5653 private $allocate = array();
5654 private $reserve = array();
5655 public function getAllocateSize() {
5656 return sizeof($this->allocate);
5658 public function getAllocateList() {
5659 return $this->allocate;
5661 public function mutableAllocate($idx) {
5662 if (!isset($this->allocate[$idx])) {
5663 $val = new \google\appengine\datastore\v4\Key();
5664 $this->allocate[$idx] = $val;
5665 return $val;
5667 return $this->allocate[$idx];
5669 public function getAllocate($idx) {
5670 if (isset($this->allocate[$idx])) {
5671 return $this->allocate[$idx];
5673 if ($idx >= end(array_keys($this->allocate))) {
5674 throw new \OutOfRangeException('index out of range: ' + $idx);
5676 return new \google\appengine\datastore\v4\Key();
5678 public function addAllocate() {
5679 $val = new \google\appengine\datastore\v4\Key();
5680 $this->allocate[] = $val;
5681 return $val;
5683 public function clearAllocate() {
5684 $this->allocate = array();
5686 public function getReserveSize() {
5687 return sizeof($this->reserve);
5689 public function getReserveList() {
5690 return $this->reserve;
5692 public function mutableReserve($idx) {
5693 if (!isset($this->reserve[$idx])) {
5694 $val = new \google\appengine\datastore\v4\Key();
5695 $this->reserve[$idx] = $val;
5696 return $val;
5698 return $this->reserve[$idx];
5700 public function getReserve($idx) {
5701 if (isset($this->reserve[$idx])) {
5702 return $this->reserve[$idx];
5704 if ($idx >= end(array_keys($this->reserve))) {
5705 throw new \OutOfRangeException('index out of range: ' + $idx);
5707 return new \google\appengine\datastore\v4\Key();
5709 public function addReserve() {
5710 $val = new \google\appengine\datastore\v4\Key();
5711 $this->reserve[] = $val;
5712 return $val;
5714 public function clearReserve() {
5715 $this->reserve = array();
5717 public function clear() {
5718 $this->clearAllocate();
5719 $this->clearReserve();
5721 public function byteSizePartial() {
5722 $res = 0;
5723 $this->checkProtoArray($this->allocate);
5724 $res += 1 * sizeof($this->allocate);
5725 foreach ($this->allocate as $value) {
5726 $res += $this->lengthString($value->byteSizePartial());
5728 $this->checkProtoArray($this->reserve);
5729 $res += 1 * sizeof($this->reserve);
5730 foreach ($this->reserve as $value) {
5731 $res += $this->lengthString($value->byteSizePartial());
5733 return $res;
5735 public function outputPartial($out) {
5736 $this->checkProtoArray($this->allocate);
5737 foreach ($this->allocate as $value) {
5738 $out->putVarInt32(10);
5739 $out->putVarInt32($value->byteSizePartial());
5740 $value->outputPartial($out);
5742 $this->checkProtoArray($this->reserve);
5743 foreach ($this->reserve as $value) {
5744 $out->putVarInt32(18);
5745 $out->putVarInt32($value->byteSizePartial());
5746 $value->outputPartial($out);
5749 public function tryMerge($d) {
5750 while($d->avail() > 0) {
5751 $tt = $d->getVarInt32();
5752 switch ($tt) {
5753 case 10:
5754 $length = $d->getVarInt32();
5755 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
5756 $d->skip($length);
5757 $this->addAllocate()->tryMerge($tmp);
5758 break;
5759 case 18:
5760 $length = $d->getVarInt32();
5761 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
5762 $d->skip($length);
5763 $this->addReserve()->tryMerge($tmp);
5764 break;
5765 case 0:
5766 throw new \google\net\ProtocolBufferDecodeError();
5767 break;
5768 default:
5769 $d->skipData($tt);
5773 public function checkInitialized() {
5774 foreach ($this->allocate as $value) {
5775 if (!$value->isInitialized()) return 'allocate';
5777 foreach ($this->reserve as $value) {
5778 if (!$value->isInitialized()) return 'reserve';
5780 return null;
5782 public function mergeFrom($x) {
5783 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
5784 foreach ($x->getAllocateList() as $v) {
5785 $this->addAllocate()->copyFrom($v);
5787 foreach ($x->getReserveList() as $v) {
5788 $this->addReserve()->copyFrom($v);
5791 public function equals($x) {
5792 if ($x === $this) { return true; }
5793 if (sizeof($this->allocate) !== sizeof($x->allocate)) return false;
5794 foreach (array_map(null, $this->allocate, $x->allocate) as $v) {
5795 if (!$v[0]->equals($v[1])) return false;
5797 if (sizeof($this->reserve) !== sizeof($x->reserve)) return false;
5798 foreach (array_map(null, $this->reserve, $x->reserve) as $v) {
5799 if (!$v[0]->equals($v[1])) return false;
5801 return true;
5803 public function shortDebugString($prefix = "") {
5804 $res = '';
5805 foreach ($this->allocate as $value) {
5806 $res .= $prefix . "allocate <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
5808 foreach ($this->reserve as $value) {
5809 $res .= $prefix . "reserve <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
5811 return $res;
5815 namespace google\appengine\datastore\v4 {
5816 class AllocateIdsResponse extends \google\net\ProtocolMessage {
5817 private $allocated = array();
5818 public function getAllocatedSize() {
5819 return sizeof($this->allocated);
5821 public function getAllocatedList() {
5822 return $this->allocated;
5824 public function mutableAllocated($idx) {
5825 if (!isset($this->allocated[$idx])) {
5826 $val = new \google\appengine\datastore\v4\Key();
5827 $this->allocated[$idx] = $val;
5828 return $val;
5830 return $this->allocated[$idx];
5832 public function getAllocated($idx) {
5833 if (isset($this->allocated[$idx])) {
5834 return $this->allocated[$idx];
5836 if ($idx >= end(array_keys($this->allocated))) {
5837 throw new \OutOfRangeException('index out of range: ' + $idx);
5839 return new \google\appengine\datastore\v4\Key();
5841 public function addAllocated() {
5842 $val = new \google\appengine\datastore\v4\Key();
5843 $this->allocated[] = $val;
5844 return $val;
5846 public function clearAllocated() {
5847 $this->allocated = array();
5849 public function clear() {
5850 $this->clearAllocated();
5852 public function byteSizePartial() {
5853 $res = 0;
5854 $this->checkProtoArray($this->allocated);
5855 $res += 1 * sizeof($this->allocated);
5856 foreach ($this->allocated as $value) {
5857 $res += $this->lengthString($value->byteSizePartial());
5859 return $res;
5861 public function outputPartial($out) {
5862 $this->checkProtoArray($this->allocated);
5863 foreach ($this->allocated as $value) {
5864 $out->putVarInt32(10);
5865 $out->putVarInt32($value->byteSizePartial());
5866 $value->outputPartial($out);
5869 public function tryMerge($d) {
5870 while($d->avail() > 0) {
5871 $tt = $d->getVarInt32();
5872 switch ($tt) {
5873 case 10:
5874 $length = $d->getVarInt32();
5875 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
5876 $d->skip($length);
5877 $this->addAllocated()->tryMerge($tmp);
5878 break;
5879 case 0:
5880 throw new \google\net\ProtocolBufferDecodeError();
5881 break;
5882 default:
5883 $d->skipData($tt);
5887 public function checkInitialized() {
5888 foreach ($this->allocated as $value) {
5889 if (!$value->isInitialized()) return 'allocated';
5891 return null;
5893 public function mergeFrom($x) {
5894 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
5895 foreach ($x->getAllocatedList() as $v) {
5896 $this->addAllocated()->copyFrom($v);
5899 public function equals($x) {
5900 if ($x === $this) { return true; }
5901 if (sizeof($this->allocated) !== sizeof($x->allocated)) return false;
5902 foreach (array_map(null, $this->allocated, $x->allocated) as $v) {
5903 if (!$v[0]->equals($v[1])) return false;
5905 return true;
5907 public function shortDebugString($prefix = "") {
5908 $res = '';
5909 foreach ($this->allocated as $value) {
5910 $res .= $prefix . "allocated <\n" . $value->shortDebugString($prefix . " ") . $prefix . ">\n";
5912 return $res;
5916 namespace google\appengine\datastore\v4 {
5917 class WriteRequest extends \google\net\ProtocolMessage {
5918 public function getDeprecatedMutation() {
5919 if (!isset($this->deprecated_mutation)) {
5920 return new \google\appengine\datastore\v4\DeprecatedMutation();
5922 return $this->deprecated_mutation;
5924 public function mutableDeprecatedMutation() {
5925 if (!isset($this->deprecated_mutation)) {
5926 $res = new \google\appengine\datastore\v4\DeprecatedMutation();
5927 $this->deprecated_mutation = $res;
5928 return $res;
5930 return $this->deprecated_mutation;
5932 public function clearDeprecatedMutation() {
5933 if (isset($this->deprecated_mutation)) {
5934 unset($this->deprecated_mutation);
5937 public function hasDeprecatedMutation() {
5938 return isset($this->deprecated_mutation);
5940 public function clear() {
5941 $this->clearDeprecatedMutation();
5943 public function byteSizePartial() {
5944 $res = 0;
5945 if (isset($this->deprecated_mutation)) {
5946 $res += 1;
5947 $res += $this->lengthString($this->deprecated_mutation->byteSizePartial());
5949 return $res;
5951 public function outputPartial($out) {
5952 if (isset($this->deprecated_mutation)) {
5953 $out->putVarInt32(10);
5954 $out->putVarInt32($this->deprecated_mutation->byteSizePartial());
5955 $this->deprecated_mutation->outputPartial($out);
5958 public function tryMerge($d) {
5959 while($d->avail() > 0) {
5960 $tt = $d->getVarInt32();
5961 switch ($tt) {
5962 case 10:
5963 $length = $d->getVarInt32();
5964 $tmp = new \google\net\Decoder($d->buffer(), $d->pos(), $d->pos() + $length);
5965 $d->skip($length);
5966 $this->mutableDeprecatedMutation()->tryMerge($tmp);
5967 break;
5968 case 0:
5969 throw new \google\net\ProtocolBufferDecodeError();
5970 break;
5971 default:
5972 $d->skipData($tt);
5976 public function checkInitialized() {
5977 if ((!isset($this->deprecated_mutation)) || (!$this->deprecated_mutation->isInitialized())) return 'deprecated_mutation';
5978 return null;
5980 public function mergeFrom($x) {
5981 if ($x === $this) { throw new \IllegalArgumentException('Cannot copy message to itself'); }
5982 if ($x->hasDeprecatedMutation()) {
5983 $this->mutableDeprecatedMutation()->mergeFrom($x->getDeprecatedMutation());
5986 public function equals($x) {
5987 if ($x === $this) { return true; }
5988 if (isset($this->deprecated_mutation) !== isset($x->deprecated_mutation)) return false;
5989 if (isset($this->deprecated_mutation) && !$this->deprecated_mutation->equals($x->deprecated_mutation)) return false;
5990 return true;
5992 public function shortDebugString($prefix = "") {
5993 $res = '';
5994 if (isset($this->deprecated_mutation)) {
5995 $res .= $prefix . "deprecated_mutation <\n" . $this->deprecated_mutation->shortDebugString($prefix . " ") . $prefix . ">\n";
5997 return $res;