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

Side by Side Diff: generated/googleapis/lib/mirror/v1.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.mirror.v1;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection_1;
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 interacting with Glass users via the timeline. */
17 class MirrorApi {
18 /** View your location */
19 static const GlassLocationScope = "https://www.googleapis.com/auth/glass.locat ion";
20
21 /** View and manage your Glass timeline */
22 static const GlassTimelineScope = "https://www.googleapis.com/auth/glass.timel ine";
23
24
25 final common_internal.ApiRequester _requester;
26
27 AccountsResourceApi get accounts => new AccountsResourceApi(_requester);
28 ContactsResourceApi get contacts => new ContactsResourceApi(_requester);
29 LocationsResourceApi get locations => new LocationsResourceApi(_requester);
30 SettingsResourceApi get settings => new SettingsResourceApi(_requester);
31 SubscriptionsResourceApi get subscriptions => new SubscriptionsResourceApi(_re quester);
32 TimelineResourceApi get timeline => new TimelineResourceApi(_requester);
33
34 MirrorApi(http.Client client) :
35 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/mirror/v1/");
36 }
37
38
39 /** Not documented yet. */
40 class AccountsResourceApi {
41 final common_internal.ApiRequester _requester;
42
43 AccountsResourceApi(common_internal.ApiRequester client) :
44 _requester = client;
45
46 /**
47 * Inserts a new account for a user
48 *
49 * [request] - The metadata request object.
50 *
51 * Request parameters:
52 *
53 * [userToken] - The ID for the user.
54 *
55 * [accountType] - Account type to be passed to Android Account Manager.
56 *
57 * [accountName] - The name of the account to be passed to the Android Account
58 * Manager.
59 *
60 * Completes with a [Account].
61 *
62 * Completes with a [common.ApiRequestError] if the API endpoint returned an
63 * error.
64 *
65 * If the used [http.Client] completes with an error when making a REST call,
66 * this method will complete with the same error.
67 */
68 async.Future<Account> insert(Account request, core.String userToken, core.Stri ng accountType, core.String accountName) {
69 var _url = null;
70 var _queryParams = new core.Map();
71 var _uploadMedia = null;
72 var _uploadOptions = null;
73 var _downloadOptions = common.DownloadOptions.Metadata;
74 var _body = null;
75
76 if (request != null) {
77 _body = convert.JSON.encode((request).toJson());
78 }
79 if (userToken == null) {
80 throw new core.ArgumentError("Parameter userToken is required.");
81 }
82 if (accountType == null) {
83 throw new core.ArgumentError("Parameter accountType is required.");
84 }
85 if (accountName == null) {
86 throw new core.ArgumentError("Parameter accountName is required.");
87 }
88
89
90 _url = 'accounts/' + common_internal.Escaper.ecapeVariable('$userToken') + ' /' + common_internal.Escaper.ecapeVariable('$accountType') + '/' + common_intern al.Escaper.ecapeVariable('$accountName');
91
92 var _response = _requester.request(_url,
93 "POST",
94 body: _body,
95 queryParams: _queryParams,
96 uploadOptions: _uploadOptions,
97 uploadMedia: _uploadMedia,
98 downloadOptions: _downloadOptions);
99 return _response.then((data) => new Account.fromJson(data));
100 }
101
102 }
103
104
105 /** Not documented yet. */
106 class ContactsResourceApi {
107 final common_internal.ApiRequester _requester;
108
109 ContactsResourceApi(common_internal.ApiRequester client) :
110 _requester = client;
111
112 /**
113 * Deletes a contact.
114 *
115 * Request parameters:
116 *
117 * [id] - The ID of the contact.
118 *
119 * Completes with a [common.ApiRequestError] if the API endpoint returned an
120 * error.
121 *
122 * If the used [http.Client] completes with an error when making a REST call,
123 * this method will complete with the same error.
124 */
125 async.Future delete(core.String id) {
126 var _url = null;
127 var _queryParams = new core.Map();
128 var _uploadMedia = null;
129 var _uploadOptions = null;
130 var _downloadOptions = common.DownloadOptions.Metadata;
131 var _body = null;
132
133 if (id == null) {
134 throw new core.ArgumentError("Parameter id is required.");
135 }
136
137 _downloadOptions = null;
138
139 _url = 'contacts/' + common_internal.Escaper.ecapeVariable('$id');
140
141 var _response = _requester.request(_url,
142 "DELETE",
143 body: _body,
144 queryParams: _queryParams,
145 uploadOptions: _uploadOptions,
146 uploadMedia: _uploadMedia,
147 downloadOptions: _downloadOptions);
148 return _response.then((data) => null);
149 }
150
151 /**
152 * Gets a single contact by ID.
153 *
154 * Request parameters:
155 *
156 * [id] - The ID of the contact.
157 *
158 * Completes with a [Contact].
159 *
160 * Completes with a [common.ApiRequestError] if the API endpoint returned an
161 * error.
162 *
163 * If the used [http.Client] completes with an error when making a REST call,
164 * this method will complete with the same error.
165 */
166 async.Future<Contact> get(core.String id) {
167 var _url = null;
168 var _queryParams = new core.Map();
169 var _uploadMedia = null;
170 var _uploadOptions = null;
171 var _downloadOptions = common.DownloadOptions.Metadata;
172 var _body = null;
173
174 if (id == null) {
175 throw new core.ArgumentError("Parameter id is required.");
176 }
177
178
179 _url = 'contacts/' + common_internal.Escaper.ecapeVariable('$id');
180
181 var _response = _requester.request(_url,
182 "GET",
183 body: _body,
184 queryParams: _queryParams,
185 uploadOptions: _uploadOptions,
186 uploadMedia: _uploadMedia,
187 downloadOptions: _downloadOptions);
188 return _response.then((data) => new Contact.fromJson(data));
189 }
190
191 /**
192 * Inserts a new contact.
193 *
194 * [request] - The metadata request object.
195 *
196 * Request parameters:
197 *
198 * Completes with a [Contact].
199 *
200 * Completes with a [common.ApiRequestError] if the API endpoint returned an
201 * error.
202 *
203 * If the used [http.Client] completes with an error when making a REST call,
204 * this method will complete with the same error.
205 */
206 async.Future<Contact> insert(Contact request) {
207 var _url = null;
208 var _queryParams = new core.Map();
209 var _uploadMedia = null;
210 var _uploadOptions = null;
211 var _downloadOptions = common.DownloadOptions.Metadata;
212 var _body = null;
213
214 if (request != null) {
215 _body = convert.JSON.encode((request).toJson());
216 }
217
218
219 _url = 'contacts';
220
221 var _response = _requester.request(_url,
222 "POST",
223 body: _body,
224 queryParams: _queryParams,
225 uploadOptions: _uploadOptions,
226 uploadMedia: _uploadMedia,
227 downloadOptions: _downloadOptions);
228 return _response.then((data) => new Contact.fromJson(data));
229 }
230
231 /**
232 * Retrieves a list of contacts for the authenticated user.
233 *
234 * Request parameters:
235 *
236 * Completes with a [ContactsListResponse].
237 *
238 * Completes with a [common.ApiRequestError] if the API endpoint returned an
239 * error.
240 *
241 * If the used [http.Client] completes with an error when making a REST call,
242 * this method will complete with the same error.
243 */
244 async.Future<ContactsListResponse> list() {
245 var _url = null;
246 var _queryParams = new core.Map();
247 var _uploadMedia = null;
248 var _uploadOptions = null;
249 var _downloadOptions = common.DownloadOptions.Metadata;
250 var _body = null;
251
252
253
254 _url = 'contacts';
255
256 var _response = _requester.request(_url,
257 "GET",
258 body: _body,
259 queryParams: _queryParams,
260 uploadOptions: _uploadOptions,
261 uploadMedia: _uploadMedia,
262 downloadOptions: _downloadOptions);
263 return _response.then((data) => new ContactsListResponse.fromJson(data));
264 }
265
266 /**
267 * Updates a contact in place. This method supports patch semantics.
268 *
269 * [request] - The metadata request object.
270 *
271 * Request parameters:
272 *
273 * [id] - The ID of the contact.
274 *
275 * Completes with a [Contact].
276 *
277 * Completes with a [common.ApiRequestError] if the API endpoint returned an
278 * error.
279 *
280 * If the used [http.Client] completes with an error when making a REST call,
281 * this method will complete with the same error.
282 */
283 async.Future<Contact> patch(Contact request, core.String id) {
284 var _url = null;
285 var _queryParams = new core.Map();
286 var _uploadMedia = null;
287 var _uploadOptions = null;
288 var _downloadOptions = common.DownloadOptions.Metadata;
289 var _body = null;
290
291 if (request != null) {
292 _body = convert.JSON.encode((request).toJson());
293 }
294 if (id == null) {
295 throw new core.ArgumentError("Parameter id is required.");
296 }
297
298
299 _url = 'contacts/' + common_internal.Escaper.ecapeVariable('$id');
300
301 var _response = _requester.request(_url,
302 "PATCH",
303 body: _body,
304 queryParams: _queryParams,
305 uploadOptions: _uploadOptions,
306 uploadMedia: _uploadMedia,
307 downloadOptions: _downloadOptions);
308 return _response.then((data) => new Contact.fromJson(data));
309 }
310
311 /**
312 * Updates a contact in place.
313 *
314 * [request] - The metadata request object.
315 *
316 * Request parameters:
317 *
318 * [id] - The ID of the contact.
319 *
320 * Completes with a [Contact].
321 *
322 * Completes with a [common.ApiRequestError] if the API endpoint returned an
323 * error.
324 *
325 * If the used [http.Client] completes with an error when making a REST call,
326 * this method will complete with the same error.
327 */
328 async.Future<Contact> update(Contact request, core.String id) {
329 var _url = null;
330 var _queryParams = new core.Map();
331 var _uploadMedia = null;
332 var _uploadOptions = null;
333 var _downloadOptions = common.DownloadOptions.Metadata;
334 var _body = null;
335
336 if (request != null) {
337 _body = convert.JSON.encode((request).toJson());
338 }
339 if (id == null) {
340 throw new core.ArgumentError("Parameter id is required.");
341 }
342
343
344 _url = 'contacts/' + common_internal.Escaper.ecapeVariable('$id');
345
346 var _response = _requester.request(_url,
347 "PUT",
348 body: _body,
349 queryParams: _queryParams,
350 uploadOptions: _uploadOptions,
351 uploadMedia: _uploadMedia,
352 downloadOptions: _downloadOptions);
353 return _response.then((data) => new Contact.fromJson(data));
354 }
355
356 }
357
358
359 /** Not documented yet. */
360 class LocationsResourceApi {
361 final common_internal.ApiRequester _requester;
362
363 LocationsResourceApi(common_internal.ApiRequester client) :
364 _requester = client;
365
366 /**
367 * Gets a single location by ID.
368 *
369 * Request parameters:
370 *
371 * [id] - The ID of the location or latest for the last known location.
372 *
373 * Completes with a [Location].
374 *
375 * Completes with a [common.ApiRequestError] if the API endpoint returned an
376 * error.
377 *
378 * If the used [http.Client] completes with an error when making a REST call,
379 * this method will complete with the same error.
380 */
381 async.Future<Location> get(core.String id) {
382 var _url = null;
383 var _queryParams = new core.Map();
384 var _uploadMedia = null;
385 var _uploadOptions = null;
386 var _downloadOptions = common.DownloadOptions.Metadata;
387 var _body = null;
388
389 if (id == null) {
390 throw new core.ArgumentError("Parameter id is required.");
391 }
392
393
394 _url = 'locations/' + common_internal.Escaper.ecapeVariable('$id');
395
396 var _response = _requester.request(_url,
397 "GET",
398 body: _body,
399 queryParams: _queryParams,
400 uploadOptions: _uploadOptions,
401 uploadMedia: _uploadMedia,
402 downloadOptions: _downloadOptions);
403 return _response.then((data) => new Location.fromJson(data));
404 }
405
406 /**
407 * Retrieves a list of locations for the user.
408 *
409 * Request parameters:
410 *
411 * Completes with a [LocationsListResponse].
412 *
413 * Completes with a [common.ApiRequestError] if the API endpoint returned an
414 * error.
415 *
416 * If the used [http.Client] completes with an error when making a REST call,
417 * this method will complete with the same error.
418 */
419 async.Future<LocationsListResponse> list() {
420 var _url = null;
421 var _queryParams = new core.Map();
422 var _uploadMedia = null;
423 var _uploadOptions = null;
424 var _downloadOptions = common.DownloadOptions.Metadata;
425 var _body = null;
426
427
428
429 _url = 'locations';
430
431 var _response = _requester.request(_url,
432 "GET",
433 body: _body,
434 queryParams: _queryParams,
435 uploadOptions: _uploadOptions,
436 uploadMedia: _uploadMedia,
437 downloadOptions: _downloadOptions);
438 return _response.then((data) => new LocationsListResponse.fromJson(data));
439 }
440
441 }
442
443
444 /** Not documented yet. */
445 class SettingsResourceApi {
446 final common_internal.ApiRequester _requester;
447
448 SettingsResourceApi(common_internal.ApiRequester client) :
449 _requester = client;
450
451 /**
452 * Gets a single setting by ID.
453 *
454 * Request parameters:
455 *
456 * [id] - The ID of the setting. The following IDs are valid:
457 * - locale - The key to the user’s language/locale (BCP 47 identifier) that
458 * Glassware should use to render localized content.
459 * - timezone - The key to the user’s current time zone region as defined in
460 * the tz database. Example: America/Los_Angeles.
461 *
462 * Completes with a [Setting].
463 *
464 * Completes with a [common.ApiRequestError] if the API endpoint returned an
465 * error.
466 *
467 * If the used [http.Client] completes with an error when making a REST call,
468 * this method will complete with the same error.
469 */
470 async.Future<Setting> get(core.String id) {
471 var _url = null;
472 var _queryParams = new core.Map();
473 var _uploadMedia = null;
474 var _uploadOptions = null;
475 var _downloadOptions = common.DownloadOptions.Metadata;
476 var _body = null;
477
478 if (id == null) {
479 throw new core.ArgumentError("Parameter id is required.");
480 }
481
482
483 _url = 'settings/' + common_internal.Escaper.ecapeVariable('$id');
484
485 var _response = _requester.request(_url,
486 "GET",
487 body: _body,
488 queryParams: _queryParams,
489 uploadOptions: _uploadOptions,
490 uploadMedia: _uploadMedia,
491 downloadOptions: _downloadOptions);
492 return _response.then((data) => new Setting.fromJson(data));
493 }
494
495 }
496
497
498 /** Not documented yet. */
499 class SubscriptionsResourceApi {
500 final common_internal.ApiRequester _requester;
501
502 SubscriptionsResourceApi(common_internal.ApiRequester client) :
503 _requester = client;
504
505 /**
506 * Deletes a subscription.
507 *
508 * Request parameters:
509 *
510 * [id] - The ID of the subscription.
511 *
512 * Completes with a [common.ApiRequestError] if the API endpoint returned an
513 * error.
514 *
515 * If the used [http.Client] completes with an error when making a REST call,
516 * this method will complete with the same error.
517 */
518 async.Future delete(core.String id) {
519 var _url = null;
520 var _queryParams = new core.Map();
521 var _uploadMedia = null;
522 var _uploadOptions = null;
523 var _downloadOptions = common.DownloadOptions.Metadata;
524 var _body = null;
525
526 if (id == null) {
527 throw new core.ArgumentError("Parameter id is required.");
528 }
529
530 _downloadOptions = null;
531
532 _url = 'subscriptions/' + common_internal.Escaper.ecapeVariable('$id');
533
534 var _response = _requester.request(_url,
535 "DELETE",
536 body: _body,
537 queryParams: _queryParams,
538 uploadOptions: _uploadOptions,
539 uploadMedia: _uploadMedia,
540 downloadOptions: _downloadOptions);
541 return _response.then((data) => null);
542 }
543
544 /**
545 * Creates a new subscription.
546 *
547 * [request] - The metadata request object.
548 *
549 * Request parameters:
550 *
551 * Completes with a [Subscription].
552 *
553 * Completes with a [common.ApiRequestError] if the API endpoint returned an
554 * error.
555 *
556 * If the used [http.Client] completes with an error when making a REST call,
557 * this method will complete with the same error.
558 */
559 async.Future<Subscription> insert(Subscription request) {
560 var _url = null;
561 var _queryParams = new core.Map();
562 var _uploadMedia = null;
563 var _uploadOptions = null;
564 var _downloadOptions = common.DownloadOptions.Metadata;
565 var _body = null;
566
567 if (request != null) {
568 _body = convert.JSON.encode((request).toJson());
569 }
570
571
572 _url = 'subscriptions';
573
574 var _response = _requester.request(_url,
575 "POST",
576 body: _body,
577 queryParams: _queryParams,
578 uploadOptions: _uploadOptions,
579 uploadMedia: _uploadMedia,
580 downloadOptions: _downloadOptions);
581 return _response.then((data) => new Subscription.fromJson(data));
582 }
583
584 /**
585 * Retrieves a list of subscriptions for the authenticated user and service.
586 *
587 * Request parameters:
588 *
589 * Completes with a [SubscriptionsListResponse].
590 *
591 * Completes with a [common.ApiRequestError] if the API endpoint returned an
592 * error.
593 *
594 * If the used [http.Client] completes with an error when making a REST call,
595 * this method will complete with the same error.
596 */
597 async.Future<SubscriptionsListResponse> list() {
598 var _url = null;
599 var _queryParams = new core.Map();
600 var _uploadMedia = null;
601 var _uploadOptions = null;
602 var _downloadOptions = common.DownloadOptions.Metadata;
603 var _body = null;
604
605
606
607 _url = 'subscriptions';
608
609 var _response = _requester.request(_url,
610 "GET",
611 body: _body,
612 queryParams: _queryParams,
613 uploadOptions: _uploadOptions,
614 uploadMedia: _uploadMedia,
615 downloadOptions: _downloadOptions);
616 return _response.then((data) => new SubscriptionsListResponse.fromJson(data) );
617 }
618
619 /**
620 * Updates an existing subscription in place.
621 *
622 * [request] - The metadata request object.
623 *
624 * Request parameters:
625 *
626 * [id] - The ID of the subscription.
627 *
628 * Completes with a [Subscription].
629 *
630 * Completes with a [common.ApiRequestError] if the API endpoint returned an
631 * error.
632 *
633 * If the used [http.Client] completes with an error when making a REST call,
634 * this method will complete with the same error.
635 */
636 async.Future<Subscription> update(Subscription request, core.String id) {
637 var _url = null;
638 var _queryParams = new core.Map();
639 var _uploadMedia = null;
640 var _uploadOptions = null;
641 var _downloadOptions = common.DownloadOptions.Metadata;
642 var _body = null;
643
644 if (request != null) {
645 _body = convert.JSON.encode((request).toJson());
646 }
647 if (id == null) {
648 throw new core.ArgumentError("Parameter id is required.");
649 }
650
651
652 _url = 'subscriptions/' + common_internal.Escaper.ecapeVariable('$id');
653
654 var _response = _requester.request(_url,
655 "PUT",
656 body: _body,
657 queryParams: _queryParams,
658 uploadOptions: _uploadOptions,
659 uploadMedia: _uploadMedia,
660 downloadOptions: _downloadOptions);
661 return _response.then((data) => new Subscription.fromJson(data));
662 }
663
664 }
665
666
667 /** Not documented yet. */
668 class TimelineResourceApi {
669 final common_internal.ApiRequester _requester;
670
671 TimelineAttachmentsResourceApi get attachments => new TimelineAttachmentsResou rceApi(_requester);
672
673 TimelineResourceApi(common_internal.ApiRequester client) :
674 _requester = client;
675
676 /**
677 * Deletes a timeline item.
678 *
679 * Request parameters:
680 *
681 * [id] - The ID of the timeline item.
682 *
683 * Completes with a [common.ApiRequestError] if the API endpoint returned an
684 * error.
685 *
686 * If the used [http.Client] completes with an error when making a REST call,
687 * this method will complete with the same error.
688 */
689 async.Future delete(core.String id) {
690 var _url = null;
691 var _queryParams = new core.Map();
692 var _uploadMedia = null;
693 var _uploadOptions = null;
694 var _downloadOptions = common.DownloadOptions.Metadata;
695 var _body = null;
696
697 if (id == null) {
698 throw new core.ArgumentError("Parameter id is required.");
699 }
700
701 _downloadOptions = null;
702
703 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$id');
704
705 var _response = _requester.request(_url,
706 "DELETE",
707 body: _body,
708 queryParams: _queryParams,
709 uploadOptions: _uploadOptions,
710 uploadMedia: _uploadMedia,
711 downloadOptions: _downloadOptions);
712 return _response.then((data) => null);
713 }
714
715 /**
716 * Gets a single timeline item by ID.
717 *
718 * Request parameters:
719 *
720 * [id] - The ID of the timeline item.
721 *
722 * Completes with a [TimelineItem].
723 *
724 * Completes with a [common.ApiRequestError] if the API endpoint returned an
725 * error.
726 *
727 * If the used [http.Client] completes with an error when making a REST call,
728 * this method will complete with the same error.
729 */
730 async.Future<TimelineItem> get(core.String id) {
731 var _url = null;
732 var _queryParams = new core.Map();
733 var _uploadMedia = null;
734 var _uploadOptions = null;
735 var _downloadOptions = common.DownloadOptions.Metadata;
736 var _body = null;
737
738 if (id == null) {
739 throw new core.ArgumentError("Parameter id is required.");
740 }
741
742
743 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$id');
744
745 var _response = _requester.request(_url,
746 "GET",
747 body: _body,
748 queryParams: _queryParams,
749 uploadOptions: _uploadOptions,
750 uploadMedia: _uploadMedia,
751 downloadOptions: _downloadOptions);
752 return _response.then((data) => new TimelineItem.fromJson(data));
753 }
754
755 /**
756 * Inserts a new item into the timeline.
757 *
758 * [request] - The metadata request object.
759 *
760 * Request parameters:
761 *
762 * [uploadMedia] - The media to upload.
763 *
764 * [uploadOptions] - Options for the media upload. Streaming Media without the
765 * length being known ahead of time is only supported via resumable uploads.
766 *
767 * Completes with a [TimelineItem].
768 *
769 * Completes with a [common.ApiRequestError] if the API endpoint returned an
770 * error.
771 *
772 * If the used [http.Client] completes with an error when making a REST call,
773 * this method will complete with the same error.
774 */
775 async.Future<TimelineItem> insert(TimelineItem request, {common.UploadOptions uploadOptions : common.UploadOptions.Default, common.Media uploadMedia}) {
776 var _url = null;
777 var _queryParams = new core.Map();
778 var _uploadMedia = null;
779 var _uploadOptions = null;
780 var _downloadOptions = common.DownloadOptions.Metadata;
781 var _body = null;
782
783 if (request != null) {
784 _body = convert.JSON.encode((request).toJson());
785 }
786
787 _uploadMedia = uploadMedia;
788 _uploadOptions = uploadOptions;
789
790 if (_uploadMedia == null) {
791 _url = 'timeline';
792 } else if (_uploadOptions is common.ResumableUploadOptions) {
793 _url = '/resumable/upload/mirror/v1/timeline';
794 } else {
795 _url = '/upload/mirror/v1/timeline';
796 }
797
798
799 var _response = _requester.request(_url,
800 "POST",
801 body: _body,
802 queryParams: _queryParams,
803 uploadOptions: _uploadOptions,
804 uploadMedia: _uploadMedia,
805 downloadOptions: _downloadOptions);
806 return _response.then((data) => new TimelineItem.fromJson(data));
807 }
808
809 /**
810 * Retrieves a list of timeline items for the authenticated user.
811 *
812 * Request parameters:
813 *
814 * [bundleId] - If provided, only items with the given bundleId will be
815 * returned.
816 *
817 * [includeDeleted] - If true, tombstone records for deleted items will be
818 * returned.
819 *
820 * [maxResults] - The maximum number of items to include in the response, used
821 * for paging.
822 *
823 * [orderBy] - Controls the order in which timeline items are returned.
824 * Possible string values are:
825 * - "displayTime" : Results will be ordered by displayTime (default). This is
826 * the same ordering as is used in the timeline on the device.
827 * - "writeTime" : Results will be ordered by the time at which they were last
828 * written to the data store.
829 *
830 * [pageToken] - Token for the page of results to return.
831 *
832 * [pinnedOnly] - If true, only pinned items will be returned.
833 *
834 * [sourceItemId] - If provided, only items with the given sourceItemId will
835 * be returned.
836 *
837 * Completes with a [TimelineListResponse].
838 *
839 * Completes with a [common.ApiRequestError] if the API endpoint returned an
840 * error.
841 *
842 * If the used [http.Client] completes with an error when making a REST call,
843 * this method will complete with the same error.
844 */
845 async.Future<TimelineListResponse> list({core.String bundleId, core.bool inclu deDeleted, core.int maxResults, core.String orderBy, core.String pageToken, core .bool pinnedOnly, core.String sourceItemId}) {
846 var _url = null;
847 var _queryParams = new core.Map();
848 var _uploadMedia = null;
849 var _uploadOptions = null;
850 var _downloadOptions = common.DownloadOptions.Metadata;
851 var _body = null;
852
853 if (bundleId != null) {
854 _queryParams["bundleId"] = [bundleId];
855 }
856 if (includeDeleted != null) {
857 _queryParams["includeDeleted"] = ["${includeDeleted}"];
858 }
859 if (maxResults != null) {
860 _queryParams["maxResults"] = ["${maxResults}"];
861 }
862 if (orderBy != null) {
863 _queryParams["orderBy"] = [orderBy];
864 }
865 if (pageToken != null) {
866 _queryParams["pageToken"] = [pageToken];
867 }
868 if (pinnedOnly != null) {
869 _queryParams["pinnedOnly"] = ["${pinnedOnly}"];
870 }
871 if (sourceItemId != null) {
872 _queryParams["sourceItemId"] = [sourceItemId];
873 }
874
875
876 _url = 'timeline';
877
878 var _response = _requester.request(_url,
879 "GET",
880 body: _body,
881 queryParams: _queryParams,
882 uploadOptions: _uploadOptions,
883 uploadMedia: _uploadMedia,
884 downloadOptions: _downloadOptions);
885 return _response.then((data) => new TimelineListResponse.fromJson(data));
886 }
887
888 /**
889 * Updates a timeline item in place. This method supports patch semantics.
890 *
891 * [request] - The metadata request object.
892 *
893 * Request parameters:
894 *
895 * [id] - The ID of the timeline item.
896 *
897 * Completes with a [TimelineItem].
898 *
899 * Completes with a [common.ApiRequestError] if the API endpoint returned an
900 * error.
901 *
902 * If the used [http.Client] completes with an error when making a REST call,
903 * this method will complete with the same error.
904 */
905 async.Future<TimelineItem> patch(TimelineItem request, core.String id) {
906 var _url = null;
907 var _queryParams = new core.Map();
908 var _uploadMedia = null;
909 var _uploadOptions = null;
910 var _downloadOptions = common.DownloadOptions.Metadata;
911 var _body = null;
912
913 if (request != null) {
914 _body = convert.JSON.encode((request).toJson());
915 }
916 if (id == null) {
917 throw new core.ArgumentError("Parameter id is required.");
918 }
919
920
921 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$id');
922
923 var _response = _requester.request(_url,
924 "PATCH",
925 body: _body,
926 queryParams: _queryParams,
927 uploadOptions: _uploadOptions,
928 uploadMedia: _uploadMedia,
929 downloadOptions: _downloadOptions);
930 return _response.then((data) => new TimelineItem.fromJson(data));
931 }
932
933 /**
934 * Updates a timeline item in place.
935 *
936 * [request] - The metadata request object.
937 *
938 * Request parameters:
939 *
940 * [id] - The ID of the timeline item.
941 *
942 * [uploadMedia] - The media to upload.
943 *
944 * [uploadOptions] - Options for the media upload. Streaming Media without the
945 * length being known ahead of time is only supported via resumable uploads.
946 *
947 * Completes with a [TimelineItem].
948 *
949 * Completes with a [common.ApiRequestError] if the API endpoint returned an
950 * error.
951 *
952 * If the used [http.Client] completes with an error when making a REST call,
953 * this method will complete with the same error.
954 */
955 async.Future<TimelineItem> update(TimelineItem request, core.String id, {commo n.UploadOptions uploadOptions : common.UploadOptions.Default, common.Media uploa dMedia}) {
956 var _url = null;
957 var _queryParams = new core.Map();
958 var _uploadMedia = null;
959 var _uploadOptions = null;
960 var _downloadOptions = common.DownloadOptions.Metadata;
961 var _body = null;
962
963 if (request != null) {
964 _body = convert.JSON.encode((request).toJson());
965 }
966 if (id == null) {
967 throw new core.ArgumentError("Parameter id is required.");
968 }
969
970 _uploadMedia = uploadMedia;
971 _uploadOptions = uploadOptions;
972
973 if (_uploadMedia == null) {
974 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$id');
975 } else if (_uploadOptions is common.ResumableUploadOptions) {
976 _url = '/resumable/upload/mirror/v1/timeline/' + common_internal.Escaper.e capeVariable('$id');
977 } else {
978 _url = '/upload/mirror/v1/timeline/' + common_internal.Escaper.ecapeVariab le('$id');
979 }
980
981
982 var _response = _requester.request(_url,
983 "PUT",
984 body: _body,
985 queryParams: _queryParams,
986 uploadOptions: _uploadOptions,
987 uploadMedia: _uploadMedia,
988 downloadOptions: _downloadOptions);
989 return _response.then((data) => new TimelineItem.fromJson(data));
990 }
991
992 }
993
994
995 /** Not documented yet. */
996 class TimelineAttachmentsResourceApi {
997 final common_internal.ApiRequester _requester;
998
999 TimelineAttachmentsResourceApi(common_internal.ApiRequester client) :
1000 _requester = client;
1001
1002 /**
1003 * Deletes an attachment from a timeline item.
1004 *
1005 * Request parameters:
1006 *
1007 * [itemId] - The ID of the timeline item the attachment belongs to.
1008 *
1009 * [attachmentId] - The ID of the attachment.
1010 *
1011 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1012 * error.
1013 *
1014 * If the used [http.Client] completes with an error when making a REST call,
1015 * this method will complete with the same error.
1016 */
1017 async.Future delete(core.String itemId, core.String attachmentId) {
1018 var _url = null;
1019 var _queryParams = new core.Map();
1020 var _uploadMedia = null;
1021 var _uploadOptions = null;
1022 var _downloadOptions = common.DownloadOptions.Metadata;
1023 var _body = null;
1024
1025 if (itemId == null) {
1026 throw new core.ArgumentError("Parameter itemId is required.");
1027 }
1028 if (attachmentId == null) {
1029 throw new core.ArgumentError("Parameter attachmentId is required.");
1030 }
1031
1032 _downloadOptions = null;
1033
1034 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$itemId') + '/at tachments/' + common_internal.Escaper.ecapeVariable('$attachmentId');
1035
1036 var _response = _requester.request(_url,
1037 "DELETE",
1038 body: _body,
1039 queryParams: _queryParams,
1040 uploadOptions: _uploadOptions,
1041 uploadMedia: _uploadMedia,
1042 downloadOptions: _downloadOptions);
1043 return _response.then((data) => null);
1044 }
1045
1046 /**
1047 * Retrieves an attachment on a timeline item by item ID and attachment ID.
1048 *
1049 * Request parameters:
1050 *
1051 * [itemId] - The ID of the timeline item the attachment belongs to.
1052 *
1053 * [attachmentId] - The ID of the attachment.
1054 *
1055 * [downloadOptions] - Options for downloading. A download can be either a
1056 * Metadata (default) or Media download. Partial Media downloads are possible
1057 * as well.
1058 *
1059 * Completes with a
1060 *
1061 * - [Attachment] for Metadata downloads (see [downloadOptions]).
1062 *
1063 * - [common.Media] for Media downloads (see [downloadOptions]).
1064 *
1065 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1066 * error.
1067 *
1068 * If the used [http.Client] completes with an error when making a REST call,
1069 * this method will complete with the same error.
1070 */
1071 async.Future get(core.String itemId, core.String attachmentId, {common.Downloa dOptions downloadOptions: common.DownloadOptions.Metadata}) {
1072 var _url = null;
1073 var _queryParams = new core.Map();
1074 var _uploadMedia = null;
1075 var _uploadOptions = null;
1076 var _downloadOptions = common.DownloadOptions.Metadata;
1077 var _body = null;
1078
1079 if (itemId == null) {
1080 throw new core.ArgumentError("Parameter itemId is required.");
1081 }
1082 if (attachmentId == null) {
1083 throw new core.ArgumentError("Parameter attachmentId is required.");
1084 }
1085
1086 _downloadOptions = downloadOptions;
1087
1088 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$itemId') + '/at tachments/' + common_internal.Escaper.ecapeVariable('$attachmentId');
1089
1090 var _response = _requester.request(_url,
1091 "GET",
1092 body: _body,
1093 queryParams: _queryParams,
1094 uploadOptions: _uploadOptions,
1095 uploadMedia: _uploadMedia,
1096 downloadOptions: _downloadOptions);
1097 if (_downloadOptions == null ||
1098 _downloadOptions == common.DownloadOptions.Metadata) {
1099 return _response.then((data) => new Attachment.fromJson(data));
1100 } else {
1101 return _response;
1102 }
1103 }
1104
1105 /**
1106 * Adds a new attachment to a timeline item.
1107 *
1108 * Request parameters:
1109 *
1110 * [itemId] - The ID of the timeline item the attachment belongs to.
1111 *
1112 * [uploadMedia] - The media to upload.
1113 *
1114 * [uploadOptions] - Options for the media upload. Streaming Media without the
1115 * length being known ahead of time is only supported via resumable uploads.
1116 *
1117 * Completes with a [Attachment].
1118 *
1119 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1120 * error.
1121 *
1122 * If the used [http.Client] completes with an error when making a REST call,
1123 * this method will complete with the same error.
1124 */
1125 async.Future<Attachment> insert(core.String itemId, {common.UploadOptions uplo adOptions : common.UploadOptions.Default, common.Media uploadMedia}) {
1126 var _url = null;
1127 var _queryParams = new core.Map();
1128 var _uploadMedia = null;
1129 var _uploadOptions = null;
1130 var _downloadOptions = common.DownloadOptions.Metadata;
1131 var _body = null;
1132
1133 if (itemId == null) {
1134 throw new core.ArgumentError("Parameter itemId is required.");
1135 }
1136
1137 _uploadMedia = uploadMedia;
1138 _uploadOptions = uploadOptions;
1139
1140 if (_uploadMedia == null) {
1141 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$itemId') + '/ attachments';
1142 } else if (_uploadOptions is common.ResumableUploadOptions) {
1143 _url = '/resumable/upload/mirror/v1/timeline/' + common_internal.Escaper.e capeVariable('$itemId') + '/attachments';
1144 } else {
1145 _url = '/upload/mirror/v1/timeline/' + common_internal.Escaper.ecapeVariab le('$itemId') + '/attachments';
1146 }
1147
1148
1149 var _response = _requester.request(_url,
1150 "POST",
1151 body: _body,
1152 queryParams: _queryParams,
1153 uploadOptions: _uploadOptions,
1154 uploadMedia: _uploadMedia,
1155 downloadOptions: _downloadOptions);
1156 return _response.then((data) => new Attachment.fromJson(data));
1157 }
1158
1159 /**
1160 * Returns a list of attachments for a timeline item.
1161 *
1162 * Request parameters:
1163 *
1164 * [itemId] - The ID of the timeline item whose attachments should be listed.
1165 *
1166 * Completes with a [AttachmentsListResponse].
1167 *
1168 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1169 * error.
1170 *
1171 * If the used [http.Client] completes with an error when making a REST call,
1172 * this method will complete with the same error.
1173 */
1174 async.Future<AttachmentsListResponse> list(core.String itemId) {
1175 var _url = null;
1176 var _queryParams = new core.Map();
1177 var _uploadMedia = null;
1178 var _uploadOptions = null;
1179 var _downloadOptions = common.DownloadOptions.Metadata;
1180 var _body = null;
1181
1182 if (itemId == null) {
1183 throw new core.ArgumentError("Parameter itemId is required.");
1184 }
1185
1186
1187 _url = 'timeline/' + common_internal.Escaper.ecapeVariable('$itemId') + '/at tachments';
1188
1189 var _response = _requester.request(_url,
1190 "GET",
1191 body: _body,
1192 queryParams: _queryParams,
1193 uploadOptions: _uploadOptions,
1194 uploadMedia: _uploadMedia,
1195 downloadOptions: _downloadOptions);
1196 return _response.then((data) => new AttachmentsListResponse.fromJson(data));
1197 }
1198
1199 }
1200
1201
1202
1203 /** Represents an account passed into the Account Manager on Glass. */
1204 class Account {
1205 /** Not documented yet. */
1206 core.List<AuthToken> authTokens;
1207
1208 /** Not documented yet. */
1209 core.List<core.String> features;
1210
1211 /** Not documented yet. */
1212 core.String password;
1213
1214 /** Not documented yet. */
1215 core.List<UserData> userData;
1216
1217
1218 Account();
1219
1220 Account.fromJson(core.Map _json) {
1221 if (_json.containsKey("authTokens")) {
1222 authTokens = _json["authTokens"].map((value) => new AuthToken.fromJson(val ue)).toList();
1223 }
1224 if (_json.containsKey("features")) {
1225 features = _json["features"];
1226 }
1227 if (_json.containsKey("password")) {
1228 password = _json["password"];
1229 }
1230 if (_json.containsKey("userData")) {
1231 userData = _json["userData"].map((value) => new UserData.fromJson(value)). toList();
1232 }
1233 }
1234
1235 core.Map toJson() {
1236 var _json = new core.Map();
1237 if (authTokens != null) {
1238 _json["authTokens"] = authTokens.map((value) => (value).toJson()).toList() ;
1239 }
1240 if (features != null) {
1241 _json["features"] = features;
1242 }
1243 if (password != null) {
1244 _json["password"] = password;
1245 }
1246 if (userData != null) {
1247 _json["userData"] = userData.map((value) => (value).toJson()).toList();
1248 }
1249 return _json;
1250 }
1251 }
1252
1253
1254 /**
1255 * Represents media content, such as a photo, that can be attached to a timeline
1256 * item.
1257 */
1258 class Attachment {
1259 /** The MIME type of the attachment. */
1260 core.String contentType;
1261
1262 /** The URL for the content. */
1263 core.String contentUrl;
1264
1265 /** The ID of the attachment. */
1266 core.String id;
1267
1268 /**
1269 * Indicates that the contentUrl is not available because the attachment
1270 * content is still being processed. If the caller wishes to retrieve the
1271 * content, it should try again later.
1272 */
1273 core.bool isProcessingContent;
1274
1275
1276 Attachment();
1277
1278 Attachment.fromJson(core.Map _json) {
1279 if (_json.containsKey("contentType")) {
1280 contentType = _json["contentType"];
1281 }
1282 if (_json.containsKey("contentUrl")) {
1283 contentUrl = _json["contentUrl"];
1284 }
1285 if (_json.containsKey("id")) {
1286 id = _json["id"];
1287 }
1288 if (_json.containsKey("isProcessingContent")) {
1289 isProcessingContent = _json["isProcessingContent"];
1290 }
1291 }
1292
1293 core.Map toJson() {
1294 var _json = new core.Map();
1295 if (contentType != null) {
1296 _json["contentType"] = contentType;
1297 }
1298 if (contentUrl != null) {
1299 _json["contentUrl"] = contentUrl;
1300 }
1301 if (id != null) {
1302 _json["id"] = id;
1303 }
1304 if (isProcessingContent != null) {
1305 _json["isProcessingContent"] = isProcessingContent;
1306 }
1307 return _json;
1308 }
1309 }
1310
1311
1312 /**
1313 * A list of Attachments. This is the response from the server to GET requests
1314 * on the attachments collection.
1315 */
1316 class AttachmentsListResponse {
1317 /** The list of attachments. */
1318 core.List<Attachment> items;
1319
1320 /** The type of resource. This is always mirror#attachmentsList. */
1321 core.String kind;
1322
1323
1324 AttachmentsListResponse();
1325
1326 AttachmentsListResponse.fromJson(core.Map _json) {
1327 if (_json.containsKey("items")) {
1328 items = _json["items"].map((value) => new Attachment.fromJson(value)).toLi st();
1329 }
1330 if (_json.containsKey("kind")) {
1331 kind = _json["kind"];
1332 }
1333 }
1334
1335 core.Map toJson() {
1336 var _json = new core.Map();
1337 if (items != null) {
1338 _json["items"] = items.map((value) => (value).toJson()).toList();
1339 }
1340 if (kind != null) {
1341 _json["kind"] = kind;
1342 }
1343 return _json;
1344 }
1345 }
1346
1347
1348 /** Not documented yet. */
1349 class AuthToken {
1350 /** Not documented yet. */
1351 core.String authToken;
1352
1353 /** Not documented yet. */
1354 core.String type;
1355
1356
1357 AuthToken();
1358
1359 AuthToken.fromJson(core.Map _json) {
1360 if (_json.containsKey("authToken")) {
1361 authToken = _json["authToken"];
1362 }
1363 if (_json.containsKey("type")) {
1364 type = _json["type"];
1365 }
1366 }
1367
1368 core.Map toJson() {
1369 var _json = new core.Map();
1370 if (authToken != null) {
1371 _json["authToken"] = authToken;
1372 }
1373 if (type != null) {
1374 _json["type"] = type;
1375 }
1376 return _json;
1377 }
1378 }
1379
1380
1381 /** A single menu command that is part of a Contact. */
1382 class Command {
1383 /**
1384 * The type of operation this command corresponds to. Allowed values are:
1385 * - TAKE_A_NOTE - Shares a timeline item with the transcription of user
1386 * speech from the "Take a note" voice menu command.
1387 * - POST_AN_UPDATE - Shares a timeline item with the transcription of user
1388 * speech from the "Post an update" voice menu command.
1389 */
1390 core.String type;
1391
1392
1393 Command();
1394
1395 Command.fromJson(core.Map _json) {
1396 if (_json.containsKey("type")) {
1397 type = _json["type"];
1398 }
1399 }
1400
1401 core.Map toJson() {
1402 var _json = new core.Map();
1403 if (type != null) {
1404 _json["type"] = type;
1405 }
1406 return _json;
1407 }
1408 }
1409
1410
1411 /** A person or group that can be used as a creator or a contact. */
1412 class Contact {
1413 /**
1414 * A list of voice menu commands that a contact can handle. Glass shows up to
1415 * three contacts for each voice menu command. If there are more than that,
1416 * the three contacts with the highest priority are shown for that particular
1417 * command.
1418 */
1419 core.List<Command> acceptCommands;
1420
1421 /**
1422 * A list of MIME types that a contact supports. The contact will be shown to
1423 * the user if any of its acceptTypes matches any of the types of the
1424 * attachments on the item. If no acceptTypes are given, the contact will be
1425 * shown for all items.
1426 */
1427 core.List<core.String> acceptTypes;
1428
1429 /** The name to display for this contact. */
1430 core.String displayName;
1431
1432 /**
1433 * An ID for this contact. This is generated by the application and is treated
1434 * as an opaque token.
1435 */
1436 core.String id;
1437
1438 /**
1439 * Set of image URLs to display for a contact. Most contacts will have a
1440 * single image, but a "group" contact may include up to 8 image URLs and they
1441 * will be resized and cropped into a mosaic on the client.
1442 */
1443 core.List<core.String> imageUrls;
1444
1445 /** The type of resource. This is always mirror#contact. */
1446 core.String kind;
1447
1448 /**
1449 * Primary phone number for the contact. This can be a fully-qualified number,
1450 * with country calling code and area code, or a local number.
1451 */
1452 core.String phoneNumber;
1453
1454 /**
1455 * Priority for the contact to determine ordering in a list of contacts.
1456 * Contacts with higher priorities will be shown before ones with lower
1457 * priorities.
1458 */
1459 core.int priority;
1460
1461 /**
1462 * A list of sharing features that a contact can handle. Allowed values are:
1463 * - ADD_CAPTION
1464 */
1465 core.List<core.String> sharingFeatures;
1466
1467 /**
1468 * The ID of the application that created this contact. This is populated by
1469 * the API
1470 */
1471 core.String source;
1472
1473 /**
1474 * Name of this contact as it should be pronounced. If this contact's name
1475 * must be spoken as part of a voice disambiguation menu, this name is used as
1476 * the expected pronunciation. This is useful for contact names with
1477 * unpronounceable characters or whose display spelling is otherwise not
1478 * phonetic.
1479 */
1480 core.String speakableName;
1481
1482 /**
1483 * The type for this contact. This is used for sorting in UIs. Allowed values
1484 * are:
1485 * - INDIVIDUAL - Represents a single person. This is the default.
1486 * - GROUP - Represents more than a single person.
1487 */
1488 core.String type;
1489
1490
1491 Contact();
1492
1493 Contact.fromJson(core.Map _json) {
1494 if (_json.containsKey("acceptCommands")) {
1495 acceptCommands = _json["acceptCommands"].map((value) => new Command.fromJs on(value)).toList();
1496 }
1497 if (_json.containsKey("acceptTypes")) {
1498 acceptTypes = _json["acceptTypes"];
1499 }
1500 if (_json.containsKey("displayName")) {
1501 displayName = _json["displayName"];
1502 }
1503 if (_json.containsKey("id")) {
1504 id = _json["id"];
1505 }
1506 if (_json.containsKey("imageUrls")) {
1507 imageUrls = _json["imageUrls"];
1508 }
1509 if (_json.containsKey("kind")) {
1510 kind = _json["kind"];
1511 }
1512 if (_json.containsKey("phoneNumber")) {
1513 phoneNumber = _json["phoneNumber"];
1514 }
1515 if (_json.containsKey("priority")) {
1516 priority = _json["priority"];
1517 }
1518 if (_json.containsKey("sharingFeatures")) {
1519 sharingFeatures = _json["sharingFeatures"];
1520 }
1521 if (_json.containsKey("source")) {
1522 source = _json["source"];
1523 }
1524 if (_json.containsKey("speakableName")) {
1525 speakableName = _json["speakableName"];
1526 }
1527 if (_json.containsKey("type")) {
1528 type = _json["type"];
1529 }
1530 }
1531
1532 core.Map toJson() {
1533 var _json = new core.Map();
1534 if (acceptCommands != null) {
1535 _json["acceptCommands"] = acceptCommands.map((value) => (value).toJson()). toList();
1536 }
1537 if (acceptTypes != null) {
1538 _json["acceptTypes"] = acceptTypes;
1539 }
1540 if (displayName != null) {
1541 _json["displayName"] = displayName;
1542 }
1543 if (id != null) {
1544 _json["id"] = id;
1545 }
1546 if (imageUrls != null) {
1547 _json["imageUrls"] = imageUrls;
1548 }
1549 if (kind != null) {
1550 _json["kind"] = kind;
1551 }
1552 if (phoneNumber != null) {
1553 _json["phoneNumber"] = phoneNumber;
1554 }
1555 if (priority != null) {
1556 _json["priority"] = priority;
1557 }
1558 if (sharingFeatures != null) {
1559 _json["sharingFeatures"] = sharingFeatures;
1560 }
1561 if (source != null) {
1562 _json["source"] = source;
1563 }
1564 if (speakableName != null) {
1565 _json["speakableName"] = speakableName;
1566 }
1567 if (type != null) {
1568 _json["type"] = type;
1569 }
1570 return _json;
1571 }
1572 }
1573
1574
1575 /**
1576 * A list of Contacts representing contacts. This is the response from the
1577 * server to GET requests on the contacts collection.
1578 */
1579 class ContactsListResponse {
1580 /** Contact list. */
1581 core.List<Contact> items;
1582
1583 /** The type of resource. This is always mirror#contacts. */
1584 core.String kind;
1585
1586
1587 ContactsListResponse();
1588
1589 ContactsListResponse.fromJson(core.Map _json) {
1590 if (_json.containsKey("items")) {
1591 items = _json["items"].map((value) => new Contact.fromJson(value)).toList( );
1592 }
1593 if (_json.containsKey("kind")) {
1594 kind = _json["kind"];
1595 }
1596 }
1597
1598 core.Map toJson() {
1599 var _json = new core.Map();
1600 if (items != null) {
1601 _json["items"] = items.map((value) => (value).toJson()).toList();
1602 }
1603 if (kind != null) {
1604 _json["kind"] = kind;
1605 }
1606 return _json;
1607 }
1608 }
1609
1610
1611 /** A geographic location that can be associated with a timeline item. */
1612 class Location {
1613 /** The accuracy of the location fix in meters. */
1614 core.double accuracy;
1615
1616 /** The full address of the location. */
1617 core.String address;
1618
1619 /**
1620 * The name to be displayed. This may be a business name or a user-defined
1621 * place, such as "Home".
1622 */
1623 core.String displayName;
1624
1625 /** The ID of the location. */
1626 core.String id;
1627
1628 /** The type of resource. This is always mirror#location. */
1629 core.String kind;
1630
1631 /** The latitude, in degrees. */
1632 core.double latitude;
1633
1634 /** The longitude, in degrees. */
1635 core.double longitude;
1636
1637 /**
1638 * The time at which this location was captured, formatted according to RFC
1639 * 3339.
1640 */
1641 core.DateTime timestamp;
1642
1643
1644 Location();
1645
1646 Location.fromJson(core.Map _json) {
1647 if (_json.containsKey("accuracy")) {
1648 accuracy = _json["accuracy"];
1649 }
1650 if (_json.containsKey("address")) {
1651 address = _json["address"];
1652 }
1653 if (_json.containsKey("displayName")) {
1654 displayName = _json["displayName"];
1655 }
1656 if (_json.containsKey("id")) {
1657 id = _json["id"];
1658 }
1659 if (_json.containsKey("kind")) {
1660 kind = _json["kind"];
1661 }
1662 if (_json.containsKey("latitude")) {
1663 latitude = _json["latitude"];
1664 }
1665 if (_json.containsKey("longitude")) {
1666 longitude = _json["longitude"];
1667 }
1668 if (_json.containsKey("timestamp")) {
1669 timestamp = core.DateTime.parse(_json["timestamp"]);
1670 }
1671 }
1672
1673 core.Map toJson() {
1674 var _json = new core.Map();
1675 if (accuracy != null) {
1676 _json["accuracy"] = accuracy;
1677 }
1678 if (address != null) {
1679 _json["address"] = address;
1680 }
1681 if (displayName != null) {
1682 _json["displayName"] = displayName;
1683 }
1684 if (id != null) {
1685 _json["id"] = id;
1686 }
1687 if (kind != null) {
1688 _json["kind"] = kind;
1689 }
1690 if (latitude != null) {
1691 _json["latitude"] = latitude;
1692 }
1693 if (longitude != null) {
1694 _json["longitude"] = longitude;
1695 }
1696 if (timestamp != null) {
1697 _json["timestamp"] = (timestamp).toIso8601String();
1698 }
1699 return _json;
1700 }
1701 }
1702
1703
1704 /**
1705 * A list of Locations. This is the response from the server to GET requests on
1706 * the locations collection.
1707 */
1708 class LocationsListResponse {
1709 /** The list of locations. */
1710 core.List<Location> items;
1711
1712 /** The type of resource. This is always mirror#locationsList. */
1713 core.String kind;
1714
1715
1716 LocationsListResponse();
1717
1718 LocationsListResponse.fromJson(core.Map _json) {
1719 if (_json.containsKey("items")) {
1720 items = _json["items"].map((value) => new Location.fromJson(value)).toList ();
1721 }
1722 if (_json.containsKey("kind")) {
1723 kind = _json["kind"];
1724 }
1725 }
1726
1727 core.Map toJson() {
1728 var _json = new core.Map();
1729 if (items != null) {
1730 _json["items"] = items.map((value) => (value).toJson()).toList();
1731 }
1732 if (kind != null) {
1733 _json["kind"] = kind;
1734 }
1735 return _json;
1736 }
1737 }
1738
1739
1740 /** A custom menu item that can be presented to the user by a timeline item. */
1741 class MenuItem {
1742 /**
1743 * Controls the behavior when the user picks the menu option. Allowed values
1744 * are:
1745 * - CUSTOM - Custom action set by the service. When the user selects this
1746 * menuItem, the API triggers a notification to your callbackUrl with the
1747 * userActions.type set to CUSTOM and the userActions.payload set to the ID of
1748 * this menu item. This is the default value.
1749 * - Built-in actions:
1750 * - REPLY - Initiate a reply to the timeline item using the voice recording
1751 * UI. The creator attribute must be set in the timeline item for this menu to
1752 * be available.
1753 * - REPLY_ALL - Same behavior as REPLY. The original timeline item's
1754 * recipients will be added to the reply item.
1755 * - DELETE - Delete the timeline item.
1756 * - SHARE - Share the timeline item with the available contacts.
1757 * - READ_ALOUD - Read the timeline item's speakableText aloud; if this field
1758 * is not set, read the text field; if none of those fields are set, this menu
1759 * item is ignored.
1760 * - GET_MEDIA_INPUT - Allow users to provide media payloads to Glassware from
1761 * a menu item (currently, only transcribed text from voice input is
1762 * supported). Subscribe to notifications when users invoke this menu item to
1763 * receive the timeline item ID. Retrieve the media from the timeline item in
1764 * the payload property.
1765 * - VOICE_CALL - Initiate a phone call using the timeline item's
1766 * creator.phoneNumber attribute as recipient.
1767 * - NAVIGATE - Navigate to the timeline item's location.
1768 * - TOGGLE_PINNED - Toggle the isPinned state of the timeline item.
1769 * - OPEN_URI - Open the payload of the menu item in the browser.
1770 * - PLAY_VIDEO - Open the payload of the menu item in the Glass video player.
1771 * - SEND_MESSAGE - Initiate sending a message to the timeline item's creator:
1772 * - If the creator.phoneNumber is set and Glass is connected to an Android
1773 * phone, the message is an SMS.
1774 * - Otherwise, if the creator.email is set, the message is an email.
1775 */
1776 core.String action;
1777
1778 /**
1779 * The ID for this menu item. This is generated by the application and is
1780 * treated as an opaque token.
1781 */
1782 core.String id;
1783
1784 /**
1785 * A generic payload whose meaning changes depending on this MenuItem's
1786 * action.
1787 * - When the action is OPEN_URI, the payload is the URL of the website to
1788 * view.
1789 * - When the action is PLAY_VIDEO, the payload is the streaming URL of the
1790 * video
1791 * - When the action is GET_MEDIA_INPUT, the payload is the text transcription
1792 * of a user's speech input
1793 */
1794 core.String payload;
1795
1796 /**
1797 * If set to true on a CUSTOM menu item, that item will be removed from the
1798 * menu after it is selected.
1799 */
1800 core.bool removeWhenSelected;
1801
1802 /**
1803 * For CUSTOM items, a list of values controlling the appearance of the menu
1804 * item in each of its states. A value for the DEFAULT state must be provided.
1805 * If the PENDING or CONFIRMED states are missing, they will not be shown.
1806 */
1807 core.List<MenuValue> values;
1808
1809
1810 MenuItem();
1811
1812 MenuItem.fromJson(core.Map _json) {
1813 if (_json.containsKey("action")) {
1814 action = _json["action"];
1815 }
1816 if (_json.containsKey("id")) {
1817 id = _json["id"];
1818 }
1819 if (_json.containsKey("payload")) {
1820 payload = _json["payload"];
1821 }
1822 if (_json.containsKey("removeWhenSelected")) {
1823 removeWhenSelected = _json["removeWhenSelected"];
1824 }
1825 if (_json.containsKey("values")) {
1826 values = _json["values"].map((value) => new MenuValue.fromJson(value)).toL ist();
1827 }
1828 }
1829
1830 core.Map toJson() {
1831 var _json = new core.Map();
1832 if (action != null) {
1833 _json["action"] = action;
1834 }
1835 if (id != null) {
1836 _json["id"] = id;
1837 }
1838 if (payload != null) {
1839 _json["payload"] = payload;
1840 }
1841 if (removeWhenSelected != null) {
1842 _json["removeWhenSelected"] = removeWhenSelected;
1843 }
1844 if (values != null) {
1845 _json["values"] = values.map((value) => (value).toJson()).toList();
1846 }
1847 return _json;
1848 }
1849 }
1850
1851
1852 /** A single value that is part of a MenuItem. */
1853 class MenuValue {
1854 /**
1855 * The name to display for the menu item. If you specify this property for a
1856 * built-in menu item, the default contextual voice command for that menu item
1857 * is not shown.
1858 */
1859 core.String displayName;
1860
1861 /** URL of an icon to display with the menu item. */
1862 core.String iconUrl;
1863
1864 /**
1865 * The state that this value applies to. Allowed values are:
1866 * - DEFAULT - Default value shown when displayed in the menuItems list.
1867 * - PENDING - Value shown when the menuItem has been selected by the user but
1868 * can still be cancelled.
1869 * - CONFIRMED - Value shown when the menuItem has been selected by the user
1870 * and can no longer be cancelled.
1871 */
1872 core.String state;
1873
1874
1875 MenuValue();
1876
1877 MenuValue.fromJson(core.Map _json) {
1878 if (_json.containsKey("displayName")) {
1879 displayName = _json["displayName"];
1880 }
1881 if (_json.containsKey("iconUrl")) {
1882 iconUrl = _json["iconUrl"];
1883 }
1884 if (_json.containsKey("state")) {
1885 state = _json["state"];
1886 }
1887 }
1888
1889 core.Map toJson() {
1890 var _json = new core.Map();
1891 if (displayName != null) {
1892 _json["displayName"] = displayName;
1893 }
1894 if (iconUrl != null) {
1895 _json["iconUrl"] = iconUrl;
1896 }
1897 if (state != null) {
1898 _json["state"] = state;
1899 }
1900 return _json;
1901 }
1902 }
1903
1904
1905 /** A notification delivered by the API. */
1906 class Notification {
1907 /** The collection that generated the notification. */
1908 core.String collection;
1909
1910 /** The ID of the item that generated the notification. */
1911 core.String itemId;
1912
1913 /** The type of operation that generated the notification. */
1914 core.String operation;
1915
1916 /** A list of actions taken by the user that triggered the notification. */
1917 core.List<UserAction> userActions;
1918
1919 /**
1920 * The user token provided by the service when it subscribed for
1921 * notifications.
1922 */
1923 core.String userToken;
1924
1925 /**
1926 * The secret verify token provided by the service when it subscribed for
1927 * notifications.
1928 */
1929 core.String verifyToken;
1930
1931
1932 Notification();
1933
1934 Notification.fromJson(core.Map _json) {
1935 if (_json.containsKey("collection")) {
1936 collection = _json["collection"];
1937 }
1938 if (_json.containsKey("itemId")) {
1939 itemId = _json["itemId"];
1940 }
1941 if (_json.containsKey("operation")) {
1942 operation = _json["operation"];
1943 }
1944 if (_json.containsKey("userActions")) {
1945 userActions = _json["userActions"].map((value) => new UserAction.fromJson( value)).toList();
1946 }
1947 if (_json.containsKey("userToken")) {
1948 userToken = _json["userToken"];
1949 }
1950 if (_json.containsKey("verifyToken")) {
1951 verifyToken = _json["verifyToken"];
1952 }
1953 }
1954
1955 core.Map toJson() {
1956 var _json = new core.Map();
1957 if (collection != null) {
1958 _json["collection"] = collection;
1959 }
1960 if (itemId != null) {
1961 _json["itemId"] = itemId;
1962 }
1963 if (operation != null) {
1964 _json["operation"] = operation;
1965 }
1966 if (userActions != null) {
1967 _json["userActions"] = userActions.map((value) => (value).toJson()).toList ();
1968 }
1969 if (userToken != null) {
1970 _json["userToken"] = userToken;
1971 }
1972 if (verifyToken != null) {
1973 _json["verifyToken"] = verifyToken;
1974 }
1975 return _json;
1976 }
1977 }
1978
1979
1980 /**
1981 * Controls how notifications for a timeline item are presented to the user.
1982 */
1983 class NotificationConfig {
1984 /** The time at which the notification should be delivered. */
1985 core.DateTime deliveryTime;
1986
1987 /**
1988 * Describes how important the notification is. Allowed values are:
1989 * - DEFAULT - Notifications of default importance. A chime will be played to
1990 * alert users.
1991 */
1992 core.String level;
1993
1994
1995 NotificationConfig();
1996
1997 NotificationConfig.fromJson(core.Map _json) {
1998 if (_json.containsKey("deliveryTime")) {
1999 deliveryTime = core.DateTime.parse(_json["deliveryTime"]);
2000 }
2001 if (_json.containsKey("level")) {
2002 level = _json["level"];
2003 }
2004 }
2005
2006 core.Map toJson() {
2007 var _json = new core.Map();
2008 if (deliveryTime != null) {
2009 _json["deliveryTime"] = (deliveryTime).toIso8601String();
2010 }
2011 if (level != null) {
2012 _json["level"] = level;
2013 }
2014 return _json;
2015 }
2016 }
2017
2018
2019 /** A setting for Glass. */
2020 class Setting {
2021 /**
2022 * The setting's ID. The following IDs are valid:
2023 * - locale - The key to the user’s language/locale (BCP 47 identifier) that
2024 * Glassware should use to render localized content.
2025 * - timezone - The key to the user’s current time zone region as defined in
2026 * the tz database. Example: America/Los_Angeles.
2027 */
2028 core.String id;
2029
2030 /** The type of resource. This is always mirror#setting. */
2031 core.String kind;
2032
2033 /** The setting value, as a string. */
2034 core.String value;
2035
2036
2037 Setting();
2038
2039 Setting.fromJson(core.Map _json) {
2040 if (_json.containsKey("id")) {
2041 id = _json["id"];
2042 }
2043 if (_json.containsKey("kind")) {
2044 kind = _json["kind"];
2045 }
2046 if (_json.containsKey("value")) {
2047 value = _json["value"];
2048 }
2049 }
2050
2051 core.Map toJson() {
2052 var _json = new core.Map();
2053 if (id != null) {
2054 _json["id"] = id;
2055 }
2056 if (kind != null) {
2057 _json["kind"] = kind;
2058 }
2059 if (value != null) {
2060 _json["value"] = value;
2061 }
2062 return _json;
2063 }
2064 }
2065
2066
2067 /** A subscription to events on a collection. */
2068 class Subscription {
2069 /**
2070 * The URL where notifications should be delivered (must start with https://).
2071 */
2072 core.String callbackUrl;
2073
2074 /**
2075 * The collection to subscribe to. Allowed values are:
2076 * - timeline - Changes in the timeline including insertion, deletion, and
2077 * updates.
2078 * - locations - Location updates.
2079 * - settings - Settings updates.
2080 */
2081 core.String collection;
2082
2083 /** The ID of the subscription. */
2084 core.String id;
2085
2086 /** The type of resource. This is always mirror#subscription. */
2087 core.String kind;
2088
2089 /**
2090 * Container object for notifications. This is not populated in the
2091 * Subscription resource.
2092 */
2093 Notification notification;
2094
2095 /**
2096 * A list of operations that should be subscribed to. An empty list indicates
2097 * that all operations on the collection should be subscribed to. Allowed
2098 * values are:
2099 * - UPDATE - The item has been updated.
2100 * - INSERT - A new item has been inserted.
2101 * - DELETE - The item has been deleted.
2102 * - MENU_ACTION - A custom menu item has been triggered by the user.
2103 */
2104 core.List<core.String> operation;
2105
2106 /**
2107 * The time at which this subscription was last modified, formatted according
2108 * to RFC 3339.
2109 */
2110 core.DateTime updated;
2111
2112 /**
2113 * An opaque token sent to the subscriber in notifications so that it can
2114 * determine the ID of the user.
2115 */
2116 core.String userToken;
2117
2118 /**
2119 * A secret token sent to the subscriber in notifications so that it can
2120 * verify that the notification was generated by Google.
2121 */
2122 core.String verifyToken;
2123
2124
2125 Subscription();
2126
2127 Subscription.fromJson(core.Map _json) {
2128 if (_json.containsKey("callbackUrl")) {
2129 callbackUrl = _json["callbackUrl"];
2130 }
2131 if (_json.containsKey("collection")) {
2132 collection = _json["collection"];
2133 }
2134 if (_json.containsKey("id")) {
2135 id = _json["id"];
2136 }
2137 if (_json.containsKey("kind")) {
2138 kind = _json["kind"];
2139 }
2140 if (_json.containsKey("notification")) {
2141 notification = new Notification.fromJson(_json["notification"]);
2142 }
2143 if (_json.containsKey("operation")) {
2144 operation = _json["operation"];
2145 }
2146 if (_json.containsKey("updated")) {
2147 updated = core.DateTime.parse(_json["updated"]);
2148 }
2149 if (_json.containsKey("userToken")) {
2150 userToken = _json["userToken"];
2151 }
2152 if (_json.containsKey("verifyToken")) {
2153 verifyToken = _json["verifyToken"];
2154 }
2155 }
2156
2157 core.Map toJson() {
2158 var _json = new core.Map();
2159 if (callbackUrl != null) {
2160 _json["callbackUrl"] = callbackUrl;
2161 }
2162 if (collection != null) {
2163 _json["collection"] = collection;
2164 }
2165 if (id != null) {
2166 _json["id"] = id;
2167 }
2168 if (kind != null) {
2169 _json["kind"] = kind;
2170 }
2171 if (notification != null) {
2172 _json["notification"] = (notification).toJson();
2173 }
2174 if (operation != null) {
2175 _json["operation"] = operation;
2176 }
2177 if (updated != null) {
2178 _json["updated"] = (updated).toIso8601String();
2179 }
2180 if (userToken != null) {
2181 _json["userToken"] = userToken;
2182 }
2183 if (verifyToken != null) {
2184 _json["verifyToken"] = verifyToken;
2185 }
2186 return _json;
2187 }
2188 }
2189
2190
2191 /**
2192 * A list of Subscriptions. This is the response from the server to GET requests
2193 * on the subscription collection.
2194 */
2195 class SubscriptionsListResponse {
2196 /** The list of subscriptions. */
2197 core.List<Subscription> items;
2198
2199 /** The type of resource. This is always mirror#subscriptionsList. */
2200 core.String kind;
2201
2202
2203 SubscriptionsListResponse();
2204
2205 SubscriptionsListResponse.fromJson(core.Map _json) {
2206 if (_json.containsKey("items")) {
2207 items = _json["items"].map((value) => new Subscription.fromJson(value)).to List();
2208 }
2209 if (_json.containsKey("kind")) {
2210 kind = _json["kind"];
2211 }
2212 }
2213
2214 core.Map toJson() {
2215 var _json = new core.Map();
2216 if (items != null) {
2217 _json["items"] = items.map((value) => (value).toJson()).toList();
2218 }
2219 if (kind != null) {
2220 _json["kind"] = kind;
2221 }
2222 return _json;
2223 }
2224 }
2225
2226
2227 /**
2228 * Each item in the user's timeline is represented as a TimelineItem JSON
2229 * structure, described below.
2230 */
2231 class TimelineItem {
2232 /**
2233 * A list of media attachments associated with this item. As a convenience,
2234 * you can refer to attachments in your HTML payloads with the attachment or
2235 * cid scheme. For example:
2236 * - attachment: <img src="attachment:attachment_index"> where
2237 * attachment_index is the 0-based index of this array.
2238 * - cid: <img src="cid:attachment_id"> where attachment_id is the ID of the
2239 * attachment.
2240 */
2241 core.List<Attachment> attachments;
2242
2243 /**
2244 * The bundle ID for this item. Services can specify a bundleId to group many
2245 * items together. They appear under a single top-level item on the device.
2246 */
2247 core.String bundleId;
2248
2249 /**
2250 * A canonical URL pointing to the canonical/high quality version of the data
2251 * represented by the timeline item.
2252 */
2253 core.String canonicalUrl;
2254
2255 /**
2256 * The time at which this item was created, formatted according to RFC 3339.
2257 */
2258 core.DateTime created;
2259
2260 /** The user or group that created this item. */
2261 Contact creator;
2262
2263 /**
2264 * The time that should be displayed when this item is viewed in the timeline,
2265 * formatted according to RFC 3339. This user's timeline is sorted
2266 * chronologically on display time, so this will also determine where the item
2267 * is displayed in the timeline. If not set by the service, the display time
2268 * defaults to the updated time.
2269 */
2270 core.DateTime displayTime;
2271
2272 /** ETag for this item. */
2273 core.String etag;
2274
2275 /**
2276 * HTML content for this item. If both text and html are provided for an item,
2277 * the html will be rendered in the timeline.
2278 * Allowed HTML elements - You can use these elements in your timeline cards.
2279 *
2280 * - Headers: h1, h2, h3, h4, h5, h6
2281 * - Images: img
2282 * - Lists: li, ol, ul
2283 * - HTML5 semantics: article, aside, details, figure, figcaption, footer,
2284 * header, nav, section, summary, time
2285 * - Structural: blockquote, br, div, hr, p, span
2286 * - Style: b, big, center, em, i, u, s, small, strike, strong, style, sub,
2287 * sup
2288 * - Tables: table, tbody, td, tfoot, th, thead, tr
2289 * Blocked HTML elements: These elements and their contents are removed from
2290 * HTML payloads.
2291 *
2292 * - Document headers: head, title
2293 * - Embeds: audio, embed, object, source, video
2294 * - Frames: frame, frameset
2295 * - Scripting: applet, script
2296 * Other elements: Any elements that aren't listed are removed, but their
2297 * contents are preserved.
2298 */
2299 core.String html;
2300
2301 /** The ID of the timeline item. This is unique within a user's timeline. */
2302 core.String id;
2303
2304 /**
2305 * If this item was generated as a reply to another item, this field will be
2306 * set to the ID of the item being replied to. This can be used to attach a
2307 * reply to the appropriate conversation or post.
2308 */
2309 core.String inReplyTo;
2310
2311 /**
2312 * Whether this item is a bundle cover.
2313 *
2314 * If an item is marked as a bundle cover, it will be the entry point to the
2315 * bundle of items that have the same bundleId as that item. It will be shown
2316 * only on the main timeline — not within the opened bundle.
2317 *
2318 * On the main timeline, items that are shown are:
2319 * - Items that have isBundleCover set to true
2320 * - Items that do not have a bundleId In a bundle sub-timeline, items that
2321 * are shown are:
2322 * - Items that have the bundleId in question AND isBundleCover set to false
2323 */
2324 core.bool isBundleCover;
2325
2326 /**
2327 * When true, indicates this item is deleted, and only the ID property is set.
2328 */
2329 core.bool isDeleted;
2330
2331 /**
2332 * When true, indicates this item is pinned, which means it's grouped
2333 * alongside "active" items like navigation and hangouts, on the opposite side
2334 * of the home screen from historical (non-pinned) timeline items. You can
2335 * allow the user to toggle the value of this property with the TOGGLE_PINNED
2336 * built-in menu item.
2337 */
2338 core.bool isPinned;
2339
2340 /** The type of resource. This is always mirror#timelineItem. */
2341 core.String kind;
2342
2343 /** The geographic location associated with this item. */
2344 Location location;
2345
2346 /**
2347 * A list of menu items that will be presented to the user when this item is
2348 * selected in the timeline.
2349 */
2350 core.List<MenuItem> menuItems;
2351
2352 /**
2353 * Controls how notifications for this item are presented on the device. If
2354 * this is missing, no notification will be generated.
2355 */
2356 NotificationConfig notification;
2357
2358 /**
2359 * For pinned items, this determines the order in which the item is displayed
2360 * in the timeline, with a higher score appearing closer to the clock. Note:
2361 * setting this field is currently not supported.
2362 */
2363 core.int pinScore;
2364
2365 /** A list of users or groups that this item has been shared with. */
2366 core.List<Contact> recipients;
2367
2368 /** A URL that can be used to retrieve this item. */
2369 core.String selfLink;
2370
2371 /**
2372 * Opaque string you can use to map a timeline item to data in your own
2373 * service.
2374 */
2375 core.String sourceItemId;
2376
2377 /**
2378 * The speakable version of the content of this item. Along with the
2379 * READ_ALOUD menu item, use this field to provide text that would be clearer
2380 * when read aloud, or to provide extended information to what is displayed
2381 * visually on Glass.
2382 *
2383 * Glassware should also specify the speakableType field, which will be spoken
2384 * before this text in cases where the additional context is useful, for
2385 * example when the user requests that the item be read aloud following a
2386 * notification.
2387 */
2388 core.String speakableText;
2389
2390 /**
2391 * A speakable description of the type of this item. This will be announced to
2392 * the user prior to reading the content of the item in cases where the
2393 * additional context is useful, for example when the user requests that the
2394 * item be read aloud following a notification.
2395 *
2396 * This should be a short, simple noun phrase such as "Email", "Text message",
2397 * or "Daily Planet News Update".
2398 *
2399 * Glassware are encouraged to populate this field for every timeline item,
2400 * even if the item does not contain speakableText or text so that the user
2401 * can learn the type of the item without looking at the screen.
2402 */
2403 core.String speakableType;
2404
2405 /** Text content of this item. */
2406 core.String text;
2407
2408 /** The title of this item. */
2409 core.String title;
2410
2411 /**
2412 * The time at which this item was last modified, formatted according to RFC
2413 * 3339.
2414 */
2415 core.DateTime updated;
2416
2417
2418 TimelineItem();
2419
2420 TimelineItem.fromJson(core.Map _json) {
2421 if (_json.containsKey("attachments")) {
2422 attachments = _json["attachments"].map((value) => new Attachment.fromJson( value)).toList();
2423 }
2424 if (_json.containsKey("bundleId")) {
2425 bundleId = _json["bundleId"];
2426 }
2427 if (_json.containsKey("canonicalUrl")) {
2428 canonicalUrl = _json["canonicalUrl"];
2429 }
2430 if (_json.containsKey("created")) {
2431 created = core.DateTime.parse(_json["created"]);
2432 }
2433 if (_json.containsKey("creator")) {
2434 creator = new Contact.fromJson(_json["creator"]);
2435 }
2436 if (_json.containsKey("displayTime")) {
2437 displayTime = core.DateTime.parse(_json["displayTime"]);
2438 }
2439 if (_json.containsKey("etag")) {
2440 etag = _json["etag"];
2441 }
2442 if (_json.containsKey("html")) {
2443 html = _json["html"];
2444 }
2445 if (_json.containsKey("id")) {
2446 id = _json["id"];
2447 }
2448 if (_json.containsKey("inReplyTo")) {
2449 inReplyTo = _json["inReplyTo"];
2450 }
2451 if (_json.containsKey("isBundleCover")) {
2452 isBundleCover = _json["isBundleCover"];
2453 }
2454 if (_json.containsKey("isDeleted")) {
2455 isDeleted = _json["isDeleted"];
2456 }
2457 if (_json.containsKey("isPinned")) {
2458 isPinned = _json["isPinned"];
2459 }
2460 if (_json.containsKey("kind")) {
2461 kind = _json["kind"];
2462 }
2463 if (_json.containsKey("location")) {
2464 location = new Location.fromJson(_json["location"]);
2465 }
2466 if (_json.containsKey("menuItems")) {
2467 menuItems = _json["menuItems"].map((value) => new MenuItem.fromJson(value) ).toList();
2468 }
2469 if (_json.containsKey("notification")) {
2470 notification = new NotificationConfig.fromJson(_json["notification"]);
2471 }
2472 if (_json.containsKey("pinScore")) {
2473 pinScore = _json["pinScore"];
2474 }
2475 if (_json.containsKey("recipients")) {
2476 recipients = _json["recipients"].map((value) => new Contact.fromJson(value )).toList();
2477 }
2478 if (_json.containsKey("selfLink")) {
2479 selfLink = _json["selfLink"];
2480 }
2481 if (_json.containsKey("sourceItemId")) {
2482 sourceItemId = _json["sourceItemId"];
2483 }
2484 if (_json.containsKey("speakableText")) {
2485 speakableText = _json["speakableText"];
2486 }
2487 if (_json.containsKey("speakableType")) {
2488 speakableType = _json["speakableType"];
2489 }
2490 if (_json.containsKey("text")) {
2491 text = _json["text"];
2492 }
2493 if (_json.containsKey("title")) {
2494 title = _json["title"];
2495 }
2496 if (_json.containsKey("updated")) {
2497 updated = core.DateTime.parse(_json["updated"]);
2498 }
2499 }
2500
2501 core.Map toJson() {
2502 var _json = new core.Map();
2503 if (attachments != null) {
2504 _json["attachments"] = attachments.map((value) => (value).toJson()).toList ();
2505 }
2506 if (bundleId != null) {
2507 _json["bundleId"] = bundleId;
2508 }
2509 if (canonicalUrl != null) {
2510 _json["canonicalUrl"] = canonicalUrl;
2511 }
2512 if (created != null) {
2513 _json["created"] = (created).toIso8601String();
2514 }
2515 if (creator != null) {
2516 _json["creator"] = (creator).toJson();
2517 }
2518 if (displayTime != null) {
2519 _json["displayTime"] = (displayTime).toIso8601String();
2520 }
2521 if (etag != null) {
2522 _json["etag"] = etag;
2523 }
2524 if (html != null) {
2525 _json["html"] = html;
2526 }
2527 if (id != null) {
2528 _json["id"] = id;
2529 }
2530 if (inReplyTo != null) {
2531 _json["inReplyTo"] = inReplyTo;
2532 }
2533 if (isBundleCover != null) {
2534 _json["isBundleCover"] = isBundleCover;
2535 }
2536 if (isDeleted != null) {
2537 _json["isDeleted"] = isDeleted;
2538 }
2539 if (isPinned != null) {
2540 _json["isPinned"] = isPinned;
2541 }
2542 if (kind != null) {
2543 _json["kind"] = kind;
2544 }
2545 if (location != null) {
2546 _json["location"] = (location).toJson();
2547 }
2548 if (menuItems != null) {
2549 _json["menuItems"] = menuItems.map((value) => (value).toJson()).toList();
2550 }
2551 if (notification != null) {
2552 _json["notification"] = (notification).toJson();
2553 }
2554 if (pinScore != null) {
2555 _json["pinScore"] = pinScore;
2556 }
2557 if (recipients != null) {
2558 _json["recipients"] = recipients.map((value) => (value).toJson()).toList() ;
2559 }
2560 if (selfLink != null) {
2561 _json["selfLink"] = selfLink;
2562 }
2563 if (sourceItemId != null) {
2564 _json["sourceItemId"] = sourceItemId;
2565 }
2566 if (speakableText != null) {
2567 _json["speakableText"] = speakableText;
2568 }
2569 if (speakableType != null) {
2570 _json["speakableType"] = speakableType;
2571 }
2572 if (text != null) {
2573 _json["text"] = text;
2574 }
2575 if (title != null) {
2576 _json["title"] = title;
2577 }
2578 if (updated != null) {
2579 _json["updated"] = (updated).toIso8601String();
2580 }
2581 return _json;
2582 }
2583 }
2584
2585
2586 /**
2587 * A list of timeline items. This is the response from the server to GET
2588 * requests on the timeline collection.
2589 */
2590 class TimelineListResponse {
2591 /** Items in the timeline. */
2592 core.List<TimelineItem> items;
2593
2594 /** The type of resource. This is always mirror#timeline. */
2595 core.String kind;
2596
2597 /**
2598 * The next page token. Provide this as the pageToken parameter in the request
2599 * to retrieve the next page of results.
2600 */
2601 core.String nextPageToken;
2602
2603
2604 TimelineListResponse();
2605
2606 TimelineListResponse.fromJson(core.Map _json) {
2607 if (_json.containsKey("items")) {
2608 items = _json["items"].map((value) => new TimelineItem.fromJson(value)).to List();
2609 }
2610 if (_json.containsKey("kind")) {
2611 kind = _json["kind"];
2612 }
2613 if (_json.containsKey("nextPageToken")) {
2614 nextPageToken = _json["nextPageToken"];
2615 }
2616 }
2617
2618 core.Map toJson() {
2619 var _json = new core.Map();
2620 if (items != null) {
2621 _json["items"] = items.map((value) => (value).toJson()).toList();
2622 }
2623 if (kind != null) {
2624 _json["kind"] = kind;
2625 }
2626 if (nextPageToken != null) {
2627 _json["nextPageToken"] = nextPageToken;
2628 }
2629 return _json;
2630 }
2631 }
2632
2633
2634 /** Represents an action taken by the user that triggered a notification. */
2635 class UserAction {
2636 /**
2637 * An optional payload for the action.
2638 *
2639 * For actions of type CUSTOM, this is the ID of the custom menu item that was
2640 * selected.
2641 */
2642 core.String payload;
2643
2644 /**
2645 * The type of action. The value of this can be:
2646 * - SHARE - the user shared an item.
2647 * - REPLY - the user replied to an item.
2648 * - REPLY_ALL - the user replied to all recipients of an item.
2649 * - CUSTOM - the user selected a custom menu item on the timeline item.
2650 * - DELETE - the user deleted the item.
2651 * - PIN - the user pinned the item.
2652 * - UNPIN - the user unpinned the item.
2653 * - LAUNCH - the user initiated a voice command. In the future, additional
2654 * types may be added. UserActions with unrecognized types should be ignored.
2655 */
2656 core.String type;
2657
2658
2659 UserAction();
2660
2661 UserAction.fromJson(core.Map _json) {
2662 if (_json.containsKey("payload")) {
2663 payload = _json["payload"];
2664 }
2665 if (_json.containsKey("type")) {
2666 type = _json["type"];
2667 }
2668 }
2669
2670 core.Map toJson() {
2671 var _json = new core.Map();
2672 if (payload != null) {
2673 _json["payload"] = payload;
2674 }
2675 if (type != null) {
2676 _json["type"] = type;
2677 }
2678 return _json;
2679 }
2680 }
2681
2682
2683 /** Not documented yet. */
2684 class UserData {
2685 /** Not documented yet. */
2686 core.String key;
2687
2688 /** Not documented yet. */
2689 core.String value;
2690
2691
2692 UserData();
2693
2694 UserData.fromJson(core.Map _json) {
2695 if (_json.containsKey("key")) {
2696 key = _json["key"];
2697 }
2698 if (_json.containsKey("value")) {
2699 value = _json["value"];
2700 }
2701 }
2702
2703 core.Map toJson() {
2704 var _json = new core.Map();
2705 if (key != null) {
2706 _json["key"] = key;
2707 }
2708 if (value != null) {
2709 _json["value"] = value;
2710 }
2711 return _json;
2712 }
2713 }
2714
2715
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698