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

Side by Side Diff: generated/googleapis/lib/drive/v2.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.drive.v2;
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_1;
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 /** The API to interact with Drive. */
17 class DriveApi {
18 /** View and manage the files and documents in your Google Drive */
19 static const DriveScope = "https://www.googleapis.com/auth/drive";
20
21 /** View and manage its own configuration data in your Google Drive */
22 static const DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdat a";
23
24 /** View your Google Drive apps */
25 static const DriveAppsReadonlyScope = "https://www.googleapis.com/auth/drive.a pps.readonly";
26
27 /**
28 * View and manage Google Drive files that you have opened or created with
29 * this app
30 */
31 static const DriveFileScope = "https://www.googleapis.com/auth/drive.file";
32
33 /** View metadata for files and documents in your Google Drive */
34 static const DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/dri ve.metadata.readonly";
35
36 /** View the files and documents in your Google Drive */
37 static const DriveReadonlyScope = "https://www.googleapis.com/auth/drive.reado nly";
38
39 /** Modify your Google Apps Script scripts' behavior */
40 static const DriveScriptsScope = "https://www.googleapis.com/auth/drive.script s";
41
42
43 final common_internal.ApiRequester _requester;
44
45 AboutResourceApi get about => new AboutResourceApi(_requester);
46 AppsResourceApi get apps => new AppsResourceApi(_requester);
47 ChangesResourceApi get changes => new ChangesResourceApi(_requester);
48 ChannelsResourceApi get channels => new ChannelsResourceApi(_requester);
49 ChildrenResourceApi get children => new ChildrenResourceApi(_requester);
50 CommentsResourceApi get comments => new CommentsResourceApi(_requester);
51 FilesResourceApi get files => new FilesResourceApi(_requester);
52 ParentsResourceApi get parents => new ParentsResourceApi(_requester);
53 PermissionsResourceApi get permissions => new PermissionsResourceApi(_requeste r);
54 PropertiesResourceApi get properties => new PropertiesResourceApi(_requester);
55 RealtimeResourceApi get realtime => new RealtimeResourceApi(_requester);
56 RepliesResourceApi get replies => new RepliesResourceApi(_requester);
57 RevisionsResourceApi get revisions => new RevisionsResourceApi(_requester);
58
59 DriveApi(http.Client client) :
60 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/drive/v2/");
61 }
62
63
64 /** Not documented yet. */
65 class AboutResourceApi {
66 final common_internal.ApiRequester _requester;
67
68 AboutResourceApi(common_internal.ApiRequester client) :
69 _requester = client;
70
71 /**
72 * Gets the information about the current user along with Drive API settings
73 *
74 * Request parameters:
75 *
76 * [includeSubscribed] - When calculating the number of remaining change IDs,
77 * whether to include public files the user has opened and shared files. When
78 * set to false, this counts only change IDs for owned files and any shared or
79 * public files that the user has explicitly added to a folder they own.
80 *
81 * [maxChangeIdCount] - Maximum number of remaining change IDs to count
82 *
83 * [startChangeId] - Change ID to start counting from when calculating number
84 * of remaining change IDs
85 *
86 * Completes with a [About].
87 *
88 * Completes with a [common.ApiRequestError] if the API endpoint returned an
89 * error.
90 *
91 * If the used [http.Client] completes with an error when making a REST call,
92 * this method will complete with the same error.
93 */
94 async.Future<About> get({core.bool includeSubscribed, core.String maxChangeIdC ount, core.String startChangeId}) {
95 var _url = null;
96 var _queryParams = new core.Map();
97 var _uploadMedia = null;
98 var _uploadOptions = null;
99 var _downloadOptions = common.DownloadOptions.Metadata;
100 var _body = null;
101
102 if (includeSubscribed != null) {
103 _queryParams["includeSubscribed"] = ["${includeSubscribed}"];
104 }
105 if (maxChangeIdCount != null) {
106 _queryParams["maxChangeIdCount"] = [maxChangeIdCount];
107 }
108 if (startChangeId != null) {
109 _queryParams["startChangeId"] = [startChangeId];
110 }
111
112
113 _url = 'about';
114
115 var _response = _requester.request(_url,
116 "GET",
117 body: _body,
118 queryParams: _queryParams,
119 uploadOptions: _uploadOptions,
120 uploadMedia: _uploadMedia,
121 downloadOptions: _downloadOptions);
122 return _response.then((data) => new About.fromJson(data));
123 }
124
125 }
126
127
128 /** Not documented yet. */
129 class AppsResourceApi {
130 final common_internal.ApiRequester _requester;
131
132 AppsResourceApi(common_internal.ApiRequester client) :
133 _requester = client;
134
135 /**
136 * Gets a specific app.
137 *
138 * Request parameters:
139 *
140 * [appId] - The ID of the app.
141 *
142 * Completes with a [App].
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<App> get(core.String appId) {
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 (appId == null) {
159 throw new core.ArgumentError("Parameter appId is required.");
160 }
161
162
163 _url = 'apps/' + common_internal.Escaper.ecapeVariable('$appId');
164
165 var _response = _requester.request(_url,
166 "GET",
167 body: _body,
168 queryParams: _queryParams,
169 uploadOptions: _uploadOptions,
170 uploadMedia: _uploadMedia,
171 downloadOptions: _downloadOptions);
172 return _response.then((data) => new App.fromJson(data));
173 }
174
175 /**
176 * Lists a user's installed apps.
177 *
178 * Request parameters:
179 *
180 * [appFilterExtensions] - A comma-separated list of file extensions for open
181 * with filtering. All apps within the given app query scope which can open
182 * any of the given file extensions will be included in the response. If
183 * appFilterMimeTypes are provided as well, the result is a union of the two
184 * resulting app lists.
185 *
186 * [appFilterMimeTypes] - A comma-separated list of MIME types for open with
187 * filtering. All apps within the given app query scope which can open any of
188 * the given MIME types will be included in the response. If
189 * appFilterExtensions are provided as well, the result is a union of the two
190 * resulting app lists.
191 *
192 * [languageCode] - A language or locale code, as defined by BCP 47, with some
193 * extensions from Unicode's LDML format
194 * (http://www.unicode.org/reports/tr35/).
195 *
196 * Completes with a [AppList].
197 *
198 * Completes with a [common.ApiRequestError] if the API endpoint returned an
199 * error.
200 *
201 * If the used [http.Client] completes with an error when making a REST call,
202 * this method will complete with the same error.
203 */
204 async.Future<AppList> list({core.String appFilterExtensions, core.String appFi lterMimeTypes, core.String languageCode}) {
205 var _url = null;
206 var _queryParams = new core.Map();
207 var _uploadMedia = null;
208 var _uploadOptions = null;
209 var _downloadOptions = common.DownloadOptions.Metadata;
210 var _body = null;
211
212 if (appFilterExtensions != null) {
213 _queryParams["appFilterExtensions"] = [appFilterExtensions];
214 }
215 if (appFilterMimeTypes != null) {
216 _queryParams["appFilterMimeTypes"] = [appFilterMimeTypes];
217 }
218 if (languageCode != null) {
219 _queryParams["languageCode"] = [languageCode];
220 }
221
222
223 _url = 'apps';
224
225 var _response = _requester.request(_url,
226 "GET",
227 body: _body,
228 queryParams: _queryParams,
229 uploadOptions: _uploadOptions,
230 uploadMedia: _uploadMedia,
231 downloadOptions: _downloadOptions);
232 return _response.then((data) => new AppList.fromJson(data));
233 }
234
235 }
236
237
238 /** Not documented yet. */
239 class ChangesResourceApi {
240 final common_internal.ApiRequester _requester;
241
242 ChangesResourceApi(common_internal.ApiRequester client) :
243 _requester = client;
244
245 /**
246 * Gets a specific change.
247 *
248 * Request parameters:
249 *
250 * [changeId] - The ID of the change.
251 *
252 * Completes with a [Change].
253 *
254 * Completes with a [common.ApiRequestError] if the API endpoint returned an
255 * error.
256 *
257 * If the used [http.Client] completes with an error when making a REST call,
258 * this method will complete with the same error.
259 */
260 async.Future<Change> get(core.String changeId) {
261 var _url = null;
262 var _queryParams = new core.Map();
263 var _uploadMedia = null;
264 var _uploadOptions = null;
265 var _downloadOptions = common.DownloadOptions.Metadata;
266 var _body = null;
267
268 if (changeId == null) {
269 throw new core.ArgumentError("Parameter changeId is required.");
270 }
271
272
273 _url = 'changes/' + common_internal.Escaper.ecapeVariable('$changeId');
274
275 var _response = _requester.request(_url,
276 "GET",
277 body: _body,
278 queryParams: _queryParams,
279 uploadOptions: _uploadOptions,
280 uploadMedia: _uploadMedia,
281 downloadOptions: _downloadOptions);
282 return _response.then((data) => new Change.fromJson(data));
283 }
284
285 /**
286 * Lists the changes for a user.
287 *
288 * Request parameters:
289 *
290 * [includeDeleted] - Whether to include deleted items.
291 *
292 * [includeSubscribed] - Whether to include public files the user has opened
293 * and shared files. When set to false, the list only includes owned files
294 * plus any shared or public files the user has explicitly added to a folder
295 * they own.
296 *
297 * [maxResults] - Maximum number of changes to return.
298 *
299 * [pageToken] - Page token for changes.
300 *
301 * [startChangeId] - Change ID to start listing changes from.
302 *
303 * Completes with a [ChangeList].
304 *
305 * Completes with a [common.ApiRequestError] if the API endpoint returned an
306 * error.
307 *
308 * If the used [http.Client] completes with an error when making a REST call,
309 * this method will complete with the same error.
310 */
311 async.Future<ChangeList> list({core.bool includeDeleted, core.bool includeSubs cribed, core.int maxResults, core.String pageToken, core.String startChangeId}) {
312 var _url = null;
313 var _queryParams = new core.Map();
314 var _uploadMedia = null;
315 var _uploadOptions = null;
316 var _downloadOptions = common.DownloadOptions.Metadata;
317 var _body = null;
318
319 if (includeDeleted != null) {
320 _queryParams["includeDeleted"] = ["${includeDeleted}"];
321 }
322 if (includeSubscribed != null) {
323 _queryParams["includeSubscribed"] = ["${includeSubscribed}"];
324 }
325 if (maxResults != null) {
326 _queryParams["maxResults"] = ["${maxResults}"];
327 }
328 if (pageToken != null) {
329 _queryParams["pageToken"] = [pageToken];
330 }
331 if (startChangeId != null) {
332 _queryParams["startChangeId"] = [startChangeId];
333 }
334
335
336 _url = 'changes';
337
338 var _response = _requester.request(_url,
339 "GET",
340 body: _body,
341 queryParams: _queryParams,
342 uploadOptions: _uploadOptions,
343 uploadMedia: _uploadMedia,
344 downloadOptions: _downloadOptions);
345 return _response.then((data) => new ChangeList.fromJson(data));
346 }
347
348 /**
349 * Subscribe to changes for a user.
350 *
351 * [request] - The metadata request object.
352 *
353 * Request parameters:
354 *
355 * [includeDeleted] - Whether to include deleted items.
356 *
357 * [includeSubscribed] - Whether to include public files the user has opened
358 * and shared files. When set to false, the list only includes owned files
359 * plus any shared or public files the user has explicitly added to a folder
360 * they own.
361 *
362 * [maxResults] - Maximum number of changes to return.
363 *
364 * [pageToken] - Page token for changes.
365 *
366 * [startChangeId] - Change ID to start listing changes from.
367 *
368 * Completes with a [Channel].
369 *
370 * Completes with a [common.ApiRequestError] if the API endpoint returned an
371 * error.
372 *
373 * If the used [http.Client] completes with an error when making a REST call,
374 * this method will complete with the same error.
375 */
376 async.Future<Channel> watch(Channel request, {core.bool includeDeleted, core.b ool includeSubscribed, core.int maxResults, core.String pageToken, core.String s tartChangeId}) {
377 var _url = null;
378 var _queryParams = new core.Map();
379 var _uploadMedia = null;
380 var _uploadOptions = null;
381 var _downloadOptions = common.DownloadOptions.Metadata;
382 var _body = null;
383
384 if (request != null) {
385 _body = convert_1.JSON.encode((request).toJson());
386 }
387 if (includeDeleted != null) {
388 _queryParams["includeDeleted"] = ["${includeDeleted}"];
389 }
390 if (includeSubscribed != null) {
391 _queryParams["includeSubscribed"] = ["${includeSubscribed}"];
392 }
393 if (maxResults != null) {
394 _queryParams["maxResults"] = ["${maxResults}"];
395 }
396 if (pageToken != null) {
397 _queryParams["pageToken"] = [pageToken];
398 }
399 if (startChangeId != null) {
400 _queryParams["startChangeId"] = [startChangeId];
401 }
402
403
404 _url = 'changes/watch';
405
406 var _response = _requester.request(_url,
407 "POST",
408 body: _body,
409 queryParams: _queryParams,
410 uploadOptions: _uploadOptions,
411 uploadMedia: _uploadMedia,
412 downloadOptions: _downloadOptions);
413 return _response.then((data) => new Channel.fromJson(data));
414 }
415
416 }
417
418
419 /** Not documented yet. */
420 class ChannelsResourceApi {
421 final common_internal.ApiRequester _requester;
422
423 ChannelsResourceApi(common_internal.ApiRequester client) :
424 _requester = client;
425
426 /**
427 * Stop watching resources through this channel
428 *
429 * [request] - The metadata request object.
430 *
431 * Request parameters:
432 *
433 * Completes with a [common.ApiRequestError] if the API endpoint returned an
434 * error.
435 *
436 * If the used [http.Client] completes with an error when making a REST call,
437 * this method will complete with the same error.
438 */
439 async.Future stop(Channel request) {
440 var _url = null;
441 var _queryParams = new core.Map();
442 var _uploadMedia = null;
443 var _uploadOptions = null;
444 var _downloadOptions = common.DownloadOptions.Metadata;
445 var _body = null;
446
447 if (request != null) {
448 _body = convert_1.JSON.encode((request).toJson());
449 }
450
451 _downloadOptions = null;
452
453 _url = 'channels/stop';
454
455 var _response = _requester.request(_url,
456 "POST",
457 body: _body,
458 queryParams: _queryParams,
459 uploadOptions: _uploadOptions,
460 uploadMedia: _uploadMedia,
461 downloadOptions: _downloadOptions);
462 return _response.then((data) => null);
463 }
464
465 }
466
467
468 /** Not documented yet. */
469 class ChildrenResourceApi {
470 final common_internal.ApiRequester _requester;
471
472 ChildrenResourceApi(common_internal.ApiRequester client) :
473 _requester = client;
474
475 /**
476 * Removes a child from a folder.
477 *
478 * Request parameters:
479 *
480 * [folderId] - The ID of the folder.
481 *
482 * [childId] - The ID of the child.
483 *
484 * Completes with a [common.ApiRequestError] if the API endpoint returned an
485 * error.
486 *
487 * If the used [http.Client] completes with an error when making a REST call,
488 * this method will complete with the same error.
489 */
490 async.Future delete(core.String folderId, core.String childId) {
491 var _url = null;
492 var _queryParams = new core.Map();
493 var _uploadMedia = null;
494 var _uploadOptions = null;
495 var _downloadOptions = common.DownloadOptions.Metadata;
496 var _body = null;
497
498 if (folderId == null) {
499 throw new core.ArgumentError("Parameter folderId is required.");
500 }
501 if (childId == null) {
502 throw new core.ArgumentError("Parameter childId is required.");
503 }
504
505 _downloadOptions = null;
506
507 _url = 'files/' + common_internal.Escaper.ecapeVariable('$folderId') + '/chi ldren/' + common_internal.Escaper.ecapeVariable('$childId');
508
509 var _response = _requester.request(_url,
510 "DELETE",
511 body: _body,
512 queryParams: _queryParams,
513 uploadOptions: _uploadOptions,
514 uploadMedia: _uploadMedia,
515 downloadOptions: _downloadOptions);
516 return _response.then((data) => null);
517 }
518
519 /**
520 * Gets a specific child reference.
521 *
522 * Request parameters:
523 *
524 * [folderId] - The ID of the folder.
525 *
526 * [childId] - The ID of the child.
527 *
528 * Completes with a [ChildReference].
529 *
530 * Completes with a [common.ApiRequestError] if the API endpoint returned an
531 * error.
532 *
533 * If the used [http.Client] completes with an error when making a REST call,
534 * this method will complete with the same error.
535 */
536 async.Future<ChildReference> get(core.String folderId, core.String childId) {
537 var _url = null;
538 var _queryParams = new core.Map();
539 var _uploadMedia = null;
540 var _uploadOptions = null;
541 var _downloadOptions = common.DownloadOptions.Metadata;
542 var _body = null;
543
544 if (folderId == null) {
545 throw new core.ArgumentError("Parameter folderId is required.");
546 }
547 if (childId == null) {
548 throw new core.ArgumentError("Parameter childId is required.");
549 }
550
551
552 _url = 'files/' + common_internal.Escaper.ecapeVariable('$folderId') + '/chi ldren/' + common_internal.Escaper.ecapeVariable('$childId');
553
554 var _response = _requester.request(_url,
555 "GET",
556 body: _body,
557 queryParams: _queryParams,
558 uploadOptions: _uploadOptions,
559 uploadMedia: _uploadMedia,
560 downloadOptions: _downloadOptions);
561 return _response.then((data) => new ChildReference.fromJson(data));
562 }
563
564 /**
565 * Inserts a file into a folder.
566 *
567 * [request] - The metadata request object.
568 *
569 * Request parameters:
570 *
571 * [folderId] - The ID of the folder.
572 *
573 * Completes with a [ChildReference].
574 *
575 * Completes with a [common.ApiRequestError] if the API endpoint returned an
576 * error.
577 *
578 * If the used [http.Client] completes with an error when making a REST call,
579 * this method will complete with the same error.
580 */
581 async.Future<ChildReference> insert(ChildReference request, core.String folder Id) {
582 var _url = null;
583 var _queryParams = new core.Map();
584 var _uploadMedia = null;
585 var _uploadOptions = null;
586 var _downloadOptions = common.DownloadOptions.Metadata;
587 var _body = null;
588
589 if (request != null) {
590 _body = convert_1.JSON.encode((request).toJson());
591 }
592 if (folderId == null) {
593 throw new core.ArgumentError("Parameter folderId is required.");
594 }
595
596
597 _url = 'files/' + common_internal.Escaper.ecapeVariable('$folderId') + '/chi ldren';
598
599 var _response = _requester.request(_url,
600 "POST",
601 body: _body,
602 queryParams: _queryParams,
603 uploadOptions: _uploadOptions,
604 uploadMedia: _uploadMedia,
605 downloadOptions: _downloadOptions);
606 return _response.then((data) => new ChildReference.fromJson(data));
607 }
608
609 /**
610 * Lists a folder's children.
611 *
612 * Request parameters:
613 *
614 * [folderId] - The ID of the folder.
615 *
616 * [maxResults] - Maximum number of children to return.
617 *
618 * [pageToken] - Page token for children.
619 *
620 * [q] - Query string for searching children.
621 *
622 * Completes with a [ChildList].
623 *
624 * Completes with a [common.ApiRequestError] if the API endpoint returned an
625 * error.
626 *
627 * If the used [http.Client] completes with an error when making a REST call,
628 * this method will complete with the same error.
629 */
630 async.Future<ChildList> list(core.String folderId, {core.int maxResults, core. String pageToken, core.String q}) {
631 var _url = null;
632 var _queryParams = new core.Map();
633 var _uploadMedia = null;
634 var _uploadOptions = null;
635 var _downloadOptions = common.DownloadOptions.Metadata;
636 var _body = null;
637
638 if (folderId == null) {
639 throw new core.ArgumentError("Parameter folderId is required.");
640 }
641 if (maxResults != null) {
642 _queryParams["maxResults"] = ["${maxResults}"];
643 }
644 if (pageToken != null) {
645 _queryParams["pageToken"] = [pageToken];
646 }
647 if (q != null) {
648 _queryParams["q"] = [q];
649 }
650
651
652 _url = 'files/' + common_internal.Escaper.ecapeVariable('$folderId') + '/chi ldren';
653
654 var _response = _requester.request(_url,
655 "GET",
656 body: _body,
657 queryParams: _queryParams,
658 uploadOptions: _uploadOptions,
659 uploadMedia: _uploadMedia,
660 downloadOptions: _downloadOptions);
661 return _response.then((data) => new ChildList.fromJson(data));
662 }
663
664 }
665
666
667 /** Not documented yet. */
668 class CommentsResourceApi {
669 final common_internal.ApiRequester _requester;
670
671 CommentsResourceApi(common_internal.ApiRequester client) :
672 _requester = client;
673
674 /**
675 * Deletes a comment.
676 *
677 * Request parameters:
678 *
679 * [fileId] - The ID of the file.
680 *
681 * [commentId] - The ID of the comment.
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 fileId, core.String commentId) {
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 (fileId == null) {
698 throw new core.ArgumentError("Parameter fileId is required.");
699 }
700 if (commentId == null) {
701 throw new core.ArgumentError("Parameter commentId is required.");
702 }
703
704 _downloadOptions = null;
705
706 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts/' + common_internal.Escaper.ecapeVariable('$commentId');
707
708 var _response = _requester.request(_url,
709 "DELETE",
710 body: _body,
711 queryParams: _queryParams,
712 uploadOptions: _uploadOptions,
713 uploadMedia: _uploadMedia,
714 downloadOptions: _downloadOptions);
715 return _response.then((data) => null);
716 }
717
718 /**
719 * Gets a comment by ID.
720 *
721 * Request parameters:
722 *
723 * [fileId] - The ID of the file.
724 *
725 * [commentId] - The ID of the comment.
726 *
727 * [includeDeleted] - If set, this will succeed when retrieving a deleted
728 * comment, and will include any deleted replies.
729 *
730 * Completes with a [Comment].
731 *
732 * Completes with a [common.ApiRequestError] if the API endpoint returned an
733 * error.
734 *
735 * If the used [http.Client] completes with an error when making a REST call,
736 * this method will complete with the same error.
737 */
738 async.Future<Comment> get(core.String fileId, core.String commentId, {core.boo l includeDeleted}) {
739 var _url = null;
740 var _queryParams = new core.Map();
741 var _uploadMedia = null;
742 var _uploadOptions = null;
743 var _downloadOptions = common.DownloadOptions.Metadata;
744 var _body = null;
745
746 if (fileId == null) {
747 throw new core.ArgumentError("Parameter fileId is required.");
748 }
749 if (commentId == null) {
750 throw new core.ArgumentError("Parameter commentId is required.");
751 }
752 if (includeDeleted != null) {
753 _queryParams["includeDeleted"] = ["${includeDeleted}"];
754 }
755
756
757 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts/' + common_internal.Escaper.ecapeVariable('$commentId');
758
759 var _response = _requester.request(_url,
760 "GET",
761 body: _body,
762 queryParams: _queryParams,
763 uploadOptions: _uploadOptions,
764 uploadMedia: _uploadMedia,
765 downloadOptions: _downloadOptions);
766 return _response.then((data) => new Comment.fromJson(data));
767 }
768
769 /**
770 * Creates a new comment on the given file.
771 *
772 * [request] - The metadata request object.
773 *
774 * Request parameters:
775 *
776 * [fileId] - The ID of the file.
777 *
778 * Completes with a [Comment].
779 *
780 * Completes with a [common.ApiRequestError] if the API endpoint returned an
781 * error.
782 *
783 * If the used [http.Client] completes with an error when making a REST call,
784 * this method will complete with the same error.
785 */
786 async.Future<Comment> insert(Comment request, core.String fileId) {
787 var _url = null;
788 var _queryParams = new core.Map();
789 var _uploadMedia = null;
790 var _uploadOptions = null;
791 var _downloadOptions = common.DownloadOptions.Metadata;
792 var _body = null;
793
794 if (request != null) {
795 _body = convert_1.JSON.encode((request).toJson());
796 }
797 if (fileId == null) {
798 throw new core.ArgumentError("Parameter fileId is required.");
799 }
800
801
802 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts';
803
804 var _response = _requester.request(_url,
805 "POST",
806 body: _body,
807 queryParams: _queryParams,
808 uploadOptions: _uploadOptions,
809 uploadMedia: _uploadMedia,
810 downloadOptions: _downloadOptions);
811 return _response.then((data) => new Comment.fromJson(data));
812 }
813
814 /**
815 * Lists a file's comments.
816 *
817 * Request parameters:
818 *
819 * [fileId] - The ID of the file.
820 *
821 * [includeDeleted] - If set, all comments and replies, including deleted
822 * comments and replies (with content stripped) will be returned.
823 *
824 * [maxResults] - The maximum number of discussions to include in the
825 * response, used for paging.
826 * Value must be between "0" and "100".
827 *
828 * [pageToken] - The continuation token, used to page through large result
829 * sets. To get the next page of results, set this parameter to the value of
830 * "nextPageToken" from the previous response.
831 *
832 * [updatedMin] - Only discussions that were updated after this timestamp will
833 * be returned. Formatted as an RFC 3339 timestamp.
834 *
835 * Completes with a [CommentList].
836 *
837 * Completes with a [common.ApiRequestError] if the API endpoint returned an
838 * error.
839 *
840 * If the used [http.Client] completes with an error when making a REST call,
841 * this method will complete with the same error.
842 */
843 async.Future<CommentList> list(core.String fileId, {core.bool includeDeleted, core.int maxResults, core.String pageToken, core.String updatedMin}) {
844 var _url = null;
845 var _queryParams = new core.Map();
846 var _uploadMedia = null;
847 var _uploadOptions = null;
848 var _downloadOptions = common.DownloadOptions.Metadata;
849 var _body = null;
850
851 if (fileId == null) {
852 throw new core.ArgumentError("Parameter fileId is required.");
853 }
854 if (includeDeleted != null) {
855 _queryParams["includeDeleted"] = ["${includeDeleted}"];
856 }
857 if (maxResults != null) {
858 _queryParams["maxResults"] = ["${maxResults}"];
859 }
860 if (pageToken != null) {
861 _queryParams["pageToken"] = [pageToken];
862 }
863 if (updatedMin != null) {
864 _queryParams["updatedMin"] = [updatedMin];
865 }
866
867
868 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts';
869
870 var _response = _requester.request(_url,
871 "GET",
872 body: _body,
873 queryParams: _queryParams,
874 uploadOptions: _uploadOptions,
875 uploadMedia: _uploadMedia,
876 downloadOptions: _downloadOptions);
877 return _response.then((data) => new CommentList.fromJson(data));
878 }
879
880 /**
881 * Updates an existing comment. This method supports patch semantics.
882 *
883 * [request] - The metadata request object.
884 *
885 * Request parameters:
886 *
887 * [fileId] - The ID of the file.
888 *
889 * [commentId] - The ID of the comment.
890 *
891 * Completes with a [Comment].
892 *
893 * Completes with a [common.ApiRequestError] if the API endpoint returned an
894 * error.
895 *
896 * If the used [http.Client] completes with an error when making a REST call,
897 * this method will complete with the same error.
898 */
899 async.Future<Comment> patch(Comment request, core.String fileId, core.String c ommentId) {
900 var _url = null;
901 var _queryParams = new core.Map();
902 var _uploadMedia = null;
903 var _uploadOptions = null;
904 var _downloadOptions = common.DownloadOptions.Metadata;
905 var _body = null;
906
907 if (request != null) {
908 _body = convert_1.JSON.encode((request).toJson());
909 }
910 if (fileId == null) {
911 throw new core.ArgumentError("Parameter fileId is required.");
912 }
913 if (commentId == null) {
914 throw new core.ArgumentError("Parameter commentId is required.");
915 }
916
917
918 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts/' + common_internal.Escaper.ecapeVariable('$commentId');
919
920 var _response = _requester.request(_url,
921 "PATCH",
922 body: _body,
923 queryParams: _queryParams,
924 uploadOptions: _uploadOptions,
925 uploadMedia: _uploadMedia,
926 downloadOptions: _downloadOptions);
927 return _response.then((data) => new Comment.fromJson(data));
928 }
929
930 /**
931 * Updates an existing comment.
932 *
933 * [request] - The metadata request object.
934 *
935 * Request parameters:
936 *
937 * [fileId] - The ID of the file.
938 *
939 * [commentId] - The ID of the comment.
940 *
941 * Completes with a [Comment].
942 *
943 * Completes with a [common.ApiRequestError] if the API endpoint returned an
944 * error.
945 *
946 * If the used [http.Client] completes with an error when making a REST call,
947 * this method will complete with the same error.
948 */
949 async.Future<Comment> update(Comment request, core.String fileId, core.String commentId) {
950 var _url = null;
951 var _queryParams = new core.Map();
952 var _uploadMedia = null;
953 var _uploadOptions = null;
954 var _downloadOptions = common.DownloadOptions.Metadata;
955 var _body = null;
956
957 if (request != null) {
958 _body = convert_1.JSON.encode((request).toJson());
959 }
960 if (fileId == null) {
961 throw new core.ArgumentError("Parameter fileId is required.");
962 }
963 if (commentId == null) {
964 throw new core.ArgumentError("Parameter commentId is required.");
965 }
966
967
968 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts/' + common_internal.Escaper.ecapeVariable('$commentId');
969
970 var _response = _requester.request(_url,
971 "PUT",
972 body: _body,
973 queryParams: _queryParams,
974 uploadOptions: _uploadOptions,
975 uploadMedia: _uploadMedia,
976 downloadOptions: _downloadOptions);
977 return _response.then((data) => new Comment.fromJson(data));
978 }
979
980 }
981
982
983 /** Not documented yet. */
984 class FilesResourceApi {
985 final common_internal.ApiRequester _requester;
986
987 FilesResourceApi(common_internal.ApiRequester client) :
988 _requester = client;
989
990 /**
991 * Creates a copy of the specified file.
992 *
993 * [request] - The metadata request object.
994 *
995 * Request parameters:
996 *
997 * [fileId] - The ID of the file to copy.
998 *
999 * [convert] - Whether to convert this file to the corresponding Google Docs
1000 * format.
1001 *
1002 * [ocr] - Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1003 *
1004 * [ocrLanguage] - If ocr is true, hints at the language to use. Valid values
1005 * are ISO 639-1 codes.
1006 *
1007 * [pinned] - Whether to pin the head revision of the new copy. A file can
1008 * have a maximum of 200 pinned revisions.
1009 *
1010 * [timedTextLanguage] - The language of the timed text.
1011 *
1012 * [timedTextTrackName] - The timed text track name.
1013 *
1014 * [visibility] - The visibility of the new file. This parameter is only
1015 * relevant when the source is not a native Google Doc and convert=false.
1016 * Possible string values are:
1017 * - "DEFAULT" : The visibility of the new file is determined by the user's
1018 * default visibility/sharing policies.
1019 * - "PRIVATE" : The new file will be visible to only the owner.
1020 *
1021 * Completes with a [File].
1022 *
1023 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1024 * error.
1025 *
1026 * If the used [http.Client] completes with an error when making a REST call,
1027 * this method will complete with the same error.
1028 */
1029 async.Future<File> copy(File request, core.String fileId, {core.bool convert, core.bool ocr, core.String ocrLanguage, core.bool pinned, core.String timedTextL anguage, core.String timedTextTrackName, core.String visibility}) {
1030 var _url = null;
1031 var _queryParams = new core.Map();
1032 var _uploadMedia = null;
1033 var _uploadOptions = null;
1034 var _downloadOptions = common.DownloadOptions.Metadata;
1035 var _body = null;
1036
1037 if (request != null) {
1038 _body = convert_1.JSON.encode((request).toJson());
1039 }
1040 if (fileId == null) {
1041 throw new core.ArgumentError("Parameter fileId is required.");
1042 }
1043 if (convert != null) {
1044 _queryParams["convert"] = ["${convert}"];
1045 }
1046 if (ocr != null) {
1047 _queryParams["ocr"] = ["${ocr}"];
1048 }
1049 if (ocrLanguage != null) {
1050 _queryParams["ocrLanguage"] = [ocrLanguage];
1051 }
1052 if (pinned != null) {
1053 _queryParams["pinned"] = ["${pinned}"];
1054 }
1055 if (timedTextLanguage != null) {
1056 _queryParams["timedTextLanguage"] = [timedTextLanguage];
1057 }
1058 if (timedTextTrackName != null) {
1059 _queryParams["timedTextTrackName"] = [timedTextTrackName];
1060 }
1061 if (visibility != null) {
1062 _queryParams["visibility"] = [visibility];
1063 }
1064
1065
1066 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/copy' ;
1067
1068 var _response = _requester.request(_url,
1069 "POST",
1070 body: _body,
1071 queryParams: _queryParams,
1072 uploadOptions: _uploadOptions,
1073 uploadMedia: _uploadMedia,
1074 downloadOptions: _downloadOptions);
1075 return _response.then((data) => new File.fromJson(data));
1076 }
1077
1078 /**
1079 * Permanently deletes a file by ID. Skips the trash.
1080 *
1081 * Request parameters:
1082 *
1083 * [fileId] - The ID of the file to delete.
1084 *
1085 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1086 * error.
1087 *
1088 * If the used [http.Client] completes with an error when making a REST call,
1089 * this method will complete with the same error.
1090 */
1091 async.Future delete(core.String fileId) {
1092 var _url = null;
1093 var _queryParams = new core.Map();
1094 var _uploadMedia = null;
1095 var _uploadOptions = null;
1096 var _downloadOptions = common.DownloadOptions.Metadata;
1097 var _body = null;
1098
1099 if (fileId == null) {
1100 throw new core.ArgumentError("Parameter fileId is required.");
1101 }
1102
1103 _downloadOptions = null;
1104
1105 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId');
1106
1107 var _response = _requester.request(_url,
1108 "DELETE",
1109 body: _body,
1110 queryParams: _queryParams,
1111 uploadOptions: _uploadOptions,
1112 uploadMedia: _uploadMedia,
1113 downloadOptions: _downloadOptions);
1114 return _response.then((data) => null);
1115 }
1116
1117 /**
1118 * Permanently deletes all of the user's trashed files.
1119 *
1120 * Request parameters:
1121 *
1122 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1123 * error.
1124 *
1125 * If the used [http.Client] completes with an error when making a REST call,
1126 * this method will complete with the same error.
1127 */
1128 async.Future emptyTrash() {
1129 var _url = null;
1130 var _queryParams = new core.Map();
1131 var _uploadMedia = null;
1132 var _uploadOptions = null;
1133 var _downloadOptions = common.DownloadOptions.Metadata;
1134 var _body = null;
1135
1136
1137 _downloadOptions = null;
1138
1139 _url = 'files/trash';
1140
1141 var _response = _requester.request(_url,
1142 "DELETE",
1143 body: _body,
1144 queryParams: _queryParams,
1145 uploadOptions: _uploadOptions,
1146 uploadMedia: _uploadMedia,
1147 downloadOptions: _downloadOptions);
1148 return _response.then((data) => null);
1149 }
1150
1151 /**
1152 * Gets a file's metadata by ID.
1153 *
1154 * Request parameters:
1155 *
1156 * [fileId] - The ID for the file in question.
1157 *
1158 * [projection] - This parameter is deprecated and has no function.
1159 * Possible string values are:
1160 * - "BASIC" : Deprecated
1161 * - "FULL" : Deprecated
1162 *
1163 * [updateViewedDate] - Whether to update the view date after successfully
1164 * retrieving the file.
1165 *
1166 * Completes with a [File].
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<File> get(core.String fileId, {core.String projection, core.bool updateViewedDate}) {
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 (fileId == null) {
1183 throw new core.ArgumentError("Parameter fileId is required.");
1184 }
1185 if (projection != null) {
1186 _queryParams["projection"] = [projection];
1187 }
1188 if (updateViewedDate != null) {
1189 _queryParams["updateViewedDate"] = ["${updateViewedDate}"];
1190 }
1191
1192
1193 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId');
1194
1195 var _response = _requester.request(_url,
1196 "GET",
1197 body: _body,
1198 queryParams: _queryParams,
1199 uploadOptions: _uploadOptions,
1200 uploadMedia: _uploadMedia,
1201 downloadOptions: _downloadOptions);
1202 return _response.then((data) => new File.fromJson(data));
1203 }
1204
1205 /**
1206 * Insert a new file.
1207 *
1208 * [request] - The metadata request object.
1209 *
1210 * Request parameters:
1211 *
1212 * [convert] - Whether to convert this file to the corresponding Google Docs
1213 * format.
1214 *
1215 * [ocr] - Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1216 *
1217 * [ocrLanguage] - If ocr is true, hints at the language to use. Valid values
1218 * are ISO 639-1 codes.
1219 *
1220 * [pinned] - Whether to pin the head revision of the uploaded file. A file
1221 * can have a maximum of 200 pinned revisions.
1222 *
1223 * [timedTextLanguage] - The language of the timed text.
1224 *
1225 * [timedTextTrackName] - The timed text track name.
1226 *
1227 * [useContentAsIndexableText] - Whether to use the content as indexable text.
1228 *
1229 * [visibility] - The visibility of the new file. This parameter is only
1230 * relevant when convert=false.
1231 * Possible string values are:
1232 * - "DEFAULT" : The visibility of the new file is determined by the user's
1233 * default visibility/sharing policies.
1234 * - "PRIVATE" : The new file will be visible to only the owner.
1235 *
1236 * [uploadMedia] - The media to upload.
1237 *
1238 * [uploadOptions] - Options for the media upload. Streaming Media without the
1239 * length being known ahead of time is only supported via resumable uploads.
1240 *
1241 * Completes with a [File].
1242 *
1243 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1244 * error.
1245 *
1246 * If the used [http.Client] completes with an error when making a REST call,
1247 * this method will complete with the same error.
1248 */
1249 async.Future<File> insert(File request, {core.bool convert, core.bool ocr, cor e.String ocrLanguage, core.bool pinned, core.String timedTextLanguage, core.Stri ng timedTextTrackName, core.bool useContentAsIndexableText, core.String visibili ty, common.UploadOptions uploadOptions : common.UploadOptions.Default, common.Me dia uploadMedia}) {
1250 var _url = null;
1251 var _queryParams = new core.Map();
1252 var _uploadMedia = null;
1253 var _uploadOptions = null;
1254 var _downloadOptions = common.DownloadOptions.Metadata;
1255 var _body = null;
1256
1257 if (request != null) {
1258 _body = convert_1.JSON.encode((request).toJson());
1259 }
1260 if (convert != null) {
1261 _queryParams["convert"] = ["${convert}"];
1262 }
1263 if (ocr != null) {
1264 _queryParams["ocr"] = ["${ocr}"];
1265 }
1266 if (ocrLanguage != null) {
1267 _queryParams["ocrLanguage"] = [ocrLanguage];
1268 }
1269 if (pinned != null) {
1270 _queryParams["pinned"] = ["${pinned}"];
1271 }
1272 if (timedTextLanguage != null) {
1273 _queryParams["timedTextLanguage"] = [timedTextLanguage];
1274 }
1275 if (timedTextTrackName != null) {
1276 _queryParams["timedTextTrackName"] = [timedTextTrackName];
1277 }
1278 if (useContentAsIndexableText != null) {
1279 _queryParams["useContentAsIndexableText"] = ["${useContentAsIndexableText} "];
1280 }
1281 if (visibility != null) {
1282 _queryParams["visibility"] = [visibility];
1283 }
1284
1285 _uploadMedia = uploadMedia;
1286 _uploadOptions = uploadOptions;
1287
1288 if (_uploadMedia == null) {
1289 _url = 'files';
1290 } else if (_uploadOptions is common.ResumableUploadOptions) {
1291 _url = '/resumable/upload/drive/v2/files';
1292 } else {
1293 _url = '/upload/drive/v2/files';
1294 }
1295
1296
1297 var _response = _requester.request(_url,
1298 "POST",
1299 body: _body,
1300 queryParams: _queryParams,
1301 uploadOptions: _uploadOptions,
1302 uploadMedia: _uploadMedia,
1303 downloadOptions: _downloadOptions);
1304 return _response.then((data) => new File.fromJson(data));
1305 }
1306
1307 /**
1308 * Lists the user's files.
1309 *
1310 * Request parameters:
1311 *
1312 * [corpus] - The body of items (files/documents) to which the query applies.
1313 * Possible string values are:
1314 * - "DEFAULT" : The items that the user has accessed.
1315 * - "DOMAIN" : Items shared to the user's domain.
1316 *
1317 * [maxResults] - Maximum number of files to return.
1318 *
1319 * [pageToken] - Page token for files.
1320 *
1321 * [projection] - This parameter is deprecated and has no function.
1322 * Possible string values are:
1323 * - "BASIC" : Deprecated
1324 * - "FULL" : Deprecated
1325 *
1326 * [q] - Query string for searching files.
1327 *
1328 * Completes with a [FileList].
1329 *
1330 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1331 * error.
1332 *
1333 * If the used [http.Client] completes with an error when making a REST call,
1334 * this method will complete with the same error.
1335 */
1336 async.Future<FileList> list({core.String corpus, core.int maxResults, core.Str ing pageToken, core.String projection, core.String q}) {
1337 var _url = null;
1338 var _queryParams = new core.Map();
1339 var _uploadMedia = null;
1340 var _uploadOptions = null;
1341 var _downloadOptions = common.DownloadOptions.Metadata;
1342 var _body = null;
1343
1344 if (corpus != null) {
1345 _queryParams["corpus"] = [corpus];
1346 }
1347 if (maxResults != null) {
1348 _queryParams["maxResults"] = ["${maxResults}"];
1349 }
1350 if (pageToken != null) {
1351 _queryParams["pageToken"] = [pageToken];
1352 }
1353 if (projection != null) {
1354 _queryParams["projection"] = [projection];
1355 }
1356 if (q != null) {
1357 _queryParams["q"] = [q];
1358 }
1359
1360
1361 _url = 'files';
1362
1363 var _response = _requester.request(_url,
1364 "GET",
1365 body: _body,
1366 queryParams: _queryParams,
1367 uploadOptions: _uploadOptions,
1368 uploadMedia: _uploadMedia,
1369 downloadOptions: _downloadOptions);
1370 return _response.then((data) => new FileList.fromJson(data));
1371 }
1372
1373 /**
1374 * Updates file metadata and/or content. This method supports patch semantics.
1375 *
1376 * [request] - The metadata request object.
1377 *
1378 * Request parameters:
1379 *
1380 * [fileId] - The ID of the file to update.
1381 *
1382 * [addParents] - Comma-separated list of parent IDs to add.
1383 *
1384 * [convert] - Whether to convert this file to the corresponding Google Docs
1385 * format.
1386 *
1387 * [newRevision] - Whether a blob upload should create a new revision. If
1388 * false, the blob data in the current head revision is replaced. If true or
1389 * not set, a new blob is created as head revision, and previous revisions are
1390 * preserved (causing increased use of the user's data storage quota).
1391 *
1392 * [ocr] - Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1393 *
1394 * [ocrLanguage] - If ocr is true, hints at the language to use. Valid values
1395 * are ISO 639-1 codes.
1396 *
1397 * [pinned] - Whether to pin the new revision. A file can have a maximum of
1398 * 200 pinned revisions.
1399 *
1400 * [removeParents] - Comma-separated list of parent IDs to remove.
1401 *
1402 * [setModifiedDate] - Whether to set the modified date with the supplied
1403 * modified date.
1404 *
1405 * [timedTextLanguage] - The language of the timed text.
1406 *
1407 * [timedTextTrackName] - The timed text track name.
1408 *
1409 * [updateViewedDate] - Whether to update the view date after successfully
1410 * updating the file.
1411 *
1412 * [useContentAsIndexableText] - Whether to use the content as indexable text.
1413 *
1414 * Completes with a [File].
1415 *
1416 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1417 * error.
1418 *
1419 * If the used [http.Client] completes with an error when making a REST call,
1420 * this method will complete with the same error.
1421 */
1422 async.Future<File> patch(File request, core.String fileId, {core.String addPar ents, core.bool convert, core.bool newRevision, core.bool ocr, core.String ocrLa nguage, core.bool pinned, core.String removeParents, core.bool setModifiedDate, core.String timedTextLanguage, core.String timedTextTrackName, core.bool updateV iewedDate, core.bool useContentAsIndexableText}) {
1423 var _url = null;
1424 var _queryParams = new core.Map();
1425 var _uploadMedia = null;
1426 var _uploadOptions = null;
1427 var _downloadOptions = common.DownloadOptions.Metadata;
1428 var _body = null;
1429
1430 if (request != null) {
1431 _body = convert_1.JSON.encode((request).toJson());
1432 }
1433 if (fileId == null) {
1434 throw new core.ArgumentError("Parameter fileId is required.");
1435 }
1436 if (addParents != null) {
1437 _queryParams["addParents"] = [addParents];
1438 }
1439 if (convert != null) {
1440 _queryParams["convert"] = ["${convert}"];
1441 }
1442 if (newRevision != null) {
1443 _queryParams["newRevision"] = ["${newRevision}"];
1444 }
1445 if (ocr != null) {
1446 _queryParams["ocr"] = ["${ocr}"];
1447 }
1448 if (ocrLanguage != null) {
1449 _queryParams["ocrLanguage"] = [ocrLanguage];
1450 }
1451 if (pinned != null) {
1452 _queryParams["pinned"] = ["${pinned}"];
1453 }
1454 if (removeParents != null) {
1455 _queryParams["removeParents"] = [removeParents];
1456 }
1457 if (setModifiedDate != null) {
1458 _queryParams["setModifiedDate"] = ["${setModifiedDate}"];
1459 }
1460 if (timedTextLanguage != null) {
1461 _queryParams["timedTextLanguage"] = [timedTextLanguage];
1462 }
1463 if (timedTextTrackName != null) {
1464 _queryParams["timedTextTrackName"] = [timedTextTrackName];
1465 }
1466 if (updateViewedDate != null) {
1467 _queryParams["updateViewedDate"] = ["${updateViewedDate}"];
1468 }
1469 if (useContentAsIndexableText != null) {
1470 _queryParams["useContentAsIndexableText"] = ["${useContentAsIndexableText} "];
1471 }
1472
1473
1474 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId');
1475
1476 var _response = _requester.request(_url,
1477 "PATCH",
1478 body: _body,
1479 queryParams: _queryParams,
1480 uploadOptions: _uploadOptions,
1481 uploadMedia: _uploadMedia,
1482 downloadOptions: _downloadOptions);
1483 return _response.then((data) => new File.fromJson(data));
1484 }
1485
1486 /**
1487 * Set the file's updated time to the current server time.
1488 *
1489 * Request parameters:
1490 *
1491 * [fileId] - The ID of the file to update.
1492 *
1493 * Completes with a [File].
1494 *
1495 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1496 * error.
1497 *
1498 * If the used [http.Client] completes with an error when making a REST call,
1499 * this method will complete with the same error.
1500 */
1501 async.Future<File> touch(core.String fileId) {
1502 var _url = null;
1503 var _queryParams = new core.Map();
1504 var _uploadMedia = null;
1505 var _uploadOptions = null;
1506 var _downloadOptions = common.DownloadOptions.Metadata;
1507 var _body = null;
1508
1509 if (fileId == null) {
1510 throw new core.ArgumentError("Parameter fileId is required.");
1511 }
1512
1513
1514 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/touch ';
1515
1516 var _response = _requester.request(_url,
1517 "POST",
1518 body: _body,
1519 queryParams: _queryParams,
1520 uploadOptions: _uploadOptions,
1521 uploadMedia: _uploadMedia,
1522 downloadOptions: _downloadOptions);
1523 return _response.then((data) => new File.fromJson(data));
1524 }
1525
1526 /**
1527 * Moves a file to the trash.
1528 *
1529 * Request parameters:
1530 *
1531 * [fileId] - The ID of the file to trash.
1532 *
1533 * Completes with a [File].
1534 *
1535 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1536 * error.
1537 *
1538 * If the used [http.Client] completes with an error when making a REST call,
1539 * this method will complete with the same error.
1540 */
1541 async.Future<File> trash(core.String fileId) {
1542 var _url = null;
1543 var _queryParams = new core.Map();
1544 var _uploadMedia = null;
1545 var _uploadOptions = null;
1546 var _downloadOptions = common.DownloadOptions.Metadata;
1547 var _body = null;
1548
1549 if (fileId == null) {
1550 throw new core.ArgumentError("Parameter fileId is required.");
1551 }
1552
1553
1554 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/trash ';
1555
1556 var _response = _requester.request(_url,
1557 "POST",
1558 body: _body,
1559 queryParams: _queryParams,
1560 uploadOptions: _uploadOptions,
1561 uploadMedia: _uploadMedia,
1562 downloadOptions: _downloadOptions);
1563 return _response.then((data) => new File.fromJson(data));
1564 }
1565
1566 /**
1567 * Restores a file from the trash.
1568 *
1569 * Request parameters:
1570 *
1571 * [fileId] - The ID of the file to untrash.
1572 *
1573 * Completes with a [File].
1574 *
1575 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1576 * error.
1577 *
1578 * If the used [http.Client] completes with an error when making a REST call,
1579 * this method will complete with the same error.
1580 */
1581 async.Future<File> untrash(core.String fileId) {
1582 var _url = null;
1583 var _queryParams = new core.Map();
1584 var _uploadMedia = null;
1585 var _uploadOptions = null;
1586 var _downloadOptions = common.DownloadOptions.Metadata;
1587 var _body = null;
1588
1589 if (fileId == null) {
1590 throw new core.ArgumentError("Parameter fileId is required.");
1591 }
1592
1593
1594 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/untra sh';
1595
1596 var _response = _requester.request(_url,
1597 "POST",
1598 body: _body,
1599 queryParams: _queryParams,
1600 uploadOptions: _uploadOptions,
1601 uploadMedia: _uploadMedia,
1602 downloadOptions: _downloadOptions);
1603 return _response.then((data) => new File.fromJson(data));
1604 }
1605
1606 /**
1607 * Updates file metadata and/or content.
1608 *
1609 * [request] - The metadata request object.
1610 *
1611 * Request parameters:
1612 *
1613 * [fileId] - The ID of the file to update.
1614 *
1615 * [addParents] - Comma-separated list of parent IDs to add.
1616 *
1617 * [convert] - Whether to convert this file to the corresponding Google Docs
1618 * format.
1619 *
1620 * [newRevision] - Whether a blob upload should create a new revision. If
1621 * false, the blob data in the current head revision is replaced. If true or
1622 * not set, a new blob is created as head revision, and previous revisions are
1623 * preserved (causing increased use of the user's data storage quota).
1624 *
1625 * [ocr] - Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1626 *
1627 * [ocrLanguage] - If ocr is true, hints at the language to use. Valid values
1628 * are ISO 639-1 codes.
1629 *
1630 * [pinned] - Whether to pin the new revision. A file can have a maximum of
1631 * 200 pinned revisions.
1632 *
1633 * [removeParents] - Comma-separated list of parent IDs to remove.
1634 *
1635 * [setModifiedDate] - Whether to set the modified date with the supplied
1636 * modified date.
1637 *
1638 * [timedTextLanguage] - The language of the timed text.
1639 *
1640 * [timedTextTrackName] - The timed text track name.
1641 *
1642 * [updateViewedDate] - Whether to update the view date after successfully
1643 * updating the file.
1644 *
1645 * [useContentAsIndexableText] - Whether to use the content as indexable text.
1646 *
1647 * [uploadMedia] - The media to upload.
1648 *
1649 * [uploadOptions] - Options for the media upload. Streaming Media without the
1650 * length being known ahead of time is only supported via resumable uploads.
1651 *
1652 * Completes with a [File].
1653 *
1654 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1655 * error.
1656 *
1657 * If the used [http.Client] completes with an error when making a REST call,
1658 * this method will complete with the same error.
1659 */
1660 async.Future<File> update(File request, core.String fileId, {core.String addPa rents, core.bool convert, core.bool newRevision, core.bool ocr, core.String ocrL anguage, core.bool pinned, core.String removeParents, core.bool setModifiedDate, core.String timedTextLanguage, core.String timedTextTrackName, core.bool update ViewedDate, core.bool useContentAsIndexableText, common.UploadOptions uploadOpti ons : common.UploadOptions.Default, common.Media uploadMedia}) {
1661 var _url = null;
1662 var _queryParams = new core.Map();
1663 var _uploadMedia = null;
1664 var _uploadOptions = null;
1665 var _downloadOptions = common.DownloadOptions.Metadata;
1666 var _body = null;
1667
1668 if (request != null) {
1669 _body = convert_1.JSON.encode((request).toJson());
1670 }
1671 if (fileId == null) {
1672 throw new core.ArgumentError("Parameter fileId is required.");
1673 }
1674 if (addParents != null) {
1675 _queryParams["addParents"] = [addParents];
1676 }
1677 if (convert != null) {
1678 _queryParams["convert"] = ["${convert}"];
1679 }
1680 if (newRevision != null) {
1681 _queryParams["newRevision"] = ["${newRevision}"];
1682 }
1683 if (ocr != null) {
1684 _queryParams["ocr"] = ["${ocr}"];
1685 }
1686 if (ocrLanguage != null) {
1687 _queryParams["ocrLanguage"] = [ocrLanguage];
1688 }
1689 if (pinned != null) {
1690 _queryParams["pinned"] = ["${pinned}"];
1691 }
1692 if (removeParents != null) {
1693 _queryParams["removeParents"] = [removeParents];
1694 }
1695 if (setModifiedDate != null) {
1696 _queryParams["setModifiedDate"] = ["${setModifiedDate}"];
1697 }
1698 if (timedTextLanguage != null) {
1699 _queryParams["timedTextLanguage"] = [timedTextLanguage];
1700 }
1701 if (timedTextTrackName != null) {
1702 _queryParams["timedTextTrackName"] = [timedTextTrackName];
1703 }
1704 if (updateViewedDate != null) {
1705 _queryParams["updateViewedDate"] = ["${updateViewedDate}"];
1706 }
1707 if (useContentAsIndexableText != null) {
1708 _queryParams["useContentAsIndexableText"] = ["${useContentAsIndexableText} "];
1709 }
1710
1711 _uploadMedia = uploadMedia;
1712 _uploadOptions = uploadOptions;
1713
1714 if (_uploadMedia == null) {
1715 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId');
1716 } else if (_uploadOptions is common.ResumableUploadOptions) {
1717 _url = '/resumable/upload/drive/v2/files/' + common_internal.Escaper.ecape Variable('$fileId');
1718 } else {
1719 _url = '/upload/drive/v2/files/' + common_internal.Escaper.ecapeVariable(' $fileId');
1720 }
1721
1722
1723 var _response = _requester.request(_url,
1724 "PUT",
1725 body: _body,
1726 queryParams: _queryParams,
1727 uploadOptions: _uploadOptions,
1728 uploadMedia: _uploadMedia,
1729 downloadOptions: _downloadOptions);
1730 return _response.then((data) => new File.fromJson(data));
1731 }
1732
1733 /**
1734 * Subscribe to changes on a file
1735 *
1736 * [request] - The metadata request object.
1737 *
1738 * Request parameters:
1739 *
1740 * [fileId] - The ID for the file in question.
1741 *
1742 * [projection] - This parameter is deprecated and has no function.
1743 * Possible string values are:
1744 * - "BASIC" : Deprecated
1745 * - "FULL" : Deprecated
1746 *
1747 * [updateViewedDate] - Whether to update the view date after successfully
1748 * retrieving the file.
1749 *
1750 * Completes with a [Channel].
1751 *
1752 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1753 * error.
1754 *
1755 * If the used [http.Client] completes with an error when making a REST call,
1756 * this method will complete with the same error.
1757 */
1758 async.Future<Channel> watch(Channel request, core.String fileId, {core.String projection, core.bool updateViewedDate}) {
1759 var _url = null;
1760 var _queryParams = new core.Map();
1761 var _uploadMedia = null;
1762 var _uploadOptions = null;
1763 var _downloadOptions = common.DownloadOptions.Metadata;
1764 var _body = null;
1765
1766 if (request != null) {
1767 _body = convert_1.JSON.encode((request).toJson());
1768 }
1769 if (fileId == null) {
1770 throw new core.ArgumentError("Parameter fileId is required.");
1771 }
1772 if (projection != null) {
1773 _queryParams["projection"] = [projection];
1774 }
1775 if (updateViewedDate != null) {
1776 _queryParams["updateViewedDate"] = ["${updateViewedDate}"];
1777 }
1778
1779
1780 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/watch ';
1781
1782 var _response = _requester.request(_url,
1783 "POST",
1784 body: _body,
1785 queryParams: _queryParams,
1786 uploadOptions: _uploadOptions,
1787 uploadMedia: _uploadMedia,
1788 downloadOptions: _downloadOptions);
1789 return _response.then((data) => new Channel.fromJson(data));
1790 }
1791
1792 }
1793
1794
1795 /** Not documented yet. */
1796 class ParentsResourceApi {
1797 final common_internal.ApiRequester _requester;
1798
1799 ParentsResourceApi(common_internal.ApiRequester client) :
1800 _requester = client;
1801
1802 /**
1803 * Removes a parent from a file.
1804 *
1805 * Request parameters:
1806 *
1807 * [fileId] - The ID of the file.
1808 *
1809 * [parentId] - The ID of the parent.
1810 *
1811 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1812 * error.
1813 *
1814 * If the used [http.Client] completes with an error when making a REST call,
1815 * this method will complete with the same error.
1816 */
1817 async.Future delete(core.String fileId, core.String parentId) {
1818 var _url = null;
1819 var _queryParams = new core.Map();
1820 var _uploadMedia = null;
1821 var _uploadOptions = null;
1822 var _downloadOptions = common.DownloadOptions.Metadata;
1823 var _body = null;
1824
1825 if (fileId == null) {
1826 throw new core.ArgumentError("Parameter fileId is required.");
1827 }
1828 if (parentId == null) {
1829 throw new core.ArgumentError("Parameter parentId is required.");
1830 }
1831
1832 _downloadOptions = null;
1833
1834 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/paren ts/' + common_internal.Escaper.ecapeVariable('$parentId');
1835
1836 var _response = _requester.request(_url,
1837 "DELETE",
1838 body: _body,
1839 queryParams: _queryParams,
1840 uploadOptions: _uploadOptions,
1841 uploadMedia: _uploadMedia,
1842 downloadOptions: _downloadOptions);
1843 return _response.then((data) => null);
1844 }
1845
1846 /**
1847 * Gets a specific parent reference.
1848 *
1849 * Request parameters:
1850 *
1851 * [fileId] - The ID of the file.
1852 *
1853 * [parentId] - The ID of the parent.
1854 *
1855 * Completes with a [ParentReference].
1856 *
1857 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1858 * error.
1859 *
1860 * If the used [http.Client] completes with an error when making a REST call,
1861 * this method will complete with the same error.
1862 */
1863 async.Future<ParentReference> get(core.String fileId, core.String parentId) {
1864 var _url = null;
1865 var _queryParams = new core.Map();
1866 var _uploadMedia = null;
1867 var _uploadOptions = null;
1868 var _downloadOptions = common.DownloadOptions.Metadata;
1869 var _body = null;
1870
1871 if (fileId == null) {
1872 throw new core.ArgumentError("Parameter fileId is required.");
1873 }
1874 if (parentId == null) {
1875 throw new core.ArgumentError("Parameter parentId is required.");
1876 }
1877
1878
1879 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/paren ts/' + common_internal.Escaper.ecapeVariable('$parentId');
1880
1881 var _response = _requester.request(_url,
1882 "GET",
1883 body: _body,
1884 queryParams: _queryParams,
1885 uploadOptions: _uploadOptions,
1886 uploadMedia: _uploadMedia,
1887 downloadOptions: _downloadOptions);
1888 return _response.then((data) => new ParentReference.fromJson(data));
1889 }
1890
1891 /**
1892 * Adds a parent folder for a file.
1893 *
1894 * [request] - The metadata request object.
1895 *
1896 * Request parameters:
1897 *
1898 * [fileId] - The ID of the file.
1899 *
1900 * Completes with a [ParentReference].
1901 *
1902 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1903 * error.
1904 *
1905 * If the used [http.Client] completes with an error when making a REST call,
1906 * this method will complete with the same error.
1907 */
1908 async.Future<ParentReference> insert(ParentReference request, core.String file Id) {
1909 var _url = null;
1910 var _queryParams = new core.Map();
1911 var _uploadMedia = null;
1912 var _uploadOptions = null;
1913 var _downloadOptions = common.DownloadOptions.Metadata;
1914 var _body = null;
1915
1916 if (request != null) {
1917 _body = convert_1.JSON.encode((request).toJson());
1918 }
1919 if (fileId == null) {
1920 throw new core.ArgumentError("Parameter fileId is required.");
1921 }
1922
1923
1924 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/paren ts';
1925
1926 var _response = _requester.request(_url,
1927 "POST",
1928 body: _body,
1929 queryParams: _queryParams,
1930 uploadOptions: _uploadOptions,
1931 uploadMedia: _uploadMedia,
1932 downloadOptions: _downloadOptions);
1933 return _response.then((data) => new ParentReference.fromJson(data));
1934 }
1935
1936 /**
1937 * Lists a file's parents.
1938 *
1939 * Request parameters:
1940 *
1941 * [fileId] - The ID of the file.
1942 *
1943 * Completes with a [ParentList].
1944 *
1945 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1946 * error.
1947 *
1948 * If the used [http.Client] completes with an error when making a REST call,
1949 * this method will complete with the same error.
1950 */
1951 async.Future<ParentList> list(core.String fileId) {
1952 var _url = null;
1953 var _queryParams = new core.Map();
1954 var _uploadMedia = null;
1955 var _uploadOptions = null;
1956 var _downloadOptions = common.DownloadOptions.Metadata;
1957 var _body = null;
1958
1959 if (fileId == null) {
1960 throw new core.ArgumentError("Parameter fileId is required.");
1961 }
1962
1963
1964 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/paren ts';
1965
1966 var _response = _requester.request(_url,
1967 "GET",
1968 body: _body,
1969 queryParams: _queryParams,
1970 uploadOptions: _uploadOptions,
1971 uploadMedia: _uploadMedia,
1972 downloadOptions: _downloadOptions);
1973 return _response.then((data) => new ParentList.fromJson(data));
1974 }
1975
1976 }
1977
1978
1979 /** Not documented yet. */
1980 class PermissionsResourceApi {
1981 final common_internal.ApiRequester _requester;
1982
1983 PermissionsResourceApi(common_internal.ApiRequester client) :
1984 _requester = client;
1985
1986 /**
1987 * Deletes a permission from a file.
1988 *
1989 * Request parameters:
1990 *
1991 * [fileId] - The ID for the file.
1992 *
1993 * [permissionId] - The ID for the permission.
1994 *
1995 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1996 * error.
1997 *
1998 * If the used [http.Client] completes with an error when making a REST call,
1999 * this method will complete with the same error.
2000 */
2001 async.Future delete(core.String fileId, core.String permissionId) {
2002 var _url = null;
2003 var _queryParams = new core.Map();
2004 var _uploadMedia = null;
2005 var _uploadOptions = null;
2006 var _downloadOptions = common.DownloadOptions.Metadata;
2007 var _body = null;
2008
2009 if (fileId == null) {
2010 throw new core.ArgumentError("Parameter fileId is required.");
2011 }
2012 if (permissionId == null) {
2013 throw new core.ArgumentError("Parameter permissionId is required.");
2014 }
2015
2016 _downloadOptions = null;
2017
2018 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/permi ssions/' + common_internal.Escaper.ecapeVariable('$permissionId');
2019
2020 var _response = _requester.request(_url,
2021 "DELETE",
2022 body: _body,
2023 queryParams: _queryParams,
2024 uploadOptions: _uploadOptions,
2025 uploadMedia: _uploadMedia,
2026 downloadOptions: _downloadOptions);
2027 return _response.then((data) => null);
2028 }
2029
2030 /**
2031 * Gets a permission by ID.
2032 *
2033 * Request parameters:
2034 *
2035 * [fileId] - The ID for the file.
2036 *
2037 * [permissionId] - The ID for the permission.
2038 *
2039 * Completes with a [Permission].
2040 *
2041 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2042 * error.
2043 *
2044 * If the used [http.Client] completes with an error when making a REST call,
2045 * this method will complete with the same error.
2046 */
2047 async.Future<Permission> get(core.String fileId, core.String permissionId) {
2048 var _url = null;
2049 var _queryParams = new core.Map();
2050 var _uploadMedia = null;
2051 var _uploadOptions = null;
2052 var _downloadOptions = common.DownloadOptions.Metadata;
2053 var _body = null;
2054
2055 if (fileId == null) {
2056 throw new core.ArgumentError("Parameter fileId is required.");
2057 }
2058 if (permissionId == null) {
2059 throw new core.ArgumentError("Parameter permissionId is required.");
2060 }
2061
2062
2063 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/permi ssions/' + common_internal.Escaper.ecapeVariable('$permissionId');
2064
2065 var _response = _requester.request(_url,
2066 "GET",
2067 body: _body,
2068 queryParams: _queryParams,
2069 uploadOptions: _uploadOptions,
2070 uploadMedia: _uploadMedia,
2071 downloadOptions: _downloadOptions);
2072 return _response.then((data) => new Permission.fromJson(data));
2073 }
2074
2075 /**
2076 * Returns the permission ID for an email address.
2077 *
2078 * Request parameters:
2079 *
2080 * [email] - The email address for which to return a permission ID
2081 *
2082 * Completes with a [PermissionId].
2083 *
2084 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2085 * error.
2086 *
2087 * If the used [http.Client] completes with an error when making a REST call,
2088 * this method will complete with the same error.
2089 */
2090 async.Future<PermissionId> getIdForEmail(core.String email) {
2091 var _url = null;
2092 var _queryParams = new core.Map();
2093 var _uploadMedia = null;
2094 var _uploadOptions = null;
2095 var _downloadOptions = common.DownloadOptions.Metadata;
2096 var _body = null;
2097
2098 if (email == null) {
2099 throw new core.ArgumentError("Parameter email is required.");
2100 }
2101
2102
2103 _url = 'permissionIds/' + common_internal.Escaper.ecapeVariable('$email');
2104
2105 var _response = _requester.request(_url,
2106 "GET",
2107 body: _body,
2108 queryParams: _queryParams,
2109 uploadOptions: _uploadOptions,
2110 uploadMedia: _uploadMedia,
2111 downloadOptions: _downloadOptions);
2112 return _response.then((data) => new PermissionId.fromJson(data));
2113 }
2114
2115 /**
2116 * Inserts a permission for a file.
2117 *
2118 * [request] - The metadata request object.
2119 *
2120 * Request parameters:
2121 *
2122 * [fileId] - The ID for the file.
2123 *
2124 * [emailMessage] - A custom message to include in notification emails.
2125 *
2126 * [sendNotificationEmails] - Whether to send notification emails when sharing
2127 * to users or groups. This parameter is ignored and an email is sent if the
2128 * role is owner.
2129 *
2130 * Completes with a [Permission].
2131 *
2132 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2133 * error.
2134 *
2135 * If the used [http.Client] completes with an error when making a REST call,
2136 * this method will complete with the same error.
2137 */
2138 async.Future<Permission> insert(Permission request, core.String fileId, {core. String emailMessage, core.bool sendNotificationEmails}) {
2139 var _url = null;
2140 var _queryParams = new core.Map();
2141 var _uploadMedia = null;
2142 var _uploadOptions = null;
2143 var _downloadOptions = common.DownloadOptions.Metadata;
2144 var _body = null;
2145
2146 if (request != null) {
2147 _body = convert_1.JSON.encode((request).toJson());
2148 }
2149 if (fileId == null) {
2150 throw new core.ArgumentError("Parameter fileId is required.");
2151 }
2152 if (emailMessage != null) {
2153 _queryParams["emailMessage"] = [emailMessage];
2154 }
2155 if (sendNotificationEmails != null) {
2156 _queryParams["sendNotificationEmails"] = ["${sendNotificationEmails}"];
2157 }
2158
2159
2160 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/permi ssions';
2161
2162 var _response = _requester.request(_url,
2163 "POST",
2164 body: _body,
2165 queryParams: _queryParams,
2166 uploadOptions: _uploadOptions,
2167 uploadMedia: _uploadMedia,
2168 downloadOptions: _downloadOptions);
2169 return _response.then((data) => new Permission.fromJson(data));
2170 }
2171
2172 /**
2173 * Lists a file's permissions.
2174 *
2175 * Request parameters:
2176 *
2177 * [fileId] - The ID for the file.
2178 *
2179 * Completes with a [PermissionList].
2180 *
2181 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2182 * error.
2183 *
2184 * If the used [http.Client] completes with an error when making a REST call,
2185 * this method will complete with the same error.
2186 */
2187 async.Future<PermissionList> list(core.String fileId) {
2188 var _url = null;
2189 var _queryParams = new core.Map();
2190 var _uploadMedia = null;
2191 var _uploadOptions = null;
2192 var _downloadOptions = common.DownloadOptions.Metadata;
2193 var _body = null;
2194
2195 if (fileId == null) {
2196 throw new core.ArgumentError("Parameter fileId is required.");
2197 }
2198
2199
2200 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/permi ssions';
2201
2202 var _response = _requester.request(_url,
2203 "GET",
2204 body: _body,
2205 queryParams: _queryParams,
2206 uploadOptions: _uploadOptions,
2207 uploadMedia: _uploadMedia,
2208 downloadOptions: _downloadOptions);
2209 return _response.then((data) => new PermissionList.fromJson(data));
2210 }
2211
2212 /**
2213 * Updates a permission. This method supports patch semantics.
2214 *
2215 * [request] - The metadata request object.
2216 *
2217 * Request parameters:
2218 *
2219 * [fileId] - The ID for the file.
2220 *
2221 * [permissionId] - The ID for the permission.
2222 *
2223 * [transferOwnership] - Whether changing a role to 'owner' should also
2224 * downgrade the current owners to writers.
2225 *
2226 * Completes with a [Permission].
2227 *
2228 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2229 * error.
2230 *
2231 * If the used [http.Client] completes with an error when making a REST call,
2232 * this method will complete with the same error.
2233 */
2234 async.Future<Permission> patch(Permission request, core.String fileId, core.St ring permissionId, {core.bool transferOwnership}) {
2235 var _url = null;
2236 var _queryParams = new core.Map();
2237 var _uploadMedia = null;
2238 var _uploadOptions = null;
2239 var _downloadOptions = common.DownloadOptions.Metadata;
2240 var _body = null;
2241
2242 if (request != null) {
2243 _body = convert_1.JSON.encode((request).toJson());
2244 }
2245 if (fileId == null) {
2246 throw new core.ArgumentError("Parameter fileId is required.");
2247 }
2248 if (permissionId == null) {
2249 throw new core.ArgumentError("Parameter permissionId is required.");
2250 }
2251 if (transferOwnership != null) {
2252 _queryParams["transferOwnership"] = ["${transferOwnership}"];
2253 }
2254
2255
2256 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/permi ssions/' + common_internal.Escaper.ecapeVariable('$permissionId');
2257
2258 var _response = _requester.request(_url,
2259 "PATCH",
2260 body: _body,
2261 queryParams: _queryParams,
2262 uploadOptions: _uploadOptions,
2263 uploadMedia: _uploadMedia,
2264 downloadOptions: _downloadOptions);
2265 return _response.then((data) => new Permission.fromJson(data));
2266 }
2267
2268 /**
2269 * Updates a permission.
2270 *
2271 * [request] - The metadata request object.
2272 *
2273 * Request parameters:
2274 *
2275 * [fileId] - The ID for the file.
2276 *
2277 * [permissionId] - The ID for the permission.
2278 *
2279 * [transferOwnership] - Whether changing a role to 'owner' should also
2280 * downgrade the current owners to writers.
2281 *
2282 * Completes with a [Permission].
2283 *
2284 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2285 * error.
2286 *
2287 * If the used [http.Client] completes with an error when making a REST call,
2288 * this method will complete with the same error.
2289 */
2290 async.Future<Permission> update(Permission request, core.String fileId, core.S tring permissionId, {core.bool transferOwnership}) {
2291 var _url = null;
2292 var _queryParams = new core.Map();
2293 var _uploadMedia = null;
2294 var _uploadOptions = null;
2295 var _downloadOptions = common.DownloadOptions.Metadata;
2296 var _body = null;
2297
2298 if (request != null) {
2299 _body = convert_1.JSON.encode((request).toJson());
2300 }
2301 if (fileId == null) {
2302 throw new core.ArgumentError("Parameter fileId is required.");
2303 }
2304 if (permissionId == null) {
2305 throw new core.ArgumentError("Parameter permissionId is required.");
2306 }
2307 if (transferOwnership != null) {
2308 _queryParams["transferOwnership"] = ["${transferOwnership}"];
2309 }
2310
2311
2312 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/permi ssions/' + common_internal.Escaper.ecapeVariable('$permissionId');
2313
2314 var _response = _requester.request(_url,
2315 "PUT",
2316 body: _body,
2317 queryParams: _queryParams,
2318 uploadOptions: _uploadOptions,
2319 uploadMedia: _uploadMedia,
2320 downloadOptions: _downloadOptions);
2321 return _response.then((data) => new Permission.fromJson(data));
2322 }
2323
2324 }
2325
2326
2327 /** Not documented yet. */
2328 class PropertiesResourceApi {
2329 final common_internal.ApiRequester _requester;
2330
2331 PropertiesResourceApi(common_internal.ApiRequester client) :
2332 _requester = client;
2333
2334 /**
2335 * Deletes a property.
2336 *
2337 * Request parameters:
2338 *
2339 * [fileId] - The ID of the file.
2340 *
2341 * [propertyKey] - The key of the property.
2342 *
2343 * [visibility] - The visibility of the property.
2344 *
2345 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2346 * error.
2347 *
2348 * If the used [http.Client] completes with an error when making a REST call,
2349 * this method will complete with the same error.
2350 */
2351 async.Future delete(core.String fileId, core.String propertyKey, {core.String visibility}) {
2352 var _url = null;
2353 var _queryParams = new core.Map();
2354 var _uploadMedia = null;
2355 var _uploadOptions = null;
2356 var _downloadOptions = common.DownloadOptions.Metadata;
2357 var _body = null;
2358
2359 if (fileId == null) {
2360 throw new core.ArgumentError("Parameter fileId is required.");
2361 }
2362 if (propertyKey == null) {
2363 throw new core.ArgumentError("Parameter propertyKey is required.");
2364 }
2365 if (visibility != null) {
2366 _queryParams["visibility"] = [visibility];
2367 }
2368
2369 _downloadOptions = null;
2370
2371 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/prope rties/' + common_internal.Escaper.ecapeVariable('$propertyKey');
2372
2373 var _response = _requester.request(_url,
2374 "DELETE",
2375 body: _body,
2376 queryParams: _queryParams,
2377 uploadOptions: _uploadOptions,
2378 uploadMedia: _uploadMedia,
2379 downloadOptions: _downloadOptions);
2380 return _response.then((data) => null);
2381 }
2382
2383 /**
2384 * Gets a property by its key.
2385 *
2386 * Request parameters:
2387 *
2388 * [fileId] - The ID of the file.
2389 *
2390 * [propertyKey] - The key of the property.
2391 *
2392 * [visibility] - The visibility of the property.
2393 *
2394 * Completes with a [Property].
2395 *
2396 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2397 * error.
2398 *
2399 * If the used [http.Client] completes with an error when making a REST call,
2400 * this method will complete with the same error.
2401 */
2402 async.Future<Property> get(core.String fileId, core.String propertyKey, {core. String visibility}) {
2403 var _url = null;
2404 var _queryParams = new core.Map();
2405 var _uploadMedia = null;
2406 var _uploadOptions = null;
2407 var _downloadOptions = common.DownloadOptions.Metadata;
2408 var _body = null;
2409
2410 if (fileId == null) {
2411 throw new core.ArgumentError("Parameter fileId is required.");
2412 }
2413 if (propertyKey == null) {
2414 throw new core.ArgumentError("Parameter propertyKey is required.");
2415 }
2416 if (visibility != null) {
2417 _queryParams["visibility"] = [visibility];
2418 }
2419
2420
2421 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/prope rties/' + common_internal.Escaper.ecapeVariable('$propertyKey');
2422
2423 var _response = _requester.request(_url,
2424 "GET",
2425 body: _body,
2426 queryParams: _queryParams,
2427 uploadOptions: _uploadOptions,
2428 uploadMedia: _uploadMedia,
2429 downloadOptions: _downloadOptions);
2430 return _response.then((data) => new Property.fromJson(data));
2431 }
2432
2433 /**
2434 * Adds a property to a file.
2435 *
2436 * [request] - The metadata request object.
2437 *
2438 * Request parameters:
2439 *
2440 * [fileId] - The ID of the file.
2441 *
2442 * Completes with a [Property].
2443 *
2444 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2445 * error.
2446 *
2447 * If the used [http.Client] completes with an error when making a REST call,
2448 * this method will complete with the same error.
2449 */
2450 async.Future<Property> insert(Property request, core.String fileId) {
2451 var _url = null;
2452 var _queryParams = new core.Map();
2453 var _uploadMedia = null;
2454 var _uploadOptions = null;
2455 var _downloadOptions = common.DownloadOptions.Metadata;
2456 var _body = null;
2457
2458 if (request != null) {
2459 _body = convert_1.JSON.encode((request).toJson());
2460 }
2461 if (fileId == null) {
2462 throw new core.ArgumentError("Parameter fileId is required.");
2463 }
2464
2465
2466 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/prope rties';
2467
2468 var _response = _requester.request(_url,
2469 "POST",
2470 body: _body,
2471 queryParams: _queryParams,
2472 uploadOptions: _uploadOptions,
2473 uploadMedia: _uploadMedia,
2474 downloadOptions: _downloadOptions);
2475 return _response.then((data) => new Property.fromJson(data));
2476 }
2477
2478 /**
2479 * Lists a file's properties.
2480 *
2481 * Request parameters:
2482 *
2483 * [fileId] - The ID of the file.
2484 *
2485 * Completes with a [PropertyList].
2486 *
2487 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2488 * error.
2489 *
2490 * If the used [http.Client] completes with an error when making a REST call,
2491 * this method will complete with the same error.
2492 */
2493 async.Future<PropertyList> list(core.String fileId) {
2494 var _url = null;
2495 var _queryParams = new core.Map();
2496 var _uploadMedia = null;
2497 var _uploadOptions = null;
2498 var _downloadOptions = common.DownloadOptions.Metadata;
2499 var _body = null;
2500
2501 if (fileId == null) {
2502 throw new core.ArgumentError("Parameter fileId is required.");
2503 }
2504
2505
2506 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/prope rties';
2507
2508 var _response = _requester.request(_url,
2509 "GET",
2510 body: _body,
2511 queryParams: _queryParams,
2512 uploadOptions: _uploadOptions,
2513 uploadMedia: _uploadMedia,
2514 downloadOptions: _downloadOptions);
2515 return _response.then((data) => new PropertyList.fromJson(data));
2516 }
2517
2518 /**
2519 * Updates a property. This method supports patch semantics.
2520 *
2521 * [request] - The metadata request object.
2522 *
2523 * Request parameters:
2524 *
2525 * [fileId] - The ID of the file.
2526 *
2527 * [propertyKey] - The key of the property.
2528 *
2529 * [visibility] - The visibility of the property.
2530 *
2531 * Completes with a [Property].
2532 *
2533 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2534 * error.
2535 *
2536 * If the used [http.Client] completes with an error when making a REST call,
2537 * this method will complete with the same error.
2538 */
2539 async.Future<Property> patch(Property request, core.String fileId, core.String propertyKey, {core.String visibility}) {
2540 var _url = null;
2541 var _queryParams = new core.Map();
2542 var _uploadMedia = null;
2543 var _uploadOptions = null;
2544 var _downloadOptions = common.DownloadOptions.Metadata;
2545 var _body = null;
2546
2547 if (request != null) {
2548 _body = convert_1.JSON.encode((request).toJson());
2549 }
2550 if (fileId == null) {
2551 throw new core.ArgumentError("Parameter fileId is required.");
2552 }
2553 if (propertyKey == null) {
2554 throw new core.ArgumentError("Parameter propertyKey is required.");
2555 }
2556 if (visibility != null) {
2557 _queryParams["visibility"] = [visibility];
2558 }
2559
2560
2561 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/prope rties/' + common_internal.Escaper.ecapeVariable('$propertyKey');
2562
2563 var _response = _requester.request(_url,
2564 "PATCH",
2565 body: _body,
2566 queryParams: _queryParams,
2567 uploadOptions: _uploadOptions,
2568 uploadMedia: _uploadMedia,
2569 downloadOptions: _downloadOptions);
2570 return _response.then((data) => new Property.fromJson(data));
2571 }
2572
2573 /**
2574 * Updates a property.
2575 *
2576 * [request] - The metadata request object.
2577 *
2578 * Request parameters:
2579 *
2580 * [fileId] - The ID of the file.
2581 *
2582 * [propertyKey] - The key of the property.
2583 *
2584 * [visibility] - The visibility of the property.
2585 *
2586 * Completes with a [Property].
2587 *
2588 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2589 * error.
2590 *
2591 * If the used [http.Client] completes with an error when making a REST call,
2592 * this method will complete with the same error.
2593 */
2594 async.Future<Property> update(Property request, core.String fileId, core.Strin g propertyKey, {core.String visibility}) {
2595 var _url = null;
2596 var _queryParams = new core.Map();
2597 var _uploadMedia = null;
2598 var _uploadOptions = null;
2599 var _downloadOptions = common.DownloadOptions.Metadata;
2600 var _body = null;
2601
2602 if (request != null) {
2603 _body = convert_1.JSON.encode((request).toJson());
2604 }
2605 if (fileId == null) {
2606 throw new core.ArgumentError("Parameter fileId is required.");
2607 }
2608 if (propertyKey == null) {
2609 throw new core.ArgumentError("Parameter propertyKey is required.");
2610 }
2611 if (visibility != null) {
2612 _queryParams["visibility"] = [visibility];
2613 }
2614
2615
2616 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/prope rties/' + common_internal.Escaper.ecapeVariable('$propertyKey');
2617
2618 var _response = _requester.request(_url,
2619 "PUT",
2620 body: _body,
2621 queryParams: _queryParams,
2622 uploadOptions: _uploadOptions,
2623 uploadMedia: _uploadMedia,
2624 downloadOptions: _downloadOptions);
2625 return _response.then((data) => new Property.fromJson(data));
2626 }
2627
2628 }
2629
2630
2631 /** Not documented yet. */
2632 class RealtimeResourceApi {
2633 final common_internal.ApiRequester _requester;
2634
2635 RealtimeResourceApi(common_internal.ApiRequester client) :
2636 _requester = client;
2637
2638 /**
2639 * Exports the contents of the Realtime API data model associated with this
2640 * file as JSON.
2641 *
2642 * Request parameters:
2643 *
2644 * [fileId] - The ID of the file that the Realtime API data model is
2645 * associated with.
2646 *
2647 * [revision] - The revision of the Realtime API data model to export.
2648 * Revisions start at 1 (the initial empty data model) and are incremented
2649 * with each change. If this parameter is excluded, the most recent data model
2650 * will be returned.
2651 *
2652 * [downloadOptions] - Options for downloading. A download can be either a
2653 * Metadata (default) or Media download. Partial Media downloads are possible
2654 * as well.
2655 *
2656 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2657 * error.
2658 *
2659 * If the used [http.Client] completes with an error when making a REST call,
2660 * this method will complete with the same error.
2661 */
2662 async.Future get(core.String fileId, {core.int revision, common.DownloadOption s downloadOptions: common.DownloadOptions.Metadata}) {
2663 var _url = null;
2664 var _queryParams = new core.Map();
2665 var _uploadMedia = null;
2666 var _uploadOptions = null;
2667 var _downloadOptions = common.DownloadOptions.Metadata;
2668 var _body = null;
2669
2670 if (fileId == null) {
2671 throw new core.ArgumentError("Parameter fileId is required.");
2672 }
2673 if (revision != null) {
2674 _queryParams["revision"] = ["${revision}"];
2675 }
2676
2677 _downloadOptions = downloadOptions;
2678
2679 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/realt ime';
2680
2681 var _response = _requester.request(_url,
2682 "GET",
2683 body: _body,
2684 queryParams: _queryParams,
2685 uploadOptions: _uploadOptions,
2686 uploadMedia: _uploadMedia,
2687 downloadOptions: _downloadOptions);
2688 if (_downloadOptions == null ||
2689 _downloadOptions == common.DownloadOptions.Metadata) {
2690 return _response.then((data) => null);
2691 } else {
2692 return _response;
2693 }
2694 }
2695
2696 /**
2697 * Overwrites the Realtime API data model associated with this file with the
2698 * provided JSON data model.
2699 *
2700 * Request parameters:
2701 *
2702 * [fileId] - The ID of the file that the Realtime API data model is
2703 * associated with.
2704 *
2705 * [baseRevision] - The revision of the model to diff the uploaded model
2706 * against. If set, the uploaded model is diffed against the provided revision
2707 * and those differences are merged with any changes made to the model after
2708 * the provided revision. If not set, the uploaded model replaces the current
2709 * model on the server.
2710 *
2711 * [uploadMedia] - The media to upload.
2712 *
2713 * [uploadOptions] - Options for the media upload. Streaming Media without the
2714 * length being known ahead of time is only supported via resumable uploads.
2715 *
2716 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2717 * error.
2718 *
2719 * If the used [http.Client] completes with an error when making a REST call,
2720 * this method will complete with the same error.
2721 */
2722 async.Future update(core.String fileId, {core.String baseRevision, common.Uplo adOptions uploadOptions : common.UploadOptions.Default, common.Media uploadMedia }) {
2723 var _url = null;
2724 var _queryParams = new core.Map();
2725 var _uploadMedia = null;
2726 var _uploadOptions = null;
2727 var _downloadOptions = common.DownloadOptions.Metadata;
2728 var _body = null;
2729
2730 if (fileId == null) {
2731 throw new core.ArgumentError("Parameter fileId is required.");
2732 }
2733 if (baseRevision != null) {
2734 _queryParams["baseRevision"] = [baseRevision];
2735 }
2736
2737 _uploadMedia = uploadMedia;
2738 _uploadOptions = uploadOptions;
2739 _downloadOptions = null;
2740
2741 if (_uploadMedia == null) {
2742 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/rea ltime';
2743 } else if (_uploadOptions is common.ResumableUploadOptions) {
2744 _url = '/resumable/upload/drive/v2/files/' + common_internal.Escaper.ecape Variable('$fileId') + '/realtime';
2745 } else {
2746 _url = '/upload/drive/v2/files/' + common_internal.Escaper.ecapeVariable(' $fileId') + '/realtime';
2747 }
2748
2749
2750 var _response = _requester.request(_url,
2751 "PUT",
2752 body: _body,
2753 queryParams: _queryParams,
2754 uploadOptions: _uploadOptions,
2755 uploadMedia: _uploadMedia,
2756 downloadOptions: _downloadOptions);
2757 return _response.then((data) => null);
2758 }
2759
2760 }
2761
2762
2763 /** Not documented yet. */
2764 class RepliesResourceApi {
2765 final common_internal.ApiRequester _requester;
2766
2767 RepliesResourceApi(common_internal.ApiRequester client) :
2768 _requester = client;
2769
2770 /**
2771 * Deletes a reply.
2772 *
2773 * Request parameters:
2774 *
2775 * [fileId] - The ID of the file.
2776 *
2777 * [commentId] - The ID of the comment.
2778 *
2779 * [replyId] - The ID of the reply.
2780 *
2781 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2782 * error.
2783 *
2784 * If the used [http.Client] completes with an error when making a REST call,
2785 * this method will complete with the same error.
2786 */
2787 async.Future delete(core.String fileId, core.String commentId, core.String rep lyId) {
2788 var _url = null;
2789 var _queryParams = new core.Map();
2790 var _uploadMedia = null;
2791 var _uploadOptions = null;
2792 var _downloadOptions = common.DownloadOptions.Metadata;
2793 var _body = null;
2794
2795 if (fileId == null) {
2796 throw new core.ArgumentError("Parameter fileId is required.");
2797 }
2798 if (commentId == null) {
2799 throw new core.ArgumentError("Parameter commentId is required.");
2800 }
2801 if (replyId == null) {
2802 throw new core.ArgumentError("Parameter replyId is required.");
2803 }
2804
2805 _downloadOptions = null;
2806
2807 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts/' + common_internal.Escaper.ecapeVariable('$commentId') + '/replies/' + comm on_internal.Escaper.ecapeVariable('$replyId');
2808
2809 var _response = _requester.request(_url,
2810 "DELETE",
2811 body: _body,
2812 queryParams: _queryParams,
2813 uploadOptions: _uploadOptions,
2814 uploadMedia: _uploadMedia,
2815 downloadOptions: _downloadOptions);
2816 return _response.then((data) => null);
2817 }
2818
2819 /**
2820 * Gets a reply.
2821 *
2822 * Request parameters:
2823 *
2824 * [fileId] - The ID of the file.
2825 *
2826 * [commentId] - The ID of the comment.
2827 *
2828 * [replyId] - The ID of the reply.
2829 *
2830 * [includeDeleted] - If set, this will succeed when retrieving a deleted
2831 * reply.
2832 *
2833 * Completes with a [CommentReply].
2834 *
2835 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2836 * error.
2837 *
2838 * If the used [http.Client] completes with an error when making a REST call,
2839 * this method will complete with the same error.
2840 */
2841 async.Future<CommentReply> get(core.String fileId, core.String commentId, core .String replyId, {core.bool includeDeleted}) {
2842 var _url = null;
2843 var _queryParams = new core.Map();
2844 var _uploadMedia = null;
2845 var _uploadOptions = null;
2846 var _downloadOptions = common.DownloadOptions.Metadata;
2847 var _body = null;
2848
2849 if (fileId == null) {
2850 throw new core.ArgumentError("Parameter fileId is required.");
2851 }
2852 if (commentId == null) {
2853 throw new core.ArgumentError("Parameter commentId is required.");
2854 }
2855 if (replyId == null) {
2856 throw new core.ArgumentError("Parameter replyId is required.");
2857 }
2858 if (includeDeleted != null) {
2859 _queryParams["includeDeleted"] = ["${includeDeleted}"];
2860 }
2861
2862
2863 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts/' + common_internal.Escaper.ecapeVariable('$commentId') + '/replies/' + comm on_internal.Escaper.ecapeVariable('$replyId');
2864
2865 var _response = _requester.request(_url,
2866 "GET",
2867 body: _body,
2868 queryParams: _queryParams,
2869 uploadOptions: _uploadOptions,
2870 uploadMedia: _uploadMedia,
2871 downloadOptions: _downloadOptions);
2872 return _response.then((data) => new CommentReply.fromJson(data));
2873 }
2874
2875 /**
2876 * Creates a new reply to the given comment.
2877 *
2878 * [request] - The metadata request object.
2879 *
2880 * Request parameters:
2881 *
2882 * [fileId] - The ID of the file.
2883 *
2884 * [commentId] - The ID of the comment.
2885 *
2886 * Completes with a [CommentReply].
2887 *
2888 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2889 * error.
2890 *
2891 * If the used [http.Client] completes with an error when making a REST call,
2892 * this method will complete with the same error.
2893 */
2894 async.Future<CommentReply> insert(CommentReply request, core.String fileId, co re.String commentId) {
2895 var _url = null;
2896 var _queryParams = new core.Map();
2897 var _uploadMedia = null;
2898 var _uploadOptions = null;
2899 var _downloadOptions = common.DownloadOptions.Metadata;
2900 var _body = null;
2901
2902 if (request != null) {
2903 _body = convert_1.JSON.encode((request).toJson());
2904 }
2905 if (fileId == null) {
2906 throw new core.ArgumentError("Parameter fileId is required.");
2907 }
2908 if (commentId == null) {
2909 throw new core.ArgumentError("Parameter commentId is required.");
2910 }
2911
2912
2913 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts/' + common_internal.Escaper.ecapeVariable('$commentId') + '/replies';
2914
2915 var _response = _requester.request(_url,
2916 "POST",
2917 body: _body,
2918 queryParams: _queryParams,
2919 uploadOptions: _uploadOptions,
2920 uploadMedia: _uploadMedia,
2921 downloadOptions: _downloadOptions);
2922 return _response.then((data) => new CommentReply.fromJson(data));
2923 }
2924
2925 /**
2926 * Lists all of the replies to a comment.
2927 *
2928 * Request parameters:
2929 *
2930 * [fileId] - The ID of the file.
2931 *
2932 * [commentId] - The ID of the comment.
2933 *
2934 * [includeDeleted] - If set, all replies, including deleted replies (with
2935 * content stripped) will be returned.
2936 *
2937 * [maxResults] - The maximum number of replies to include in the response,
2938 * used for paging.
2939 * Value must be between "0" and "100".
2940 *
2941 * [pageToken] - The continuation token, used to page through large result
2942 * sets. To get the next page of results, set this parameter to the value of
2943 * "nextPageToken" from the previous response.
2944 *
2945 * Completes with a [CommentReplyList].
2946 *
2947 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2948 * error.
2949 *
2950 * If the used [http.Client] completes with an error when making a REST call,
2951 * this method will complete with the same error.
2952 */
2953 async.Future<CommentReplyList> list(core.String fileId, core.String commentId, {core.bool includeDeleted, core.int maxResults, core.String pageToken}) {
2954 var _url = null;
2955 var _queryParams = new core.Map();
2956 var _uploadMedia = null;
2957 var _uploadOptions = null;
2958 var _downloadOptions = common.DownloadOptions.Metadata;
2959 var _body = null;
2960
2961 if (fileId == null) {
2962 throw new core.ArgumentError("Parameter fileId is required.");
2963 }
2964 if (commentId == null) {
2965 throw new core.ArgumentError("Parameter commentId is required.");
2966 }
2967 if (includeDeleted != null) {
2968 _queryParams["includeDeleted"] = ["${includeDeleted}"];
2969 }
2970 if (maxResults != null) {
2971 _queryParams["maxResults"] = ["${maxResults}"];
2972 }
2973 if (pageToken != null) {
2974 _queryParams["pageToken"] = [pageToken];
2975 }
2976
2977
2978 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts/' + common_internal.Escaper.ecapeVariable('$commentId') + '/replies';
2979
2980 var _response = _requester.request(_url,
2981 "GET",
2982 body: _body,
2983 queryParams: _queryParams,
2984 uploadOptions: _uploadOptions,
2985 uploadMedia: _uploadMedia,
2986 downloadOptions: _downloadOptions);
2987 return _response.then((data) => new CommentReplyList.fromJson(data));
2988 }
2989
2990 /**
2991 * Updates an existing reply. This method supports patch semantics.
2992 *
2993 * [request] - The metadata request object.
2994 *
2995 * Request parameters:
2996 *
2997 * [fileId] - The ID of the file.
2998 *
2999 * [commentId] - The ID of the comment.
3000 *
3001 * [replyId] - The ID of the reply.
3002 *
3003 * Completes with a [CommentReply].
3004 *
3005 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3006 * error.
3007 *
3008 * If the used [http.Client] completes with an error when making a REST call,
3009 * this method will complete with the same error.
3010 */
3011 async.Future<CommentReply> patch(CommentReply request, core.String fileId, cor e.String commentId, core.String replyId) {
3012 var _url = null;
3013 var _queryParams = new core.Map();
3014 var _uploadMedia = null;
3015 var _uploadOptions = null;
3016 var _downloadOptions = common.DownloadOptions.Metadata;
3017 var _body = null;
3018
3019 if (request != null) {
3020 _body = convert_1.JSON.encode((request).toJson());
3021 }
3022 if (fileId == null) {
3023 throw new core.ArgumentError("Parameter fileId is required.");
3024 }
3025 if (commentId == null) {
3026 throw new core.ArgumentError("Parameter commentId is required.");
3027 }
3028 if (replyId == null) {
3029 throw new core.ArgumentError("Parameter replyId is required.");
3030 }
3031
3032
3033 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts/' + common_internal.Escaper.ecapeVariable('$commentId') + '/replies/' + comm on_internal.Escaper.ecapeVariable('$replyId');
3034
3035 var _response = _requester.request(_url,
3036 "PATCH",
3037 body: _body,
3038 queryParams: _queryParams,
3039 uploadOptions: _uploadOptions,
3040 uploadMedia: _uploadMedia,
3041 downloadOptions: _downloadOptions);
3042 return _response.then((data) => new CommentReply.fromJson(data));
3043 }
3044
3045 /**
3046 * Updates an existing reply.
3047 *
3048 * [request] - The metadata request object.
3049 *
3050 * Request parameters:
3051 *
3052 * [fileId] - The ID of the file.
3053 *
3054 * [commentId] - The ID of the comment.
3055 *
3056 * [replyId] - The ID of the reply.
3057 *
3058 * Completes with a [CommentReply].
3059 *
3060 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3061 * error.
3062 *
3063 * If the used [http.Client] completes with an error when making a REST call,
3064 * this method will complete with the same error.
3065 */
3066 async.Future<CommentReply> update(CommentReply request, core.String fileId, co re.String commentId, core.String replyId) {
3067 var _url = null;
3068 var _queryParams = new core.Map();
3069 var _uploadMedia = null;
3070 var _uploadOptions = null;
3071 var _downloadOptions = common.DownloadOptions.Metadata;
3072 var _body = null;
3073
3074 if (request != null) {
3075 _body = convert_1.JSON.encode((request).toJson());
3076 }
3077 if (fileId == null) {
3078 throw new core.ArgumentError("Parameter fileId is required.");
3079 }
3080 if (commentId == null) {
3081 throw new core.ArgumentError("Parameter commentId is required.");
3082 }
3083 if (replyId == null) {
3084 throw new core.ArgumentError("Parameter replyId is required.");
3085 }
3086
3087
3088 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/comme nts/' + common_internal.Escaper.ecapeVariable('$commentId') + '/replies/' + comm on_internal.Escaper.ecapeVariable('$replyId');
3089
3090 var _response = _requester.request(_url,
3091 "PUT",
3092 body: _body,
3093 queryParams: _queryParams,
3094 uploadOptions: _uploadOptions,
3095 uploadMedia: _uploadMedia,
3096 downloadOptions: _downloadOptions);
3097 return _response.then((data) => new CommentReply.fromJson(data));
3098 }
3099
3100 }
3101
3102
3103 /** Not documented yet. */
3104 class RevisionsResourceApi {
3105 final common_internal.ApiRequester _requester;
3106
3107 RevisionsResourceApi(common_internal.ApiRequester client) :
3108 _requester = client;
3109
3110 /**
3111 * Removes a revision.
3112 *
3113 * Request parameters:
3114 *
3115 * [fileId] - The ID of the file.
3116 *
3117 * [revisionId] - The ID of the revision.
3118 *
3119 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3120 * error.
3121 *
3122 * If the used [http.Client] completes with an error when making a REST call,
3123 * this method will complete with the same error.
3124 */
3125 async.Future delete(core.String fileId, core.String revisionId) {
3126 var _url = null;
3127 var _queryParams = new core.Map();
3128 var _uploadMedia = null;
3129 var _uploadOptions = null;
3130 var _downloadOptions = common.DownloadOptions.Metadata;
3131 var _body = null;
3132
3133 if (fileId == null) {
3134 throw new core.ArgumentError("Parameter fileId is required.");
3135 }
3136 if (revisionId == null) {
3137 throw new core.ArgumentError("Parameter revisionId is required.");
3138 }
3139
3140 _downloadOptions = null;
3141
3142 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/revis ions/' + common_internal.Escaper.ecapeVariable('$revisionId');
3143
3144 var _response = _requester.request(_url,
3145 "DELETE",
3146 body: _body,
3147 queryParams: _queryParams,
3148 uploadOptions: _uploadOptions,
3149 uploadMedia: _uploadMedia,
3150 downloadOptions: _downloadOptions);
3151 return _response.then((data) => null);
3152 }
3153
3154 /**
3155 * Gets a specific revision.
3156 *
3157 * Request parameters:
3158 *
3159 * [fileId] - The ID of the file.
3160 *
3161 * [revisionId] - The ID of the revision.
3162 *
3163 * Completes with a [Revision].
3164 *
3165 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3166 * error.
3167 *
3168 * If the used [http.Client] completes with an error when making a REST call,
3169 * this method will complete with the same error.
3170 */
3171 async.Future<Revision> get(core.String fileId, core.String revisionId) {
3172 var _url = null;
3173 var _queryParams = new core.Map();
3174 var _uploadMedia = null;
3175 var _uploadOptions = null;
3176 var _downloadOptions = common.DownloadOptions.Metadata;
3177 var _body = null;
3178
3179 if (fileId == null) {
3180 throw new core.ArgumentError("Parameter fileId is required.");
3181 }
3182 if (revisionId == null) {
3183 throw new core.ArgumentError("Parameter revisionId is required.");
3184 }
3185
3186
3187 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/revis ions/' + common_internal.Escaper.ecapeVariable('$revisionId');
3188
3189 var _response = _requester.request(_url,
3190 "GET",
3191 body: _body,
3192 queryParams: _queryParams,
3193 uploadOptions: _uploadOptions,
3194 uploadMedia: _uploadMedia,
3195 downloadOptions: _downloadOptions);
3196 return _response.then((data) => new Revision.fromJson(data));
3197 }
3198
3199 /**
3200 * Lists a file's revisions.
3201 *
3202 * Request parameters:
3203 *
3204 * [fileId] - The ID of the file.
3205 *
3206 * Completes with a [RevisionList].
3207 *
3208 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3209 * error.
3210 *
3211 * If the used [http.Client] completes with an error when making a REST call,
3212 * this method will complete with the same error.
3213 */
3214 async.Future<RevisionList> list(core.String fileId) {
3215 var _url = null;
3216 var _queryParams = new core.Map();
3217 var _uploadMedia = null;
3218 var _uploadOptions = null;
3219 var _downloadOptions = common.DownloadOptions.Metadata;
3220 var _body = null;
3221
3222 if (fileId == null) {
3223 throw new core.ArgumentError("Parameter fileId is required.");
3224 }
3225
3226
3227 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/revis ions';
3228
3229 var _response = _requester.request(_url,
3230 "GET",
3231 body: _body,
3232 queryParams: _queryParams,
3233 uploadOptions: _uploadOptions,
3234 uploadMedia: _uploadMedia,
3235 downloadOptions: _downloadOptions);
3236 return _response.then((data) => new RevisionList.fromJson(data));
3237 }
3238
3239 /**
3240 * Updates a revision. This method supports patch semantics.
3241 *
3242 * [request] - The metadata request object.
3243 *
3244 * Request parameters:
3245 *
3246 * [fileId] - The ID for the file.
3247 *
3248 * [revisionId] - The ID for the revision.
3249 *
3250 * Completes with a [Revision].
3251 *
3252 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3253 * error.
3254 *
3255 * If the used [http.Client] completes with an error when making a REST call,
3256 * this method will complete with the same error.
3257 */
3258 async.Future<Revision> patch(Revision request, core.String fileId, core.String revisionId) {
3259 var _url = null;
3260 var _queryParams = new core.Map();
3261 var _uploadMedia = null;
3262 var _uploadOptions = null;
3263 var _downloadOptions = common.DownloadOptions.Metadata;
3264 var _body = null;
3265
3266 if (request != null) {
3267 _body = convert_1.JSON.encode((request).toJson());
3268 }
3269 if (fileId == null) {
3270 throw new core.ArgumentError("Parameter fileId is required.");
3271 }
3272 if (revisionId == null) {
3273 throw new core.ArgumentError("Parameter revisionId is required.");
3274 }
3275
3276
3277 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/revis ions/' + common_internal.Escaper.ecapeVariable('$revisionId');
3278
3279 var _response = _requester.request(_url,
3280 "PATCH",
3281 body: _body,
3282 queryParams: _queryParams,
3283 uploadOptions: _uploadOptions,
3284 uploadMedia: _uploadMedia,
3285 downloadOptions: _downloadOptions);
3286 return _response.then((data) => new Revision.fromJson(data));
3287 }
3288
3289 /**
3290 * Updates a revision.
3291 *
3292 * [request] - The metadata request object.
3293 *
3294 * Request parameters:
3295 *
3296 * [fileId] - The ID for the file.
3297 *
3298 * [revisionId] - The ID for the revision.
3299 *
3300 * Completes with a [Revision].
3301 *
3302 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3303 * error.
3304 *
3305 * If the used [http.Client] completes with an error when making a REST call,
3306 * this method will complete with the same error.
3307 */
3308 async.Future<Revision> update(Revision request, core.String fileId, core.Strin g revisionId) {
3309 var _url = null;
3310 var _queryParams = new core.Map();
3311 var _uploadMedia = null;
3312 var _uploadOptions = null;
3313 var _downloadOptions = common.DownloadOptions.Metadata;
3314 var _body = null;
3315
3316 if (request != null) {
3317 _body = convert_1.JSON.encode((request).toJson());
3318 }
3319 if (fileId == null) {
3320 throw new core.ArgumentError("Parameter fileId is required.");
3321 }
3322 if (revisionId == null) {
3323 throw new core.ArgumentError("Parameter revisionId is required.");
3324 }
3325
3326
3327 _url = 'files/' + common_internal.Escaper.ecapeVariable('$fileId') + '/revis ions/' + common_internal.Escaper.ecapeVariable('$revisionId');
3328
3329 var _response = _requester.request(_url,
3330 "PUT",
3331 body: _body,
3332 queryParams: _queryParams,
3333 uploadOptions: _uploadOptions,
3334 uploadMedia: _uploadMedia,
3335 downloadOptions: _downloadOptions);
3336 return _response.then((data) => new Revision.fromJson(data));
3337 }
3338
3339 }
3340
3341
3342
3343 /** Not documented yet. */
3344 class AboutAdditionalRoleInfoRoleSets {
3345 /** The supported additional roles with the primary role. */
3346 core.List<core.String> additionalRoles;
3347
3348 /** A primary permission role. */
3349 core.String primaryRole;
3350
3351
3352 AboutAdditionalRoleInfoRoleSets();
3353
3354 AboutAdditionalRoleInfoRoleSets.fromJson(core.Map _json) {
3355 if (_json.containsKey("additionalRoles")) {
3356 additionalRoles = _json["additionalRoles"];
3357 }
3358 if (_json.containsKey("primaryRole")) {
3359 primaryRole = _json["primaryRole"];
3360 }
3361 }
3362
3363 core.Map toJson() {
3364 var _json = new core.Map();
3365 if (additionalRoles != null) {
3366 _json["additionalRoles"] = additionalRoles;
3367 }
3368 if (primaryRole != null) {
3369 _json["primaryRole"] = primaryRole;
3370 }
3371 return _json;
3372 }
3373 }
3374
3375
3376 /** Not documented yet. */
3377 class AboutAdditionalRoleInfo {
3378 /** The supported additional roles per primary role. */
3379 core.List<AboutAdditionalRoleInfoRoleSets> roleSets;
3380
3381 /** The content type that this additional role info applies to. */
3382 core.String type;
3383
3384
3385 AboutAdditionalRoleInfo();
3386
3387 AboutAdditionalRoleInfo.fromJson(core.Map _json) {
3388 if (_json.containsKey("roleSets")) {
3389 roleSets = _json["roleSets"].map((value) => new AboutAdditionalRoleInfoRol eSets.fromJson(value)).toList();
3390 }
3391 if (_json.containsKey("type")) {
3392 type = _json["type"];
3393 }
3394 }
3395
3396 core.Map toJson() {
3397 var _json = new core.Map();
3398 if (roleSets != null) {
3399 _json["roleSets"] = roleSets.map((value) => (value).toJson()).toList();
3400 }
3401 if (type != null) {
3402 _json["type"] = type;
3403 }
3404 return _json;
3405 }
3406 }
3407
3408
3409 /** Not documented yet. */
3410 class AboutExportFormats {
3411 /** The content type to convert from. */
3412 core.String source;
3413
3414 /** The possible content types to convert to. */
3415 core.List<core.String> targets;
3416
3417
3418 AboutExportFormats();
3419
3420 AboutExportFormats.fromJson(core.Map _json) {
3421 if (_json.containsKey("source")) {
3422 source = _json["source"];
3423 }
3424 if (_json.containsKey("targets")) {
3425 targets = _json["targets"];
3426 }
3427 }
3428
3429 core.Map toJson() {
3430 var _json = new core.Map();
3431 if (source != null) {
3432 _json["source"] = source;
3433 }
3434 if (targets != null) {
3435 _json["targets"] = targets;
3436 }
3437 return _json;
3438 }
3439 }
3440
3441
3442 /** Not documented yet. */
3443 class AboutFeatures {
3444 /** The name of the feature. */
3445 core.String featureName;
3446
3447 /** The request limit rate for this feature, in queries per second. */
3448 core.double featureRate;
3449
3450
3451 AboutFeatures();
3452
3453 AboutFeatures.fromJson(core.Map _json) {
3454 if (_json.containsKey("featureName")) {
3455 featureName = _json["featureName"];
3456 }
3457 if (_json.containsKey("featureRate")) {
3458 featureRate = _json["featureRate"];
3459 }
3460 }
3461
3462 core.Map toJson() {
3463 var _json = new core.Map();
3464 if (featureName != null) {
3465 _json["featureName"] = featureName;
3466 }
3467 if (featureRate != null) {
3468 _json["featureRate"] = featureRate;
3469 }
3470 return _json;
3471 }
3472 }
3473
3474
3475 /** Not documented yet. */
3476 class AboutImportFormats {
3477 /** The imported file's content type to convert from. */
3478 core.String source;
3479
3480 /** The possible content types to convert to. */
3481 core.List<core.String> targets;
3482
3483
3484 AboutImportFormats();
3485
3486 AboutImportFormats.fromJson(core.Map _json) {
3487 if (_json.containsKey("source")) {
3488 source = _json["source"];
3489 }
3490 if (_json.containsKey("targets")) {
3491 targets = _json["targets"];
3492 }
3493 }
3494
3495 core.Map toJson() {
3496 var _json = new core.Map();
3497 if (source != null) {
3498 _json["source"] = source;
3499 }
3500 if (targets != null) {
3501 _json["targets"] = targets;
3502 }
3503 return _json;
3504 }
3505 }
3506
3507
3508 /** Not documented yet. */
3509 class AboutMaxUploadSizes {
3510 /** The max upload size for this type. */
3511 core.String size;
3512
3513 /** The file type. */
3514 core.String type;
3515
3516
3517 AboutMaxUploadSizes();
3518
3519 AboutMaxUploadSizes.fromJson(core.Map _json) {
3520 if (_json.containsKey("size")) {
3521 size = _json["size"];
3522 }
3523 if (_json.containsKey("type")) {
3524 type = _json["type"];
3525 }
3526 }
3527
3528 core.Map toJson() {
3529 var _json = new core.Map();
3530 if (size != null) {
3531 _json["size"] = size;
3532 }
3533 if (type != null) {
3534 _json["type"] = type;
3535 }
3536 return _json;
3537 }
3538 }
3539
3540
3541 /** Not documented yet. */
3542 class AboutQuotaBytesByService {
3543 /** The storage quota bytes used by the service. */
3544 core.String bytesUsed;
3545
3546 /** The service's name, e.g. DRIVE, GMAIL, or PHOTOS. */
3547 core.String serviceName;
3548
3549
3550 AboutQuotaBytesByService();
3551
3552 AboutQuotaBytesByService.fromJson(core.Map _json) {
3553 if (_json.containsKey("bytesUsed")) {
3554 bytesUsed = _json["bytesUsed"];
3555 }
3556 if (_json.containsKey("serviceName")) {
3557 serviceName = _json["serviceName"];
3558 }
3559 }
3560
3561 core.Map toJson() {
3562 var _json = new core.Map();
3563 if (bytesUsed != null) {
3564 _json["bytesUsed"] = bytesUsed;
3565 }
3566 if (serviceName != null) {
3567 _json["serviceName"] = serviceName;
3568 }
3569 return _json;
3570 }
3571 }
3572
3573
3574 /** An item with user information and settings. */
3575 class About {
3576 /**
3577 * Information about supported additional roles per file type. The most
3578 * specific type takes precedence.
3579 */
3580 core.List<AboutAdditionalRoleInfo> additionalRoleInfo;
3581
3582 /** The domain sharing policy for the current user. */
3583 core.String domainSharingPolicy;
3584
3585 /** The ETag of the item. */
3586 core.String etag;
3587
3588 /** The allowable export formats. */
3589 core.List<AboutExportFormats> exportFormats;
3590
3591 /** List of additional features enabled on this account. */
3592 core.List<AboutFeatures> features;
3593
3594 /** The allowable import formats. */
3595 core.List<AboutImportFormats> importFormats;
3596
3597 /**
3598 * A boolean indicating whether the authenticated app is installed by the
3599 * authenticated user.
3600 */
3601 core.bool isCurrentAppInstalled;
3602
3603 /** This is always drive#about. */
3604 core.String kind;
3605
3606 /**
3607 * The user's language or locale code, as defined by BCP 47, with some
3608 * extensions from Unicode's LDML format
3609 * (http://www.unicode.org/reports/tr35/).
3610 */
3611 core.String languageCode;
3612
3613 /** The largest change id. */
3614 core.String largestChangeId;
3615
3616 /**
3617 * List of max upload sizes for each file type. The most specific type takes
3618 * precedence.
3619 */
3620 core.List<AboutMaxUploadSizes> maxUploadSizes;
3621
3622 /** The name of the current user. */
3623 core.String name;
3624
3625 /** The current user's ID as visible in the permissions collection. */
3626 core.String permissionId;
3627
3628 /** The amount of storage quota used by different Google services. */
3629 core.List<AboutQuotaBytesByService> quotaBytesByService;
3630
3631 /** The total number of quota bytes. */
3632 core.String quotaBytesTotal;
3633
3634 /** The number of quota bytes used by Google Drive. */
3635 core.String quotaBytesUsed;
3636
3637 /**
3638 * The number of quota bytes used by all Google apps (Drive, Picasa, etc.).
3639 */
3640 core.String quotaBytesUsedAggregate;
3641
3642 /** The number of quota bytes used by trashed items. */
3643 core.String quotaBytesUsedInTrash;
3644
3645 /**
3646 * The type of the user's storage quota. Possible values are:
3647 * - LIMITED
3648 * - UNLIMITED
3649 */
3650 core.String quotaType;
3651
3652 /** The number of remaining change ids. */
3653 core.String remainingChangeIds;
3654
3655 /** The id of the root folder. */
3656 core.String rootFolderId;
3657
3658 /** A link back to this item. */
3659 core.String selfLink;
3660
3661 /** The authenticated user. */
3662 User user;
3663
3664
3665 About();
3666
3667 About.fromJson(core.Map _json) {
3668 if (_json.containsKey("additionalRoleInfo")) {
3669 additionalRoleInfo = _json["additionalRoleInfo"].map((value) => new AboutA dditionalRoleInfo.fromJson(value)).toList();
3670 }
3671 if (_json.containsKey("domainSharingPolicy")) {
3672 domainSharingPolicy = _json["domainSharingPolicy"];
3673 }
3674 if (_json.containsKey("etag")) {
3675 etag = _json["etag"];
3676 }
3677 if (_json.containsKey("exportFormats")) {
3678 exportFormats = _json["exportFormats"].map((value) => new AboutExportForma ts.fromJson(value)).toList();
3679 }
3680 if (_json.containsKey("features")) {
3681 features = _json["features"].map((value) => new AboutFeatures.fromJson(val ue)).toList();
3682 }
3683 if (_json.containsKey("importFormats")) {
3684 importFormats = _json["importFormats"].map((value) => new AboutImportForma ts.fromJson(value)).toList();
3685 }
3686 if (_json.containsKey("isCurrentAppInstalled")) {
3687 isCurrentAppInstalled = _json["isCurrentAppInstalled"];
3688 }
3689 if (_json.containsKey("kind")) {
3690 kind = _json["kind"];
3691 }
3692 if (_json.containsKey("languageCode")) {
3693 languageCode = _json["languageCode"];
3694 }
3695 if (_json.containsKey("largestChangeId")) {
3696 largestChangeId = _json["largestChangeId"];
3697 }
3698 if (_json.containsKey("maxUploadSizes")) {
3699 maxUploadSizes = _json["maxUploadSizes"].map((value) => new AboutMaxUpload Sizes.fromJson(value)).toList();
3700 }
3701 if (_json.containsKey("name")) {
3702 name = _json["name"];
3703 }
3704 if (_json.containsKey("permissionId")) {
3705 permissionId = _json["permissionId"];
3706 }
3707 if (_json.containsKey("quotaBytesByService")) {
3708 quotaBytesByService = _json["quotaBytesByService"].map((value) => new Abou tQuotaBytesByService.fromJson(value)).toList();
3709 }
3710 if (_json.containsKey("quotaBytesTotal")) {
3711 quotaBytesTotal = _json["quotaBytesTotal"];
3712 }
3713 if (_json.containsKey("quotaBytesUsed")) {
3714 quotaBytesUsed = _json["quotaBytesUsed"];
3715 }
3716 if (_json.containsKey("quotaBytesUsedAggregate")) {
3717 quotaBytesUsedAggregate = _json["quotaBytesUsedAggregate"];
3718 }
3719 if (_json.containsKey("quotaBytesUsedInTrash")) {
3720 quotaBytesUsedInTrash = _json["quotaBytesUsedInTrash"];
3721 }
3722 if (_json.containsKey("quotaType")) {
3723 quotaType = _json["quotaType"];
3724 }
3725 if (_json.containsKey("remainingChangeIds")) {
3726 remainingChangeIds = _json["remainingChangeIds"];
3727 }
3728 if (_json.containsKey("rootFolderId")) {
3729 rootFolderId = _json["rootFolderId"];
3730 }
3731 if (_json.containsKey("selfLink")) {
3732 selfLink = _json["selfLink"];
3733 }
3734 if (_json.containsKey("user")) {
3735 user = new User.fromJson(_json["user"]);
3736 }
3737 }
3738
3739 core.Map toJson() {
3740 var _json = new core.Map();
3741 if (additionalRoleInfo != null) {
3742 _json["additionalRoleInfo"] = additionalRoleInfo.map((value) => (value).to Json()).toList();
3743 }
3744 if (domainSharingPolicy != null) {
3745 _json["domainSharingPolicy"] = domainSharingPolicy;
3746 }
3747 if (etag != null) {
3748 _json["etag"] = etag;
3749 }
3750 if (exportFormats != null) {
3751 _json["exportFormats"] = exportFormats.map((value) => (value).toJson()).to List();
3752 }
3753 if (features != null) {
3754 _json["features"] = features.map((value) => (value).toJson()).toList();
3755 }
3756 if (importFormats != null) {
3757 _json["importFormats"] = importFormats.map((value) => (value).toJson()).to List();
3758 }
3759 if (isCurrentAppInstalled != null) {
3760 _json["isCurrentAppInstalled"] = isCurrentAppInstalled;
3761 }
3762 if (kind != null) {
3763 _json["kind"] = kind;
3764 }
3765 if (languageCode != null) {
3766 _json["languageCode"] = languageCode;
3767 }
3768 if (largestChangeId != null) {
3769 _json["largestChangeId"] = largestChangeId;
3770 }
3771 if (maxUploadSizes != null) {
3772 _json["maxUploadSizes"] = maxUploadSizes.map((value) => (value).toJson()). toList();
3773 }
3774 if (name != null) {
3775 _json["name"] = name;
3776 }
3777 if (permissionId != null) {
3778 _json["permissionId"] = permissionId;
3779 }
3780 if (quotaBytesByService != null) {
3781 _json["quotaBytesByService"] = quotaBytesByService.map((value) => (value). toJson()).toList();
3782 }
3783 if (quotaBytesTotal != null) {
3784 _json["quotaBytesTotal"] = quotaBytesTotal;
3785 }
3786 if (quotaBytesUsed != null) {
3787 _json["quotaBytesUsed"] = quotaBytesUsed;
3788 }
3789 if (quotaBytesUsedAggregate != null) {
3790 _json["quotaBytesUsedAggregate"] = quotaBytesUsedAggregate;
3791 }
3792 if (quotaBytesUsedInTrash != null) {
3793 _json["quotaBytesUsedInTrash"] = quotaBytesUsedInTrash;
3794 }
3795 if (quotaType != null) {
3796 _json["quotaType"] = quotaType;
3797 }
3798 if (remainingChangeIds != null) {
3799 _json["remainingChangeIds"] = remainingChangeIds;
3800 }
3801 if (rootFolderId != null) {
3802 _json["rootFolderId"] = rootFolderId;
3803 }
3804 if (selfLink != null) {
3805 _json["selfLink"] = selfLink;
3806 }
3807 if (user != null) {
3808 _json["user"] = (user).toJson();
3809 }
3810 return _json;
3811 }
3812 }
3813
3814
3815 /** Not documented yet. */
3816 class AppIcons {
3817 /**
3818 * Category of the icon. Allowed values are:
3819 * - application - icon for the application
3820 * - document - icon for a file associated with the app
3821 * - documentShared - icon for a shared file associated with the app
3822 */
3823 core.String category;
3824
3825 /** URL for the icon. */
3826 core.String iconUrl;
3827
3828 /** Size of the icon. Represented as the maximum of the width and height. */
3829 core.int size;
3830
3831
3832 AppIcons();
3833
3834 AppIcons.fromJson(core.Map _json) {
3835 if (_json.containsKey("category")) {
3836 category = _json["category"];
3837 }
3838 if (_json.containsKey("iconUrl")) {
3839 iconUrl = _json["iconUrl"];
3840 }
3841 if (_json.containsKey("size")) {
3842 size = _json["size"];
3843 }
3844 }
3845
3846 core.Map toJson() {
3847 var _json = new core.Map();
3848 if (category != null) {
3849 _json["category"] = category;
3850 }
3851 if (iconUrl != null) {
3852 _json["iconUrl"] = iconUrl;
3853 }
3854 if (size != null) {
3855 _json["size"] = size;
3856 }
3857 return _json;
3858 }
3859 }
3860
3861
3862 /**
3863 * The apps resource provides a list of the apps that a user has installed, with
3864 * information about each app's supported MIME types, file extensions, and other
3865 * details.
3866 */
3867 class App {
3868 /** Whether the app is authorized to access data on the user's Drive. */
3869 core.bool authorized;
3870
3871 /**
3872 * The template url to create a new file with this app in a given folder. The
3873 * template will contain {folderId} to be replaced by the folder to create the
3874 * new file in.
3875 */
3876 core.String createInFolderTemplate;
3877
3878 /** The url to create a new file with this app. */
3879 core.String createUrl;
3880
3881 /**
3882 * Whether the app has drive-wide scope. An app with drive-wide scope can
3883 * access all files in the user's drive.
3884 */
3885 core.bool hasDriveWideScope;
3886
3887 /** The various icons for the app. */
3888 core.List<AppIcons> icons;
3889
3890 /** The ID of the app. */
3891 core.String id;
3892
3893 /** Whether the app is installed. */
3894 core.bool installed;
3895
3896 /** This is always drive#app. */
3897 core.String kind;
3898
3899 /** A long description of the app. */
3900 core.String longDescription;
3901
3902 /** The name of the app. */
3903 core.String name;
3904
3905 /**
3906 * The type of object this app creates (e.g. Chart). If empty, the app name
3907 * should be used instead.
3908 */
3909 core.String objectType;
3910
3911 /**
3912 * The template url for opening files with this app. The template will contain
3913 * {ids} and/or {exportIds} to be replaced by the actual file ids.
3914 */
3915 core.String openUrlTemplate;
3916
3917 /** The list of primary file extensions. */
3918 core.List<core.String> primaryFileExtensions;
3919
3920 /** The list of primary mime types. */
3921 core.List<core.String> primaryMimeTypes;
3922
3923 /** The ID of the product listing for this app. */
3924 core.String productId;
3925
3926 /** A link to the product listing for this app. */
3927 core.String productUrl;
3928
3929 /** The list of secondary file extensions. */
3930 core.List<core.String> secondaryFileExtensions;
3931
3932 /** The list of secondary mime types. */
3933 core.List<core.String> secondaryMimeTypes;
3934
3935 /** A short description of the app. */
3936 core.String shortDescription;
3937
3938 /** Whether this app supports creating new objects. */
3939 core.bool supportsCreate;
3940
3941 /** Whether this app supports importing Google Docs. */
3942 core.bool supportsImport;
3943
3944 /** Whether this app supports opening more than one file. */
3945 core.bool supportsMultiOpen;
3946
3947 /** Whether this app supports creating new files when offline. */
3948 core.bool supportsOfflineCreate;
3949
3950 /**
3951 * Whether the app is selected as the default handler for the types it
3952 * supports.
3953 */
3954 core.bool useByDefault;
3955
3956
3957 App();
3958
3959 App.fromJson(core.Map _json) {
3960 if (_json.containsKey("authorized")) {
3961 authorized = _json["authorized"];
3962 }
3963 if (_json.containsKey("createInFolderTemplate")) {
3964 createInFolderTemplate = _json["createInFolderTemplate"];
3965 }
3966 if (_json.containsKey("createUrl")) {
3967 createUrl = _json["createUrl"];
3968 }
3969 if (_json.containsKey("hasDriveWideScope")) {
3970 hasDriveWideScope = _json["hasDriveWideScope"];
3971 }
3972 if (_json.containsKey("icons")) {
3973 icons = _json["icons"].map((value) => new AppIcons.fromJson(value)).toList ();
3974 }
3975 if (_json.containsKey("id")) {
3976 id = _json["id"];
3977 }
3978 if (_json.containsKey("installed")) {
3979 installed = _json["installed"];
3980 }
3981 if (_json.containsKey("kind")) {
3982 kind = _json["kind"];
3983 }
3984 if (_json.containsKey("longDescription")) {
3985 longDescription = _json["longDescription"];
3986 }
3987 if (_json.containsKey("name")) {
3988 name = _json["name"];
3989 }
3990 if (_json.containsKey("objectType")) {
3991 objectType = _json["objectType"];
3992 }
3993 if (_json.containsKey("openUrlTemplate")) {
3994 openUrlTemplate = _json["openUrlTemplate"];
3995 }
3996 if (_json.containsKey("primaryFileExtensions")) {
3997 primaryFileExtensions = _json["primaryFileExtensions"];
3998 }
3999 if (_json.containsKey("primaryMimeTypes")) {
4000 primaryMimeTypes = _json["primaryMimeTypes"];
4001 }
4002 if (_json.containsKey("productId")) {
4003 productId = _json["productId"];
4004 }
4005 if (_json.containsKey("productUrl")) {
4006 productUrl = _json["productUrl"];
4007 }
4008 if (_json.containsKey("secondaryFileExtensions")) {
4009 secondaryFileExtensions = _json["secondaryFileExtensions"];
4010 }
4011 if (_json.containsKey("secondaryMimeTypes")) {
4012 secondaryMimeTypes = _json["secondaryMimeTypes"];
4013 }
4014 if (_json.containsKey("shortDescription")) {
4015 shortDescription = _json["shortDescription"];
4016 }
4017 if (_json.containsKey("supportsCreate")) {
4018 supportsCreate = _json["supportsCreate"];
4019 }
4020 if (_json.containsKey("supportsImport")) {
4021 supportsImport = _json["supportsImport"];
4022 }
4023 if (_json.containsKey("supportsMultiOpen")) {
4024 supportsMultiOpen = _json["supportsMultiOpen"];
4025 }
4026 if (_json.containsKey("supportsOfflineCreate")) {
4027 supportsOfflineCreate = _json["supportsOfflineCreate"];
4028 }
4029 if (_json.containsKey("useByDefault")) {
4030 useByDefault = _json["useByDefault"];
4031 }
4032 }
4033
4034 core.Map toJson() {
4035 var _json = new core.Map();
4036 if (authorized != null) {
4037 _json["authorized"] = authorized;
4038 }
4039 if (createInFolderTemplate != null) {
4040 _json["createInFolderTemplate"] = createInFolderTemplate;
4041 }
4042 if (createUrl != null) {
4043 _json["createUrl"] = createUrl;
4044 }
4045 if (hasDriveWideScope != null) {
4046 _json["hasDriveWideScope"] = hasDriveWideScope;
4047 }
4048 if (icons != null) {
4049 _json["icons"] = icons.map((value) => (value).toJson()).toList();
4050 }
4051 if (id != null) {
4052 _json["id"] = id;
4053 }
4054 if (installed != null) {
4055 _json["installed"] = installed;
4056 }
4057 if (kind != null) {
4058 _json["kind"] = kind;
4059 }
4060 if (longDescription != null) {
4061 _json["longDescription"] = longDescription;
4062 }
4063 if (name != null) {
4064 _json["name"] = name;
4065 }
4066 if (objectType != null) {
4067 _json["objectType"] = objectType;
4068 }
4069 if (openUrlTemplate != null) {
4070 _json["openUrlTemplate"] = openUrlTemplate;
4071 }
4072 if (primaryFileExtensions != null) {
4073 _json["primaryFileExtensions"] = primaryFileExtensions;
4074 }
4075 if (primaryMimeTypes != null) {
4076 _json["primaryMimeTypes"] = primaryMimeTypes;
4077 }
4078 if (productId != null) {
4079 _json["productId"] = productId;
4080 }
4081 if (productUrl != null) {
4082 _json["productUrl"] = productUrl;
4083 }
4084 if (secondaryFileExtensions != null) {
4085 _json["secondaryFileExtensions"] = secondaryFileExtensions;
4086 }
4087 if (secondaryMimeTypes != null) {
4088 _json["secondaryMimeTypes"] = secondaryMimeTypes;
4089 }
4090 if (shortDescription != null) {
4091 _json["shortDescription"] = shortDescription;
4092 }
4093 if (supportsCreate != null) {
4094 _json["supportsCreate"] = supportsCreate;
4095 }
4096 if (supportsImport != null) {
4097 _json["supportsImport"] = supportsImport;
4098 }
4099 if (supportsMultiOpen != null) {
4100 _json["supportsMultiOpen"] = supportsMultiOpen;
4101 }
4102 if (supportsOfflineCreate != null) {
4103 _json["supportsOfflineCreate"] = supportsOfflineCreate;
4104 }
4105 if (useByDefault != null) {
4106 _json["useByDefault"] = useByDefault;
4107 }
4108 return _json;
4109 }
4110 }
4111
4112
4113 /**
4114 * A list of third-party applications which the user has installed or given
4115 * access to Google Drive.
4116 */
4117 class AppList {
4118 /**
4119 * List of app IDs that the user has specified to use by default. The list is
4120 * in reverse-priority order (lowest to highest).
4121 */
4122 core.List<core.String> defaultAppIds;
4123
4124 /** The ETag of the list. */
4125 core.String etag;
4126
4127 /** The actual list of apps. */
4128 core.List<App> items;
4129
4130 /** This is always drive#appList. */
4131 core.String kind;
4132
4133 /** A link back to this list. */
4134 core.String selfLink;
4135
4136
4137 AppList();
4138
4139 AppList.fromJson(core.Map _json) {
4140 if (_json.containsKey("defaultAppIds")) {
4141 defaultAppIds = _json["defaultAppIds"];
4142 }
4143 if (_json.containsKey("etag")) {
4144 etag = _json["etag"];
4145 }
4146 if (_json.containsKey("items")) {
4147 items = _json["items"].map((value) => new App.fromJson(value)).toList();
4148 }
4149 if (_json.containsKey("kind")) {
4150 kind = _json["kind"];
4151 }
4152 if (_json.containsKey("selfLink")) {
4153 selfLink = _json["selfLink"];
4154 }
4155 }
4156
4157 core.Map toJson() {
4158 var _json = new core.Map();
4159 if (defaultAppIds != null) {
4160 _json["defaultAppIds"] = defaultAppIds;
4161 }
4162 if (etag != null) {
4163 _json["etag"] = etag;
4164 }
4165 if (items != null) {
4166 _json["items"] = items.map((value) => (value).toJson()).toList();
4167 }
4168 if (kind != null) {
4169 _json["kind"] = kind;
4170 }
4171 if (selfLink != null) {
4172 _json["selfLink"] = selfLink;
4173 }
4174 return _json;
4175 }
4176 }
4177
4178
4179 /** Representation of a change to a file. */
4180 class Change {
4181 /** Whether the file has been deleted. */
4182 core.bool deleted;
4183
4184 /**
4185 * The updated state of the file. Present if the file has not been deleted.
4186 */
4187 File file;
4188
4189 /** The ID of the file associated with this change. */
4190 core.String fileId;
4191
4192 /** The ID of the change. */
4193 core.String id;
4194
4195 /** This is always drive#change. */
4196 core.String kind;
4197
4198 /** The time of this modification. */
4199 core.DateTime modificationDate;
4200
4201 /** A link back to this change. */
4202 core.String selfLink;
4203
4204
4205 Change();
4206
4207 Change.fromJson(core.Map _json) {
4208 if (_json.containsKey("deleted")) {
4209 deleted = _json["deleted"];
4210 }
4211 if (_json.containsKey("file")) {
4212 file = new File.fromJson(_json["file"]);
4213 }
4214 if (_json.containsKey("fileId")) {
4215 fileId = _json["fileId"];
4216 }
4217 if (_json.containsKey("id")) {
4218 id = _json["id"];
4219 }
4220 if (_json.containsKey("kind")) {
4221 kind = _json["kind"];
4222 }
4223 if (_json.containsKey("modificationDate")) {
4224 modificationDate = core.DateTime.parse(_json["modificationDate"]);
4225 }
4226 if (_json.containsKey("selfLink")) {
4227 selfLink = _json["selfLink"];
4228 }
4229 }
4230
4231 core.Map toJson() {
4232 var _json = new core.Map();
4233 if (deleted != null) {
4234 _json["deleted"] = deleted;
4235 }
4236 if (file != null) {
4237 _json["file"] = (file).toJson();
4238 }
4239 if (fileId != null) {
4240 _json["fileId"] = fileId;
4241 }
4242 if (id != null) {
4243 _json["id"] = id;
4244 }
4245 if (kind != null) {
4246 _json["kind"] = kind;
4247 }
4248 if (modificationDate != null) {
4249 _json["modificationDate"] = (modificationDate).toIso8601String();
4250 }
4251 if (selfLink != null) {
4252 _json["selfLink"] = selfLink;
4253 }
4254 return _json;
4255 }
4256 }
4257
4258
4259 /** A list of changes for a user. */
4260 class ChangeList {
4261 /** The ETag of the list. */
4262 core.String etag;
4263
4264 /** The actual list of changes. */
4265 core.List<Change> items;
4266
4267 /** This is always drive#changeList. */
4268 core.String kind;
4269
4270 /** The current largest change ID. */
4271 core.String largestChangeId;
4272
4273 /** A link to the next page of changes. */
4274 core.String nextLink;
4275
4276 /** The page token for the next page of changes. */
4277 core.String nextPageToken;
4278
4279 /** A link back to this list. */
4280 core.String selfLink;
4281
4282
4283 ChangeList();
4284
4285 ChangeList.fromJson(core.Map _json) {
4286 if (_json.containsKey("etag")) {
4287 etag = _json["etag"];
4288 }
4289 if (_json.containsKey("items")) {
4290 items = _json["items"].map((value) => new Change.fromJson(value)).toList() ;
4291 }
4292 if (_json.containsKey("kind")) {
4293 kind = _json["kind"];
4294 }
4295 if (_json.containsKey("largestChangeId")) {
4296 largestChangeId = _json["largestChangeId"];
4297 }
4298 if (_json.containsKey("nextLink")) {
4299 nextLink = _json["nextLink"];
4300 }
4301 if (_json.containsKey("nextPageToken")) {
4302 nextPageToken = _json["nextPageToken"];
4303 }
4304 if (_json.containsKey("selfLink")) {
4305 selfLink = _json["selfLink"];
4306 }
4307 }
4308
4309 core.Map toJson() {
4310 var _json = new core.Map();
4311 if (etag != null) {
4312 _json["etag"] = etag;
4313 }
4314 if (items != null) {
4315 _json["items"] = items.map((value) => (value).toJson()).toList();
4316 }
4317 if (kind != null) {
4318 _json["kind"] = kind;
4319 }
4320 if (largestChangeId != null) {
4321 _json["largestChangeId"] = largestChangeId;
4322 }
4323 if (nextLink != null) {
4324 _json["nextLink"] = nextLink;
4325 }
4326 if (nextPageToken != null) {
4327 _json["nextPageToken"] = nextPageToken;
4328 }
4329 if (selfLink != null) {
4330 _json["selfLink"] = selfLink;
4331 }
4332 return _json;
4333 }
4334 }
4335
4336
4337 /** An notification channel used to watch for resource changes. */
4338 class Channel {
4339 /** The address where notifications are delivered for this channel. */
4340 core.String address;
4341
4342 /**
4343 * Date and time of notification channel expiration, expressed as a Unix
4344 * timestamp, in milliseconds. Optional.
4345 */
4346 core.String expiration;
4347
4348 /** A UUID or similar unique string that identifies this channel. */
4349 core.String id;
4350
4351 /**
4352 * Identifies this as a notification channel used to watch for changes to a
4353 * resource. Value: the fixed string "api#channel".
4354 */
4355 core.String kind;
4356
4357 /** Additional parameters controlling delivery channel behavior. Optional. */
4358 core.Map<core.String, core.String> params;
4359
4360 /** A Boolean value to indicate whether payload is wanted. Optional. */
4361 core.bool payload;
4362
4363 /**
4364 * An opaque ID that identifies the resource being watched on this channel.
4365 * Stable across different API versions.
4366 */
4367 core.String resourceId;
4368
4369 /** A version-specific identifier for the watched resource. */
4370 core.String resourceUri;
4371
4372 /**
4373 * An arbitrary string delivered to the target address with each notification
4374 * delivered over this channel. Optional.
4375 */
4376 core.String token;
4377
4378 /** The type of delivery mechanism used for this channel. */
4379 core.String type;
4380
4381
4382 Channel();
4383
4384 Channel.fromJson(core.Map _json) {
4385 if (_json.containsKey("address")) {
4386 address = _json["address"];
4387 }
4388 if (_json.containsKey("expiration")) {
4389 expiration = _json["expiration"];
4390 }
4391 if (_json.containsKey("id")) {
4392 id = _json["id"];
4393 }
4394 if (_json.containsKey("kind")) {
4395 kind = _json["kind"];
4396 }
4397 if (_json.containsKey("params")) {
4398 params = _json["params"];
4399 }
4400 if (_json.containsKey("payload")) {
4401 payload = _json["payload"];
4402 }
4403 if (_json.containsKey("resourceId")) {
4404 resourceId = _json["resourceId"];
4405 }
4406 if (_json.containsKey("resourceUri")) {
4407 resourceUri = _json["resourceUri"];
4408 }
4409 if (_json.containsKey("token")) {
4410 token = _json["token"];
4411 }
4412 if (_json.containsKey("type")) {
4413 type = _json["type"];
4414 }
4415 }
4416
4417 core.Map toJson() {
4418 var _json = new core.Map();
4419 if (address != null) {
4420 _json["address"] = address;
4421 }
4422 if (expiration != null) {
4423 _json["expiration"] = expiration;
4424 }
4425 if (id != null) {
4426 _json["id"] = id;
4427 }
4428 if (kind != null) {
4429 _json["kind"] = kind;
4430 }
4431 if (params != null) {
4432 _json["params"] = params;
4433 }
4434 if (payload != null) {
4435 _json["payload"] = payload;
4436 }
4437 if (resourceId != null) {
4438 _json["resourceId"] = resourceId;
4439 }
4440 if (resourceUri != null) {
4441 _json["resourceUri"] = resourceUri;
4442 }
4443 if (token != null) {
4444 _json["token"] = token;
4445 }
4446 if (type != null) {
4447 _json["type"] = type;
4448 }
4449 return _json;
4450 }
4451 }
4452
4453
4454 /** A list of children of a file. */
4455 class ChildList {
4456 /** The ETag of the list. */
4457 core.String etag;
4458
4459 /** The actual list of children. */
4460 core.List<ChildReference> items;
4461
4462 /** This is always drive#childList. */
4463 core.String kind;
4464
4465 /** A link to the next page of children. */
4466 core.String nextLink;
4467
4468 /** The page token for the next page of children. */
4469 core.String nextPageToken;
4470
4471 /** A link back to this list. */
4472 core.String selfLink;
4473
4474
4475 ChildList();
4476
4477 ChildList.fromJson(core.Map _json) {
4478 if (_json.containsKey("etag")) {
4479 etag = _json["etag"];
4480 }
4481 if (_json.containsKey("items")) {
4482 items = _json["items"].map((value) => new ChildReference.fromJson(value)). toList();
4483 }
4484 if (_json.containsKey("kind")) {
4485 kind = _json["kind"];
4486 }
4487 if (_json.containsKey("nextLink")) {
4488 nextLink = _json["nextLink"];
4489 }
4490 if (_json.containsKey("nextPageToken")) {
4491 nextPageToken = _json["nextPageToken"];
4492 }
4493 if (_json.containsKey("selfLink")) {
4494 selfLink = _json["selfLink"];
4495 }
4496 }
4497
4498 core.Map toJson() {
4499 var _json = new core.Map();
4500 if (etag != null) {
4501 _json["etag"] = etag;
4502 }
4503 if (items != null) {
4504 _json["items"] = items.map((value) => (value).toJson()).toList();
4505 }
4506 if (kind != null) {
4507 _json["kind"] = kind;
4508 }
4509 if (nextLink != null) {
4510 _json["nextLink"] = nextLink;
4511 }
4512 if (nextPageToken != null) {
4513 _json["nextPageToken"] = nextPageToken;
4514 }
4515 if (selfLink != null) {
4516 _json["selfLink"] = selfLink;
4517 }
4518 return _json;
4519 }
4520 }
4521
4522
4523 /** A reference to a folder's child. */
4524 class ChildReference {
4525 /** A link to the child. */
4526 core.String childLink;
4527
4528 /** The ID of the child. */
4529 core.String id;
4530
4531 /** This is always drive#childReference. */
4532 core.String kind;
4533
4534 /** A link back to this reference. */
4535 core.String selfLink;
4536
4537
4538 ChildReference();
4539
4540 ChildReference.fromJson(core.Map _json) {
4541 if (_json.containsKey("childLink")) {
4542 childLink = _json["childLink"];
4543 }
4544 if (_json.containsKey("id")) {
4545 id = _json["id"];
4546 }
4547 if (_json.containsKey("kind")) {
4548 kind = _json["kind"];
4549 }
4550 if (_json.containsKey("selfLink")) {
4551 selfLink = _json["selfLink"];
4552 }
4553 }
4554
4555 core.Map toJson() {
4556 var _json = new core.Map();
4557 if (childLink != null) {
4558 _json["childLink"] = childLink;
4559 }
4560 if (id != null) {
4561 _json["id"] = id;
4562 }
4563 if (kind != null) {
4564 _json["kind"] = kind;
4565 }
4566 if (selfLink != null) {
4567 _json["selfLink"] = selfLink;
4568 }
4569 return _json;
4570 }
4571 }
4572
4573
4574 /** The context of the file which is being commented on. */
4575 class CommentContext {
4576 /** The MIME type of the context snippet. */
4577 core.String type;
4578
4579 /**
4580 * Data representation of the segment of the file being commented on. In the
4581 * case of a text file for example, this would be the actual text that the
4582 * comment is about.
4583 */
4584 core.String value;
4585
4586
4587 CommentContext();
4588
4589 CommentContext.fromJson(core.Map _json) {
4590 if (_json.containsKey("type")) {
4591 type = _json["type"];
4592 }
4593 if (_json.containsKey("value")) {
4594 value = _json["value"];
4595 }
4596 }
4597
4598 core.Map toJson() {
4599 var _json = new core.Map();
4600 if (type != null) {
4601 _json["type"] = type;
4602 }
4603 if (value != null) {
4604 _json["value"] = value;
4605 }
4606 return _json;
4607 }
4608 }
4609
4610
4611 /** A JSON representation of a comment on a file in Google Drive. */
4612 class Comment {
4613 /**
4614 * A region of the document represented as a JSON string. See anchor
4615 * documentation for details on how to define and interpret anchor properties.
4616 */
4617 core.String anchor;
4618
4619 /** The user who wrote this comment. */
4620 User author;
4621
4622 /** The ID of the comment. */
4623 core.String commentId;
4624
4625 /**
4626 * The plain text content used to create this comment. This is not HTML safe
4627 * and should only be used as a starting point to make edits to a comment's
4628 * content.
4629 */
4630 core.String content;
4631
4632 /** The context of the file which is being commented on. */
4633 CommentContext context;
4634
4635 /** The date when this comment was first created. */
4636 core.DateTime createdDate;
4637
4638 /**
4639 * Whether this comment has been deleted. If a comment has been deleted the
4640 * content will be cleared and this will only represent a comment that once
4641 * existed.
4642 */
4643 core.bool deleted;
4644
4645 /** The file which this comment is addressing. */
4646 core.String fileId;
4647
4648 /** The title of the file which this comment is addressing. */
4649 core.String fileTitle;
4650
4651 /** HTML formatted content for this comment. */
4652 core.String htmlContent;
4653
4654 /** This is always drive#comment. */
4655 core.String kind;
4656
4657 /** The date when this comment or any of its replies were last modified. */
4658 core.DateTime modifiedDate;
4659
4660 /** Replies to this post. */
4661 core.List<CommentReply> replies;
4662
4663 /** A link back to this comment. */
4664 core.String selfLink;
4665
4666 /**
4667 * The status of this comment. Status can be changed by posting a reply to a
4668 * comment with the desired status.
4669 * - "open" - The comment is still open.
4670 * - "resolved" - The comment has been resolved by one of its replies.
4671 */
4672 core.String status;
4673
4674
4675 Comment();
4676
4677 Comment.fromJson(core.Map _json) {
4678 if (_json.containsKey("anchor")) {
4679 anchor = _json["anchor"];
4680 }
4681 if (_json.containsKey("author")) {
4682 author = new User.fromJson(_json["author"]);
4683 }
4684 if (_json.containsKey("commentId")) {
4685 commentId = _json["commentId"];
4686 }
4687 if (_json.containsKey("content")) {
4688 content = _json["content"];
4689 }
4690 if (_json.containsKey("context")) {
4691 context = new CommentContext.fromJson(_json["context"]);
4692 }
4693 if (_json.containsKey("createdDate")) {
4694 createdDate = core.DateTime.parse(_json["createdDate"]);
4695 }
4696 if (_json.containsKey("deleted")) {
4697 deleted = _json["deleted"];
4698 }
4699 if (_json.containsKey("fileId")) {
4700 fileId = _json["fileId"];
4701 }
4702 if (_json.containsKey("fileTitle")) {
4703 fileTitle = _json["fileTitle"];
4704 }
4705 if (_json.containsKey("htmlContent")) {
4706 htmlContent = _json["htmlContent"];
4707 }
4708 if (_json.containsKey("kind")) {
4709 kind = _json["kind"];
4710 }
4711 if (_json.containsKey("modifiedDate")) {
4712 modifiedDate = core.DateTime.parse(_json["modifiedDate"]);
4713 }
4714 if (_json.containsKey("replies")) {
4715 replies = _json["replies"].map((value) => new CommentReply.fromJson(value) ).toList();
4716 }
4717 if (_json.containsKey("selfLink")) {
4718 selfLink = _json["selfLink"];
4719 }
4720 if (_json.containsKey("status")) {
4721 status = _json["status"];
4722 }
4723 }
4724
4725 core.Map toJson() {
4726 var _json = new core.Map();
4727 if (anchor != null) {
4728 _json["anchor"] = anchor;
4729 }
4730 if (author != null) {
4731 _json["author"] = (author).toJson();
4732 }
4733 if (commentId != null) {
4734 _json["commentId"] = commentId;
4735 }
4736 if (content != null) {
4737 _json["content"] = content;
4738 }
4739 if (context != null) {
4740 _json["context"] = (context).toJson();
4741 }
4742 if (createdDate != null) {
4743 _json["createdDate"] = (createdDate).toIso8601String();
4744 }
4745 if (deleted != null) {
4746 _json["deleted"] = deleted;
4747 }
4748 if (fileId != null) {
4749 _json["fileId"] = fileId;
4750 }
4751 if (fileTitle != null) {
4752 _json["fileTitle"] = fileTitle;
4753 }
4754 if (htmlContent != null) {
4755 _json["htmlContent"] = htmlContent;
4756 }
4757 if (kind != null) {
4758 _json["kind"] = kind;
4759 }
4760 if (modifiedDate != null) {
4761 _json["modifiedDate"] = (modifiedDate).toIso8601String();
4762 }
4763 if (replies != null) {
4764 _json["replies"] = replies.map((value) => (value).toJson()).toList();
4765 }
4766 if (selfLink != null) {
4767 _json["selfLink"] = selfLink;
4768 }
4769 if (status != null) {
4770 _json["status"] = status;
4771 }
4772 return _json;
4773 }
4774 }
4775
4776
4777 /** A JSON representation of a list of comments on a file in Google Drive. */
4778 class CommentList {
4779 /** List of comments. */
4780 core.List<Comment> items;
4781
4782 /** This is always drive#commentList. */
4783 core.String kind;
4784
4785 /** A link to the next page of comments. */
4786 core.String nextLink;
4787
4788 /** The token to use to request the next page of results. */
4789 core.String nextPageToken;
4790
4791 /** A link back to this list. */
4792 core.String selfLink;
4793
4794
4795 CommentList();
4796
4797 CommentList.fromJson(core.Map _json) {
4798 if (_json.containsKey("items")) {
4799 items = _json["items"].map((value) => new Comment.fromJson(value)).toList( );
4800 }
4801 if (_json.containsKey("kind")) {
4802 kind = _json["kind"];
4803 }
4804 if (_json.containsKey("nextLink")) {
4805 nextLink = _json["nextLink"];
4806 }
4807 if (_json.containsKey("nextPageToken")) {
4808 nextPageToken = _json["nextPageToken"];
4809 }
4810 if (_json.containsKey("selfLink")) {
4811 selfLink = _json["selfLink"];
4812 }
4813 }
4814
4815 core.Map toJson() {
4816 var _json = new core.Map();
4817 if (items != null) {
4818 _json["items"] = items.map((value) => (value).toJson()).toList();
4819 }
4820 if (kind != null) {
4821 _json["kind"] = kind;
4822 }
4823 if (nextLink != null) {
4824 _json["nextLink"] = nextLink;
4825 }
4826 if (nextPageToken != null) {
4827 _json["nextPageToken"] = nextPageToken;
4828 }
4829 if (selfLink != null) {
4830 _json["selfLink"] = selfLink;
4831 }
4832 return _json;
4833 }
4834 }
4835
4836
4837 /** A JSON representation of a reply to a comment on a file in Google Drive. */
4838 class CommentReply {
4839 /** The user who wrote this reply. */
4840 User author;
4841
4842 /**
4843 * The plain text content used to create this reply. This is not HTML safe and
4844 * should only be used as a starting point to make edits to a reply's content.
4845 * This field is required on inserts if no verb is specified (resolve/reopen).
4846 */
4847 core.String content;
4848
4849 /** The date when this reply was first created. */
4850 core.DateTime createdDate;
4851
4852 /**
4853 * Whether this reply has been deleted. If a reply has been deleted the
4854 * content will be cleared and this will only represent a reply that once
4855 * existed.
4856 */
4857 core.bool deleted;
4858
4859 /** HTML formatted content for this reply. */
4860 core.String htmlContent;
4861
4862 /** This is always drive#commentReply. */
4863 core.String kind;
4864
4865 /** The date when this reply was last modified. */
4866 core.DateTime modifiedDate;
4867
4868 /** The ID of the reply. */
4869 core.String replyId;
4870
4871 /**
4872 * The action this reply performed to the parent comment. When creating a new
4873 * reply this is the action to be perform to the parent comment. Possible
4874 * values are:
4875 * - "resolve" - To resolve a comment.
4876 * - "reopen" - To reopen (un-resolve) a comment.
4877 */
4878 core.String verb;
4879
4880
4881 CommentReply();
4882
4883 CommentReply.fromJson(core.Map _json) {
4884 if (_json.containsKey("author")) {
4885 author = new User.fromJson(_json["author"]);
4886 }
4887 if (_json.containsKey("content")) {
4888 content = _json["content"];
4889 }
4890 if (_json.containsKey("createdDate")) {
4891 createdDate = core.DateTime.parse(_json["createdDate"]);
4892 }
4893 if (_json.containsKey("deleted")) {
4894 deleted = _json["deleted"];
4895 }
4896 if (_json.containsKey("htmlContent")) {
4897 htmlContent = _json["htmlContent"];
4898 }
4899 if (_json.containsKey("kind")) {
4900 kind = _json["kind"];
4901 }
4902 if (_json.containsKey("modifiedDate")) {
4903 modifiedDate = core.DateTime.parse(_json["modifiedDate"]);
4904 }
4905 if (_json.containsKey("replyId")) {
4906 replyId = _json["replyId"];
4907 }
4908 if (_json.containsKey("verb")) {
4909 verb = _json["verb"];
4910 }
4911 }
4912
4913 core.Map toJson() {
4914 var _json = new core.Map();
4915 if (author != null) {
4916 _json["author"] = (author).toJson();
4917 }
4918 if (content != null) {
4919 _json["content"] = content;
4920 }
4921 if (createdDate != null) {
4922 _json["createdDate"] = (createdDate).toIso8601String();
4923 }
4924 if (deleted != null) {
4925 _json["deleted"] = deleted;
4926 }
4927 if (htmlContent != null) {
4928 _json["htmlContent"] = htmlContent;
4929 }
4930 if (kind != null) {
4931 _json["kind"] = kind;
4932 }
4933 if (modifiedDate != null) {
4934 _json["modifiedDate"] = (modifiedDate).toIso8601String();
4935 }
4936 if (replyId != null) {
4937 _json["replyId"] = replyId;
4938 }
4939 if (verb != null) {
4940 _json["verb"] = verb;
4941 }
4942 return _json;
4943 }
4944 }
4945
4946
4947 /**
4948 * A JSON representation of a list of replies to a comment on a file in Google
4949 * Drive.
4950 */
4951 class CommentReplyList {
4952 /** List of reply. */
4953 core.List<CommentReply> items;
4954
4955 /** This is always drive#commentReplyList. */
4956 core.String kind;
4957
4958 /** A link to the next page of replies. */
4959 core.String nextLink;
4960
4961 /** The token to use to request the next page of results. */
4962 core.String nextPageToken;
4963
4964 /** A link back to this list. */
4965 core.String selfLink;
4966
4967
4968 CommentReplyList();
4969
4970 CommentReplyList.fromJson(core.Map _json) {
4971 if (_json.containsKey("items")) {
4972 items = _json["items"].map((value) => new CommentReply.fromJson(value)).to List();
4973 }
4974 if (_json.containsKey("kind")) {
4975 kind = _json["kind"];
4976 }
4977 if (_json.containsKey("nextLink")) {
4978 nextLink = _json["nextLink"];
4979 }
4980 if (_json.containsKey("nextPageToken")) {
4981 nextPageToken = _json["nextPageToken"];
4982 }
4983 if (_json.containsKey("selfLink")) {
4984 selfLink = _json["selfLink"];
4985 }
4986 }
4987
4988 core.Map toJson() {
4989 var _json = new core.Map();
4990 if (items != null) {
4991 _json["items"] = items.map((value) => (value).toJson()).toList();
4992 }
4993 if (kind != null) {
4994 _json["kind"] = kind;
4995 }
4996 if (nextLink != null) {
4997 _json["nextLink"] = nextLink;
4998 }
4999 if (nextPageToken != null) {
5000 _json["nextPageToken"] = nextPageToken;
5001 }
5002 if (selfLink != null) {
5003 _json["selfLink"] = selfLink;
5004 }
5005 return _json;
5006 }
5007 }
5008
5009
5010 /** Geographic location information stored in the image. */
5011 class FileImageMediaMetadataLocation {
5012 /** The altitude stored in the image. */
5013 core.double altitude;
5014
5015 /** The latitude stored in the image. */
5016 core.double latitude;
5017
5018 /** The longitude stored in the image. */
5019 core.double longitude;
5020
5021
5022 FileImageMediaMetadataLocation();
5023
5024 FileImageMediaMetadataLocation.fromJson(core.Map _json) {
5025 if (_json.containsKey("altitude")) {
5026 altitude = _json["altitude"];
5027 }
5028 if (_json.containsKey("latitude")) {
5029 latitude = _json["latitude"];
5030 }
5031 if (_json.containsKey("longitude")) {
5032 longitude = _json["longitude"];
5033 }
5034 }
5035
5036 core.Map toJson() {
5037 var _json = new core.Map();
5038 if (altitude != null) {
5039 _json["altitude"] = altitude;
5040 }
5041 if (latitude != null) {
5042 _json["latitude"] = latitude;
5043 }
5044 if (longitude != null) {
5045 _json["longitude"] = longitude;
5046 }
5047 return _json;
5048 }
5049 }
5050
5051
5052 /**
5053 * Metadata about image media. This will only be present for image types, and
5054 * its contents will depend on what can be parsed from the image content.
5055 */
5056 class FileImageMediaMetadata {
5057 /** The aperture used to create the photo (f-number). */
5058 core.double aperture;
5059
5060 /** The make of the camera used to create the photo. */
5061 core.String cameraMake;
5062
5063 /** The model of the camera used to create the photo. */
5064 core.String cameraModel;
5065
5066 /** The color space of the photo. */
5067 core.String colorSpace;
5068
5069 /** The date and time the photo was taken (EXIF format timestamp). */
5070 core.String date;
5071
5072 /** The exposure bias of the photo (APEX value). */
5073 core.double exposureBias;
5074
5075 /** The exposure mode used to create the photo. */
5076 core.String exposureMode;
5077
5078 /** The length of the exposure, in seconds. */
5079 core.double exposureTime;
5080
5081 /** Whether a flash was used to create the photo. */
5082 core.bool flashUsed;
5083
5084 /** The focal length used to create the photo, in millimeters. */
5085 core.double focalLength;
5086
5087 /** The height of the image in pixels. */
5088 core.int height;
5089
5090 /** The ISO speed used to create the photo. */
5091 core.int isoSpeed;
5092
5093 /** The lens used to create the photo. */
5094 core.String lens;
5095
5096 /** Geographic location information stored in the image. */
5097 FileImageMediaMetadataLocation location;
5098
5099 /**
5100 * The smallest f-number of the lens at the focal length used to create the
5101 * photo (APEX value).
5102 */
5103 core.double maxApertureValue;
5104
5105 /** The metering mode used to create the photo. */
5106 core.String meteringMode;
5107
5108 /**
5109 * The rotation in clockwise degrees from the image's original orientation.
5110 */
5111 core.int rotation;
5112
5113 /** The type of sensor used to create the photo. */
5114 core.String sensor;
5115
5116 /** The distance to the subject of the photo, in meters. */
5117 core.int subjectDistance;
5118
5119 /** The white balance mode used to create the photo. */
5120 core.String whiteBalance;
5121
5122 /** The width of the image in pixels. */
5123 core.int width;
5124
5125
5126 FileImageMediaMetadata();
5127
5128 FileImageMediaMetadata.fromJson(core.Map _json) {
5129 if (_json.containsKey("aperture")) {
5130 aperture = _json["aperture"];
5131 }
5132 if (_json.containsKey("cameraMake")) {
5133 cameraMake = _json["cameraMake"];
5134 }
5135 if (_json.containsKey("cameraModel")) {
5136 cameraModel = _json["cameraModel"];
5137 }
5138 if (_json.containsKey("colorSpace")) {
5139 colorSpace = _json["colorSpace"];
5140 }
5141 if (_json.containsKey("date")) {
5142 date = _json["date"];
5143 }
5144 if (_json.containsKey("exposureBias")) {
5145 exposureBias = _json["exposureBias"];
5146 }
5147 if (_json.containsKey("exposureMode")) {
5148 exposureMode = _json["exposureMode"];
5149 }
5150 if (_json.containsKey("exposureTime")) {
5151 exposureTime = _json["exposureTime"];
5152 }
5153 if (_json.containsKey("flashUsed")) {
5154 flashUsed = _json["flashUsed"];
5155 }
5156 if (_json.containsKey("focalLength")) {
5157 focalLength = _json["focalLength"];
5158 }
5159 if (_json.containsKey("height")) {
5160 height = _json["height"];
5161 }
5162 if (_json.containsKey("isoSpeed")) {
5163 isoSpeed = _json["isoSpeed"];
5164 }
5165 if (_json.containsKey("lens")) {
5166 lens = _json["lens"];
5167 }
5168 if (_json.containsKey("location")) {
5169 location = new FileImageMediaMetadataLocation.fromJson(_json["location"]);
5170 }
5171 if (_json.containsKey("maxApertureValue")) {
5172 maxApertureValue = _json["maxApertureValue"];
5173 }
5174 if (_json.containsKey("meteringMode")) {
5175 meteringMode = _json["meteringMode"];
5176 }
5177 if (_json.containsKey("rotation")) {
5178 rotation = _json["rotation"];
5179 }
5180 if (_json.containsKey("sensor")) {
5181 sensor = _json["sensor"];
5182 }
5183 if (_json.containsKey("subjectDistance")) {
5184 subjectDistance = _json["subjectDistance"];
5185 }
5186 if (_json.containsKey("whiteBalance")) {
5187 whiteBalance = _json["whiteBalance"];
5188 }
5189 if (_json.containsKey("width")) {
5190 width = _json["width"];
5191 }
5192 }
5193
5194 core.Map toJson() {
5195 var _json = new core.Map();
5196 if (aperture != null) {
5197 _json["aperture"] = aperture;
5198 }
5199 if (cameraMake != null) {
5200 _json["cameraMake"] = cameraMake;
5201 }
5202 if (cameraModel != null) {
5203 _json["cameraModel"] = cameraModel;
5204 }
5205 if (colorSpace != null) {
5206 _json["colorSpace"] = colorSpace;
5207 }
5208 if (date != null) {
5209 _json["date"] = date;
5210 }
5211 if (exposureBias != null) {
5212 _json["exposureBias"] = exposureBias;
5213 }
5214 if (exposureMode != null) {
5215 _json["exposureMode"] = exposureMode;
5216 }
5217 if (exposureTime != null) {
5218 _json["exposureTime"] = exposureTime;
5219 }
5220 if (flashUsed != null) {
5221 _json["flashUsed"] = flashUsed;
5222 }
5223 if (focalLength != null) {
5224 _json["focalLength"] = focalLength;
5225 }
5226 if (height != null) {
5227 _json["height"] = height;
5228 }
5229 if (isoSpeed != null) {
5230 _json["isoSpeed"] = isoSpeed;
5231 }
5232 if (lens != null) {
5233 _json["lens"] = lens;
5234 }
5235 if (location != null) {
5236 _json["location"] = (location).toJson();
5237 }
5238 if (maxApertureValue != null) {
5239 _json["maxApertureValue"] = maxApertureValue;
5240 }
5241 if (meteringMode != null) {
5242 _json["meteringMode"] = meteringMode;
5243 }
5244 if (rotation != null) {
5245 _json["rotation"] = rotation;
5246 }
5247 if (sensor != null) {
5248 _json["sensor"] = sensor;
5249 }
5250 if (subjectDistance != null) {
5251 _json["subjectDistance"] = subjectDistance;
5252 }
5253 if (whiteBalance != null) {
5254 _json["whiteBalance"] = whiteBalance;
5255 }
5256 if (width != null) {
5257 _json["width"] = width;
5258 }
5259 return _json;
5260 }
5261 }
5262
5263
5264 /** Indexable text attributes for the file (can only be written) */
5265 class FileIndexableText {
5266 /** The text to be indexed for this file. */
5267 core.String text;
5268
5269
5270 FileIndexableText();
5271
5272 FileIndexableText.fromJson(core.Map _json) {
5273 if (_json.containsKey("text")) {
5274 text = _json["text"];
5275 }
5276 }
5277
5278 core.Map toJson() {
5279 var _json = new core.Map();
5280 if (text != null) {
5281 _json["text"] = text;
5282 }
5283 return _json;
5284 }
5285 }
5286
5287
5288 /** A group of labels for the file. */
5289 class FileLabels {
5290 /** Deprecated. */
5291 core.bool hidden;
5292
5293 /** Whether viewers are prevented from downloading this file. */
5294 core.bool restricted;
5295
5296 /** Whether this file is starred by the user. */
5297 core.bool starred;
5298
5299 /** Whether this file has been trashed. */
5300 core.bool trashed;
5301
5302 /** Whether this file has been viewed by this user. */
5303 core.bool viewed;
5304
5305
5306 FileLabels();
5307
5308 FileLabels.fromJson(core.Map _json) {
5309 if (_json.containsKey("hidden")) {
5310 hidden = _json["hidden"];
5311 }
5312 if (_json.containsKey("restricted")) {
5313 restricted = _json["restricted"];
5314 }
5315 if (_json.containsKey("starred")) {
5316 starred = _json["starred"];
5317 }
5318 if (_json.containsKey("trashed")) {
5319 trashed = _json["trashed"];
5320 }
5321 if (_json.containsKey("viewed")) {
5322 viewed = _json["viewed"];
5323 }
5324 }
5325
5326 core.Map toJson() {
5327 var _json = new core.Map();
5328 if (hidden != null) {
5329 _json["hidden"] = hidden;
5330 }
5331 if (restricted != null) {
5332 _json["restricted"] = restricted;
5333 }
5334 if (starred != null) {
5335 _json["starred"] = starred;
5336 }
5337 if (trashed != null) {
5338 _json["trashed"] = trashed;
5339 }
5340 if (viewed != null) {
5341 _json["viewed"] = viewed;
5342 }
5343 return _json;
5344 }
5345 }
5346
5347
5348 /**
5349 * Thumbnail for the file. Only accepted on upload and for files that are not
5350 * already thumbnailed by Google.
5351 */
5352 class FileThumbnail {
5353 /** The URL-safe Base64 encoded bytes of the thumbnail image. */
5354 core.String image;
5355
5356 core.List<core.int> get imageAsBytes {
5357 return crypto.CryptoUtils.base64StringToBytes(image);
5358 }
5359
5360 void set imageAsBytes(core.List<core.int> _bytes) {
5361 image = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
5362 }
5363
5364 /** The MIME type of the thumbnail. */
5365 core.String mimeType;
5366
5367
5368 FileThumbnail();
5369
5370 FileThumbnail.fromJson(core.Map _json) {
5371 if (_json.containsKey("image")) {
5372 image = _json["image"];
5373 }
5374 if (_json.containsKey("mimeType")) {
5375 mimeType = _json["mimeType"];
5376 }
5377 }
5378
5379 core.Map toJson() {
5380 var _json = new core.Map();
5381 if (image != null) {
5382 _json["image"] = image;
5383 }
5384 if (mimeType != null) {
5385 _json["mimeType"] = mimeType;
5386 }
5387 return _json;
5388 }
5389 }
5390
5391
5392 /** The metadata for a file. */
5393 class File {
5394 /** A link for opening the file in a relevant Google editor or viewer. */
5395 core.String alternateLink;
5396
5397 /** Whether this file is in the Application Data folder. */
5398 core.bool appDataContents;
5399
5400 /** Whether the file can be copied by the current user. */
5401 core.bool copyable;
5402
5403 /** Create time for this file (formatted RFC 3339 timestamp). */
5404 core.DateTime createdDate;
5405
5406 /**
5407 * A link to open this file with the user's default app for this file. Only
5408 * populated when the drive.apps.readonly scope is used.
5409 */
5410 core.String defaultOpenWithLink;
5411
5412 /** A short description of the file. */
5413 core.String description;
5414
5415 /**
5416 * Short lived download URL for the file. This is only populated for files
5417 * with content stored in Drive.
5418 */
5419 core.String downloadUrl;
5420
5421 /** Whether the file can be edited by the current user. */
5422 core.bool editable;
5423
5424 /** A link for embedding the file. */
5425 core.String embedLink;
5426
5427 /** ETag of the file. */
5428 core.String etag;
5429
5430 /**
5431 * Whether this file has been explicitly trashed, as opposed to recursively
5432 * trashed. This will only be populated if the file is trashed.
5433 */
5434 core.bool explicitlyTrashed;
5435
5436 /** Links for exporting Google Docs to specific formats. */
5437 core.Map<core.String, core.String> exportLinks;
5438
5439 /**
5440 * The file extension used when downloading this file. This field is read
5441 * only. To set the extension, include it in the title when creating the file.
5442 * This is only populated for files with content stored in Drive.
5443 */
5444 core.String fileExtension;
5445
5446 /**
5447 * The size of the file in bytes. This is only populated for files with
5448 * content stored in Drive.
5449 */
5450 core.String fileSize;
5451
5452 /**
5453 * The ID of the file's head revision. This will only be populated for files
5454 * with content stored in Drive.
5455 */
5456 core.String headRevisionId;
5457
5458 /** A link to the file's icon. */
5459 core.String iconLink;
5460
5461 /** The ID of the file. */
5462 core.String id;
5463
5464 /**
5465 * Metadata about image media. This will only be present for image types, and
5466 * its contents will depend on what can be parsed from the image content.
5467 */
5468 FileImageMediaMetadata imageMediaMetadata;
5469
5470 /** Indexable text attributes for the file (can only be written) */
5471 FileIndexableText indexableText;
5472
5473 /** The type of file. This is always drive#file. */
5474 core.String kind;
5475
5476 /** A group of labels for the file. */
5477 FileLabels labels;
5478
5479 /** The last user to modify this file. */
5480 User lastModifyingUser;
5481
5482 /** Name of the last user to modify this file. */
5483 core.String lastModifyingUserName;
5484
5485 /**
5486 * Last time this file was viewed by the user (formatted RFC 3339 timestamp).
5487 */
5488 core.DateTime lastViewedByMeDate;
5489
5490 /**
5491 * Time this file was explicitly marked viewed by the user (formatted RFC 3339
5492 * timestamp).
5493 */
5494 core.DateTime markedViewedByMeDate;
5495
5496 /**
5497 * An MD5 checksum for the content of this file. This is populated only for
5498 * files with content stored in Drive.
5499 */
5500 core.String md5Checksum;
5501
5502 /**
5503 * The MIME type of the file. This is only mutable on update when uploading
5504 * new content. This field can be left blank, and the mimetype will be
5505 * determined from the uploaded content's MIME type.
5506 */
5507 core.String mimeType;
5508
5509 /**
5510 * Last time this file was modified by the user (formatted RFC 3339
5511 * timestamp). Note that setting modifiedDate will also update the
5512 * modifiedByMe date for the user which set the date.
5513 */
5514 core.DateTime modifiedByMeDate;
5515
5516 /**
5517 * Last time this file was modified by anyone (formatted RFC 3339 timestamp).
5518 * This is only mutable on update when the setModifiedDate parameter is set.
5519 */
5520 core.DateTime modifiedDate;
5521
5522 /**
5523 * A map of the id of each of the user's apps to a link to open this file with
5524 * that app. Only populated when the drive.apps.readonly scope is used.
5525 */
5526 core.Map<core.String, core.String> openWithLinks;
5527
5528 /**
5529 * The original filename if the file was uploaded manually, or the original
5530 * title if the file was inserted through the API. Note that renames of the
5531 * title will not change the original filename. This will only be populated on
5532 * files with content stored in Drive.
5533 */
5534 core.String originalFilename;
5535
5536 /** Name(s) of the owner(s) of this file. */
5537 core.List<core.String> ownerNames;
5538
5539 /** The owner(s) of this file. */
5540 core.List<User> owners;
5541
5542 /**
5543 * Collection of parent folders which contain this file.
5544 * Setting this field will put the file in all of the provided folders. On
5545 * insert, if no folders are provided, the file will be placed in the default
5546 * root folder.
5547 */
5548 core.List<ParentReference> parents;
5549
5550 /** The list of permissions for users with access to this file. */
5551 core.List<Permission> permissions;
5552
5553 /** The list of properties. */
5554 core.List<Property> properties;
5555
5556 /** The number of quota bytes used by this file. */
5557 core.String quotaBytesUsed;
5558
5559 /** A link back to this file. */
5560 core.String selfLink;
5561
5562 /** Whether the file has been shared. */
5563 core.bool shared;
5564
5565 /**
5566 * Time at which this file was shared with the user (formatted RFC 3339
5567 * timestamp).
5568 */
5569 core.DateTime sharedWithMeDate;
5570
5571 /** User that shared the item with the current user, if available. */
5572 User sharingUser;
5573
5574 /**
5575 * Thumbnail for the file. Only accepted on upload and for files that are not
5576 * already thumbnailed by Google.
5577 */
5578 FileThumbnail thumbnail;
5579
5580 /** A link to the file's thumbnail. */
5581 core.String thumbnailLink;
5582
5583 /** The title of this file. */
5584 core.String title;
5585
5586 /** The permissions for the authenticated user on this file. */
5587 Permission userPermission;
5588
5589 /**
5590 * A monotonically increasing version number for the file. This reflects every
5591 * change made to the file on the server, even those not visible to the
5592 * requesting user.
5593 */
5594 core.String version;
5595
5596 /**
5597 * A link for downloading the content of the file in a browser using cookie
5598 * based authentication. In cases where the content is shared publicly, the
5599 * content can be downloaded without any credentials.
5600 */
5601 core.String webContentLink;
5602
5603 /**
5604 * A link only available on public folders for viewing their static web assets
5605 * (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
5606 */
5607 core.String webViewLink;
5608
5609 /** Whether writers can share the document with other users. */
5610 core.bool writersCanShare;
5611
5612
5613 File();
5614
5615 File.fromJson(core.Map _json) {
5616 if (_json.containsKey("alternateLink")) {
5617 alternateLink = _json["alternateLink"];
5618 }
5619 if (_json.containsKey("appDataContents")) {
5620 appDataContents = _json["appDataContents"];
5621 }
5622 if (_json.containsKey("copyable")) {
5623 copyable = _json["copyable"];
5624 }
5625 if (_json.containsKey("createdDate")) {
5626 createdDate = core.DateTime.parse(_json["createdDate"]);
5627 }
5628 if (_json.containsKey("defaultOpenWithLink")) {
5629 defaultOpenWithLink = _json["defaultOpenWithLink"];
5630 }
5631 if (_json.containsKey("description")) {
5632 description = _json["description"];
5633 }
5634 if (_json.containsKey("downloadUrl")) {
5635 downloadUrl = _json["downloadUrl"];
5636 }
5637 if (_json.containsKey("editable")) {
5638 editable = _json["editable"];
5639 }
5640 if (_json.containsKey("embedLink")) {
5641 embedLink = _json["embedLink"];
5642 }
5643 if (_json.containsKey("etag")) {
5644 etag = _json["etag"];
5645 }
5646 if (_json.containsKey("explicitlyTrashed")) {
5647 explicitlyTrashed = _json["explicitlyTrashed"];
5648 }
5649 if (_json.containsKey("exportLinks")) {
5650 exportLinks = _json["exportLinks"];
5651 }
5652 if (_json.containsKey("fileExtension")) {
5653 fileExtension = _json["fileExtension"];
5654 }
5655 if (_json.containsKey("fileSize")) {
5656 fileSize = _json["fileSize"];
5657 }
5658 if (_json.containsKey("headRevisionId")) {
5659 headRevisionId = _json["headRevisionId"];
5660 }
5661 if (_json.containsKey("iconLink")) {
5662 iconLink = _json["iconLink"];
5663 }
5664 if (_json.containsKey("id")) {
5665 id = _json["id"];
5666 }
5667 if (_json.containsKey("imageMediaMetadata")) {
5668 imageMediaMetadata = new FileImageMediaMetadata.fromJson(_json["imageMedia Metadata"]);
5669 }
5670 if (_json.containsKey("indexableText")) {
5671 indexableText = new FileIndexableText.fromJson(_json["indexableText"]);
5672 }
5673 if (_json.containsKey("kind")) {
5674 kind = _json["kind"];
5675 }
5676 if (_json.containsKey("labels")) {
5677 labels = new FileLabels.fromJson(_json["labels"]);
5678 }
5679 if (_json.containsKey("lastModifyingUser")) {
5680 lastModifyingUser = new User.fromJson(_json["lastModifyingUser"]);
5681 }
5682 if (_json.containsKey("lastModifyingUserName")) {
5683 lastModifyingUserName = _json["lastModifyingUserName"];
5684 }
5685 if (_json.containsKey("lastViewedByMeDate")) {
5686 lastViewedByMeDate = core.DateTime.parse(_json["lastViewedByMeDate"]);
5687 }
5688 if (_json.containsKey("markedViewedByMeDate")) {
5689 markedViewedByMeDate = core.DateTime.parse(_json["markedViewedByMeDate"]);
5690 }
5691 if (_json.containsKey("md5Checksum")) {
5692 md5Checksum = _json["md5Checksum"];
5693 }
5694 if (_json.containsKey("mimeType")) {
5695 mimeType = _json["mimeType"];
5696 }
5697 if (_json.containsKey("modifiedByMeDate")) {
5698 modifiedByMeDate = core.DateTime.parse(_json["modifiedByMeDate"]);
5699 }
5700 if (_json.containsKey("modifiedDate")) {
5701 modifiedDate = core.DateTime.parse(_json["modifiedDate"]);
5702 }
5703 if (_json.containsKey("openWithLinks")) {
5704 openWithLinks = _json["openWithLinks"];
5705 }
5706 if (_json.containsKey("originalFilename")) {
5707 originalFilename = _json["originalFilename"];
5708 }
5709 if (_json.containsKey("ownerNames")) {
5710 ownerNames = _json["ownerNames"];
5711 }
5712 if (_json.containsKey("owners")) {
5713 owners = _json["owners"].map((value) => new User.fromJson(value)).toList() ;
5714 }
5715 if (_json.containsKey("parents")) {
5716 parents = _json["parents"].map((value) => new ParentReference.fromJson(val ue)).toList();
5717 }
5718 if (_json.containsKey("permissions")) {
5719 permissions = _json["permissions"].map((value) => new Permission.fromJson( value)).toList();
5720 }
5721 if (_json.containsKey("properties")) {
5722 properties = _json["properties"].map((value) => new Property.fromJson(valu e)).toList();
5723 }
5724 if (_json.containsKey("quotaBytesUsed")) {
5725 quotaBytesUsed = _json["quotaBytesUsed"];
5726 }
5727 if (_json.containsKey("selfLink")) {
5728 selfLink = _json["selfLink"];
5729 }
5730 if (_json.containsKey("shared")) {
5731 shared = _json["shared"];
5732 }
5733 if (_json.containsKey("sharedWithMeDate")) {
5734 sharedWithMeDate = core.DateTime.parse(_json["sharedWithMeDate"]);
5735 }
5736 if (_json.containsKey("sharingUser")) {
5737 sharingUser = new User.fromJson(_json["sharingUser"]);
5738 }
5739 if (_json.containsKey("thumbnail")) {
5740 thumbnail = new FileThumbnail.fromJson(_json["thumbnail"]);
5741 }
5742 if (_json.containsKey("thumbnailLink")) {
5743 thumbnailLink = _json["thumbnailLink"];
5744 }
5745 if (_json.containsKey("title")) {
5746 title = _json["title"];
5747 }
5748 if (_json.containsKey("userPermission")) {
5749 userPermission = new Permission.fromJson(_json["userPermission"]);
5750 }
5751 if (_json.containsKey("version")) {
5752 version = _json["version"];
5753 }
5754 if (_json.containsKey("webContentLink")) {
5755 webContentLink = _json["webContentLink"];
5756 }
5757 if (_json.containsKey("webViewLink")) {
5758 webViewLink = _json["webViewLink"];
5759 }
5760 if (_json.containsKey("writersCanShare")) {
5761 writersCanShare = _json["writersCanShare"];
5762 }
5763 }
5764
5765 core.Map toJson() {
5766 var _json = new core.Map();
5767 if (alternateLink != null) {
5768 _json["alternateLink"] = alternateLink;
5769 }
5770 if (appDataContents != null) {
5771 _json["appDataContents"] = appDataContents;
5772 }
5773 if (copyable != null) {
5774 _json["copyable"] = copyable;
5775 }
5776 if (createdDate != null) {
5777 _json["createdDate"] = (createdDate).toIso8601String();
5778 }
5779 if (defaultOpenWithLink != null) {
5780 _json["defaultOpenWithLink"] = defaultOpenWithLink;
5781 }
5782 if (description != null) {
5783 _json["description"] = description;
5784 }
5785 if (downloadUrl != null) {
5786 _json["downloadUrl"] = downloadUrl;
5787 }
5788 if (editable != null) {
5789 _json["editable"] = editable;
5790 }
5791 if (embedLink != null) {
5792 _json["embedLink"] = embedLink;
5793 }
5794 if (etag != null) {
5795 _json["etag"] = etag;
5796 }
5797 if (explicitlyTrashed != null) {
5798 _json["explicitlyTrashed"] = explicitlyTrashed;
5799 }
5800 if (exportLinks != null) {
5801 _json["exportLinks"] = exportLinks;
5802 }
5803 if (fileExtension != null) {
5804 _json["fileExtension"] = fileExtension;
5805 }
5806 if (fileSize != null) {
5807 _json["fileSize"] = fileSize;
5808 }
5809 if (headRevisionId != null) {
5810 _json["headRevisionId"] = headRevisionId;
5811 }
5812 if (iconLink != null) {
5813 _json["iconLink"] = iconLink;
5814 }
5815 if (id != null) {
5816 _json["id"] = id;
5817 }
5818 if (imageMediaMetadata != null) {
5819 _json["imageMediaMetadata"] = (imageMediaMetadata).toJson();
5820 }
5821 if (indexableText != null) {
5822 _json["indexableText"] = (indexableText).toJson();
5823 }
5824 if (kind != null) {
5825 _json["kind"] = kind;
5826 }
5827 if (labels != null) {
5828 _json["labels"] = (labels).toJson();
5829 }
5830 if (lastModifyingUser != null) {
5831 _json["lastModifyingUser"] = (lastModifyingUser).toJson();
5832 }
5833 if (lastModifyingUserName != null) {
5834 _json["lastModifyingUserName"] = lastModifyingUserName;
5835 }
5836 if (lastViewedByMeDate != null) {
5837 _json["lastViewedByMeDate"] = (lastViewedByMeDate).toIso8601String();
5838 }
5839 if (markedViewedByMeDate != null) {
5840 _json["markedViewedByMeDate"] = (markedViewedByMeDate).toIso8601String();
5841 }
5842 if (md5Checksum != null) {
5843 _json["md5Checksum"] = md5Checksum;
5844 }
5845 if (mimeType != null) {
5846 _json["mimeType"] = mimeType;
5847 }
5848 if (modifiedByMeDate != null) {
5849 _json["modifiedByMeDate"] = (modifiedByMeDate).toIso8601String();
5850 }
5851 if (modifiedDate != null) {
5852 _json["modifiedDate"] = (modifiedDate).toIso8601String();
5853 }
5854 if (openWithLinks != null) {
5855 _json["openWithLinks"] = openWithLinks;
5856 }
5857 if (originalFilename != null) {
5858 _json["originalFilename"] = originalFilename;
5859 }
5860 if (ownerNames != null) {
5861 _json["ownerNames"] = ownerNames;
5862 }
5863 if (owners != null) {
5864 _json["owners"] = owners.map((value) => (value).toJson()).toList();
5865 }
5866 if (parents != null) {
5867 _json["parents"] = parents.map((value) => (value).toJson()).toList();
5868 }
5869 if (permissions != null) {
5870 _json["permissions"] = permissions.map((value) => (value).toJson()).toList ();
5871 }
5872 if (properties != null) {
5873 _json["properties"] = properties.map((value) => (value).toJson()).toList() ;
5874 }
5875 if (quotaBytesUsed != null) {
5876 _json["quotaBytesUsed"] = quotaBytesUsed;
5877 }
5878 if (selfLink != null) {
5879 _json["selfLink"] = selfLink;
5880 }
5881 if (shared != null) {
5882 _json["shared"] = shared;
5883 }
5884 if (sharedWithMeDate != null) {
5885 _json["sharedWithMeDate"] = (sharedWithMeDate).toIso8601String();
5886 }
5887 if (sharingUser != null) {
5888 _json["sharingUser"] = (sharingUser).toJson();
5889 }
5890 if (thumbnail != null) {
5891 _json["thumbnail"] = (thumbnail).toJson();
5892 }
5893 if (thumbnailLink != null) {
5894 _json["thumbnailLink"] = thumbnailLink;
5895 }
5896 if (title != null) {
5897 _json["title"] = title;
5898 }
5899 if (userPermission != null) {
5900 _json["userPermission"] = (userPermission).toJson();
5901 }
5902 if (version != null) {
5903 _json["version"] = version;
5904 }
5905 if (webContentLink != null) {
5906 _json["webContentLink"] = webContentLink;
5907 }
5908 if (webViewLink != null) {
5909 _json["webViewLink"] = webViewLink;
5910 }
5911 if (writersCanShare != null) {
5912 _json["writersCanShare"] = writersCanShare;
5913 }
5914 return _json;
5915 }
5916 }
5917
5918
5919 /** A list of files. */
5920 class FileList {
5921 /** The ETag of the list. */
5922 core.String etag;
5923
5924 /** The actual list of files. */
5925 core.List<File> items;
5926
5927 /** This is always drive#fileList. */
5928 core.String kind;
5929
5930 /** A link to the next page of files. */
5931 core.String nextLink;
5932
5933 /** The page token for the next page of files. */
5934 core.String nextPageToken;
5935
5936 /** A link back to this list. */
5937 core.String selfLink;
5938
5939
5940 FileList();
5941
5942 FileList.fromJson(core.Map _json) {
5943 if (_json.containsKey("etag")) {
5944 etag = _json["etag"];
5945 }
5946 if (_json.containsKey("items")) {
5947 items = _json["items"].map((value) => new File.fromJson(value)).toList();
5948 }
5949 if (_json.containsKey("kind")) {
5950 kind = _json["kind"];
5951 }
5952 if (_json.containsKey("nextLink")) {
5953 nextLink = _json["nextLink"];
5954 }
5955 if (_json.containsKey("nextPageToken")) {
5956 nextPageToken = _json["nextPageToken"];
5957 }
5958 if (_json.containsKey("selfLink")) {
5959 selfLink = _json["selfLink"];
5960 }
5961 }
5962
5963 core.Map toJson() {
5964 var _json = new core.Map();
5965 if (etag != null) {
5966 _json["etag"] = etag;
5967 }
5968 if (items != null) {
5969 _json["items"] = items.map((value) => (value).toJson()).toList();
5970 }
5971 if (kind != null) {
5972 _json["kind"] = kind;
5973 }
5974 if (nextLink != null) {
5975 _json["nextLink"] = nextLink;
5976 }
5977 if (nextPageToken != null) {
5978 _json["nextPageToken"] = nextPageToken;
5979 }
5980 if (selfLink != null) {
5981 _json["selfLink"] = selfLink;
5982 }
5983 return _json;
5984 }
5985 }
5986
5987
5988 /** A list of a file's parents. */
5989 class ParentList {
5990 /** The ETag of the list. */
5991 core.String etag;
5992
5993 /** The actual list of parents. */
5994 core.List<ParentReference> items;
5995
5996 /** This is always drive#parentList. */
5997 core.String kind;
5998
5999 /** A link back to this list. */
6000 core.String selfLink;
6001
6002
6003 ParentList();
6004
6005 ParentList.fromJson(core.Map _json) {
6006 if (_json.containsKey("etag")) {
6007 etag = _json["etag"];
6008 }
6009 if (_json.containsKey("items")) {
6010 items = _json["items"].map((value) => new ParentReference.fromJson(value)) .toList();
6011 }
6012 if (_json.containsKey("kind")) {
6013 kind = _json["kind"];
6014 }
6015 if (_json.containsKey("selfLink")) {
6016 selfLink = _json["selfLink"];
6017 }
6018 }
6019
6020 core.Map toJson() {
6021 var _json = new core.Map();
6022 if (etag != null) {
6023 _json["etag"] = etag;
6024 }
6025 if (items != null) {
6026 _json["items"] = items.map((value) => (value).toJson()).toList();
6027 }
6028 if (kind != null) {
6029 _json["kind"] = kind;
6030 }
6031 if (selfLink != null) {
6032 _json["selfLink"] = selfLink;
6033 }
6034 return _json;
6035 }
6036 }
6037
6038
6039 /** A reference to a file's parent. */
6040 class ParentReference {
6041 /** The ID of the parent. */
6042 core.String id;
6043
6044 /** Whether or not the parent is the root folder. */
6045 core.bool isRoot;
6046
6047 /** This is always drive#parentReference. */
6048 core.String kind;
6049
6050 /** A link to the parent. */
6051 core.String parentLink;
6052
6053 /** A link back to this reference. */
6054 core.String selfLink;
6055
6056
6057 ParentReference();
6058
6059 ParentReference.fromJson(core.Map _json) {
6060 if (_json.containsKey("id")) {
6061 id = _json["id"];
6062 }
6063 if (_json.containsKey("isRoot")) {
6064 isRoot = _json["isRoot"];
6065 }
6066 if (_json.containsKey("kind")) {
6067 kind = _json["kind"];
6068 }
6069 if (_json.containsKey("parentLink")) {
6070 parentLink = _json["parentLink"];
6071 }
6072 if (_json.containsKey("selfLink")) {
6073 selfLink = _json["selfLink"];
6074 }
6075 }
6076
6077 core.Map toJson() {
6078 var _json = new core.Map();
6079 if (id != null) {
6080 _json["id"] = id;
6081 }
6082 if (isRoot != null) {
6083 _json["isRoot"] = isRoot;
6084 }
6085 if (kind != null) {
6086 _json["kind"] = kind;
6087 }
6088 if (parentLink != null) {
6089 _json["parentLink"] = parentLink;
6090 }
6091 if (selfLink != null) {
6092 _json["selfLink"] = selfLink;
6093 }
6094 return _json;
6095 }
6096 }
6097
6098
6099 /** A permission for a file. */
6100 class Permission {
6101 /** Additional roles for this user. Only commenter is currently allowed. */
6102 core.List<core.String> additionalRoles;
6103
6104 /** The authkey parameter required for this permission. */
6105 core.String authKey;
6106
6107 /**
6108 * The domain name of the entity this permission refers to. This is an
6109 * output-only field which is present when the permission type is user, group
6110 * or domain.
6111 */
6112 core.String domain;
6113
6114 /**
6115 * The email address of the user this permission refers to. This is an
6116 * output-only field which is present when the permission type is user and the
6117 * given user's Google+ profile privacy settings allow exposing their email
6118 * address.
6119 */
6120 core.String emailAddress;
6121
6122 /** The ETag of the permission. */
6123 core.String etag;
6124
6125 /**
6126 * The ID of the user this permission refers to, and identical to the
6127 * permissionId in the About and Files resources. When making a
6128 * drive.permissions.insert request, exactly one of the id or value fields
6129 * must be specified.
6130 */
6131 core.String id;
6132
6133 /** This is always drive#permission. */
6134 core.String kind;
6135
6136 /** The name for this permission. */
6137 core.String name;
6138
6139 /** A link to the profile photo, if available. */
6140 core.String photoLink;
6141
6142 /**
6143 * The primary role for this user. Allowed values are:
6144 * - owner
6145 * - reader
6146 * - writer
6147 */
6148 core.String role;
6149
6150 /** A link back to this permission. */
6151 core.String selfLink;
6152
6153 /**
6154 * The account type. Allowed values are:
6155 * - user
6156 * - group
6157 * - domain
6158 * - anyone
6159 */
6160 core.String type;
6161
6162 /**
6163 * The email address or domain name for the entity. This is used during
6164 * inserts and is not populated in responses. When making a
6165 * drive.permissions.insert request, exactly one of the id or value fields
6166 * must be specified.
6167 */
6168 core.String value;
6169
6170 /** Whether the link is required for this permission. */
6171 core.bool withLink;
6172
6173
6174 Permission();
6175
6176 Permission.fromJson(core.Map _json) {
6177 if (_json.containsKey("additionalRoles")) {
6178 additionalRoles = _json["additionalRoles"];
6179 }
6180 if (_json.containsKey("authKey")) {
6181 authKey = _json["authKey"];
6182 }
6183 if (_json.containsKey("domain")) {
6184 domain = _json["domain"];
6185 }
6186 if (_json.containsKey("emailAddress")) {
6187 emailAddress = _json["emailAddress"];
6188 }
6189 if (_json.containsKey("etag")) {
6190 etag = _json["etag"];
6191 }
6192 if (_json.containsKey("id")) {
6193 id = _json["id"];
6194 }
6195 if (_json.containsKey("kind")) {
6196 kind = _json["kind"];
6197 }
6198 if (_json.containsKey("name")) {
6199 name = _json["name"];
6200 }
6201 if (_json.containsKey("photoLink")) {
6202 photoLink = _json["photoLink"];
6203 }
6204 if (_json.containsKey("role")) {
6205 role = _json["role"];
6206 }
6207 if (_json.containsKey("selfLink")) {
6208 selfLink = _json["selfLink"];
6209 }
6210 if (_json.containsKey("type")) {
6211 type = _json["type"];
6212 }
6213 if (_json.containsKey("value")) {
6214 value = _json["value"];
6215 }
6216 if (_json.containsKey("withLink")) {
6217 withLink = _json["withLink"];
6218 }
6219 }
6220
6221 core.Map toJson() {
6222 var _json = new core.Map();
6223 if (additionalRoles != null) {
6224 _json["additionalRoles"] = additionalRoles;
6225 }
6226 if (authKey != null) {
6227 _json["authKey"] = authKey;
6228 }
6229 if (domain != null) {
6230 _json["domain"] = domain;
6231 }
6232 if (emailAddress != null) {
6233 _json["emailAddress"] = emailAddress;
6234 }
6235 if (etag != null) {
6236 _json["etag"] = etag;
6237 }
6238 if (id != null) {
6239 _json["id"] = id;
6240 }
6241 if (kind != null) {
6242 _json["kind"] = kind;
6243 }
6244 if (name != null) {
6245 _json["name"] = name;
6246 }
6247 if (photoLink != null) {
6248 _json["photoLink"] = photoLink;
6249 }
6250 if (role != null) {
6251 _json["role"] = role;
6252 }
6253 if (selfLink != null) {
6254 _json["selfLink"] = selfLink;
6255 }
6256 if (type != null) {
6257 _json["type"] = type;
6258 }
6259 if (value != null) {
6260 _json["value"] = value;
6261 }
6262 if (withLink != null) {
6263 _json["withLink"] = withLink;
6264 }
6265 return _json;
6266 }
6267 }
6268
6269
6270 /** An ID for a user or group as seen in Permission items. */
6271 class PermissionId {
6272 /** The permission ID. */
6273 core.String id;
6274
6275 /** This is always drive#permissionId. */
6276 core.String kind;
6277
6278
6279 PermissionId();
6280
6281 PermissionId.fromJson(core.Map _json) {
6282 if (_json.containsKey("id")) {
6283 id = _json["id"];
6284 }
6285 if (_json.containsKey("kind")) {
6286 kind = _json["kind"];
6287 }
6288 }
6289
6290 core.Map toJson() {
6291 var _json = new core.Map();
6292 if (id != null) {
6293 _json["id"] = id;
6294 }
6295 if (kind != null) {
6296 _json["kind"] = kind;
6297 }
6298 return _json;
6299 }
6300 }
6301
6302
6303 /** A list of permissions associated with a file. */
6304 class PermissionList {
6305 /** The ETag of the list. */
6306 core.String etag;
6307
6308 /** The actual list of permissions. */
6309 core.List<Permission> items;
6310
6311 /** This is always drive#permissionList. */
6312 core.String kind;
6313
6314 /** A link back to this list. */
6315 core.String selfLink;
6316
6317
6318 PermissionList();
6319
6320 PermissionList.fromJson(core.Map _json) {
6321 if (_json.containsKey("etag")) {
6322 etag = _json["etag"];
6323 }
6324 if (_json.containsKey("items")) {
6325 items = _json["items"].map((value) => new Permission.fromJson(value)).toLi st();
6326 }
6327 if (_json.containsKey("kind")) {
6328 kind = _json["kind"];
6329 }
6330 if (_json.containsKey("selfLink")) {
6331 selfLink = _json["selfLink"];
6332 }
6333 }
6334
6335 core.Map toJson() {
6336 var _json = new core.Map();
6337 if (etag != null) {
6338 _json["etag"] = etag;
6339 }
6340 if (items != null) {
6341 _json["items"] = items.map((value) => (value).toJson()).toList();
6342 }
6343 if (kind != null) {
6344 _json["kind"] = kind;
6345 }
6346 if (selfLink != null) {
6347 _json["selfLink"] = selfLink;
6348 }
6349 return _json;
6350 }
6351 }
6352
6353
6354 /** A key-value pair that is either public or private to an application. */
6355 class Property {
6356 /** ETag of the property. */
6357 core.String etag;
6358
6359 /** The key of this property. */
6360 core.String key;
6361
6362 /** This is always drive#property. */
6363 core.String kind;
6364
6365 /** The link back to this property. */
6366 core.String selfLink;
6367
6368 /** The value of this property. */
6369 core.String value;
6370
6371 /** The visibility of this property. */
6372 core.String visibility;
6373
6374
6375 Property();
6376
6377 Property.fromJson(core.Map _json) {
6378 if (_json.containsKey("etag")) {
6379 etag = _json["etag"];
6380 }
6381 if (_json.containsKey("key")) {
6382 key = _json["key"];
6383 }
6384 if (_json.containsKey("kind")) {
6385 kind = _json["kind"];
6386 }
6387 if (_json.containsKey("selfLink")) {
6388 selfLink = _json["selfLink"];
6389 }
6390 if (_json.containsKey("value")) {
6391 value = _json["value"];
6392 }
6393 if (_json.containsKey("visibility")) {
6394 visibility = _json["visibility"];
6395 }
6396 }
6397
6398 core.Map toJson() {
6399 var _json = new core.Map();
6400 if (etag != null) {
6401 _json["etag"] = etag;
6402 }
6403 if (key != null) {
6404 _json["key"] = key;
6405 }
6406 if (kind != null) {
6407 _json["kind"] = kind;
6408 }
6409 if (selfLink != null) {
6410 _json["selfLink"] = selfLink;
6411 }
6412 if (value != null) {
6413 _json["value"] = value;
6414 }
6415 if (visibility != null) {
6416 _json["visibility"] = visibility;
6417 }
6418 return _json;
6419 }
6420 }
6421
6422
6423 /**
6424 * A collection of properties, key-value pairs that are either public or private
6425 * to an application.
6426 */
6427 class PropertyList {
6428 /** The ETag of the list. */
6429 core.String etag;
6430
6431 /** The list of properties. */
6432 core.List<Property> items;
6433
6434 /** This is always drive#propertyList. */
6435 core.String kind;
6436
6437 /** The link back to this list. */
6438 core.String selfLink;
6439
6440
6441 PropertyList();
6442
6443 PropertyList.fromJson(core.Map _json) {
6444 if (_json.containsKey("etag")) {
6445 etag = _json["etag"];
6446 }
6447 if (_json.containsKey("items")) {
6448 items = _json["items"].map((value) => new Property.fromJson(value)).toList ();
6449 }
6450 if (_json.containsKey("kind")) {
6451 kind = _json["kind"];
6452 }
6453 if (_json.containsKey("selfLink")) {
6454 selfLink = _json["selfLink"];
6455 }
6456 }
6457
6458 core.Map toJson() {
6459 var _json = new core.Map();
6460 if (etag != null) {
6461 _json["etag"] = etag;
6462 }
6463 if (items != null) {
6464 _json["items"] = items.map((value) => (value).toJson()).toList();
6465 }
6466 if (kind != null) {
6467 _json["kind"] = kind;
6468 }
6469 if (selfLink != null) {
6470 _json["selfLink"] = selfLink;
6471 }
6472 return _json;
6473 }
6474 }
6475
6476
6477 /** A revision of a file. */
6478 class Revision {
6479 /**
6480 * Short term download URL for the file. This will only be populated on files
6481 * with content stored in Drive.
6482 */
6483 core.String downloadUrl;
6484
6485 /** The ETag of the revision. */
6486 core.String etag;
6487
6488 /** Links for exporting Google Docs to specific formats. */
6489 core.Map<core.String, core.String> exportLinks;
6490
6491 /**
6492 * The size of the revision in bytes. This will only be populated on files
6493 * with content stored in Drive.
6494 */
6495 core.String fileSize;
6496
6497 /** The ID of the revision. */
6498 core.String id;
6499
6500 /** This is always drive#revision. */
6501 core.String kind;
6502
6503 /** The last user to modify this revision. */
6504 User lastModifyingUser;
6505
6506 /** Name of the last user to modify this revision. */
6507 core.String lastModifyingUserName;
6508
6509 /**
6510 * An MD5 checksum for the content of this revision. This will only be
6511 * populated on files with content stored in Drive.
6512 */
6513 core.String md5Checksum;
6514
6515 /** The MIME type of the revision. */
6516 core.String mimeType;
6517
6518 /** Last time this revision was modified (formatted RFC 3339 timestamp). */
6519 core.DateTime modifiedDate;
6520
6521 /**
6522 * The original filename when this revision was created. This will only be
6523 * populated on files with content stored in Drive.
6524 */
6525 core.String originalFilename;
6526
6527 /**
6528 * Whether this revision is pinned to prevent automatic purging. This will
6529 * only be populated and can only be modified on files with content stored in
6530 * Drive which are not Google Docs. Revisions can also be pinned when they are
6531 * created through the drive.files.insert/update/copy by using the pinned
6532 * query parameter.
6533 */
6534 core.bool pinned;
6535
6536 /**
6537 * Whether subsequent revisions will be automatically republished. This is
6538 * only populated and can only be modified for Google Docs.
6539 */
6540 core.bool publishAuto;
6541
6542 /**
6543 * Whether this revision is published. This is only populated and can only be
6544 * modified for Google Docs.
6545 */
6546 core.bool published;
6547
6548 /** A link to the published revision. */
6549 core.String publishedLink;
6550
6551 /**
6552 * Whether this revision is published outside the domain. This is only
6553 * populated and can only be modified for Google Docs.
6554 */
6555 core.bool publishedOutsideDomain;
6556
6557 /** A link back to this revision. */
6558 core.String selfLink;
6559
6560
6561 Revision();
6562
6563 Revision.fromJson(core.Map _json) {
6564 if (_json.containsKey("downloadUrl")) {
6565 downloadUrl = _json["downloadUrl"];
6566 }
6567 if (_json.containsKey("etag")) {
6568 etag = _json["etag"];
6569 }
6570 if (_json.containsKey("exportLinks")) {
6571 exportLinks = _json["exportLinks"];
6572 }
6573 if (_json.containsKey("fileSize")) {
6574 fileSize = _json["fileSize"];
6575 }
6576 if (_json.containsKey("id")) {
6577 id = _json["id"];
6578 }
6579 if (_json.containsKey("kind")) {
6580 kind = _json["kind"];
6581 }
6582 if (_json.containsKey("lastModifyingUser")) {
6583 lastModifyingUser = new User.fromJson(_json["lastModifyingUser"]);
6584 }
6585 if (_json.containsKey("lastModifyingUserName")) {
6586 lastModifyingUserName = _json["lastModifyingUserName"];
6587 }
6588 if (_json.containsKey("md5Checksum")) {
6589 md5Checksum = _json["md5Checksum"];
6590 }
6591 if (_json.containsKey("mimeType")) {
6592 mimeType = _json["mimeType"];
6593 }
6594 if (_json.containsKey("modifiedDate")) {
6595 modifiedDate = core.DateTime.parse(_json["modifiedDate"]);
6596 }
6597 if (_json.containsKey("originalFilename")) {
6598 originalFilename = _json["originalFilename"];
6599 }
6600 if (_json.containsKey("pinned")) {
6601 pinned = _json["pinned"];
6602 }
6603 if (_json.containsKey("publishAuto")) {
6604 publishAuto = _json["publishAuto"];
6605 }
6606 if (_json.containsKey("published")) {
6607 published = _json["published"];
6608 }
6609 if (_json.containsKey("publishedLink")) {
6610 publishedLink = _json["publishedLink"];
6611 }
6612 if (_json.containsKey("publishedOutsideDomain")) {
6613 publishedOutsideDomain = _json["publishedOutsideDomain"];
6614 }
6615 if (_json.containsKey("selfLink")) {
6616 selfLink = _json["selfLink"];
6617 }
6618 }
6619
6620 core.Map toJson() {
6621 var _json = new core.Map();
6622 if (downloadUrl != null) {
6623 _json["downloadUrl"] = downloadUrl;
6624 }
6625 if (etag != null) {
6626 _json["etag"] = etag;
6627 }
6628 if (exportLinks != null) {
6629 _json["exportLinks"] = exportLinks;
6630 }
6631 if (fileSize != null) {
6632 _json["fileSize"] = fileSize;
6633 }
6634 if (id != null) {
6635 _json["id"] = id;
6636 }
6637 if (kind != null) {
6638 _json["kind"] = kind;
6639 }
6640 if (lastModifyingUser != null) {
6641 _json["lastModifyingUser"] = (lastModifyingUser).toJson();
6642 }
6643 if (lastModifyingUserName != null) {
6644 _json["lastModifyingUserName"] = lastModifyingUserName;
6645 }
6646 if (md5Checksum != null) {
6647 _json["md5Checksum"] = md5Checksum;
6648 }
6649 if (mimeType != null) {
6650 _json["mimeType"] = mimeType;
6651 }
6652 if (modifiedDate != null) {
6653 _json["modifiedDate"] = (modifiedDate).toIso8601String();
6654 }
6655 if (originalFilename != null) {
6656 _json["originalFilename"] = originalFilename;
6657 }
6658 if (pinned != null) {
6659 _json["pinned"] = pinned;
6660 }
6661 if (publishAuto != null) {
6662 _json["publishAuto"] = publishAuto;
6663 }
6664 if (published != null) {
6665 _json["published"] = published;
6666 }
6667 if (publishedLink != null) {
6668 _json["publishedLink"] = publishedLink;
6669 }
6670 if (publishedOutsideDomain != null) {
6671 _json["publishedOutsideDomain"] = publishedOutsideDomain;
6672 }
6673 if (selfLink != null) {
6674 _json["selfLink"] = selfLink;
6675 }
6676 return _json;
6677 }
6678 }
6679
6680
6681 /** A list of revisions of a file. */
6682 class RevisionList {
6683 /** The ETag of the list. */
6684 core.String etag;
6685
6686 /** The actual list of revisions. */
6687 core.List<Revision> items;
6688
6689 /** This is always drive#revisionList. */
6690 core.String kind;
6691
6692 /** A link back to this list. */
6693 core.String selfLink;
6694
6695
6696 RevisionList();
6697
6698 RevisionList.fromJson(core.Map _json) {
6699 if (_json.containsKey("etag")) {
6700 etag = _json["etag"];
6701 }
6702 if (_json.containsKey("items")) {
6703 items = _json["items"].map((value) => new Revision.fromJson(value)).toList ();
6704 }
6705 if (_json.containsKey("kind")) {
6706 kind = _json["kind"];
6707 }
6708 if (_json.containsKey("selfLink")) {
6709 selfLink = _json["selfLink"];
6710 }
6711 }
6712
6713 core.Map toJson() {
6714 var _json = new core.Map();
6715 if (etag != null) {
6716 _json["etag"] = etag;
6717 }
6718 if (items != null) {
6719 _json["items"] = items.map((value) => (value).toJson()).toList();
6720 }
6721 if (kind != null) {
6722 _json["kind"] = kind;
6723 }
6724 if (selfLink != null) {
6725 _json["selfLink"] = selfLink;
6726 }
6727 return _json;
6728 }
6729 }
6730
6731
6732 /** The user's profile picture. */
6733 class UserPicture {
6734 /** A URL that points to a profile picture of this user. */
6735 core.String url;
6736
6737
6738 UserPicture();
6739
6740 UserPicture.fromJson(core.Map _json) {
6741 if (_json.containsKey("url")) {
6742 url = _json["url"];
6743 }
6744 }
6745
6746 core.Map toJson() {
6747 var _json = new core.Map();
6748 if (url != null) {
6749 _json["url"] = url;
6750 }
6751 return _json;
6752 }
6753 }
6754
6755
6756 /** The JSON template for a user. */
6757 class User {
6758 /** A plain text displayable name for this user. */
6759 core.String displayName;
6760
6761 /** The email address of the user. */
6762 core.String emailAddress;
6763
6764 /**
6765 * Whether this user is the same as the authenticated user for whom the
6766 * request was made.
6767 */
6768 core.bool isAuthenticatedUser;
6769
6770 /** This is always drive#user. */
6771 core.String kind;
6772
6773 /** The user's ID as visible in the permissions collection. */
6774 core.String permissionId;
6775
6776 /** The user's profile picture. */
6777 UserPicture picture;
6778
6779
6780 User();
6781
6782 User.fromJson(core.Map _json) {
6783 if (_json.containsKey("displayName")) {
6784 displayName = _json["displayName"];
6785 }
6786 if (_json.containsKey("emailAddress")) {
6787 emailAddress = _json["emailAddress"];
6788 }
6789 if (_json.containsKey("isAuthenticatedUser")) {
6790 isAuthenticatedUser = _json["isAuthenticatedUser"];
6791 }
6792 if (_json.containsKey("kind")) {
6793 kind = _json["kind"];
6794 }
6795 if (_json.containsKey("permissionId")) {
6796 permissionId = _json["permissionId"];
6797 }
6798 if (_json.containsKey("picture")) {
6799 picture = new UserPicture.fromJson(_json["picture"]);
6800 }
6801 }
6802
6803 core.Map toJson() {
6804 var _json = new core.Map();
6805 if (displayName != null) {
6806 _json["displayName"] = displayName;
6807 }
6808 if (emailAddress != null) {
6809 _json["emailAddress"] = emailAddress;
6810 }
6811 if (isAuthenticatedUser != null) {
6812 _json["isAuthenticatedUser"] = isAuthenticatedUser;
6813 }
6814 if (kind != null) {
6815 _json["kind"] = kind;
6816 }
6817 if (permissionId != null) {
6818 _json["permissionId"] = permissionId;
6819 }
6820 if (picture != null) {
6821 _json["picture"] = (picture).toJson();
6822 }
6823 return _json;
6824 }
6825 }
6826
6827
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698