Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: generated/googleapis_beta/lib/datastore/v1beta2.dart

Issue 559053002: Generate 0.1.0 version of googleapis/googleapis_beta (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library googleapis_beta.datastore.v1beta2;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async;
6 import "dart:convert" as convert;
7
8 import "package:crypto/crypto.dart" as crypto;
9 import 'package:http/http.dart' as http;
10 import '../src/common_internal.dart' as common_internal;
11 import '../common/common.dart' as common;
12
13 export '../common/common.dart' show ApiRequestError;
14 export '../common/common.dart' show DetailedApiRequestError;
15
16 /** API for accessing Google Cloud Datastore. */
17 class DatastoreApi {
18 /** View and manage your Google Cloud Datastore data */
19 static const DatastoreScope = "https://www.googleapis.com/auth/datastore";
20
21 /** View your email address */
22 static const UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.em ail";
23
24
25 final common_internal.ApiRequester _requester;
26
27 DatasetsResourceApi get datasets => new DatasetsResourceApi(_requester);
28
29 DatastoreApi(http.Client client) :
30 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/datastore/v1beta2/datasets/");
31 }
32
33
34 /** Not documented yet. */
35 class DatasetsResourceApi {
36 final common_internal.ApiRequester _requester;
37
38 DatasetsResourceApi(common_internal.ApiRequester client) :
39 _requester = client;
40
41 /**
42 * Allocate IDs for incomplete keys (useful for referencing an entity before
43 * it is inserted).
44 *
45 * [request] - The metadata request object.
46 *
47 * Request parameters:
48 *
49 * [datasetId] - Identifies the dataset.
50 *
51 * Completes with a [AllocateIdsResponse].
52 *
53 * Completes with a [common.ApiRequestError] if the API endpoint returned an
54 * error.
55 *
56 * If the used [http.Client] completes with an error when making a REST call,
57 * this method will complete with the same error.
58 */
59 async.Future<AllocateIdsResponse> allocateIds(AllocateIdsRequest request, core .String datasetId) {
60 var _url = null;
61 var _queryParams = new core.Map();
62 var _uploadMedia = null;
63 var _uploadOptions = null;
64 var _downloadOptions = common.DownloadOptions.Metadata;
65 var _body = null;
66
67 if (request != null) {
68 _body = convert.JSON.encode((request).toJson());
69 }
70 if (datasetId == null) {
71 throw new core.ArgumentError("Parameter datasetId is required.");
72 }
73
74
75 _url = common_internal.Escaper.ecapeVariable('$datasetId') + '/allocateIds';
76
77 var _response = _requester.request(_url,
78 "POST",
79 body: _body,
80 queryParams: _queryParams,
81 uploadOptions: _uploadOptions,
82 uploadMedia: _uploadMedia,
83 downloadOptions: _downloadOptions);
84 return _response.then((data) => new AllocateIdsResponse.fromJson(data));
85 }
86
87 /**
88 * Begin a new transaction.
89 *
90 * [request] - The metadata request object.
91 *
92 * Request parameters:
93 *
94 * [datasetId] - Identifies the dataset.
95 *
96 * Completes with a [BeginTransactionResponse].
97 *
98 * Completes with a [common.ApiRequestError] if the API endpoint returned an
99 * error.
100 *
101 * If the used [http.Client] completes with an error when making a REST call,
102 * this method will complete with the same error.
103 */
104 async.Future<BeginTransactionResponse> beginTransaction(BeginTransactionReques t request, core.String datasetId) {
105 var _url = null;
106 var _queryParams = new core.Map();
107 var _uploadMedia = null;
108 var _uploadOptions = null;
109 var _downloadOptions = common.DownloadOptions.Metadata;
110 var _body = null;
111
112 if (request != null) {
113 _body = convert.JSON.encode((request).toJson());
114 }
115 if (datasetId == null) {
116 throw new core.ArgumentError("Parameter datasetId is required.");
117 }
118
119
120 _url = common_internal.Escaper.ecapeVariable('$datasetId') + '/beginTransact ion';
121
122 var _response = _requester.request(_url,
123 "POST",
124 body: _body,
125 queryParams: _queryParams,
126 uploadOptions: _uploadOptions,
127 uploadMedia: _uploadMedia,
128 downloadOptions: _downloadOptions);
129 return _response.then((data) => new BeginTransactionResponse.fromJson(data)) ;
130 }
131
132 /**
133 * Commit a transaction, optionally creating, deleting or modifying some
134 * entities.
135 *
136 * [request] - The metadata request object.
137 *
138 * Request parameters:
139 *
140 * [datasetId] - Identifies the dataset.
141 *
142 * Completes with a [CommitResponse].
143 *
144 * Completes with a [common.ApiRequestError] if the API endpoint returned an
145 * error.
146 *
147 * If the used [http.Client] completes with an error when making a REST call,
148 * this method will complete with the same error.
149 */
150 async.Future<CommitResponse> commit(CommitRequest request, core.String dataset Id) {
151 var _url = null;
152 var _queryParams = new core.Map();
153 var _uploadMedia = null;
154 var _uploadOptions = null;
155 var _downloadOptions = common.DownloadOptions.Metadata;
156 var _body = null;
157
158 if (request != null) {
159 _body = convert.JSON.encode((request).toJson());
160 }
161 if (datasetId == null) {
162 throw new core.ArgumentError("Parameter datasetId is required.");
163 }
164
165
166 _url = common_internal.Escaper.ecapeVariable('$datasetId') + '/commit';
167
168 var _response = _requester.request(_url,
169 "POST",
170 body: _body,
171 queryParams: _queryParams,
172 uploadOptions: _uploadOptions,
173 uploadMedia: _uploadMedia,
174 downloadOptions: _downloadOptions);
175 return _response.then((data) => new CommitResponse.fromJson(data));
176 }
177
178 /**
179 * Look up some entities by key.
180 *
181 * [request] - The metadata request object.
182 *
183 * Request parameters:
184 *
185 * [datasetId] - Identifies the dataset.
186 *
187 * Completes with a [LookupResponse].
188 *
189 * Completes with a [common.ApiRequestError] if the API endpoint returned an
190 * error.
191 *
192 * If the used [http.Client] completes with an error when making a REST call,
193 * this method will complete with the same error.
194 */
195 async.Future<LookupResponse> lookup(LookupRequest request, core.String dataset Id) {
196 var _url = null;
197 var _queryParams = new core.Map();
198 var _uploadMedia = null;
199 var _uploadOptions = null;
200 var _downloadOptions = common.DownloadOptions.Metadata;
201 var _body = null;
202
203 if (request != null) {
204 _body = convert.JSON.encode((request).toJson());
205 }
206 if (datasetId == null) {
207 throw new core.ArgumentError("Parameter datasetId is required.");
208 }
209
210
211 _url = common_internal.Escaper.ecapeVariable('$datasetId') + '/lookup';
212
213 var _response = _requester.request(_url,
214 "POST",
215 body: _body,
216 queryParams: _queryParams,
217 uploadOptions: _uploadOptions,
218 uploadMedia: _uploadMedia,
219 downloadOptions: _downloadOptions);
220 return _response.then((data) => new LookupResponse.fromJson(data));
221 }
222
223 /**
224 * Roll back a transaction.
225 *
226 * [request] - The metadata request object.
227 *
228 * Request parameters:
229 *
230 * [datasetId] - Identifies the dataset.
231 *
232 * Completes with a [RollbackResponse].
233 *
234 * Completes with a [common.ApiRequestError] if the API endpoint returned an
235 * error.
236 *
237 * If the used [http.Client] completes with an error when making a REST call,
238 * this method will complete with the same error.
239 */
240 async.Future<RollbackResponse> rollback(RollbackRequest request, core.String d atasetId) {
241 var _url = null;
242 var _queryParams = new core.Map();
243 var _uploadMedia = null;
244 var _uploadOptions = null;
245 var _downloadOptions = common.DownloadOptions.Metadata;
246 var _body = null;
247
248 if (request != null) {
249 _body = convert.JSON.encode((request).toJson());
250 }
251 if (datasetId == null) {
252 throw new core.ArgumentError("Parameter datasetId is required.");
253 }
254
255
256 _url = common_internal.Escaper.ecapeVariable('$datasetId') + '/rollback';
257
258 var _response = _requester.request(_url,
259 "POST",
260 body: _body,
261 queryParams: _queryParams,
262 uploadOptions: _uploadOptions,
263 uploadMedia: _uploadMedia,
264 downloadOptions: _downloadOptions);
265 return _response.then((data) => new RollbackResponse.fromJson(data));
266 }
267
268 /**
269 * Query for entities.
270 *
271 * [request] - The metadata request object.
272 *
273 * Request parameters:
274 *
275 * [datasetId] - Identifies the dataset.
276 *
277 * Completes with a [RunQueryResponse].
278 *
279 * Completes with a [common.ApiRequestError] if the API endpoint returned an
280 * error.
281 *
282 * If the used [http.Client] completes with an error when making a REST call,
283 * this method will complete with the same error.
284 */
285 async.Future<RunQueryResponse> runQuery(RunQueryRequest request, core.String d atasetId) {
286 var _url = null;
287 var _queryParams = new core.Map();
288 var _uploadMedia = null;
289 var _uploadOptions = null;
290 var _downloadOptions = common.DownloadOptions.Metadata;
291 var _body = null;
292
293 if (request != null) {
294 _body = convert.JSON.encode((request).toJson());
295 }
296 if (datasetId == null) {
297 throw new core.ArgumentError("Parameter datasetId is required.");
298 }
299
300
301 _url = common_internal.Escaper.ecapeVariable('$datasetId') + '/runQuery';
302
303 var _response = _requester.request(_url,
304 "POST",
305 body: _body,
306 queryParams: _queryParams,
307 uploadOptions: _uploadOptions,
308 uploadMedia: _uploadMedia,
309 downloadOptions: _downloadOptions);
310 return _response.then((data) => new RunQueryResponse.fromJson(data));
311 }
312
313 }
314
315
316
317 /** Not documented yet. */
318 class AllocateIdsRequest {
319 /**
320 * A list of keys with incomplete key paths to allocate IDs for. No key may be
321 * reserved/read-only.
322 */
323 core.List<Key> keys;
324
325
326 AllocateIdsRequest();
327
328 AllocateIdsRequest.fromJson(core.Map _json) {
329 if (_json.containsKey("keys")) {
330 keys = _json["keys"].map((value) => new Key.fromJson(value)).toList();
331 }
332 }
333
334 core.Map toJson() {
335 var _json = new core.Map();
336 if (keys != null) {
337 _json["keys"] = keys.map((value) => (value).toJson()).toList();
338 }
339 return _json;
340 }
341 }
342
343
344 /** Not documented yet. */
345 class AllocateIdsResponse {
346 /** Not documented yet. */
347 ResponseHeader header;
348
349 /**
350 * The keys specified in the request (in the same order), each with its key
351 * path completed with a newly allocated ID.
352 */
353 core.List<Key> keys;
354
355
356 AllocateIdsResponse();
357
358 AllocateIdsResponse.fromJson(core.Map _json) {
359 if (_json.containsKey("header")) {
360 header = new ResponseHeader.fromJson(_json["header"]);
361 }
362 if (_json.containsKey("keys")) {
363 keys = _json["keys"].map((value) => new Key.fromJson(value)).toList();
364 }
365 }
366
367 core.Map toJson() {
368 var _json = new core.Map();
369 if (header != null) {
370 _json["header"] = (header).toJson();
371 }
372 if (keys != null) {
373 _json["keys"] = keys.map((value) => (value).toJson()).toList();
374 }
375 return _json;
376 }
377 }
378
379
380 /** Not documented yet. */
381 class BeginTransactionRequest {
382 /**
383 * The transaction isolation level. Either snapshot or serializable. The
384 * default isolation level is snapshot isolation, which means that another
385 * transaction may not concurrently modify the data that is modified by this
386 * transaction. Optionally, a transaction can request to be made serializable
387 * which means that another transaction cannot concurrently modify the data
388 * that is read or modified by this transaction.
389 * Possible string values are:
390 * - "SERIALIZABLE"
391 * - "SNAPSHOT"
392 */
393 core.String isolationLevel;
394
395
396 BeginTransactionRequest();
397
398 BeginTransactionRequest.fromJson(core.Map _json) {
399 if (_json.containsKey("isolationLevel")) {
400 isolationLevel = _json["isolationLevel"];
401 }
402 }
403
404 core.Map toJson() {
405 var _json = new core.Map();
406 if (isolationLevel != null) {
407 _json["isolationLevel"] = isolationLevel;
408 }
409 return _json;
410 }
411 }
412
413
414 /** Not documented yet. */
415 class BeginTransactionResponse {
416 /** Not documented yet. */
417 ResponseHeader header;
418
419 /** The transaction identifier (always present). */
420 core.String transaction;
421
422 core.List<core.int> get transactionAsBytes {
423 return crypto.CryptoUtils.base64StringToBytes(transaction);
424 }
425
426 void set transactionAsBytes(core.List<core.int> _bytes) {
427 transaction = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
428 }
429
430
431 BeginTransactionResponse();
432
433 BeginTransactionResponse.fromJson(core.Map _json) {
434 if (_json.containsKey("header")) {
435 header = new ResponseHeader.fromJson(_json["header"]);
436 }
437 if (_json.containsKey("transaction")) {
438 transaction = _json["transaction"];
439 }
440 }
441
442 core.Map toJson() {
443 var _json = new core.Map();
444 if (header != null) {
445 _json["header"] = (header).toJson();
446 }
447 if (transaction != null) {
448 _json["transaction"] = transaction;
449 }
450 return _json;
451 }
452 }
453
454
455 /** Not documented yet. */
456 class CommitRequest {
457 /** Not documented yet. */
458 core.bool ignoreReadOnly;
459
460 /**
461 * The type of commit to perform. Either TRANSACTIONAL or NON_TRANSACTIONAL.
462 * Possible string values are:
463 * - "NON_TRANSACTIONAL"
464 * - "TRANSACTIONAL"
465 */
466 core.String mode;
467
468 /** The mutation to perform. Optional. */
469 Mutation mutation;
470
471 /**
472 * The transaction identifier, returned by a call to beginTransaction. Must be
473 * set when mode is TRANSACTIONAL.
474 */
475 core.String transaction;
476
477 core.List<core.int> get transactionAsBytes {
478 return crypto.CryptoUtils.base64StringToBytes(transaction);
479 }
480
481 void set transactionAsBytes(core.List<core.int> _bytes) {
482 transaction = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
483 }
484
485
486 CommitRequest();
487
488 CommitRequest.fromJson(core.Map _json) {
489 if (_json.containsKey("ignoreReadOnly")) {
490 ignoreReadOnly = _json["ignoreReadOnly"];
491 }
492 if (_json.containsKey("mode")) {
493 mode = _json["mode"];
494 }
495 if (_json.containsKey("mutation")) {
496 mutation = new Mutation.fromJson(_json["mutation"]);
497 }
498 if (_json.containsKey("transaction")) {
499 transaction = _json["transaction"];
500 }
501 }
502
503 core.Map toJson() {
504 var _json = new core.Map();
505 if (ignoreReadOnly != null) {
506 _json["ignoreReadOnly"] = ignoreReadOnly;
507 }
508 if (mode != null) {
509 _json["mode"] = mode;
510 }
511 if (mutation != null) {
512 _json["mutation"] = (mutation).toJson();
513 }
514 if (transaction != null) {
515 _json["transaction"] = transaction;
516 }
517 return _json;
518 }
519 }
520
521
522 /** Not documented yet. */
523 class CommitResponse {
524 /** Not documented yet. */
525 ResponseHeader header;
526
527 /** The result of performing the mutation (if any). */
528 MutationResult mutationResult;
529
530
531 CommitResponse();
532
533 CommitResponse.fromJson(core.Map _json) {
534 if (_json.containsKey("header")) {
535 header = new ResponseHeader.fromJson(_json["header"]);
536 }
537 if (_json.containsKey("mutationResult")) {
538 mutationResult = new MutationResult.fromJson(_json["mutationResult"]);
539 }
540 }
541
542 core.Map toJson() {
543 var _json = new core.Map();
544 if (header != null) {
545 _json["header"] = (header).toJson();
546 }
547 if (mutationResult != null) {
548 _json["mutationResult"] = (mutationResult).toJson();
549 }
550 return _json;
551 }
552 }
553
554
555 /** Not documented yet. */
556 class CompositeFilter {
557 /** The list of filters to combine. Must contain at least one filter. */
558 core.List<Filter> filters;
559
560 /**
561 * The operator for combining multiple filters. Only "and" is currently
562 * supported.
563 * Possible string values are:
564 * - "AND"
565 */
566 core.String operator;
567
568
569 CompositeFilter();
570
571 CompositeFilter.fromJson(core.Map _json) {
572 if (_json.containsKey("filters")) {
573 filters = _json["filters"].map((value) => new Filter.fromJson(value)).toLi st();
574 }
575 if (_json.containsKey("operator")) {
576 operator = _json["operator"];
577 }
578 }
579
580 core.Map toJson() {
581 var _json = new core.Map();
582 if (filters != null) {
583 _json["filters"] = filters.map((value) => (value).toJson()).toList();
584 }
585 if (operator != null) {
586 _json["operator"] = operator;
587 }
588 return _json;
589 }
590 }
591
592
593 /** Not documented yet. */
594 class Entity {
595 /**
596 * The entity's key.
597 *
598 * An entity must have a key, unless otherwise documented (for example, an
599 * entity in Value.entityValue may have no key). An entity's kind is its key's
600 * path's last element's kind, or null if it has no key.
601 */
602 Key key;
603
604 /** The entity's properties. */
605 core.Map<core.String, Property> properties;
606
607
608 Entity();
609
610 Entity.fromJson(core.Map _json) {
611 if (_json.containsKey("key")) {
612 key = new Key.fromJson(_json["key"]);
613 }
614 if (_json.containsKey("properties")) {
615 properties = common_internal.mapMap(_json["properties"], (item) => new Pro perty.fromJson(item));
616 }
617 }
618
619 core.Map toJson() {
620 var _json = new core.Map();
621 if (key != null) {
622 _json["key"] = (key).toJson();
623 }
624 if (properties != null) {
625 _json["properties"] = common_internal.mapMap(properties, (item) => (item). toJson());
626 }
627 return _json;
628 }
629 }
630
631
632 /** Not documented yet. */
633 class EntityResult {
634 /** The resulting entity. */
635 Entity entity;
636
637
638 EntityResult();
639
640 EntityResult.fromJson(core.Map _json) {
641 if (_json.containsKey("entity")) {
642 entity = new Entity.fromJson(_json["entity"]);
643 }
644 }
645
646 core.Map toJson() {
647 var _json = new core.Map();
648 if (entity != null) {
649 _json["entity"] = (entity).toJson();
650 }
651 return _json;
652 }
653 }
654
655
656 /** Not documented yet. */
657 class Filter {
658 /** A composite filter. */
659 CompositeFilter compositeFilter;
660
661 /** A filter on a property. */
662 PropertyFilter propertyFilter;
663
664
665 Filter();
666
667 Filter.fromJson(core.Map _json) {
668 if (_json.containsKey("compositeFilter")) {
669 compositeFilter = new CompositeFilter.fromJson(_json["compositeFilter"]);
670 }
671 if (_json.containsKey("propertyFilter")) {
672 propertyFilter = new PropertyFilter.fromJson(_json["propertyFilter"]);
673 }
674 }
675
676 core.Map toJson() {
677 var _json = new core.Map();
678 if (compositeFilter != null) {
679 _json["compositeFilter"] = (compositeFilter).toJson();
680 }
681 if (propertyFilter != null) {
682 _json["propertyFilter"] = (propertyFilter).toJson();
683 }
684 return _json;
685 }
686 }
687
688
689 /** Not documented yet. */
690 class GqlQuery {
691 /** When false, the query string must not contain a literal. */
692 core.bool allowLiteral;
693
694 /**
695 * A named argument must set field GqlQueryArg.name. No two named arguments
696 * may have the same name. For each non-reserved named binding site in the
697 * query string, there must be a named argument with that name, but not
698 * necessarily the inverse.
699 */
700 core.List<GqlQueryArg> nameArgs;
701
702 /**
703 * Numbered binding site @1 references the first numbered argument,
704 * effectively using 1-based indexing, rather than the usual 0. A numbered
705 * argument must NOT set field GqlQueryArg.name. For each binding site
706 * numbered i in query_string, there must be an ith numbered argument. The
707 * inverse must also be true.
708 */
709 core.List<GqlQueryArg> numberArgs;
710
711 /** Not documented yet. */
712 core.String queryString;
713
714
715 GqlQuery();
716
717 GqlQuery.fromJson(core.Map _json) {
718 if (_json.containsKey("allowLiteral")) {
719 allowLiteral = _json["allowLiteral"];
720 }
721 if (_json.containsKey("nameArgs")) {
722 nameArgs = _json["nameArgs"].map((value) => new GqlQueryArg.fromJson(value )).toList();
723 }
724 if (_json.containsKey("numberArgs")) {
725 numberArgs = _json["numberArgs"].map((value) => new GqlQueryArg.fromJson(v alue)).toList();
726 }
727 if (_json.containsKey("queryString")) {
728 queryString = _json["queryString"];
729 }
730 }
731
732 core.Map toJson() {
733 var _json = new core.Map();
734 if (allowLiteral != null) {
735 _json["allowLiteral"] = allowLiteral;
736 }
737 if (nameArgs != null) {
738 _json["nameArgs"] = nameArgs.map((value) => (value).toJson()).toList();
739 }
740 if (numberArgs != null) {
741 _json["numberArgs"] = numberArgs.map((value) => (value).toJson()).toList() ;
742 }
743 if (queryString != null) {
744 _json["queryString"] = queryString;
745 }
746 return _json;
747 }
748 }
749
750
751 /** Not documented yet. */
752 class GqlQueryArg {
753 /** Not documented yet. */
754 core.String cursor;
755
756 core.List<core.int> get cursorAsBytes {
757 return crypto.CryptoUtils.base64StringToBytes(cursor);
758 }
759
760 void set cursorAsBytes(core.List<core.int> _bytes) {
761 cursor = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
762 }
763
764 /**
765 * Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". Must not match regex "__.*__".
766 * Must not be "".
767 */
768 core.String name;
769
770 /** Not documented yet. */
771 Value value;
772
773
774 GqlQueryArg();
775
776 GqlQueryArg.fromJson(core.Map _json) {
777 if (_json.containsKey("cursor")) {
778 cursor = _json["cursor"];
779 }
780 if (_json.containsKey("name")) {
781 name = _json["name"];
782 }
783 if (_json.containsKey("value")) {
784 value = new Value.fromJson(_json["value"]);
785 }
786 }
787
788 core.Map toJson() {
789 var _json = new core.Map();
790 if (cursor != null) {
791 _json["cursor"] = cursor;
792 }
793 if (name != null) {
794 _json["name"] = name;
795 }
796 if (value != null) {
797 _json["value"] = (value).toJson();
798 }
799 return _json;
800 }
801 }
802
803
804 /** Not documented yet. */
805 class Key {
806 /**
807 * Entities are partitioned into subsets, currently identified by a dataset
808 * (usually implicitly specified by the project) and namespace ID. Queries are
809 * scoped to a single partition.
810 */
811 PartitionId partitionId;
812
813 /**
814 * The entity path. An entity path consists of one or more elements composed
815 * of a kind and a string or numerical identifier, which identify entities.
816 * The first element identifies a root entity, the second element identifies a
817 * child of the root entity, the third element a child of the second entity,
818 * and so forth. The entities identified by all prefixes of the path are
819 * called the element's ancestors. An entity path is always fully complete:
820 * ALL of the entity's ancestors are required to be in the path along with the
821 * entity identifier itself. The only exception is that in some documented
822 * cases, the identifier in the last path element (for the entity) itself may
823 * be omitted. A path can never be empty. The path can have at most 100
824 * elements.
825 */
826 core.List<KeyPathElement> path;
827
828
829 Key();
830
831 Key.fromJson(core.Map _json) {
832 if (_json.containsKey("partitionId")) {
833 partitionId = new PartitionId.fromJson(_json["partitionId"]);
834 }
835 if (_json.containsKey("path")) {
836 path = _json["path"].map((value) => new KeyPathElement.fromJson(value)).to List();
837 }
838 }
839
840 core.Map toJson() {
841 var _json = new core.Map();
842 if (partitionId != null) {
843 _json["partitionId"] = (partitionId).toJson();
844 }
845 if (path != null) {
846 _json["path"] = path.map((value) => (value).toJson()).toList();
847 }
848 return _json;
849 }
850 }
851
852
853 /**
854 * A (kind, ID/name) pair used to construct a key path.
855 *
856 * At most one of name or ID may be set. If either is set, the element is
857 * complete. If neither is set, the element is incomplete.
858 */
859 class KeyPathElement {
860 /**
861 * The ID of the entity. Never equal to zero. Values less than zero are
862 * discouraged and will not be supported in the future.
863 */
864 core.String id;
865
866 /**
867 * The kind of the entity. A kind matching regex "__.*__" is
868 * reserved/read-only. A kind must not contain more than 500 characters.
869 * Cannot be "".
870 */
871 core.String kind;
872
873 /**
874 * The name of the entity. A name matching regex "__.*__" is
875 * reserved/read-only. A name must not be more than 500 characters. Cannot be
876 * "".
877 */
878 core.String name;
879
880
881 KeyPathElement();
882
883 KeyPathElement.fromJson(core.Map _json) {
884 if (_json.containsKey("id")) {
885 id = _json["id"];
886 }
887 if (_json.containsKey("kind")) {
888 kind = _json["kind"];
889 }
890 if (_json.containsKey("name")) {
891 name = _json["name"];
892 }
893 }
894
895 core.Map toJson() {
896 var _json = new core.Map();
897 if (id != null) {
898 _json["id"] = id;
899 }
900 if (kind != null) {
901 _json["kind"] = kind;
902 }
903 if (name != null) {
904 _json["name"] = name;
905 }
906 return _json;
907 }
908 }
909
910
911 /** Not documented yet. */
912 class KindExpression {
913 /** The name of the kind. */
914 core.String name;
915
916
917 KindExpression();
918
919 KindExpression.fromJson(core.Map _json) {
920 if (_json.containsKey("name")) {
921 name = _json["name"];
922 }
923 }
924
925 core.Map toJson() {
926 var _json = new core.Map();
927 if (name != null) {
928 _json["name"] = name;
929 }
930 return _json;
931 }
932 }
933
934
935 /** Not documented yet. */
936 class LookupRequest {
937 /** Keys of entities to look up from the datastore. */
938 core.List<Key> keys;
939
940 /** Options for this lookup request. Optional. */
941 ReadOptions readOptions;
942
943
944 LookupRequest();
945
946 LookupRequest.fromJson(core.Map _json) {
947 if (_json.containsKey("keys")) {
948 keys = _json["keys"].map((value) => new Key.fromJson(value)).toList();
949 }
950 if (_json.containsKey("readOptions")) {
951 readOptions = new ReadOptions.fromJson(_json["readOptions"]);
952 }
953 }
954
955 core.Map toJson() {
956 var _json = new core.Map();
957 if (keys != null) {
958 _json["keys"] = keys.map((value) => (value).toJson()).toList();
959 }
960 if (readOptions != null) {
961 _json["readOptions"] = (readOptions).toJson();
962 }
963 return _json;
964 }
965 }
966
967
968 /** Not documented yet. */
969 class LookupResponse {
970 /** A list of keys that were not looked up due to resource constraints. */
971 core.List<Key> deferred;
972
973 /** Entities found. */
974 core.List<EntityResult> found;
975
976 /** Not documented yet. */
977 ResponseHeader header;
978
979 /** Entities not found, with only the key populated. */
980 core.List<EntityResult> missing;
981
982
983 LookupResponse();
984
985 LookupResponse.fromJson(core.Map _json) {
986 if (_json.containsKey("deferred")) {
987 deferred = _json["deferred"].map((value) => new Key.fromJson(value)).toLis t();
988 }
989 if (_json.containsKey("found")) {
990 found = _json["found"].map((value) => new EntityResult.fromJson(value)).to List();
991 }
992 if (_json.containsKey("header")) {
993 header = new ResponseHeader.fromJson(_json["header"]);
994 }
995 if (_json.containsKey("missing")) {
996 missing = _json["missing"].map((value) => new EntityResult.fromJson(value) ).toList();
997 }
998 }
999
1000 core.Map toJson() {
1001 var _json = new core.Map();
1002 if (deferred != null) {
1003 _json["deferred"] = deferred.map((value) => (value).toJson()).toList();
1004 }
1005 if (found != null) {
1006 _json["found"] = found.map((value) => (value).toJson()).toList();
1007 }
1008 if (header != null) {
1009 _json["header"] = (header).toJson();
1010 }
1011 if (missing != null) {
1012 _json["missing"] = missing.map((value) => (value).toJson()).toList();
1013 }
1014 return _json;
1015 }
1016 }
1017
1018
1019 /** Not documented yet. */
1020 class Mutation {
1021 /**
1022 * Keys of entities to delete. Each key must have a complete key path and must
1023 * not be reserved/read-only.
1024 */
1025 core.List<Key> delete;
1026
1027 /** Ignore a user specified read-only period. Optional. */
1028 core.bool force;
1029
1030 /**
1031 * Entities to insert. Each inserted entity's key must have a complete path
1032 * and must not be reserved/read-only.
1033 */
1034 core.List<Entity> insert;
1035
1036 /**
1037 * Insert entities with a newly allocated ID. Each inserted entity's key must
1038 * omit the final identifier in its path and must not be reserved/read-only.
1039 */
1040 core.List<Entity> insertAutoId;
1041
1042 /**
1043 * Entities to update. Each updated entity's key must have a complete path and
1044 * must not be reserved/read-only.
1045 */
1046 core.List<Entity> update;
1047
1048 /**
1049 * Entities to upsert. Each upserted entity's key must have a complete path
1050 * and must not be reserved/read-only.
1051 */
1052 core.List<Entity> upsert;
1053
1054
1055 Mutation();
1056
1057 Mutation.fromJson(core.Map _json) {
1058 if (_json.containsKey("delete")) {
1059 delete = _json["delete"].map((value) => new Key.fromJson(value)).toList();
1060 }
1061 if (_json.containsKey("force")) {
1062 force = _json["force"];
1063 }
1064 if (_json.containsKey("insert")) {
1065 insert = _json["insert"].map((value) => new Entity.fromJson(value)).toList ();
1066 }
1067 if (_json.containsKey("insertAutoId")) {
1068 insertAutoId = _json["insertAutoId"].map((value) => new Entity.fromJson(va lue)).toList();
1069 }
1070 if (_json.containsKey("update")) {
1071 update = _json["update"].map((value) => new Entity.fromJson(value)).toList ();
1072 }
1073 if (_json.containsKey("upsert")) {
1074 upsert = _json["upsert"].map((value) => new Entity.fromJson(value)).toList ();
1075 }
1076 }
1077
1078 core.Map toJson() {
1079 var _json = new core.Map();
1080 if (delete != null) {
1081 _json["delete"] = delete.map((value) => (value).toJson()).toList();
1082 }
1083 if (force != null) {
1084 _json["force"] = force;
1085 }
1086 if (insert != null) {
1087 _json["insert"] = insert.map((value) => (value).toJson()).toList();
1088 }
1089 if (insertAutoId != null) {
1090 _json["insertAutoId"] = insertAutoId.map((value) => (value).toJson()).toLi st();
1091 }
1092 if (update != null) {
1093 _json["update"] = update.map((value) => (value).toJson()).toList();
1094 }
1095 if (upsert != null) {
1096 _json["upsert"] = upsert.map((value) => (value).toJson()).toList();
1097 }
1098 return _json;
1099 }
1100 }
1101
1102
1103 /** Not documented yet. */
1104 class MutationResult {
1105 /** Number of index writes. */
1106 core.int indexUpdates;
1107
1108 /**
1109 * Keys for insertAutoId entities. One per entity from the request, in the
1110 * same order.
1111 */
1112 core.List<Key> insertAutoIdKeys;
1113
1114
1115 MutationResult();
1116
1117 MutationResult.fromJson(core.Map _json) {
1118 if (_json.containsKey("indexUpdates")) {
1119 indexUpdates = _json["indexUpdates"];
1120 }
1121 if (_json.containsKey("insertAutoIdKeys")) {
1122 insertAutoIdKeys = _json["insertAutoIdKeys"].map((value) => new Key.fromJs on(value)).toList();
1123 }
1124 }
1125
1126 core.Map toJson() {
1127 var _json = new core.Map();
1128 if (indexUpdates != null) {
1129 _json["indexUpdates"] = indexUpdates;
1130 }
1131 if (insertAutoIdKeys != null) {
1132 _json["insertAutoIdKeys"] = insertAutoIdKeys.map((value) => (value).toJson ()).toList();
1133 }
1134 return _json;
1135 }
1136 }
1137
1138
1139 /** Not documented yet. */
1140 class PartitionId {
1141 /** The dataset ID. */
1142 core.String datasetId;
1143
1144 /** The namespace. */
1145 core.String namespace;
1146
1147
1148 PartitionId();
1149
1150 PartitionId.fromJson(core.Map _json) {
1151 if (_json.containsKey("datasetId")) {
1152 datasetId = _json["datasetId"];
1153 }
1154 if (_json.containsKey("namespace")) {
1155 namespace = _json["namespace"];
1156 }
1157 }
1158
1159 core.Map toJson() {
1160 var _json = new core.Map();
1161 if (datasetId != null) {
1162 _json["datasetId"] = datasetId;
1163 }
1164 if (namespace != null) {
1165 _json["namespace"] = namespace;
1166 }
1167 return _json;
1168 }
1169 }
1170
1171
1172 /** Not documented yet. */
1173 class Property {
1174 /** A blob key value. */
1175 core.String blobKeyValue;
1176
1177 /** A blob value. May be a maximum of 1,000,000 bytes. */
1178 core.String blobValue;
1179
1180 core.List<core.int> get blobValueAsBytes {
1181 return crypto.CryptoUtils.base64StringToBytes(blobValue);
1182 }
1183
1184 void set blobValueAsBytes(core.List<core.int> _bytes) {
1185 blobValue = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
1186 }
1187
1188 /** A boolean value. */
1189 core.bool booleanValue;
1190
1191 /** A timestamp value. */
1192 core.DateTime dateTimeValue;
1193
1194 /** A double value. */
1195 core.double doubleValue;
1196
1197 /**
1198 * An entity value. May have no key. May have a key with an incomplete key
1199 * path. May have a reserved/read-only key.
1200 */
1201 Entity entityValue;
1202
1203 /**
1204 * If the value should be indexed.
1205 *
1206 * The indexed property may be set for a null value. When indexed is true,
1207 * stringValue is limited to 500 characters and the blob value is limited to
1208 * 500 bytes. Input values by default have indexed set to true; however, you
1209 * can explicitly set indexed to true if you want. (An output value never has
1210 * indexed explicitly set to true.) If a value is itself an entity, it cannot
1211 * have indexed set to true.
1212 */
1213 core.bool indexed;
1214
1215 /** An integer value. */
1216 core.String integerValue;
1217
1218 /** A key value. */
1219 Key keyValue;
1220
1221 /**
1222 * A list value. Cannot contain another list value. Cannot also have a meaning
1223 * and indexing set.
1224 */
1225 core.List<Value> listValue;
1226
1227 /** The meaning field is reserved and should not be used. */
1228 core.int meaning;
1229
1230 /** A UTF-8 encoded string value. */
1231 core.String stringValue;
1232
1233
1234 Property();
1235
1236 Property.fromJson(core.Map _json) {
1237 if (_json.containsKey("blobKeyValue")) {
1238 blobKeyValue = _json["blobKeyValue"];
1239 }
1240 if (_json.containsKey("blobValue")) {
1241 blobValue = _json["blobValue"];
1242 }
1243 if (_json.containsKey("booleanValue")) {
1244 booleanValue = _json["booleanValue"];
1245 }
1246 if (_json.containsKey("dateTimeValue")) {
1247 dateTimeValue = core.DateTime.parse(_json["dateTimeValue"]);
1248 }
1249 if (_json.containsKey("doubleValue")) {
1250 doubleValue = _json["doubleValue"];
1251 }
1252 if (_json.containsKey("entityValue")) {
1253 entityValue = new Entity.fromJson(_json["entityValue"]);
1254 }
1255 if (_json.containsKey("indexed")) {
1256 indexed = _json["indexed"];
1257 }
1258 if (_json.containsKey("integerValue")) {
1259 integerValue = _json["integerValue"];
1260 }
1261 if (_json.containsKey("keyValue")) {
1262 keyValue = new Key.fromJson(_json["keyValue"]);
1263 }
1264 if (_json.containsKey("listValue")) {
1265 listValue = _json["listValue"].map((value) => new Value.fromJson(value)).t oList();
1266 }
1267 if (_json.containsKey("meaning")) {
1268 meaning = _json["meaning"];
1269 }
1270 if (_json.containsKey("stringValue")) {
1271 stringValue = _json["stringValue"];
1272 }
1273 }
1274
1275 core.Map toJson() {
1276 var _json = new core.Map();
1277 if (blobKeyValue != null) {
1278 _json["blobKeyValue"] = blobKeyValue;
1279 }
1280 if (blobValue != null) {
1281 _json["blobValue"] = blobValue;
1282 }
1283 if (booleanValue != null) {
1284 _json["booleanValue"] = booleanValue;
1285 }
1286 if (dateTimeValue != null) {
1287 _json["dateTimeValue"] = (dateTimeValue).toIso8601String();
1288 }
1289 if (doubleValue != null) {
1290 _json["doubleValue"] = doubleValue;
1291 }
1292 if (entityValue != null) {
1293 _json["entityValue"] = (entityValue).toJson();
1294 }
1295 if (indexed != null) {
1296 _json["indexed"] = indexed;
1297 }
1298 if (integerValue != null) {
1299 _json["integerValue"] = integerValue;
1300 }
1301 if (keyValue != null) {
1302 _json["keyValue"] = (keyValue).toJson();
1303 }
1304 if (listValue != null) {
1305 _json["listValue"] = listValue.map((value) => (value).toJson()).toList();
1306 }
1307 if (meaning != null) {
1308 _json["meaning"] = meaning;
1309 }
1310 if (stringValue != null) {
1311 _json["stringValue"] = stringValue;
1312 }
1313 return _json;
1314 }
1315 }
1316
1317
1318 /** Not documented yet. */
1319 class PropertyExpression {
1320 /**
1321 * The aggregation function to apply to the property. Optional. Can only be
1322 * used when grouping by at least one property. Must then be set on all
1323 * properties in the projection that are not being grouped by. Aggregation
1324 * functions: first selects the first result as determined by the query's
1325 * order.
1326 * Possible string values are:
1327 * - "FIRST"
1328 */
1329 core.String aggregationFunction;
1330
1331 /** The property to project. */
1332 PropertyReference property;
1333
1334
1335 PropertyExpression();
1336
1337 PropertyExpression.fromJson(core.Map _json) {
1338 if (_json.containsKey("aggregationFunction")) {
1339 aggregationFunction = _json["aggregationFunction"];
1340 }
1341 if (_json.containsKey("property")) {
1342 property = new PropertyReference.fromJson(_json["property"]);
1343 }
1344 }
1345
1346 core.Map toJson() {
1347 var _json = new core.Map();
1348 if (aggregationFunction != null) {
1349 _json["aggregationFunction"] = aggregationFunction;
1350 }
1351 if (property != null) {
1352 _json["property"] = (property).toJson();
1353 }
1354 return _json;
1355 }
1356 }
1357
1358
1359 /** Not documented yet. */
1360 class PropertyFilter {
1361 /**
1362 * The operator to filter by. One of lessThan, lessThanOrEqual, greaterThan,
1363 * greaterThanOrEqual, equal, or hasAncestor.
1364 * Possible string values are:
1365 * - "EQUAL"
1366 * - "GREATER_THAN"
1367 * - "GREATER_THAN_OR_EQUAL"
1368 * - "HAS_ANCESTOR"
1369 * - "LESS_THAN"
1370 * - "LESS_THAN_OR_EQUAL"
1371 */
1372 core.String operator;
1373
1374 /** The property to filter by. */
1375 PropertyReference property;
1376
1377 /** The value to compare the property to. */
1378 Value value;
1379
1380
1381 PropertyFilter();
1382
1383 PropertyFilter.fromJson(core.Map _json) {
1384 if (_json.containsKey("operator")) {
1385 operator = _json["operator"];
1386 }
1387 if (_json.containsKey("property")) {
1388 property = new PropertyReference.fromJson(_json["property"]);
1389 }
1390 if (_json.containsKey("value")) {
1391 value = new Value.fromJson(_json["value"]);
1392 }
1393 }
1394
1395 core.Map toJson() {
1396 var _json = new core.Map();
1397 if (operator != null) {
1398 _json["operator"] = operator;
1399 }
1400 if (property != null) {
1401 _json["property"] = (property).toJson();
1402 }
1403 if (value != null) {
1404 _json["value"] = (value).toJson();
1405 }
1406 return _json;
1407 }
1408 }
1409
1410
1411 /** Not documented yet. */
1412 class PropertyOrder {
1413 /**
1414 * The direction to order by. One of ascending or descending. Optional,
1415 * defaults to ascending.
1416 * Possible string values are:
1417 * - "ASCENDING"
1418 * - "DESCENDING"
1419 */
1420 core.String direction;
1421
1422 /** The property to order by. */
1423 PropertyReference property;
1424
1425
1426 PropertyOrder();
1427
1428 PropertyOrder.fromJson(core.Map _json) {
1429 if (_json.containsKey("direction")) {
1430 direction = _json["direction"];
1431 }
1432 if (_json.containsKey("property")) {
1433 property = new PropertyReference.fromJson(_json["property"]);
1434 }
1435 }
1436
1437 core.Map toJson() {
1438 var _json = new core.Map();
1439 if (direction != null) {
1440 _json["direction"] = direction;
1441 }
1442 if (property != null) {
1443 _json["property"] = (property).toJson();
1444 }
1445 return _json;
1446 }
1447 }
1448
1449
1450 /** Not documented yet. */
1451 class PropertyReference {
1452 /** The name of the property. */
1453 core.String name;
1454
1455
1456 PropertyReference();
1457
1458 PropertyReference.fromJson(core.Map _json) {
1459 if (_json.containsKey("name")) {
1460 name = _json["name"];
1461 }
1462 }
1463
1464 core.Map toJson() {
1465 var _json = new core.Map();
1466 if (name != null) {
1467 _json["name"] = name;
1468 }
1469 return _json;
1470 }
1471 }
1472
1473
1474 /** Not documented yet. */
1475 class Query {
1476 /**
1477 * An ending point for the query results. Optional. Query cursors are returned
1478 * in query result batches.
1479 */
1480 core.String endCursor;
1481
1482 core.List<core.int> get endCursorAsBytes {
1483 return crypto.CryptoUtils.base64StringToBytes(endCursor);
1484 }
1485
1486 void set endCursorAsBytes(core.List<core.int> _bytes) {
1487 endCursor = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
1488 }
1489
1490 /** The filter to apply (optional). */
1491 Filter filter;
1492
1493 /**
1494 * The properties to group by (if empty, no grouping is applied to the result
1495 * set).
1496 */
1497 core.List<PropertyReference> groupBy;
1498
1499 /** The kinds to query (if empty, returns entities from all kinds). */
1500 core.List<KindExpression> kinds;
1501
1502 /**
1503 * The maximum number of results to return. Applies after all other
1504 * constraints. Optional.
1505 */
1506 core.int limit;
1507
1508 /**
1509 * The number of results to skip. Applies before limit, but after all other
1510 * constraints (optional, defaults to 0).
1511 */
1512 core.int offset;
1513
1514 /**
1515 * The order to apply to the query results (if empty, order is unspecified).
1516 */
1517 core.List<PropertyOrder> order;
1518
1519 /** The projection to return. If not set the entire entity is returned. */
1520 core.List<PropertyExpression> projection;
1521
1522 /**
1523 * A starting point for the query results. Optional. Query cursors are
1524 * returned in query result batches.
1525 */
1526 core.String startCursor;
1527
1528 core.List<core.int> get startCursorAsBytes {
1529 return crypto.CryptoUtils.base64StringToBytes(startCursor);
1530 }
1531
1532 void set startCursorAsBytes(core.List<core.int> _bytes) {
1533 startCursor = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
1534 }
1535
1536
1537 Query();
1538
1539 Query.fromJson(core.Map _json) {
1540 if (_json.containsKey("endCursor")) {
1541 endCursor = _json["endCursor"];
1542 }
1543 if (_json.containsKey("filter")) {
1544 filter = new Filter.fromJson(_json["filter"]);
1545 }
1546 if (_json.containsKey("groupBy")) {
1547 groupBy = _json["groupBy"].map((value) => new PropertyReference.fromJson(v alue)).toList();
1548 }
1549 if (_json.containsKey("kinds")) {
1550 kinds = _json["kinds"].map((value) => new KindExpression.fromJson(value)). toList();
1551 }
1552 if (_json.containsKey("limit")) {
1553 limit = _json["limit"];
1554 }
1555 if (_json.containsKey("offset")) {
1556 offset = _json["offset"];
1557 }
1558 if (_json.containsKey("order")) {
1559 order = _json["order"].map((value) => new PropertyOrder.fromJson(value)).t oList();
1560 }
1561 if (_json.containsKey("projection")) {
1562 projection = _json["projection"].map((value) => new PropertyExpression.fro mJson(value)).toList();
1563 }
1564 if (_json.containsKey("startCursor")) {
1565 startCursor = _json["startCursor"];
1566 }
1567 }
1568
1569 core.Map toJson() {
1570 var _json = new core.Map();
1571 if (endCursor != null) {
1572 _json["endCursor"] = endCursor;
1573 }
1574 if (filter != null) {
1575 _json["filter"] = (filter).toJson();
1576 }
1577 if (groupBy != null) {
1578 _json["groupBy"] = groupBy.map((value) => (value).toJson()).toList();
1579 }
1580 if (kinds != null) {
1581 _json["kinds"] = kinds.map((value) => (value).toJson()).toList();
1582 }
1583 if (limit != null) {
1584 _json["limit"] = limit;
1585 }
1586 if (offset != null) {
1587 _json["offset"] = offset;
1588 }
1589 if (order != null) {
1590 _json["order"] = order.map((value) => (value).toJson()).toList();
1591 }
1592 if (projection != null) {
1593 _json["projection"] = projection.map((value) => (value).toJson()).toList() ;
1594 }
1595 if (startCursor != null) {
1596 _json["startCursor"] = startCursor;
1597 }
1598 return _json;
1599 }
1600 }
1601
1602
1603 /** Not documented yet. */
1604 class QueryResultBatch {
1605 /**
1606 * A cursor that points to the position after the last result in the batch.
1607 * May be absent.
1608 */
1609 core.String endCursor;
1610
1611 core.List<core.int> get endCursorAsBytes {
1612 return crypto.CryptoUtils.base64StringToBytes(endCursor);
1613 }
1614
1615 void set endCursorAsBytes(core.List<core.int> _bytes) {
1616 endCursor = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
1617 }
1618
1619 /**
1620 * The result type for every entity in entityResults. full for full entities,
1621 * projection for entities with only projected properties, keyOnly for
1622 * entities with only a key.
1623 * Possible string values are:
1624 * - "FULL"
1625 * - "KEY_ONLY"
1626 * - "PROJECTION"
1627 */
1628 core.String entityResultType;
1629
1630 /** The results for this batch. */
1631 core.List<EntityResult> entityResults;
1632
1633 /**
1634 * The state of the query after the current batch. One of notFinished,
1635 * moreResultsAfterLimit, noMoreResults.
1636 * Possible string values are:
1637 * - "MORE_RESULTS_AFTER_LIMIT"
1638 * - "NOT_FINISHED"
1639 * - "NO_MORE_RESULTS"
1640 */
1641 core.String moreResults;
1642
1643 /** The number of results skipped because of Query.offset. */
1644 core.int skippedResults;
1645
1646
1647 QueryResultBatch();
1648
1649 QueryResultBatch.fromJson(core.Map _json) {
1650 if (_json.containsKey("endCursor")) {
1651 endCursor = _json["endCursor"];
1652 }
1653 if (_json.containsKey("entityResultType")) {
1654 entityResultType = _json["entityResultType"];
1655 }
1656 if (_json.containsKey("entityResults")) {
1657 entityResults = _json["entityResults"].map((value) => new EntityResult.fro mJson(value)).toList();
1658 }
1659 if (_json.containsKey("moreResults")) {
1660 moreResults = _json["moreResults"];
1661 }
1662 if (_json.containsKey("skippedResults")) {
1663 skippedResults = _json["skippedResults"];
1664 }
1665 }
1666
1667 core.Map toJson() {
1668 var _json = new core.Map();
1669 if (endCursor != null) {
1670 _json["endCursor"] = endCursor;
1671 }
1672 if (entityResultType != null) {
1673 _json["entityResultType"] = entityResultType;
1674 }
1675 if (entityResults != null) {
1676 _json["entityResults"] = entityResults.map((value) => (value).toJson()).to List();
1677 }
1678 if (moreResults != null) {
1679 _json["moreResults"] = moreResults;
1680 }
1681 if (skippedResults != null) {
1682 _json["skippedResults"] = skippedResults;
1683 }
1684 return _json;
1685 }
1686 }
1687
1688
1689 /** Not documented yet. */
1690 class ReadOptions {
1691 /**
1692 * The read consistency to use. One of default, strong, or eventual. Cannot be
1693 * set when transaction is set. Lookup and ancestor queries default to strong,
1694 * global queries default to eventual and cannot be set to strong. Optional.
1695 * Default is default.
1696 * Possible string values are:
1697 * - "DEFAULT"
1698 * - "EVENTUAL"
1699 * - "STRONG"
1700 */
1701 core.String readConsistency;
1702
1703 /** The transaction to use. Optional. */
1704 core.String transaction;
1705
1706 core.List<core.int> get transactionAsBytes {
1707 return crypto.CryptoUtils.base64StringToBytes(transaction);
1708 }
1709
1710 void set transactionAsBytes(core.List<core.int> _bytes) {
1711 transaction = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
1712 }
1713
1714
1715 ReadOptions();
1716
1717 ReadOptions.fromJson(core.Map _json) {
1718 if (_json.containsKey("readConsistency")) {
1719 readConsistency = _json["readConsistency"];
1720 }
1721 if (_json.containsKey("transaction")) {
1722 transaction = _json["transaction"];
1723 }
1724 }
1725
1726 core.Map toJson() {
1727 var _json = new core.Map();
1728 if (readConsistency != null) {
1729 _json["readConsistency"] = readConsistency;
1730 }
1731 if (transaction != null) {
1732 _json["transaction"] = transaction;
1733 }
1734 return _json;
1735 }
1736 }
1737
1738
1739 /** Not documented yet. */
1740 class ResponseHeader {
1741 /**
1742 * Identifies what kind of resource this is. Value: the fixed string
1743 * "datastore#responseHeader".
1744 */
1745 core.String kind;
1746
1747
1748 ResponseHeader();
1749
1750 ResponseHeader.fromJson(core.Map _json) {
1751 if (_json.containsKey("kind")) {
1752 kind = _json["kind"];
1753 }
1754 }
1755
1756 core.Map toJson() {
1757 var _json = new core.Map();
1758 if (kind != null) {
1759 _json["kind"] = kind;
1760 }
1761 return _json;
1762 }
1763 }
1764
1765
1766 /** Not documented yet. */
1767 class RollbackRequest {
1768 /** The transaction identifier, returned by a call to beginTransaction. */
1769 core.String transaction;
1770
1771 core.List<core.int> get transactionAsBytes {
1772 return crypto.CryptoUtils.base64StringToBytes(transaction);
1773 }
1774
1775 void set transactionAsBytes(core.List<core.int> _bytes) {
1776 transaction = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
1777 }
1778
1779
1780 RollbackRequest();
1781
1782 RollbackRequest.fromJson(core.Map _json) {
1783 if (_json.containsKey("transaction")) {
1784 transaction = _json["transaction"];
1785 }
1786 }
1787
1788 core.Map toJson() {
1789 var _json = new core.Map();
1790 if (transaction != null) {
1791 _json["transaction"] = transaction;
1792 }
1793 return _json;
1794 }
1795 }
1796
1797
1798 /** Not documented yet. */
1799 class RollbackResponse {
1800 /** Not documented yet. */
1801 ResponseHeader header;
1802
1803
1804 RollbackResponse();
1805
1806 RollbackResponse.fromJson(core.Map _json) {
1807 if (_json.containsKey("header")) {
1808 header = new ResponseHeader.fromJson(_json["header"]);
1809 }
1810 }
1811
1812 core.Map toJson() {
1813 var _json = new core.Map();
1814 if (header != null) {
1815 _json["header"] = (header).toJson();
1816 }
1817 return _json;
1818 }
1819 }
1820
1821
1822 /** Not documented yet. */
1823 class RunQueryRequest {
1824 /**
1825 * The GQL query to run. Either this field or field query must be set, but not
1826 * both.
1827 */
1828 GqlQuery gqlQuery;
1829
1830 /**
1831 * Entities are partitioned into subsets, identified by a dataset (usually
1832 * implicitly specified by the project) and namespace ID. Queries are scoped
1833 * to a single partition. This partition ID is normalized with the standard
1834 * default context partition ID, but all other partition IDs in
1835 * RunQueryRequest are normalized with this partition ID as the context
1836 * partition ID.
1837 */
1838 PartitionId partitionId;
1839
1840 /**
1841 * The query to run. Either this field or field gql_query must be set, but not
1842 * both.
1843 */
1844 Query query;
1845
1846 /** The options for this query. */
1847 ReadOptions readOptions;
1848
1849
1850 RunQueryRequest();
1851
1852 RunQueryRequest.fromJson(core.Map _json) {
1853 if (_json.containsKey("gqlQuery")) {
1854 gqlQuery = new GqlQuery.fromJson(_json["gqlQuery"]);
1855 }
1856 if (_json.containsKey("partitionId")) {
1857 partitionId = new PartitionId.fromJson(_json["partitionId"]);
1858 }
1859 if (_json.containsKey("query")) {
1860 query = new Query.fromJson(_json["query"]);
1861 }
1862 if (_json.containsKey("readOptions")) {
1863 readOptions = new ReadOptions.fromJson(_json["readOptions"]);
1864 }
1865 }
1866
1867 core.Map toJson() {
1868 var _json = new core.Map();
1869 if (gqlQuery != null) {
1870 _json["gqlQuery"] = (gqlQuery).toJson();
1871 }
1872 if (partitionId != null) {
1873 _json["partitionId"] = (partitionId).toJson();
1874 }
1875 if (query != null) {
1876 _json["query"] = (query).toJson();
1877 }
1878 if (readOptions != null) {
1879 _json["readOptions"] = (readOptions).toJson();
1880 }
1881 return _json;
1882 }
1883 }
1884
1885
1886 /** Not documented yet. */
1887 class RunQueryResponse {
1888 /** A batch of query results (always present). */
1889 QueryResultBatch batch;
1890
1891 /** Not documented yet. */
1892 ResponseHeader header;
1893
1894
1895 RunQueryResponse();
1896
1897 RunQueryResponse.fromJson(core.Map _json) {
1898 if (_json.containsKey("batch")) {
1899 batch = new QueryResultBatch.fromJson(_json["batch"]);
1900 }
1901 if (_json.containsKey("header")) {
1902 header = new ResponseHeader.fromJson(_json["header"]);
1903 }
1904 }
1905
1906 core.Map toJson() {
1907 var _json = new core.Map();
1908 if (batch != null) {
1909 _json["batch"] = (batch).toJson();
1910 }
1911 if (header != null) {
1912 _json["header"] = (header).toJson();
1913 }
1914 return _json;
1915 }
1916 }
1917
1918
1919 /** Not documented yet. */
1920 class Value {
1921 /** A blob key value. */
1922 core.String blobKeyValue;
1923
1924 /** A blob value. May be a maximum of 1,000,000 bytes. */
1925 core.String blobValue;
1926
1927 core.List<core.int> get blobValueAsBytes {
1928 return crypto.CryptoUtils.base64StringToBytes(blobValue);
1929 }
1930
1931 void set blobValueAsBytes(core.List<core.int> _bytes) {
1932 blobValue = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
1933 }
1934
1935 /** A boolean value. */
1936 core.bool booleanValue;
1937
1938 /** A timestamp value. */
1939 core.DateTime dateTimeValue;
1940
1941 /** A double value. */
1942 core.double doubleValue;
1943
1944 /**
1945 * An entity value. May have no key. May have a key with an incomplete key
1946 * path. May have a reserved/read-only key.
1947 */
1948 Entity entityValue;
1949
1950 /**
1951 * If the value should be indexed.
1952 *
1953 * The indexed property may be set for a null value. When indexed is true,
1954 * stringValue is limited to 500 characters and the blob value is limited to
1955 * 500 bytes. Input values by default have indexed set to true; however, you
1956 * can explicitly set indexed to true if you want. (An output value never has
1957 * indexed explicitly set to true.) If a value is itself an entity, it cannot
1958 * have indexed set to true.
1959 */
1960 core.bool indexed;
1961
1962 /** An integer value. */
1963 core.String integerValue;
1964
1965 /** A key value. */
1966 Key keyValue;
1967
1968 /**
1969 * A list value. Cannot contain another list value. Cannot also have a meaning
1970 * and indexing set.
1971 */
1972 core.List<Value> listValue;
1973
1974 /** The meaning field is reserved and should not be used. */
1975 core.int meaning;
1976
1977 /** A UTF-8 encoded string value. */
1978 core.String stringValue;
1979
1980
1981 Value();
1982
1983 Value.fromJson(core.Map _json) {
1984 if (_json.containsKey("blobKeyValue")) {
1985 blobKeyValue = _json["blobKeyValue"];
1986 }
1987 if (_json.containsKey("blobValue")) {
1988 blobValue = _json["blobValue"];
1989 }
1990 if (_json.containsKey("booleanValue")) {
1991 booleanValue = _json["booleanValue"];
1992 }
1993 if (_json.containsKey("dateTimeValue")) {
1994 dateTimeValue = core.DateTime.parse(_json["dateTimeValue"]);
1995 }
1996 if (_json.containsKey("doubleValue")) {
1997 doubleValue = _json["doubleValue"];
1998 }
1999 if (_json.containsKey("entityValue")) {
2000 entityValue = new Entity.fromJson(_json["entityValue"]);
2001 }
2002 if (_json.containsKey("indexed")) {
2003 indexed = _json["indexed"];
2004 }
2005 if (_json.containsKey("integerValue")) {
2006 integerValue = _json["integerValue"];
2007 }
2008 if (_json.containsKey("keyValue")) {
2009 keyValue = new Key.fromJson(_json["keyValue"]);
2010 }
2011 if (_json.containsKey("listValue")) {
2012 listValue = _json["listValue"].map((value) => new Value.fromJson(value)).t oList();
2013 }
2014 if (_json.containsKey("meaning")) {
2015 meaning = _json["meaning"];
2016 }
2017 if (_json.containsKey("stringValue")) {
2018 stringValue = _json["stringValue"];
2019 }
2020 }
2021
2022 core.Map toJson() {
2023 var _json = new core.Map();
2024 if (blobKeyValue != null) {
2025 _json["blobKeyValue"] = blobKeyValue;
2026 }
2027 if (blobValue != null) {
2028 _json["blobValue"] = blobValue;
2029 }
2030 if (booleanValue != null) {
2031 _json["booleanValue"] = booleanValue;
2032 }
2033 if (dateTimeValue != null) {
2034 _json["dateTimeValue"] = (dateTimeValue).toIso8601String();
2035 }
2036 if (doubleValue != null) {
2037 _json["doubleValue"] = doubleValue;
2038 }
2039 if (entityValue != null) {
2040 _json["entityValue"] = (entityValue).toJson();
2041 }
2042 if (indexed != null) {
2043 _json["indexed"] = indexed;
2044 }
2045 if (integerValue != null) {
2046 _json["integerValue"] = integerValue;
2047 }
2048 if (keyValue != null) {
2049 _json["keyValue"] = (keyValue).toJson();
2050 }
2051 if (listValue != null) {
2052 _json["listValue"] = listValue.map((value) => (value).toJson()).toList();
2053 }
2054 if (meaning != null) {
2055 _json["meaning"] = meaning;
2056 }
2057 if (stringValue != null) {
2058 _json["stringValue"] = stringValue;
2059 }
2060 return _json;
2061 }
2062 }
2063
2064
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698