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

Side by Side Diff: generated/googleapis/lib/drive/v3.dart

Issue 2734843002: Api-roll 46: 2017-03-06 (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « generated/googleapis/lib/drive/v2.dart ('k') | generated/googleapis/lib/firebaserules/v1.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // This is a generated file (see the discoveryapis_generator project). 1 // This is a generated file (see the discoveryapis_generator project).
2 2
3 library googleapis.drive.v3; 3 library googleapis.drive.v3;
4 4
5 import 'dart:core' as core; 5 import 'dart:core' as core;
6 import 'dart:async' as async; 6 import 'dart:async' as async;
7 import 'dart:convert' as convert; 7 import 'dart:convert' as convert;
8 8
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
10 import 'package:http/http.dart' as http; 10 import 'package:http/http.dart' as http;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 final commons.ApiRequester _requester; 52 final commons.ApiRequester _requester;
53 53
54 AboutResourceApi get about => new AboutResourceApi(_requester); 54 AboutResourceApi get about => new AboutResourceApi(_requester);
55 ChangesResourceApi get changes => new ChangesResourceApi(_requester); 55 ChangesResourceApi get changes => new ChangesResourceApi(_requester);
56 ChannelsResourceApi get channels => new ChannelsResourceApi(_requester); 56 ChannelsResourceApi get channels => new ChannelsResourceApi(_requester);
57 CommentsResourceApi get comments => new CommentsResourceApi(_requester); 57 CommentsResourceApi get comments => new CommentsResourceApi(_requester);
58 FilesResourceApi get files => new FilesResourceApi(_requester); 58 FilesResourceApi get files => new FilesResourceApi(_requester);
59 PermissionsResourceApi get permissions => new PermissionsResourceApi(_requeste r); 59 PermissionsResourceApi get permissions => new PermissionsResourceApi(_requeste r);
60 RepliesResourceApi get replies => new RepliesResourceApi(_requester); 60 RepliesResourceApi get replies => new RepliesResourceApi(_requester);
61 RevisionsResourceApi get revisions => new RevisionsResourceApi(_requester); 61 RevisionsResourceApi get revisions => new RevisionsResourceApi(_requester);
62 TeamdrivesResourceApi get teamdrives => new TeamdrivesResourceApi(_requester);
62 63
63 DriveApi(http.Client client, {core.String rootUrl: "https://www.googleapis.com /", core.String servicePath: "drive/v3/"}) : 64 DriveApi(http.Client client, {core.String rootUrl: "https://www.googleapis.com /", core.String servicePath: "drive/v3/"}) :
64 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A GENT); 65 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A GENT);
65 } 66 }
66 67
67 68
68 class AboutResourceApi { 69 class AboutResourceApi {
69 final commons.ApiRequester _requester; 70 final commons.ApiRequester _requester;
70 71
71 AboutResourceApi(commons.ApiRequester client) : 72 AboutResourceApi(commons.ApiRequester client) :
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 final commons.ApiRequester _requester; 113 final commons.ApiRequester _requester;
113 114
114 ChangesResourceApi(commons.ApiRequester client) : 115 ChangesResourceApi(commons.ApiRequester client) :
115 _requester = client; 116 _requester = client;
116 117
117 /** 118 /**
118 * Gets the starting pageToken for listing future changes. 119 * Gets the starting pageToken for listing future changes.
119 * 120 *
120 * Request parameters: 121 * Request parameters:
121 * 122 *
123 * [supportsTeamDrives] - Whether the requesting application supports Team
124 * Drives.
125 *
126 * [teamDriveId] - The ID of the Team Drive for which the starting pageToken
127 * for listing future changes from that Team Drive will be returned.
128 *
122 * Completes with a [StartPageToken]. 129 * Completes with a [StartPageToken].
123 * 130 *
124 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 131 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
125 * error. 132 * error.
126 * 133 *
127 * If the used [http.Client] completes with an error when making a REST call, 134 * If the used [http.Client] completes with an error when making a REST call,
128 * this method will complete with the same error. 135 * this method will complete with the same error.
129 */ 136 */
130 async.Future<StartPageToken> getStartPageToken() { 137 async.Future<StartPageToken> getStartPageToken({core.bool supportsTeamDrives, core.String teamDriveId}) {
131 var _url = null; 138 var _url = null;
132 var _queryParams = new core.Map(); 139 var _queryParams = new core.Map();
133 var _uploadMedia = null; 140 var _uploadMedia = null;
134 var _uploadOptions = null; 141 var _uploadOptions = null;
135 var _downloadOptions = commons.DownloadOptions.Metadata; 142 var _downloadOptions = commons.DownloadOptions.Metadata;
136 var _body = null; 143 var _body = null;
137 144
145 if (supportsTeamDrives != null) {
146 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
147 }
148 if (teamDriveId != null) {
149 _queryParams["teamDriveId"] = [teamDriveId];
150 }
138 151
139 _url = 'changes/startPageToken'; 152 _url = 'changes/startPageToken';
140 153
141 var _response = _requester.request(_url, 154 var _response = _requester.request(_url,
142 "GET", 155 "GET",
143 body: _body, 156 body: _body,
144 queryParams: _queryParams, 157 queryParams: _queryParams,
145 uploadOptions: _uploadOptions, 158 uploadOptions: _uploadOptions,
146 uploadMedia: _uploadMedia, 159 uploadMedia: _uploadMedia,
147 downloadOptions: _downloadOptions); 160 downloadOptions: _downloadOptions);
148 return _response.then((data) => new StartPageToken.fromJson(data)); 161 return _response.then((data) => new StartPageToken.fromJson(data));
149 } 162 }
150 163
151 /** 164 /**
152 * Lists changes for a user. 165 * Lists the changes for a user or Team Drive.
153 * 166 *
154 * Request parameters: 167 * Request parameters:
155 * 168 *
156 * [pageToken] - The token for continuing a previous list request on the next 169 * [pageToken] - The token for continuing a previous list request on the next
157 * page. This should be set to the value of 'nextPageToken' from the previous 170 * page. This should be set to the value of 'nextPageToken' from the previous
158 * response or to the response from the getStartPageToken method. 171 * response or to the response from the getStartPageToken method.
159 * 172 *
173 * [includeCorpusRemovals] - Whether changes should include the file resource
174 * if the file is still accessible by the user at the time of the request,
175 * even when a file was removed from the list of changes and there will be no
176 * further change entries for this file.
177 *
160 * [includeRemoved] - Whether to include changes indicating that items have 178 * [includeRemoved] - Whether to include changes indicating that items have
161 * left the view of the changes list, for example by deletion or lost access. 179 * been removed from the list of changes, for example by deletion or loss of
180 * access.
181 *
182 * [includeTeamDriveItems] - Whether Team Drive files or changes should be
183 * included in results.
162 * 184 *
163 * [pageSize] - The maximum number of changes to return per page. 185 * [pageSize] - The maximum number of changes to return per page.
164 * Value must be between "1" and "1000". 186 * Value must be between "1" and "1000".
165 * 187 *
166 * [restrictToMyDrive] - Whether to restrict the results to changes inside the 188 * [restrictToMyDrive] - Whether to restrict the results to changes inside the
167 * My Drive hierarchy. This omits changes to files such as those in the 189 * My Drive hierarchy. This omits changes to files such as those in the
168 * Application Data folder or shared files which have not been added to My 190 * Application Data folder or shared files which have not been added to My
169 * Drive. 191 * Drive.
170 * 192 *
171 * [spaces] - A comma-separated list of spaces to query within the user 193 * [spaces] - A comma-separated list of spaces to query within the user
172 * corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. 194 * corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
173 * 195 *
196 * [supportsTeamDrives] - Whether the requesting application supports Team
197 * Drives.
198 *
199 * [teamDriveId] - The Team Drive from which changes will be returned. If
200 * specified the change IDs will be reflective of the Team Drive; use the
201 * combined Team Drive ID and change ID as an identifier.
202 *
174 * Completes with a [ChangeList]. 203 * Completes with a [ChangeList].
175 * 204 *
176 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 205 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
177 * error. 206 * error.
178 * 207 *
179 * If the used [http.Client] completes with an error when making a REST call, 208 * If the used [http.Client] completes with an error when making a REST call,
180 * this method will complete with the same error. 209 * this method will complete with the same error.
181 */ 210 */
182 async.Future<ChangeList> list(core.String pageToken, {core.bool includeRemoved , core.int pageSize, core.bool restrictToMyDrive, core.String spaces}) { 211 async.Future<ChangeList> list(core.String pageToken, {core.bool includeCorpusR emovals, core.bool includeRemoved, core.bool includeTeamDriveItems, core.int pag eSize, core.bool restrictToMyDrive, core.String spaces, core.bool supportsTeamDr ives, core.String teamDriveId}) {
183 var _url = null; 212 var _url = null;
184 var _queryParams = new core.Map(); 213 var _queryParams = new core.Map();
185 var _uploadMedia = null; 214 var _uploadMedia = null;
186 var _uploadOptions = null; 215 var _uploadOptions = null;
187 var _downloadOptions = commons.DownloadOptions.Metadata; 216 var _downloadOptions = commons.DownloadOptions.Metadata;
188 var _body = null; 217 var _body = null;
189 218
190 if (pageToken == null) { 219 if (pageToken == null) {
191 throw new core.ArgumentError("Parameter pageToken is required."); 220 throw new core.ArgumentError("Parameter pageToken is required.");
192 } 221 }
193 _queryParams["pageToken"] = [pageToken]; 222 _queryParams["pageToken"] = [pageToken];
223 if (includeCorpusRemovals != null) {
224 _queryParams["includeCorpusRemovals"] = ["${includeCorpusRemovals}"];
225 }
194 if (includeRemoved != null) { 226 if (includeRemoved != null) {
195 _queryParams["includeRemoved"] = ["${includeRemoved}"]; 227 _queryParams["includeRemoved"] = ["${includeRemoved}"];
196 } 228 }
229 if (includeTeamDriveItems != null) {
230 _queryParams["includeTeamDriveItems"] = ["${includeTeamDriveItems}"];
231 }
197 if (pageSize != null) { 232 if (pageSize != null) {
198 _queryParams["pageSize"] = ["${pageSize}"]; 233 _queryParams["pageSize"] = ["${pageSize}"];
199 } 234 }
200 if (restrictToMyDrive != null) { 235 if (restrictToMyDrive != null) {
201 _queryParams["restrictToMyDrive"] = ["${restrictToMyDrive}"]; 236 _queryParams["restrictToMyDrive"] = ["${restrictToMyDrive}"];
202 } 237 }
203 if (spaces != null) { 238 if (spaces != null) {
204 _queryParams["spaces"] = [spaces]; 239 _queryParams["spaces"] = [spaces];
205 } 240 }
241 if (supportsTeamDrives != null) {
242 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
243 }
244 if (teamDriveId != null) {
245 _queryParams["teamDriveId"] = [teamDriveId];
246 }
206 247
207 _url = 'changes'; 248 _url = 'changes';
208 249
209 var _response = _requester.request(_url, 250 var _response = _requester.request(_url,
210 "GET", 251 "GET",
211 body: _body, 252 body: _body,
212 queryParams: _queryParams, 253 queryParams: _queryParams,
213 uploadOptions: _uploadOptions, 254 uploadOptions: _uploadOptions,
214 uploadMedia: _uploadMedia, 255 uploadMedia: _uploadMedia,
215 downloadOptions: _downloadOptions); 256 downloadOptions: _downloadOptions);
216 return _response.then((data) => new ChangeList.fromJson(data)); 257 return _response.then((data) => new ChangeList.fromJson(data));
217 } 258 }
218 259
219 /** 260 /**
220 * Subscribes to changes for a user. 261 * Subscribes to changes for a user.
221 * 262 *
222 * [request] - The metadata request object. 263 * [request] - The metadata request object.
223 * 264 *
224 * Request parameters: 265 * Request parameters:
225 * 266 *
226 * [pageToken] - The token for continuing a previous list request on the next 267 * [pageToken] - The token for continuing a previous list request on the next
227 * page. This should be set to the value of 'nextPageToken' from the previous 268 * page. This should be set to the value of 'nextPageToken' from the previous
228 * response or to the response from the getStartPageToken method. 269 * response or to the response from the getStartPageToken method.
229 * 270 *
271 * [includeCorpusRemovals] - Whether changes should include the file resource
272 * if the file is still accessible by the user at the time of the request,
273 * even when a file was removed from the list of changes and there will be no
274 * further change entries for this file.
275 *
230 * [includeRemoved] - Whether to include changes indicating that items have 276 * [includeRemoved] - Whether to include changes indicating that items have
231 * left the view of the changes list, for example by deletion or lost access. 277 * been removed from the list of changes, for example by deletion or loss of
278 * access.
279 *
280 * [includeTeamDriveItems] - Whether Team Drive files or changes should be
281 * included in results.
232 * 282 *
233 * [pageSize] - The maximum number of changes to return per page. 283 * [pageSize] - The maximum number of changes to return per page.
234 * Value must be between "1" and "1000". 284 * Value must be between "1" and "1000".
235 * 285 *
236 * [restrictToMyDrive] - Whether to restrict the results to changes inside the 286 * [restrictToMyDrive] - Whether to restrict the results to changes inside the
237 * My Drive hierarchy. This omits changes to files such as those in the 287 * My Drive hierarchy. This omits changes to files such as those in the
238 * Application Data folder or shared files which have not been added to My 288 * Application Data folder or shared files which have not been added to My
239 * Drive. 289 * Drive.
240 * 290 *
241 * [spaces] - A comma-separated list of spaces to query within the user 291 * [spaces] - A comma-separated list of spaces to query within the user
242 * corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. 292 * corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
243 * 293 *
294 * [supportsTeamDrives] - Whether the requesting application supports Team
295 * Drives.
296 *
297 * [teamDriveId] - The Team Drive from which changes will be returned. If
298 * specified the change IDs will be reflective of the Team Drive; use the
299 * combined Team Drive ID and change ID as an identifier.
300 *
244 * Completes with a [Channel]. 301 * Completes with a [Channel].
245 * 302 *
246 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 303 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
247 * error. 304 * error.
248 * 305 *
249 * If the used [http.Client] completes with an error when making a REST call, 306 * If the used [http.Client] completes with an error when making a REST call,
250 * this method will complete with the same error. 307 * this method will complete with the same error.
251 */ 308 */
252 async.Future<Channel> watch(Channel request, core.String pageToken, {core.bool includeRemoved, core.int pageSize, core.bool restrictToMyDrive, core.String spa ces}) { 309 async.Future<Channel> watch(Channel request, core.String pageToken, {core.bool includeCorpusRemovals, core.bool includeRemoved, core.bool includeTeamDriveItem s, core.int pageSize, core.bool restrictToMyDrive, core.String spaces, core.bool supportsTeamDrives, core.String teamDriveId}) {
253 var _url = null; 310 var _url = null;
254 var _queryParams = new core.Map(); 311 var _queryParams = new core.Map();
255 var _uploadMedia = null; 312 var _uploadMedia = null;
256 var _uploadOptions = null; 313 var _uploadOptions = null;
257 var _downloadOptions = commons.DownloadOptions.Metadata; 314 var _downloadOptions = commons.DownloadOptions.Metadata;
258 var _body = null; 315 var _body = null;
259 316
260 if (request != null) { 317 if (request != null) {
261 _body = convert.JSON.encode((request).toJson()); 318 _body = convert.JSON.encode((request).toJson());
262 } 319 }
263 if (pageToken == null) { 320 if (pageToken == null) {
264 throw new core.ArgumentError("Parameter pageToken is required."); 321 throw new core.ArgumentError("Parameter pageToken is required.");
265 } 322 }
266 _queryParams["pageToken"] = [pageToken]; 323 _queryParams["pageToken"] = [pageToken];
324 if (includeCorpusRemovals != null) {
325 _queryParams["includeCorpusRemovals"] = ["${includeCorpusRemovals}"];
326 }
267 if (includeRemoved != null) { 327 if (includeRemoved != null) {
268 _queryParams["includeRemoved"] = ["${includeRemoved}"]; 328 _queryParams["includeRemoved"] = ["${includeRemoved}"];
269 } 329 }
330 if (includeTeamDriveItems != null) {
331 _queryParams["includeTeamDriveItems"] = ["${includeTeamDriveItems}"];
332 }
270 if (pageSize != null) { 333 if (pageSize != null) {
271 _queryParams["pageSize"] = ["${pageSize}"]; 334 _queryParams["pageSize"] = ["${pageSize}"];
272 } 335 }
273 if (restrictToMyDrive != null) { 336 if (restrictToMyDrive != null) {
274 _queryParams["restrictToMyDrive"] = ["${restrictToMyDrive}"]; 337 _queryParams["restrictToMyDrive"] = ["${restrictToMyDrive}"];
275 } 338 }
276 if (spaces != null) { 339 if (spaces != null) {
277 _queryParams["spaces"] = [spaces]; 340 _queryParams["spaces"] = [spaces];
278 } 341 }
342 if (supportsTeamDrives != null) {
343 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
344 }
345 if (teamDriveId != null) {
346 _queryParams["teamDriveId"] = [teamDriveId];
347 }
279 348
280 _url = 'changes/watch'; 349 _url = 'changes/watch';
281 350
282 var _response = _requester.request(_url, 351 var _response = _requester.request(_url,
283 "POST", 352 "POST",
284 body: _body, 353 body: _body,
285 queryParams: _queryParams, 354 queryParams: _queryParams,
286 uploadOptions: _uploadOptions, 355 uploadOptions: _uploadOptions,
287 uploadMedia: _uploadMedia, 356 uploadMedia: _uploadMedia,
288 downloadOptions: _downloadOptions); 357 downloadOptions: _downloadOptions);
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 * bypasses that behavior for the request. Permissions are still inherited 691 * bypasses that behavior for the request. Permissions are still inherited
623 * from parent folders. 692 * from parent folders.
624 * 693 *
625 * [keepRevisionForever] - Whether to set the 'keepForever' field in the new 694 * [keepRevisionForever] - Whether to set the 'keepForever' field in the new
626 * head revision. This is only applicable to files with binary content in 695 * head revision. This is only applicable to files with binary content in
627 * Drive. 696 * Drive.
628 * 697 *
629 * [ocrLanguage] - A language hint for OCR processing during image import (ISO 698 * [ocrLanguage] - A language hint for OCR processing during image import (ISO
630 * 639-1 code). 699 * 639-1 code).
631 * 700 *
701 * [supportsTeamDrives] - Whether the requesting application supports Team
702 * Drives.
703 *
632 * Completes with a [File]. 704 * Completes with a [File].
633 * 705 *
634 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 706 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
635 * error. 707 * error.
636 * 708 *
637 * If the used [http.Client] completes with an error when making a REST call, 709 * If the used [http.Client] completes with an error when making a REST call,
638 * this method will complete with the same error. 710 * this method will complete with the same error.
639 */ 711 */
640 async.Future<File> copy(File request, core.String fileId, {core.bool ignoreDef aultVisibility, core.bool keepRevisionForever, core.String ocrLanguage}) { 712 async.Future<File> copy(File request, core.String fileId, {core.bool ignoreDef aultVisibility, core.bool keepRevisionForever, core.String ocrLanguage, core.boo l supportsTeamDrives}) {
641 var _url = null; 713 var _url = null;
642 var _queryParams = new core.Map(); 714 var _queryParams = new core.Map();
643 var _uploadMedia = null; 715 var _uploadMedia = null;
644 var _uploadOptions = null; 716 var _uploadOptions = null;
645 var _downloadOptions = commons.DownloadOptions.Metadata; 717 var _downloadOptions = commons.DownloadOptions.Metadata;
646 var _body = null; 718 var _body = null;
647 719
648 if (request != null) { 720 if (request != null) {
649 _body = convert.JSON.encode((request).toJson()); 721 _body = convert.JSON.encode((request).toJson());
650 } 722 }
651 if (fileId == null) { 723 if (fileId == null) {
652 throw new core.ArgumentError("Parameter fileId is required."); 724 throw new core.ArgumentError("Parameter fileId is required.");
653 } 725 }
654 if (ignoreDefaultVisibility != null) { 726 if (ignoreDefaultVisibility != null) {
655 _queryParams["ignoreDefaultVisibility"] = ["${ignoreDefaultVisibility}"]; 727 _queryParams["ignoreDefaultVisibility"] = ["${ignoreDefaultVisibility}"];
656 } 728 }
657 if (keepRevisionForever != null) { 729 if (keepRevisionForever != null) {
658 _queryParams["keepRevisionForever"] = ["${keepRevisionForever}"]; 730 _queryParams["keepRevisionForever"] = ["${keepRevisionForever}"];
659 } 731 }
660 if (ocrLanguage != null) { 732 if (ocrLanguage != null) {
661 _queryParams["ocrLanguage"] = [ocrLanguage]; 733 _queryParams["ocrLanguage"] = [ocrLanguage];
662 } 734 }
735 if (supportsTeamDrives != null) {
736 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
737 }
663 738
664 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/copy'; 739 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/copy';
665 740
666 var _response = _requester.request(_url, 741 var _response = _requester.request(_url,
667 "POST", 742 "POST",
668 body: _body, 743 body: _body,
669 queryParams: _queryParams, 744 queryParams: _queryParams,
670 uploadOptions: _uploadOptions, 745 uploadOptions: _uploadOptions,
671 uploadMedia: _uploadMedia, 746 uploadMedia: _uploadMedia,
672 downloadOptions: _downloadOptions); 747 downloadOptions: _downloadOptions);
(...skipping 13 matching lines...) Expand all
686 * bypasses that behavior for the request. Permissions are still inherited 761 * bypasses that behavior for the request. Permissions are still inherited
687 * from parent folders. 762 * from parent folders.
688 * 763 *
689 * [keepRevisionForever] - Whether to set the 'keepForever' field in the new 764 * [keepRevisionForever] - Whether to set the 'keepForever' field in the new
690 * head revision. This is only applicable to files with binary content in 765 * head revision. This is only applicable to files with binary content in
691 * Drive. 766 * Drive.
692 * 767 *
693 * [ocrLanguage] - A language hint for OCR processing during image import (ISO 768 * [ocrLanguage] - A language hint for OCR processing during image import (ISO
694 * 639-1 code). 769 * 639-1 code).
695 * 770 *
771 * [supportsTeamDrives] - Whether the requesting application supports Team
772 * Drives.
773 *
696 * [useContentAsIndexableText] - Whether to use the uploaded content as 774 * [useContentAsIndexableText] - Whether to use the uploaded content as
697 * indexable text. 775 * indexable text.
698 * 776 *
699 * [uploadMedia] - The media to upload. 777 * [uploadMedia] - The media to upload.
700 * 778 *
701 * [uploadOptions] - Options for the media upload. Streaming Media without the 779 * [uploadOptions] - Options for the media upload. Streaming Media without the
702 * length being known ahead of time is only supported via resumable uploads. 780 * length being known ahead of time is only supported via resumable uploads.
703 * 781 *
704 * Completes with a [File]. 782 * Completes with a [File].
705 * 783 *
706 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 784 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
707 * error. 785 * error.
708 * 786 *
709 * If the used [http.Client] completes with an error when making a REST call, 787 * If the used [http.Client] completes with an error when making a REST call,
710 * this method will complete with the same error. 788 * this method will complete with the same error.
711 */ 789 */
712 async.Future<File> create(File request, {core.bool ignoreDefaultVisibility, co re.bool keepRevisionForever, core.String ocrLanguage, core.bool useContentAsInde xableText, commons.UploadOptions uploadOptions : commons.UploadOptions.Default, commons.Media uploadMedia}) { 790 async.Future<File> create(File request, {core.bool ignoreDefaultVisibility, co re.bool keepRevisionForever, core.String ocrLanguage, core.bool supportsTeamDriv es, core.bool useContentAsIndexableText, commons.UploadOptions uploadOptions : c ommons.UploadOptions.Default, commons.Media uploadMedia}) {
713 var _url = null; 791 var _url = null;
714 var _queryParams = new core.Map(); 792 var _queryParams = new core.Map();
715 var _uploadMedia = null; 793 var _uploadMedia = null;
716 var _uploadOptions = null; 794 var _uploadOptions = null;
717 var _downloadOptions = commons.DownloadOptions.Metadata; 795 var _downloadOptions = commons.DownloadOptions.Metadata;
718 var _body = null; 796 var _body = null;
719 797
720 if (request != null) { 798 if (request != null) {
721 _body = convert.JSON.encode((request).toJson()); 799 _body = convert.JSON.encode((request).toJson());
722 } 800 }
723 if (ignoreDefaultVisibility != null) { 801 if (ignoreDefaultVisibility != null) {
724 _queryParams["ignoreDefaultVisibility"] = ["${ignoreDefaultVisibility}"]; 802 _queryParams["ignoreDefaultVisibility"] = ["${ignoreDefaultVisibility}"];
725 } 803 }
726 if (keepRevisionForever != null) { 804 if (keepRevisionForever != null) {
727 _queryParams["keepRevisionForever"] = ["${keepRevisionForever}"]; 805 _queryParams["keepRevisionForever"] = ["${keepRevisionForever}"];
728 } 806 }
729 if (ocrLanguage != null) { 807 if (ocrLanguage != null) {
730 _queryParams["ocrLanguage"] = [ocrLanguage]; 808 _queryParams["ocrLanguage"] = [ocrLanguage];
731 } 809 }
810 if (supportsTeamDrives != null) {
811 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
812 }
732 if (useContentAsIndexableText != null) { 813 if (useContentAsIndexableText != null) {
733 _queryParams["useContentAsIndexableText"] = ["${useContentAsIndexableText} "]; 814 _queryParams["useContentAsIndexableText"] = ["${useContentAsIndexableText} "];
734 } 815 }
735 816
736 _uploadMedia = uploadMedia; 817 _uploadMedia = uploadMedia;
737 _uploadOptions = uploadOptions; 818 _uploadOptions = uploadOptions;
738 819
739 if (_uploadMedia == null) { 820 if (_uploadMedia == null) {
740 _url = 'files'; 821 _url = 'files';
741 } else if (_uploadOptions is commons.ResumableUploadOptions) { 822 } else if (_uploadOptions is commons.ResumableUploadOptions) {
742 _url = '/resumable/upload/drive/v3/files'; 823 _url = '/resumable/upload/drive/v3/files';
743 } else { 824 } else {
744 _url = '/upload/drive/v3/files'; 825 _url = '/upload/drive/v3/files';
745 } 826 }
746 827
747 828
748 var _response = _requester.request(_url, 829 var _response = _requester.request(_url,
749 "POST", 830 "POST",
750 body: _body, 831 body: _body,
751 queryParams: _queryParams, 832 queryParams: _queryParams,
752 uploadOptions: _uploadOptions, 833 uploadOptions: _uploadOptions,
753 uploadMedia: _uploadMedia, 834 uploadMedia: _uploadMedia,
754 downloadOptions: _downloadOptions); 835 downloadOptions: _downloadOptions);
755 return _response.then((data) => new File.fromJson(data)); 836 return _response.then((data) => new File.fromJson(data));
756 } 837 }
757 838
758 /** 839 /**
759 * Permanently deletes a file owned by the user without moving it to the 840 * Permanently deletes a file owned by the user without moving it to the
760 * trash. If the target is a folder, all descendants owned by the user are 841 * trash. If the file belongs to a Team Drive the user must be an organizer on
761 * also deleted. 842 * the parent. If the target is a folder, all descendants owned by the user
843 * are also deleted.
762 * 844 *
763 * Request parameters: 845 * Request parameters:
764 * 846 *
765 * [fileId] - The ID of the file. 847 * [fileId] - The ID of the file.
766 * 848 *
849 * [supportsTeamDrives] - Whether the requesting application supports Team
850 * Drives.
851 *
767 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 852 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
768 * error. 853 * error.
769 * 854 *
770 * If the used [http.Client] completes with an error when making a REST call, 855 * If the used [http.Client] completes with an error when making a REST call,
771 * this method will complete with the same error. 856 * this method will complete with the same error.
772 */ 857 */
773 async.Future delete(core.String fileId) { 858 async.Future delete(core.String fileId, {core.bool supportsTeamDrives}) {
774 var _url = null; 859 var _url = null;
775 var _queryParams = new core.Map(); 860 var _queryParams = new core.Map();
776 var _uploadMedia = null; 861 var _uploadMedia = null;
777 var _uploadOptions = null; 862 var _uploadOptions = null;
778 var _downloadOptions = commons.DownloadOptions.Metadata; 863 var _downloadOptions = commons.DownloadOptions.Metadata;
779 var _body = null; 864 var _body = null;
780 865
781 if (fileId == null) { 866 if (fileId == null) {
782 throw new core.ArgumentError("Parameter fileId is required."); 867 throw new core.ArgumentError("Parameter fileId is required.");
783 } 868 }
869 if (supportsTeamDrives != null) {
870 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
871 }
784 872
785 _downloadOptions = null; 873 _downloadOptions = null;
786 874
787 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId'); 875 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId');
788 876
789 var _response = _requester.request(_url, 877 var _response = _requester.request(_url,
790 "DELETE", 878 "DELETE",
791 body: _body, 879 body: _body,
792 queryParams: _queryParams, 880 queryParams: _queryParams,
793 uploadOptions: _uploadOptions, 881 uploadOptions: _uploadOptions,
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 * Gets a file's metadata or content by ID. 1023 * Gets a file's metadata or content by ID.
936 * 1024 *
937 * Request parameters: 1025 * Request parameters:
938 * 1026 *
939 * [fileId] - The ID of the file. 1027 * [fileId] - The ID of the file.
940 * 1028 *
941 * [acknowledgeAbuse] - Whether the user is acknowledging the risk of 1029 * [acknowledgeAbuse] - Whether the user is acknowledging the risk of
942 * downloading known malware or other abusive files. This is only applicable 1030 * downloading known malware or other abusive files. This is only applicable
943 * when alt=media. 1031 * when alt=media.
944 * 1032 *
1033 * [supportsTeamDrives] - Whether the requesting application supports Team
1034 * Drives.
1035 *
945 * [downloadOptions] - Options for downloading. A download can be either a 1036 * [downloadOptions] - Options for downloading. A download can be either a
946 * Metadata (default) or Media download. Partial Media downloads are possible 1037 * Metadata (default) or Media download. Partial Media downloads are possible
947 * as well. 1038 * as well.
948 * 1039 *
949 * Completes with a 1040 * Completes with a
950 * 1041 *
951 * - [File] for Metadata downloads (see [downloadOptions]). 1042 * - [File] for Metadata downloads (see [downloadOptions]).
952 * 1043 *
953 * - [commons.Media] for Media downloads (see [downloadOptions]). 1044 * - [commons.Media] for Media downloads (see [downloadOptions]).
954 * 1045 *
955 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1046 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
956 * error. 1047 * error.
957 * 1048 *
958 * If the used [http.Client] completes with an error when making a REST call, 1049 * If the used [http.Client] completes with an error when making a REST call,
959 * this method will complete with the same error. 1050 * this method will complete with the same error.
960 */ 1051 */
961 async.Future get(core.String fileId, {core.bool acknowledgeAbuse, commons.Down loadOptions downloadOptions: commons.DownloadOptions.Metadata}) { 1052 async.Future get(core.String fileId, {core.bool acknowledgeAbuse, core.bool su pportsTeamDrives, commons.DownloadOptions downloadOptions: commons.DownloadOptio ns.Metadata}) {
962 var _url = null; 1053 var _url = null;
963 var _queryParams = new core.Map(); 1054 var _queryParams = new core.Map();
964 var _uploadMedia = null; 1055 var _uploadMedia = null;
965 var _uploadOptions = null; 1056 var _uploadOptions = null;
966 var _downloadOptions = commons.DownloadOptions.Metadata; 1057 var _downloadOptions = commons.DownloadOptions.Metadata;
967 var _body = null; 1058 var _body = null;
968 1059
969 if (fileId == null) { 1060 if (fileId == null) {
970 throw new core.ArgumentError("Parameter fileId is required."); 1061 throw new core.ArgumentError("Parameter fileId is required.");
971 } 1062 }
972 if (acknowledgeAbuse != null) { 1063 if (acknowledgeAbuse != null) {
973 _queryParams["acknowledgeAbuse"] = ["${acknowledgeAbuse}"]; 1064 _queryParams["acknowledgeAbuse"] = ["${acknowledgeAbuse}"];
974 } 1065 }
1066 if (supportsTeamDrives != null) {
1067 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
1068 }
975 1069
976 _downloadOptions = downloadOptions; 1070 _downloadOptions = downloadOptions;
977 1071
978 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId'); 1072 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId');
979 1073
980 var _response = _requester.request(_url, 1074 var _response = _requester.request(_url,
981 "GET", 1075 "GET",
982 body: _body, 1076 body: _body,
983 queryParams: _queryParams, 1077 queryParams: _queryParams,
984 uploadOptions: _uploadOptions, 1078 uploadOptions: _uploadOptions,
985 uploadMedia: _uploadMedia, 1079 uploadMedia: _uploadMedia,
986 downloadOptions: _downloadOptions); 1080 downloadOptions: _downloadOptions);
987 if (_downloadOptions == null || 1081 if (_downloadOptions == null ||
988 _downloadOptions == commons.DownloadOptions.Metadata) { 1082 _downloadOptions == commons.DownloadOptions.Metadata) {
989 return _response.then((data) => new File.fromJson(data)); 1083 return _response.then((data) => new File.fromJson(data));
990 } else { 1084 } else {
991 return _response; 1085 return _response;
992 } 1086 }
993 } 1087 }
994 1088
995 /** 1089 /**
996 * Lists or searches files. 1090 * Lists or searches files.
997 * 1091 *
998 * Request parameters: 1092 * Request parameters:
999 * 1093 *
1000 * [corpus] - The source of files to list. 1094 * [corpora] - Comma-separated list of bodies of items (files/documents) to
1095 * which the query applies. Supported bodies are 'user', 'domain', 'teamDrive'
1096 * and 'allTeamDrives'. 'allTeamDrives' must be combined with 'user'; all
1097 * other values must be used in isolation. Prefer 'user' or 'teamDrive' to
1098 * 'allTeamDrives' for efficiency.
1099 *
1100 * [corpus] - The source of files to list. Deprecated: use 'corpora' instead.
1001 * Possible string values are: 1101 * Possible string values are:
1002 * - "domain" : Files shared to the user's domain. 1102 * - "domain" : Files shared to the user's domain.
1003 * - "user" : Files owned by or shared to the user. 1103 * - "user" : Files owned by or shared to the user.
1004 * 1104 *
1105 * [includeTeamDriveItems] - Whether Team Drive items should be included in
1106 * results.
1107 *
1005 * [orderBy] - A comma-separated list of sort keys. Valid keys are 1108 * [orderBy] - A comma-separated list of sort keys. Valid keys are
1006 * 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 1109 * 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name',
1007 * 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 1110 * 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and
1008 * 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed 1111 * 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed
1009 * with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime 1112 * with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime
1010 * desc,name. Please note that there is a current limitation for users with 1113 * desc,name. Please note that there is a current limitation for users with
1011 * approximately one million files in which the requested sort order is 1114 * approximately one million files in which the requested sort order is
1012 * ignored. 1115 * ignored.
1013 * 1116 *
1014 * [pageSize] - The maximum number of files to return per page. 1117 * [pageSize] - The maximum number of files to return per page.
1015 * Value must be between "1" and "1000". 1118 * Value must be between "1" and "1000".
1016 * 1119 *
1017 * [pageToken] - The token for continuing a previous list request on the next 1120 * [pageToken] - The token for continuing a previous list request on the next
1018 * page. This should be set to the value of 'nextPageToken' from the previous 1121 * page. This should be set to the value of 'nextPageToken' from the previous
1019 * response. 1122 * response.
1020 * 1123 *
1021 * [q] - A query for filtering the file results. See the "Search for Files" 1124 * [q] - A query for filtering the file results. See the "Search for Files"
1022 * guide for supported syntax. 1125 * guide for supported syntax.
1023 * 1126 *
1024 * [spaces] - A comma-separated list of spaces to query within the corpus. 1127 * [spaces] - A comma-separated list of spaces to query within the corpus.
1025 * Supported values are 'drive', 'appDataFolder' and 'photos'. 1128 * Supported values are 'drive', 'appDataFolder' and 'photos'.
1026 * 1129 *
1130 * [supportsTeamDrives] - Whether the requesting application supports Team
1131 * Drives.
1132 *
1133 * [teamDriveId] - ID of Team Drive to search.
1134 *
1027 * Completes with a [FileList]. 1135 * Completes with a [FileList].
1028 * 1136 *
1029 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1137 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1030 * error. 1138 * error.
1031 * 1139 *
1032 * If the used [http.Client] completes with an error when making a REST call, 1140 * If the used [http.Client] completes with an error when making a REST call,
1033 * this method will complete with the same error. 1141 * this method will complete with the same error.
1034 */ 1142 */
1035 async.Future<FileList> list({core.String corpus, core.String orderBy, core.int pageSize, core.String pageToken, core.String q, core.String spaces}) { 1143 async.Future<FileList> list({core.String corpora, core.String corpus, core.boo l includeTeamDriveItems, core.String orderBy, core.int pageSize, core.String pag eToken, core.String q, core.String spaces, core.bool supportsTeamDrives, core.St ring teamDriveId}) {
1036 var _url = null; 1144 var _url = null;
1037 var _queryParams = new core.Map(); 1145 var _queryParams = new core.Map();
1038 var _uploadMedia = null; 1146 var _uploadMedia = null;
1039 var _uploadOptions = null; 1147 var _uploadOptions = null;
1040 var _downloadOptions = commons.DownloadOptions.Metadata; 1148 var _downloadOptions = commons.DownloadOptions.Metadata;
1041 var _body = null; 1149 var _body = null;
1042 1150
1151 if (corpora != null) {
1152 _queryParams["corpora"] = [corpora];
1153 }
1043 if (corpus != null) { 1154 if (corpus != null) {
1044 _queryParams["corpus"] = [corpus]; 1155 _queryParams["corpus"] = [corpus];
1045 } 1156 }
1157 if (includeTeamDriveItems != null) {
1158 _queryParams["includeTeamDriveItems"] = ["${includeTeamDriveItems}"];
1159 }
1046 if (orderBy != null) { 1160 if (orderBy != null) {
1047 _queryParams["orderBy"] = [orderBy]; 1161 _queryParams["orderBy"] = [orderBy];
1048 } 1162 }
1049 if (pageSize != null) { 1163 if (pageSize != null) {
1050 _queryParams["pageSize"] = ["${pageSize}"]; 1164 _queryParams["pageSize"] = ["${pageSize}"];
1051 } 1165 }
1052 if (pageToken != null) { 1166 if (pageToken != null) {
1053 _queryParams["pageToken"] = [pageToken]; 1167 _queryParams["pageToken"] = [pageToken];
1054 } 1168 }
1055 if (q != null) { 1169 if (q != null) {
1056 _queryParams["q"] = [q]; 1170 _queryParams["q"] = [q];
1057 } 1171 }
1058 if (spaces != null) { 1172 if (spaces != null) {
1059 _queryParams["spaces"] = [spaces]; 1173 _queryParams["spaces"] = [spaces];
1060 } 1174 }
1175 if (supportsTeamDrives != null) {
1176 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
1177 }
1178 if (teamDriveId != null) {
1179 _queryParams["teamDriveId"] = [teamDriveId];
1180 }
1061 1181
1062 _url = 'files'; 1182 _url = 'files';
1063 1183
1064 var _response = _requester.request(_url, 1184 var _response = _requester.request(_url,
1065 "GET", 1185 "GET",
1066 body: _body, 1186 body: _body,
1067 queryParams: _queryParams, 1187 queryParams: _queryParams,
1068 uploadOptions: _uploadOptions, 1188 uploadOptions: _uploadOptions,
1069 uploadMedia: _uploadMedia, 1189 uploadMedia: _uploadMedia,
1070 downloadOptions: _downloadOptions); 1190 downloadOptions: _downloadOptions);
(...skipping 13 matching lines...) Expand all
1084 * 1204 *
1085 * [keepRevisionForever] - Whether to set the 'keepForever' field in the new 1205 * [keepRevisionForever] - Whether to set the 'keepForever' field in the new
1086 * head revision. This is only applicable to files with binary content in 1206 * head revision. This is only applicable to files with binary content in
1087 * Drive. 1207 * Drive.
1088 * 1208 *
1089 * [ocrLanguage] - A language hint for OCR processing during image import (ISO 1209 * [ocrLanguage] - A language hint for OCR processing during image import (ISO
1090 * 639-1 code). 1210 * 639-1 code).
1091 * 1211 *
1092 * [removeParents] - A comma-separated list of parent IDs to remove. 1212 * [removeParents] - A comma-separated list of parent IDs to remove.
1093 * 1213 *
1214 * [supportsTeamDrives] - Whether the requesting application supports Team
1215 * Drives.
1216 *
1094 * [useContentAsIndexableText] - Whether to use the uploaded content as 1217 * [useContentAsIndexableText] - Whether to use the uploaded content as
1095 * indexable text. 1218 * indexable text.
1096 * 1219 *
1097 * [uploadMedia] - The media to upload. 1220 * [uploadMedia] - The media to upload.
1098 * 1221 *
1099 * [uploadOptions] - Options for the media upload. Streaming Media without the 1222 * [uploadOptions] - Options for the media upload. Streaming Media without the
1100 * length being known ahead of time is only supported via resumable uploads. 1223 * length being known ahead of time is only supported via resumable uploads.
1101 * 1224 *
1102 * Completes with a [File]. 1225 * Completes with a [File].
1103 * 1226 *
1104 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1227 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1105 * error. 1228 * error.
1106 * 1229 *
1107 * If the used [http.Client] completes with an error when making a REST call, 1230 * If the used [http.Client] completes with an error when making a REST call,
1108 * this method will complete with the same error. 1231 * this method will complete with the same error.
1109 */ 1232 */
1110 async.Future<File> update(File request, core.String fileId, {core.String addPa rents, core.bool keepRevisionForever, core.String ocrLanguage, core.String remov eParents, core.bool useContentAsIndexableText, commons.UploadOptions uploadOptio ns : commons.UploadOptions.Default, commons.Media uploadMedia}) { 1233 async.Future<File> update(File request, core.String fileId, {core.String addPa rents, core.bool keepRevisionForever, core.String ocrLanguage, core.String remov eParents, core.bool supportsTeamDrives, core.bool useContentAsIndexableText, com mons.UploadOptions uploadOptions : commons.UploadOptions.Default, commons.Media uploadMedia}) {
1111 var _url = null; 1234 var _url = null;
1112 var _queryParams = new core.Map(); 1235 var _queryParams = new core.Map();
1113 var _uploadMedia = null; 1236 var _uploadMedia = null;
1114 var _uploadOptions = null; 1237 var _uploadOptions = null;
1115 var _downloadOptions = commons.DownloadOptions.Metadata; 1238 var _downloadOptions = commons.DownloadOptions.Metadata;
1116 var _body = null; 1239 var _body = null;
1117 1240
1118 if (request != null) { 1241 if (request != null) {
1119 _body = convert.JSON.encode((request).toJson()); 1242 _body = convert.JSON.encode((request).toJson());
1120 } 1243 }
1121 if (fileId == null) { 1244 if (fileId == null) {
1122 throw new core.ArgumentError("Parameter fileId is required."); 1245 throw new core.ArgumentError("Parameter fileId is required.");
1123 } 1246 }
1124 if (addParents != null) { 1247 if (addParents != null) {
1125 _queryParams["addParents"] = [addParents]; 1248 _queryParams["addParents"] = [addParents];
1126 } 1249 }
1127 if (keepRevisionForever != null) { 1250 if (keepRevisionForever != null) {
1128 _queryParams["keepRevisionForever"] = ["${keepRevisionForever}"]; 1251 _queryParams["keepRevisionForever"] = ["${keepRevisionForever}"];
1129 } 1252 }
1130 if (ocrLanguage != null) { 1253 if (ocrLanguage != null) {
1131 _queryParams["ocrLanguage"] = [ocrLanguage]; 1254 _queryParams["ocrLanguage"] = [ocrLanguage];
1132 } 1255 }
1133 if (removeParents != null) { 1256 if (removeParents != null) {
1134 _queryParams["removeParents"] = [removeParents]; 1257 _queryParams["removeParents"] = [removeParents];
1135 } 1258 }
1259 if (supportsTeamDrives != null) {
1260 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
1261 }
1136 if (useContentAsIndexableText != null) { 1262 if (useContentAsIndexableText != null) {
1137 _queryParams["useContentAsIndexableText"] = ["${useContentAsIndexableText} "]; 1263 _queryParams["useContentAsIndexableText"] = ["${useContentAsIndexableText} "];
1138 } 1264 }
1139 1265
1140 _uploadMedia = uploadMedia; 1266 _uploadMedia = uploadMedia;
1141 _uploadOptions = uploadOptions; 1267 _uploadOptions = uploadOptions;
1142 1268
1143 if (_uploadMedia == null) { 1269 if (_uploadMedia == null) {
1144 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId'); 1270 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId');
1145 } else if (_uploadOptions is commons.ResumableUploadOptions) { 1271 } else if (_uploadOptions is commons.ResumableUploadOptions) {
(...skipping 19 matching lines...) Expand all
1165 * [request] - The metadata request object. 1291 * [request] - The metadata request object.
1166 * 1292 *
1167 * Request parameters: 1293 * Request parameters:
1168 * 1294 *
1169 * [fileId] - The ID of the file. 1295 * [fileId] - The ID of the file.
1170 * 1296 *
1171 * [acknowledgeAbuse] - Whether the user is acknowledging the risk of 1297 * [acknowledgeAbuse] - Whether the user is acknowledging the risk of
1172 * downloading known malware or other abusive files. This is only applicable 1298 * downloading known malware or other abusive files. This is only applicable
1173 * when alt=media. 1299 * when alt=media.
1174 * 1300 *
1301 * [supportsTeamDrives] - Whether the requesting application supports Team
1302 * Drives.
1303 *
1175 * [downloadOptions] - Options for downloading. A download can be either a 1304 * [downloadOptions] - Options for downloading. A download can be either a
1176 * Metadata (default) or Media download. Partial Media downloads are possible 1305 * Metadata (default) or Media download. Partial Media downloads are possible
1177 * as well. 1306 * as well.
1178 * 1307 *
1179 * Completes with a 1308 * Completes with a
1180 * 1309 *
1181 * - [Channel] for Metadata downloads (see [downloadOptions]). 1310 * - [Channel] for Metadata downloads (see [downloadOptions]).
1182 * 1311 *
1183 * - [commons.Media] for Media downloads (see [downloadOptions]). 1312 * - [commons.Media] for Media downloads (see [downloadOptions]).
1184 * 1313 *
1185 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1314 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1186 * error. 1315 * error.
1187 * 1316 *
1188 * If the used [http.Client] completes with an error when making a REST call, 1317 * If the used [http.Client] completes with an error when making a REST call,
1189 * this method will complete with the same error. 1318 * this method will complete with the same error.
1190 */ 1319 */
1191 async.Future watch(Channel request, core.String fileId, {core.bool acknowledge Abuse, commons.DownloadOptions downloadOptions: commons.DownloadOptions.Metadata }) { 1320 async.Future watch(Channel request, core.String fileId, {core.bool acknowledge Abuse, core.bool supportsTeamDrives, commons.DownloadOptions downloadOptions: co mmons.DownloadOptions.Metadata}) {
1192 var _url = null; 1321 var _url = null;
1193 var _queryParams = new core.Map(); 1322 var _queryParams = new core.Map();
1194 var _uploadMedia = null; 1323 var _uploadMedia = null;
1195 var _uploadOptions = null; 1324 var _uploadOptions = null;
1196 var _downloadOptions = commons.DownloadOptions.Metadata; 1325 var _downloadOptions = commons.DownloadOptions.Metadata;
1197 var _body = null; 1326 var _body = null;
1198 1327
1199 if (request != null) { 1328 if (request != null) {
1200 _body = convert.JSON.encode((request).toJson()); 1329 _body = convert.JSON.encode((request).toJson());
1201 } 1330 }
1202 if (fileId == null) { 1331 if (fileId == null) {
1203 throw new core.ArgumentError("Parameter fileId is required."); 1332 throw new core.ArgumentError("Parameter fileId is required.");
1204 } 1333 }
1205 if (acknowledgeAbuse != null) { 1334 if (acknowledgeAbuse != null) {
1206 _queryParams["acknowledgeAbuse"] = ["${acknowledgeAbuse}"]; 1335 _queryParams["acknowledgeAbuse"] = ["${acknowledgeAbuse}"];
1207 } 1336 }
1337 if (supportsTeamDrives != null) {
1338 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
1339 }
1208 1340
1209 _downloadOptions = downloadOptions; 1341 _downloadOptions = downloadOptions;
1210 1342
1211 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/watch'; 1343 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/watch';
1212 1344
1213 var _response = _requester.request(_url, 1345 var _response = _requester.request(_url,
1214 "POST", 1346 "POST",
1215 body: _body, 1347 body: _body,
1216 queryParams: _queryParams, 1348 queryParams: _queryParams,
1217 uploadOptions: _uploadOptions, 1349 uploadOptions: _uploadOptions,
(...skipping 10 matching lines...) Expand all
1228 } 1360 }
1229 1361
1230 1362
1231 class PermissionsResourceApi { 1363 class PermissionsResourceApi {
1232 final commons.ApiRequester _requester; 1364 final commons.ApiRequester _requester;
1233 1365
1234 PermissionsResourceApi(commons.ApiRequester client) : 1366 PermissionsResourceApi(commons.ApiRequester client) :
1235 _requester = client; 1367 _requester = client;
1236 1368
1237 /** 1369 /**
1238 * Creates a permission for a file. 1370 * Creates a permission for a file or Team Drive.
1239 * 1371 *
1240 * [request] - The metadata request object. 1372 * [request] - The metadata request object.
1241 * 1373 *
1242 * Request parameters: 1374 * Request parameters:
1243 * 1375 *
1244 * [fileId] - The ID of the file. 1376 * [fileId] - The ID of the file or Team Drive.
1245 * 1377 *
1246 * [emailMessage] - A custom message to include in the notification email. 1378 * [emailMessage] - A custom message to include in the notification email.
1247 * 1379 *
1248 * [sendNotificationEmail] - Whether to send a notification email when sharing 1380 * [sendNotificationEmail] - Whether to send a notification email when sharing
1249 * to users or groups. This defaults to true for users and groups, and is not 1381 * to users or groups. This defaults to true for users and groups, and is not
1250 * allowed for other requests. It must not be disabled for ownership 1382 * allowed for other requests. It must not be disabled for ownership
1251 * transfers. 1383 * transfers.
1252 * 1384 *
1385 * [supportsTeamDrives] - Whether the requesting application supports Team
1386 * Drives.
1387 *
1253 * [transferOwnership] - Whether to transfer ownership to the specified user 1388 * [transferOwnership] - Whether to transfer ownership to the specified user
1254 * and downgrade the current owner to a writer. This parameter is required as 1389 * and downgrade the current owner to a writer. This parameter is required as
1255 * an acknowledgement of the side effect. 1390 * an acknowledgement of the side effect.
1256 * 1391 *
1257 * Completes with a [Permission]. 1392 * Completes with a [Permission].
1258 * 1393 *
1259 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1394 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1260 * error. 1395 * error.
1261 * 1396 *
1262 * If the used [http.Client] completes with an error when making a REST call, 1397 * If the used [http.Client] completes with an error when making a REST call,
1263 * this method will complete with the same error. 1398 * this method will complete with the same error.
1264 */ 1399 */
1265 async.Future<Permission> create(Permission request, core.String fileId, {core. String emailMessage, core.bool sendNotificationEmail, core.bool transferOwnershi p}) { 1400 async.Future<Permission> create(Permission request, core.String fileId, {core. String emailMessage, core.bool sendNotificationEmail, core.bool supportsTeamDriv es, core.bool transferOwnership}) {
1266 var _url = null; 1401 var _url = null;
1267 var _queryParams = new core.Map(); 1402 var _queryParams = new core.Map();
1268 var _uploadMedia = null; 1403 var _uploadMedia = null;
1269 var _uploadOptions = null; 1404 var _uploadOptions = null;
1270 var _downloadOptions = commons.DownloadOptions.Metadata; 1405 var _downloadOptions = commons.DownloadOptions.Metadata;
1271 var _body = null; 1406 var _body = null;
1272 1407
1273 if (request != null) { 1408 if (request != null) {
1274 _body = convert.JSON.encode((request).toJson()); 1409 _body = convert.JSON.encode((request).toJson());
1275 } 1410 }
1276 if (fileId == null) { 1411 if (fileId == null) {
1277 throw new core.ArgumentError("Parameter fileId is required."); 1412 throw new core.ArgumentError("Parameter fileId is required.");
1278 } 1413 }
1279 if (emailMessage != null) { 1414 if (emailMessage != null) {
1280 _queryParams["emailMessage"] = [emailMessage]; 1415 _queryParams["emailMessage"] = [emailMessage];
1281 } 1416 }
1282 if (sendNotificationEmail != null) { 1417 if (sendNotificationEmail != null) {
1283 _queryParams["sendNotificationEmail"] = ["${sendNotificationEmail}"]; 1418 _queryParams["sendNotificationEmail"] = ["${sendNotificationEmail}"];
1284 } 1419 }
1420 if (supportsTeamDrives != null) {
1421 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
1422 }
1285 if (transferOwnership != null) { 1423 if (transferOwnership != null) {
1286 _queryParams["transferOwnership"] = ["${transferOwnership}"]; 1424 _queryParams["transferOwnership"] = ["${transferOwnership}"];
1287 } 1425 }
1288 1426
1289 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/permissions'; 1427 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/permissions';
1290 1428
1291 var _response = _requester.request(_url, 1429 var _response = _requester.request(_url,
1292 "POST", 1430 "POST",
1293 body: _body, 1431 body: _body,
1294 queryParams: _queryParams, 1432 queryParams: _queryParams,
1295 uploadOptions: _uploadOptions, 1433 uploadOptions: _uploadOptions,
1296 uploadMedia: _uploadMedia, 1434 uploadMedia: _uploadMedia,
1297 downloadOptions: _downloadOptions); 1435 downloadOptions: _downloadOptions);
1298 return _response.then((data) => new Permission.fromJson(data)); 1436 return _response.then((data) => new Permission.fromJson(data));
1299 } 1437 }
1300 1438
1301 /** 1439 /**
1302 * Deletes a permission. 1440 * Deletes a permission.
1303 * 1441 *
1304 * Request parameters: 1442 * Request parameters:
1305 * 1443 *
1306 * [fileId] - The ID of the file. 1444 * [fileId] - The ID of the file or Team Drive.
1307 * 1445 *
1308 * [permissionId] - The ID of the permission. 1446 * [permissionId] - The ID of the permission.
1309 * 1447 *
1448 * [supportsTeamDrives] - Whether the requesting application supports Team
1449 * Drives.
1450 *
1310 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1451 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1311 * error. 1452 * error.
1312 * 1453 *
1313 * If the used [http.Client] completes with an error when making a REST call, 1454 * If the used [http.Client] completes with an error when making a REST call,
1314 * this method will complete with the same error. 1455 * this method will complete with the same error.
1315 */ 1456 */
1316 async.Future delete(core.String fileId, core.String permissionId) { 1457 async.Future delete(core.String fileId, core.String permissionId, {core.bool s upportsTeamDrives}) {
1317 var _url = null; 1458 var _url = null;
1318 var _queryParams = new core.Map(); 1459 var _queryParams = new core.Map();
1319 var _uploadMedia = null; 1460 var _uploadMedia = null;
1320 var _uploadOptions = null; 1461 var _uploadOptions = null;
1321 var _downloadOptions = commons.DownloadOptions.Metadata; 1462 var _downloadOptions = commons.DownloadOptions.Metadata;
1322 var _body = null; 1463 var _body = null;
1323 1464
1324 if (fileId == null) { 1465 if (fileId == null) {
1325 throw new core.ArgumentError("Parameter fileId is required."); 1466 throw new core.ArgumentError("Parameter fileId is required.");
1326 } 1467 }
1327 if (permissionId == null) { 1468 if (permissionId == null) {
1328 throw new core.ArgumentError("Parameter permissionId is required."); 1469 throw new core.ArgumentError("Parameter permissionId is required.");
1329 } 1470 }
1471 if (supportsTeamDrives != null) {
1472 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
1473 }
1330 1474
1331 _downloadOptions = null; 1475 _downloadOptions = null;
1332 1476
1333 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/permissions/' + commons.Escaper.ecapeVariable('$permissionId'); 1477 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/permissions/' + commons.Escaper.ecapeVariable('$permissionId');
1334 1478
1335 var _response = _requester.request(_url, 1479 var _response = _requester.request(_url,
1336 "DELETE", 1480 "DELETE",
1337 body: _body, 1481 body: _body,
1338 queryParams: _queryParams, 1482 queryParams: _queryParams,
1339 uploadOptions: _uploadOptions, 1483 uploadOptions: _uploadOptions,
1340 uploadMedia: _uploadMedia, 1484 uploadMedia: _uploadMedia,
1341 downloadOptions: _downloadOptions); 1485 downloadOptions: _downloadOptions);
1342 return _response.then((data) => null); 1486 return _response.then((data) => null);
1343 } 1487 }
1344 1488
1345 /** 1489 /**
1346 * Gets a permission by ID. 1490 * Gets a permission by ID.
1347 * 1491 *
1348 * Request parameters: 1492 * Request parameters:
1349 * 1493 *
1350 * [fileId] - The ID of the file. 1494 * [fileId] - The ID of the file.
1351 * 1495 *
1352 * [permissionId] - The ID of the permission. 1496 * [permissionId] - The ID of the permission.
1353 * 1497 *
1498 * [supportsTeamDrives] - Whether the requesting application supports Team
1499 * Drives.
1500 *
1354 * Completes with a [Permission]. 1501 * Completes with a [Permission].
1355 * 1502 *
1356 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1503 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1357 * error. 1504 * error.
1358 * 1505 *
1359 * If the used [http.Client] completes with an error when making a REST call, 1506 * If the used [http.Client] completes with an error when making a REST call,
1360 * this method will complete with the same error. 1507 * this method will complete with the same error.
1361 */ 1508 */
1362 async.Future<Permission> get(core.String fileId, core.String permissionId) { 1509 async.Future<Permission> get(core.String fileId, core.String permissionId, {co re.bool supportsTeamDrives}) {
1363 var _url = null; 1510 var _url = null;
1364 var _queryParams = new core.Map(); 1511 var _queryParams = new core.Map();
1365 var _uploadMedia = null; 1512 var _uploadMedia = null;
1366 var _uploadOptions = null; 1513 var _uploadOptions = null;
1367 var _downloadOptions = commons.DownloadOptions.Metadata; 1514 var _downloadOptions = commons.DownloadOptions.Metadata;
1368 var _body = null; 1515 var _body = null;
1369 1516
1370 if (fileId == null) { 1517 if (fileId == null) {
1371 throw new core.ArgumentError("Parameter fileId is required."); 1518 throw new core.ArgumentError("Parameter fileId is required.");
1372 } 1519 }
1373 if (permissionId == null) { 1520 if (permissionId == null) {
1374 throw new core.ArgumentError("Parameter permissionId is required."); 1521 throw new core.ArgumentError("Parameter permissionId is required.");
1375 } 1522 }
1523 if (supportsTeamDrives != null) {
1524 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
1525 }
1376 1526
1377 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/permissions/' + commons.Escaper.ecapeVariable('$permissionId'); 1527 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/permissions/' + commons.Escaper.ecapeVariable('$permissionId');
1378 1528
1379 var _response = _requester.request(_url, 1529 var _response = _requester.request(_url,
1380 "GET", 1530 "GET",
1381 body: _body, 1531 body: _body,
1382 queryParams: _queryParams, 1532 queryParams: _queryParams,
1383 uploadOptions: _uploadOptions, 1533 uploadOptions: _uploadOptions,
1384 uploadMedia: _uploadMedia, 1534 uploadMedia: _uploadMedia,
1385 downloadOptions: _downloadOptions); 1535 downloadOptions: _downloadOptions);
1386 return _response.then((data) => new Permission.fromJson(data)); 1536 return _response.then((data) => new Permission.fromJson(data));
1387 } 1537 }
1388 1538
1389 /** 1539 /**
1390 * Lists a file's permissions. 1540 * Lists a file's or Team Drive's permissions.
1391 * 1541 *
1392 * Request parameters: 1542 * Request parameters:
1393 * 1543 *
1394 * [fileId] - The ID of the file. 1544 * [fileId] - The ID of the file or Team Drive.
1545 *
1546 * [pageSize] - The maximum number of permissions to return per page. When not
1547 * set for files in a Team Drive, at most 100 results will be returned. When
1548 * not set for files that are not in a Team Drive, the entire list will be
1549 * returned.
1550 * Value must be between "1" and "100".
1551 *
1552 * [pageToken] - The token for continuing a previous list request on the next
1553 * page. This should be set to the value of 'nextPageToken' from the previous
1554 * response.
1555 *
1556 * [supportsTeamDrives] - Whether the requesting application supports Team
1557 * Drives.
1395 * 1558 *
1396 * Completes with a [PermissionList]. 1559 * Completes with a [PermissionList].
1397 * 1560 *
1398 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1561 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1399 * error. 1562 * error.
1400 * 1563 *
1401 * If the used [http.Client] completes with an error when making a REST call, 1564 * If the used [http.Client] completes with an error when making a REST call,
1402 * this method will complete with the same error. 1565 * this method will complete with the same error.
1403 */ 1566 */
1404 async.Future<PermissionList> list(core.String fileId) { 1567 async.Future<PermissionList> list(core.String fileId, {core.int pageSize, core .String pageToken, core.bool supportsTeamDrives}) {
1405 var _url = null; 1568 var _url = null;
1406 var _queryParams = new core.Map(); 1569 var _queryParams = new core.Map();
1407 var _uploadMedia = null; 1570 var _uploadMedia = null;
1408 var _uploadOptions = null; 1571 var _uploadOptions = null;
1409 var _downloadOptions = commons.DownloadOptions.Metadata; 1572 var _downloadOptions = commons.DownloadOptions.Metadata;
1410 var _body = null; 1573 var _body = null;
1411 1574
1412 if (fileId == null) { 1575 if (fileId == null) {
1413 throw new core.ArgumentError("Parameter fileId is required."); 1576 throw new core.ArgumentError("Parameter fileId is required.");
1414 } 1577 }
1578 if (pageSize != null) {
1579 _queryParams["pageSize"] = ["${pageSize}"];
1580 }
1581 if (pageToken != null) {
1582 _queryParams["pageToken"] = [pageToken];
1583 }
1584 if (supportsTeamDrives != null) {
1585 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
1586 }
1415 1587
1416 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/permissions'; 1588 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/permissions';
1417 1589
1418 var _response = _requester.request(_url, 1590 var _response = _requester.request(_url,
1419 "GET", 1591 "GET",
1420 body: _body, 1592 body: _body,
1421 queryParams: _queryParams, 1593 queryParams: _queryParams,
1422 uploadOptions: _uploadOptions, 1594 uploadOptions: _uploadOptions,
1423 uploadMedia: _uploadMedia, 1595 uploadMedia: _uploadMedia,
1424 downloadOptions: _downloadOptions); 1596 downloadOptions: _downloadOptions);
1425 return _response.then((data) => new PermissionList.fromJson(data)); 1597 return _response.then((data) => new PermissionList.fromJson(data));
1426 } 1598 }
1427 1599
1428 /** 1600 /**
1429 * Updates a permission with patch semantics. 1601 * Updates a permission with patch semantics.
1430 * 1602 *
1431 * [request] - The metadata request object. 1603 * [request] - The metadata request object.
1432 * 1604 *
1433 * Request parameters: 1605 * Request parameters:
1434 * 1606 *
1435 * [fileId] - The ID of the file. 1607 * [fileId] - The ID of the file or Team Drive.
1436 * 1608 *
1437 * [permissionId] - The ID of the permission. 1609 * [permissionId] - The ID of the permission.
1438 * 1610 *
1439 * [removeExpiration] - Whether to remove the expiration date. 1611 * [removeExpiration] - Whether to remove the expiration date.
1440 * 1612 *
1613 * [supportsTeamDrives] - Whether the requesting application supports Team
1614 * Drives.
1615 *
1441 * [transferOwnership] - Whether to transfer ownership to the specified user 1616 * [transferOwnership] - Whether to transfer ownership to the specified user
1442 * and downgrade the current owner to a writer. This parameter is required as 1617 * and downgrade the current owner to a writer. This parameter is required as
1443 * an acknowledgement of the side effect. 1618 * an acknowledgement of the side effect.
1444 * 1619 *
1445 * Completes with a [Permission]. 1620 * Completes with a [Permission].
1446 * 1621 *
1447 * Completes with a [commons.ApiRequestError] if the API endpoint returned an 1622 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1448 * error. 1623 * error.
1449 * 1624 *
1450 * If the used [http.Client] completes with an error when making a REST call, 1625 * If the used [http.Client] completes with an error when making a REST call,
1451 * this method will complete with the same error. 1626 * this method will complete with the same error.
1452 */ 1627 */
1453 async.Future<Permission> update(Permission request, core.String fileId, core.S tring permissionId, {core.bool removeExpiration, core.bool transferOwnership}) { 1628 async.Future<Permission> update(Permission request, core.String fileId, core.S tring permissionId, {core.bool removeExpiration, core.bool supportsTeamDrives, c ore.bool transferOwnership}) {
1454 var _url = null; 1629 var _url = null;
1455 var _queryParams = new core.Map(); 1630 var _queryParams = new core.Map();
1456 var _uploadMedia = null; 1631 var _uploadMedia = null;
1457 var _uploadOptions = null; 1632 var _uploadOptions = null;
1458 var _downloadOptions = commons.DownloadOptions.Metadata; 1633 var _downloadOptions = commons.DownloadOptions.Metadata;
1459 var _body = null; 1634 var _body = null;
1460 1635
1461 if (request != null) { 1636 if (request != null) {
1462 _body = convert.JSON.encode((request).toJson()); 1637 _body = convert.JSON.encode((request).toJson());
1463 } 1638 }
1464 if (fileId == null) { 1639 if (fileId == null) {
1465 throw new core.ArgumentError("Parameter fileId is required."); 1640 throw new core.ArgumentError("Parameter fileId is required.");
1466 } 1641 }
1467 if (permissionId == null) { 1642 if (permissionId == null) {
1468 throw new core.ArgumentError("Parameter permissionId is required."); 1643 throw new core.ArgumentError("Parameter permissionId is required.");
1469 } 1644 }
1470 if (removeExpiration != null) { 1645 if (removeExpiration != null) {
1471 _queryParams["removeExpiration"] = ["${removeExpiration}"]; 1646 _queryParams["removeExpiration"] = ["${removeExpiration}"];
1472 } 1647 }
1648 if (supportsTeamDrives != null) {
1649 _queryParams["supportsTeamDrives"] = ["${supportsTeamDrives}"];
1650 }
1473 if (transferOwnership != null) { 1651 if (transferOwnership != null) {
1474 _queryParams["transferOwnership"] = ["${transferOwnership}"]; 1652 _queryParams["transferOwnership"] = ["${transferOwnership}"];
1475 } 1653 }
1476 1654
1477 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/permissions/' + commons.Escaper.ecapeVariable('$permissionId'); 1655 _url = 'files/' + commons.Escaper.ecapeVariable('$fileId') + '/permissions/' + commons.Escaper.ecapeVariable('$permissionId');
1478 1656
1479 var _response = _requester.request(_url, 1657 var _response = _requester.request(_url,
1480 "PATCH", 1658 "PATCH",
1481 body: _body, 1659 body: _body,
1482 queryParams: _queryParams, 1660 queryParams: _queryParams,
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1982 queryParams: _queryParams, 2160 queryParams: _queryParams,
1983 uploadOptions: _uploadOptions, 2161 uploadOptions: _uploadOptions,
1984 uploadMedia: _uploadMedia, 2162 uploadMedia: _uploadMedia,
1985 downloadOptions: _downloadOptions); 2163 downloadOptions: _downloadOptions);
1986 return _response.then((data) => new Revision.fromJson(data)); 2164 return _response.then((data) => new Revision.fromJson(data));
1987 } 2165 }
1988 2166
1989 } 2167 }
1990 2168
1991 2169
2170 class TeamdrivesResourceApi {
2171 final commons.ApiRequester _requester;
2172
2173 TeamdrivesResourceApi(commons.ApiRequester client) :
2174 _requester = client;
2175
2176 /**
2177 * Creates a new Team Drive.
2178 *
2179 * [request] - The metadata request object.
2180 *
2181 * Request parameters:
2182 *
2183 * [requestId] - An ID, such as a random UUID, which uniquely identifies this
2184 * user's request for idempotent creation of a Team Drive. A repeated request
2185 * by the same user and with the same request ID will avoid creating
2186 * duplicates by attempting to create the same Team Drive. If the Team Drive
2187 * already exists a 409 error will be returned.
2188 *
2189 * Completes with a [TeamDrive].
2190 *
2191 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2192 * error.
2193 *
2194 * If the used [http.Client] completes with an error when making a REST call,
2195 * this method will complete with the same error.
2196 */
2197 async.Future<TeamDrive> create(TeamDrive request, core.String requestId) {
2198 var _url = null;
2199 var _queryParams = new core.Map();
2200 var _uploadMedia = null;
2201 var _uploadOptions = null;
2202 var _downloadOptions = commons.DownloadOptions.Metadata;
2203 var _body = null;
2204
2205 if (request != null) {
2206 _body = convert.JSON.encode((request).toJson());
2207 }
2208 if (requestId == null) {
2209 throw new core.ArgumentError("Parameter requestId is required.");
2210 }
2211 _queryParams["requestId"] = [requestId];
2212
2213 _url = 'teamdrives';
2214
2215 var _response = _requester.request(_url,
2216 "POST",
2217 body: _body,
2218 queryParams: _queryParams,
2219 uploadOptions: _uploadOptions,
2220 uploadMedia: _uploadMedia,
2221 downloadOptions: _downloadOptions);
2222 return _response.then((data) => new TeamDrive.fromJson(data));
2223 }
2224
2225 /**
2226 * Permanently deletes a Team Drive for which the user is an organizer. The
2227 * Team Drive cannot contain any untrashed items.
2228 *
2229 * Request parameters:
2230 *
2231 * [teamDriveId] - The ID of the Team Drive
2232 *
2233 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2234 * error.
2235 *
2236 * If the used [http.Client] completes with an error when making a REST call,
2237 * this method will complete with the same error.
2238 */
2239 async.Future delete(core.String teamDriveId) {
2240 var _url = null;
2241 var _queryParams = new core.Map();
2242 var _uploadMedia = null;
2243 var _uploadOptions = null;
2244 var _downloadOptions = commons.DownloadOptions.Metadata;
2245 var _body = null;
2246
2247 if (teamDriveId == null) {
2248 throw new core.ArgumentError("Parameter teamDriveId is required.");
2249 }
2250
2251 _downloadOptions = null;
2252
2253 _url = 'teamdrives/' + commons.Escaper.ecapeVariable('$teamDriveId');
2254
2255 var _response = _requester.request(_url,
2256 "DELETE",
2257 body: _body,
2258 queryParams: _queryParams,
2259 uploadOptions: _uploadOptions,
2260 uploadMedia: _uploadMedia,
2261 downloadOptions: _downloadOptions);
2262 return _response.then((data) => null);
2263 }
2264
2265 /**
2266 * Gets a Team Drive's metadata by ID.
2267 *
2268 * Request parameters:
2269 *
2270 * [teamDriveId] - The ID of the Team Drive
2271 *
2272 * Completes with a [TeamDrive].
2273 *
2274 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2275 * error.
2276 *
2277 * If the used [http.Client] completes with an error when making a REST call,
2278 * this method will complete with the same error.
2279 */
2280 async.Future<TeamDrive> get(core.String teamDriveId) {
2281 var _url = null;
2282 var _queryParams = new core.Map();
2283 var _uploadMedia = null;
2284 var _uploadOptions = null;
2285 var _downloadOptions = commons.DownloadOptions.Metadata;
2286 var _body = null;
2287
2288 if (teamDriveId == null) {
2289 throw new core.ArgumentError("Parameter teamDriveId is required.");
2290 }
2291
2292 _url = 'teamdrives/' + commons.Escaper.ecapeVariable('$teamDriveId');
2293
2294 var _response = _requester.request(_url,
2295 "GET",
2296 body: _body,
2297 queryParams: _queryParams,
2298 uploadOptions: _uploadOptions,
2299 uploadMedia: _uploadMedia,
2300 downloadOptions: _downloadOptions);
2301 return _response.then((data) => new TeamDrive.fromJson(data));
2302 }
2303
2304 /**
2305 * Lists the user's Team Drives.
2306 *
2307 * Request parameters:
2308 *
2309 * [pageSize] - Maximum number of Team Drives to return.
2310 * Value must be between "1" and "100".
2311 *
2312 * [pageToken] - Page token for Team Drives.
2313 *
2314 * Completes with a [TeamDriveList].
2315 *
2316 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2317 * error.
2318 *
2319 * If the used [http.Client] completes with an error when making a REST call,
2320 * this method will complete with the same error.
2321 */
2322 async.Future<TeamDriveList> list({core.int pageSize, core.String pageToken}) {
2323 var _url = null;
2324 var _queryParams = new core.Map();
2325 var _uploadMedia = null;
2326 var _uploadOptions = null;
2327 var _downloadOptions = commons.DownloadOptions.Metadata;
2328 var _body = null;
2329
2330 if (pageSize != null) {
2331 _queryParams["pageSize"] = ["${pageSize}"];
2332 }
2333 if (pageToken != null) {
2334 _queryParams["pageToken"] = [pageToken];
2335 }
2336
2337 _url = 'teamdrives';
2338
2339 var _response = _requester.request(_url,
2340 "GET",
2341 body: _body,
2342 queryParams: _queryParams,
2343 uploadOptions: _uploadOptions,
2344 uploadMedia: _uploadMedia,
2345 downloadOptions: _downloadOptions);
2346 return _response.then((data) => new TeamDriveList.fromJson(data));
2347 }
2348
2349 /**
2350 * Updates a Team Drive's metadata
2351 *
2352 * [request] - The metadata request object.
2353 *
2354 * Request parameters:
2355 *
2356 * [teamDriveId] - The ID of the Team Drive
2357 *
2358 * Completes with a [TeamDrive].
2359 *
2360 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2361 * error.
2362 *
2363 * If the used [http.Client] completes with an error when making a REST call,
2364 * this method will complete with the same error.
2365 */
2366 async.Future<TeamDrive> update(TeamDrive request, core.String teamDriveId) {
2367 var _url = null;
2368 var _queryParams = new core.Map();
2369 var _uploadMedia = null;
2370 var _uploadOptions = null;
2371 var _downloadOptions = commons.DownloadOptions.Metadata;
2372 var _body = null;
2373
2374 if (request != null) {
2375 _body = convert.JSON.encode((request).toJson());
2376 }
2377 if (teamDriveId == null) {
2378 throw new core.ArgumentError("Parameter teamDriveId is required.");
2379 }
2380
2381 _url = 'teamdrives/' + commons.Escaper.ecapeVariable('$teamDriveId');
2382
2383 var _response = _requester.request(_url,
2384 "PATCH",
2385 body: _body,
2386 queryParams: _queryParams,
2387 uploadOptions: _uploadOptions,
2388 uploadMedia: _uploadMedia,
2389 downloadOptions: _downloadOptions);
2390 return _response.then((data) => new TeamDrive.fromJson(data));
2391 }
2392
2393 }
2394
2395
1992 2396
1993 /** 2397 /**
1994 * The user's storage quota limits and usage. All fields are measured in bytes. 2398 * The user's storage quota limits and usage. All fields are measured in bytes.
1995 */ 2399 */
1996 class AboutStorageQuota { 2400 class AboutStorageQuota {
1997 /** 2401 /**
1998 * The usage limit, if applicable. This will not be present if the user has 2402 * The usage limit, if applicable. This will not be present if the user has
1999 * unlimited storage. 2403 * unlimited storage.
2000 */ 2404 */
2001 core.String limit; 2405 core.String limit;
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 if (storageQuota != null) { 2534 if (storageQuota != null) {
2131 _json["storageQuota"] = (storageQuota).toJson(); 2535 _json["storageQuota"] = (storageQuota).toJson();
2132 } 2536 }
2133 if (user != null) { 2537 if (user != null) {
2134 _json["user"] = (user).toJson(); 2538 _json["user"] = (user).toJson();
2135 } 2539 }
2136 return _json; 2540 return _json;
2137 } 2541 }
2138 } 2542 }
2139 2543
2140 /** A change to a file. */ 2544 /** A change to a file or Team Drive. */
2141 class Change { 2545 class Change {
2142 /** 2546 /**
2143 * The updated state of the file. Present if the file has not been removed. 2547 * The updated state of the file. Present if the type is file and the file has
2548 * not been removed from this list of changes.
2144 */ 2549 */
2145 File file; 2550 File file;
2146 /** The ID of the file which has changed. */ 2551 /** The ID of the file which has changed. */
2147 core.String fileId; 2552 core.String fileId;
2148 /** 2553 /**
2149 * Identifies what kind of resource this is. Value: the fixed string 2554 * Identifies what kind of resource this is. Value: the fixed string
2150 * "drive#change". 2555 * "drive#change".
2151 */ 2556 */
2152 core.String kind; 2557 core.String kind;
2153 /** 2558 /**
2154 * Whether the file has been removed from the view of the changes list, for 2559 * Whether the file or Team Drive has been removed from this list of changes,
2155 * example by deletion or lost access. 2560 * for example by deletion or loss of access.
2156 */ 2561 */
2157 core.bool removed; 2562 core.bool removed;
2563 /**
2564 * The updated state of the Team Drive. Present if the type is teamDrive, the
2565 * user is still a member of the Team Drive, and the Team Drive has not been
2566 * removed.
2567 */
2568 TeamDrive teamDrive;
2569 /** The ID of the Team Drive associated with this change. */
2570 core.String teamDriveId;
2158 /** The time of this change (RFC 3339 date-time). */ 2571 /** The time of this change (RFC 3339 date-time). */
2159 core.DateTime time; 2572 core.DateTime time;
2573 /** The type of the change. Possible values are file and teamDrive. */
2574 core.String type;
2160 2575
2161 Change(); 2576 Change();
2162 2577
2163 Change.fromJson(core.Map _json) { 2578 Change.fromJson(core.Map _json) {
2164 if (_json.containsKey("file")) { 2579 if (_json.containsKey("file")) {
2165 file = new File.fromJson(_json["file"]); 2580 file = new File.fromJson(_json["file"]);
2166 } 2581 }
2167 if (_json.containsKey("fileId")) { 2582 if (_json.containsKey("fileId")) {
2168 fileId = _json["fileId"]; 2583 fileId = _json["fileId"];
2169 } 2584 }
2170 if (_json.containsKey("kind")) { 2585 if (_json.containsKey("kind")) {
2171 kind = _json["kind"]; 2586 kind = _json["kind"];
2172 } 2587 }
2173 if (_json.containsKey("removed")) { 2588 if (_json.containsKey("removed")) {
2174 removed = _json["removed"]; 2589 removed = _json["removed"];
2175 } 2590 }
2591 if (_json.containsKey("teamDrive")) {
2592 teamDrive = new TeamDrive.fromJson(_json["teamDrive"]);
2593 }
2594 if (_json.containsKey("teamDriveId")) {
2595 teamDriveId = _json["teamDriveId"];
2596 }
2176 if (_json.containsKey("time")) { 2597 if (_json.containsKey("time")) {
2177 time = core.DateTime.parse(_json["time"]); 2598 time = core.DateTime.parse(_json["time"]);
2178 } 2599 }
2600 if (_json.containsKey("type")) {
2601 type = _json["type"];
2602 }
2179 } 2603 }
2180 2604
2181 core.Map toJson() { 2605 core.Map toJson() {
2182 var _json = new core.Map(); 2606 var _json = new core.Map();
2183 if (file != null) { 2607 if (file != null) {
2184 _json["file"] = (file).toJson(); 2608 _json["file"] = (file).toJson();
2185 } 2609 }
2186 if (fileId != null) { 2610 if (fileId != null) {
2187 _json["fileId"] = fileId; 2611 _json["fileId"] = fileId;
2188 } 2612 }
2189 if (kind != null) { 2613 if (kind != null) {
2190 _json["kind"] = kind; 2614 _json["kind"] = kind;
2191 } 2615 }
2192 if (removed != null) { 2616 if (removed != null) {
2193 _json["removed"] = removed; 2617 _json["removed"] = removed;
2194 } 2618 }
2619 if (teamDrive != null) {
2620 _json["teamDrive"] = (teamDrive).toJson();
2621 }
2622 if (teamDriveId != null) {
2623 _json["teamDriveId"] = teamDriveId;
2624 }
2195 if (time != null) { 2625 if (time != null) {
2196 _json["time"] = (time).toIso8601String(); 2626 _json["time"] = (time).toIso8601String();
2197 } 2627 }
2628 if (type != null) {
2629 _json["type"] = type;
2630 }
2198 return _json; 2631 return _json;
2199 } 2632 }
2200 } 2633 }
2201 2634
2202 /** A list of changes for a user. */ 2635 /** A list of changes for a user. */
2203 class ChangeList { 2636 class ChangeList {
2204 /** 2637 /**
2205 * The list of changes. If nextPageToken is populated, then this list may be 2638 * The list of changes. If nextPageToken is populated, then this list may be
2206 * incomplete and an additional page of results should be fetched. 2639 * incomplete and an additional page of results should be fetched.
2207 */ 2640 */
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
2572 if (kind != null) { 3005 if (kind != null) {
2573 _json["kind"] = kind; 3006 _json["kind"] = kind;
2574 } 3007 }
2575 if (nextPageToken != null) { 3008 if (nextPageToken != null) {
2576 _json["nextPageToken"] = nextPageToken; 3009 _json["nextPageToken"] = nextPageToken;
2577 } 3010 }
2578 return _json; 3011 return _json;
2579 } 3012 }
2580 } 3013 }
2581 3014
2582 /** Capabilities the current user has on the file. */ 3015 /**
3016 * Capabilities the current user has on the file. Each capability corresponds to
3017 * a fine-grained action that a user may take.
3018 */
2583 class FileCapabilities { 3019 class FileCapabilities {
3020 /**
3021 * Whether the user can add children to this folder. This is always false when
3022 * the item is not a folder.
3023 */
3024 core.bool canAddChildren;
2584 /** Whether the user can comment on the file. */ 3025 /** Whether the user can comment on the file. */
2585 core.bool canComment; 3026 core.bool canComment;
2586 /** Whether the user can copy the file. */ 3027 /**
3028 * Whether the user can copy the file. For a Team Drive item, whether
3029 * non-folder descendants of this item, or this item itself if it is not a
3030 * folder, can be copied.
3031 */
2587 core.bool canCopy; 3032 core.bool canCopy;
3033 /** Whether the file can be deleted by the user. */
3034 core.bool canDelete;
3035 /** Whether the file can be downloaded by the user. */
3036 core.bool canDownload;
2588 /** Whether the user can edit the file's content. */ 3037 /** Whether the user can edit the file's content. */
2589 core.bool canEdit; 3038 core.bool canEdit;
2590 /** 3039 /**
2591 * Whether the current user has read access to the Revisions resource of the 3040 * Whether the user can list the children of this folder. This is always false
2592 * file. 3041 * when the item is not a folder.
3042 */
3043 core.bool canListChildren;
3044 /**
3045 * Whether the current user can move this item into a Team Drive. If the item
3046 * is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
3047 */
3048 core.bool canMoveItemIntoTeamDrive;
3049 /**
3050 * Whether the user can move this Team Drive item by changing its parent. Note
3051 * that a request to change the parent for this item may still fail depending
3052 * on the new parent that is being added. Only populated for Team Drive files.
3053 */
3054 core.bool canMoveTeamDriveItem;
3055 /**
3056 * Whether the user has read access to the Revisions resource of the file. For
3057 * a Team Drive item, whether revisions of non-folder descendants of this
3058 * item, or this item itself if it is not a folder, can be read.
2593 */ 3059 */
2594 core.bool canReadRevisions; 3060 core.bool canReadRevisions;
2595 /** 3061 /**
3062 * Whether the user has read access to the Team Drive to which this file
3063 * belongs. Only populated for Team Drive files.
3064 */
3065 core.bool canReadTeamDrive;
3066 /**
3067 * Whether the user can remove children from this folder. This is always false
3068 * when the item is not a folder.
3069 */
3070 core.bool canRemoveChildren;
3071 /** Whether the file can be renamed by the user. */
3072 core.bool canRename;
3073 /**
2596 * Whether the user can modify the file's permissions and sharing settings. 3074 * Whether the user can modify the file's permissions and sharing settings.
2597 */ 3075 */
2598 core.bool canShare; 3076 core.bool canShare;
3077 /** Whether the file can be trashed by the user. */
3078 core.bool canTrash;
3079 /** Whether the file can be restored from the trash by the current user. */
3080 core.bool canUntrash;
2599 3081
2600 FileCapabilities(); 3082 FileCapabilities();
2601 3083
2602 FileCapabilities.fromJson(core.Map _json) { 3084 FileCapabilities.fromJson(core.Map _json) {
3085 if (_json.containsKey("canAddChildren")) {
3086 canAddChildren = _json["canAddChildren"];
3087 }
2603 if (_json.containsKey("canComment")) { 3088 if (_json.containsKey("canComment")) {
2604 canComment = _json["canComment"]; 3089 canComment = _json["canComment"];
2605 } 3090 }
2606 if (_json.containsKey("canCopy")) { 3091 if (_json.containsKey("canCopy")) {
2607 canCopy = _json["canCopy"]; 3092 canCopy = _json["canCopy"];
2608 } 3093 }
3094 if (_json.containsKey("canDelete")) {
3095 canDelete = _json["canDelete"];
3096 }
3097 if (_json.containsKey("canDownload")) {
3098 canDownload = _json["canDownload"];
3099 }
2609 if (_json.containsKey("canEdit")) { 3100 if (_json.containsKey("canEdit")) {
2610 canEdit = _json["canEdit"]; 3101 canEdit = _json["canEdit"];
2611 } 3102 }
3103 if (_json.containsKey("canListChildren")) {
3104 canListChildren = _json["canListChildren"];
3105 }
3106 if (_json.containsKey("canMoveItemIntoTeamDrive")) {
3107 canMoveItemIntoTeamDrive = _json["canMoveItemIntoTeamDrive"];
3108 }
3109 if (_json.containsKey("canMoveTeamDriveItem")) {
3110 canMoveTeamDriveItem = _json["canMoveTeamDriveItem"];
3111 }
2612 if (_json.containsKey("canReadRevisions")) { 3112 if (_json.containsKey("canReadRevisions")) {
2613 canReadRevisions = _json["canReadRevisions"]; 3113 canReadRevisions = _json["canReadRevisions"];
2614 } 3114 }
3115 if (_json.containsKey("canReadTeamDrive")) {
3116 canReadTeamDrive = _json["canReadTeamDrive"];
3117 }
3118 if (_json.containsKey("canRemoveChildren")) {
3119 canRemoveChildren = _json["canRemoveChildren"];
3120 }
3121 if (_json.containsKey("canRename")) {
3122 canRename = _json["canRename"];
3123 }
2615 if (_json.containsKey("canShare")) { 3124 if (_json.containsKey("canShare")) {
2616 canShare = _json["canShare"]; 3125 canShare = _json["canShare"];
2617 } 3126 }
3127 if (_json.containsKey("canTrash")) {
3128 canTrash = _json["canTrash"];
3129 }
3130 if (_json.containsKey("canUntrash")) {
3131 canUntrash = _json["canUntrash"];
3132 }
2618 } 3133 }
2619 3134
2620 core.Map toJson() { 3135 core.Map toJson() {
2621 var _json = new core.Map(); 3136 var _json = new core.Map();
3137 if (canAddChildren != null) {
3138 _json["canAddChildren"] = canAddChildren;
3139 }
2622 if (canComment != null) { 3140 if (canComment != null) {
2623 _json["canComment"] = canComment; 3141 _json["canComment"] = canComment;
2624 } 3142 }
2625 if (canCopy != null) { 3143 if (canCopy != null) {
2626 _json["canCopy"] = canCopy; 3144 _json["canCopy"] = canCopy;
2627 } 3145 }
3146 if (canDelete != null) {
3147 _json["canDelete"] = canDelete;
3148 }
3149 if (canDownload != null) {
3150 _json["canDownload"] = canDownload;
3151 }
2628 if (canEdit != null) { 3152 if (canEdit != null) {
2629 _json["canEdit"] = canEdit; 3153 _json["canEdit"] = canEdit;
2630 } 3154 }
3155 if (canListChildren != null) {
3156 _json["canListChildren"] = canListChildren;
3157 }
3158 if (canMoveItemIntoTeamDrive != null) {
3159 _json["canMoveItemIntoTeamDrive"] = canMoveItemIntoTeamDrive;
3160 }
3161 if (canMoveTeamDriveItem != null) {
3162 _json["canMoveTeamDriveItem"] = canMoveTeamDriveItem;
3163 }
2631 if (canReadRevisions != null) { 3164 if (canReadRevisions != null) {
2632 _json["canReadRevisions"] = canReadRevisions; 3165 _json["canReadRevisions"] = canReadRevisions;
2633 } 3166 }
3167 if (canReadTeamDrive != null) {
3168 _json["canReadTeamDrive"] = canReadTeamDrive;
3169 }
3170 if (canRemoveChildren != null) {
3171 _json["canRemoveChildren"] = canRemoveChildren;
3172 }
3173 if (canRename != null) {
3174 _json["canRename"] = canRename;
3175 }
2634 if (canShare != null) { 3176 if (canShare != null) {
2635 _json["canShare"] = canShare; 3177 _json["canShare"] = canShare;
2636 } 3178 }
3179 if (canTrash != null) {
3180 _json["canTrash"] = canTrash;
3181 }
3182 if (canUntrash != null) {
3183 _json["canUntrash"] = canUntrash;
3184 }
2637 return _json; 3185 return _json;
2638 } 3186 }
2639 } 3187 }
2640 3188
2641 /** 3189 /**
2642 * A thumbnail for the file. This will only be used if Drive cannot generate a 3190 * A thumbnail for the file. This will only be used if Drive cannot generate a
2643 * standard thumbnail. 3191 * standard thumbnail.
2644 */ 3192 */
2645 class FileContentHintsThumbnail { 3193 class FileContentHintsThumbnail {
2646 /** The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). */ 3194 /** The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). */
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
2984 } 3532 }
2985 3533
2986 /** The metadata for a file. */ 3534 /** The metadata for a file. */
2987 class File { 3535 class File {
2988 /** 3536 /**
2989 * A collection of arbitrary key-value pairs which are private to the 3537 * A collection of arbitrary key-value pairs which are private to the
2990 * requesting app. 3538 * requesting app.
2991 * Entries with null values are cleared in update and copy requests. 3539 * Entries with null values are cleared in update and copy requests.
2992 */ 3540 */
2993 core.Map<core.String, core.String> appProperties; 3541 core.Map<core.String, core.String> appProperties;
2994 /** Capabilities the current user has on the file. */ 3542 /**
3543 * Capabilities the current user has on the file. Each capability corresponds
3544 * to a fine-grained action that a user may take.
3545 */
2995 FileCapabilities capabilities; 3546 FileCapabilities capabilities;
2996 /** 3547 /**
2997 * Additional information about the content of the file. These fields are 3548 * Additional information about the content of the file. These fields are
2998 * never populated in responses. 3549 * never populated in responses.
2999 */ 3550 */
3000 FileContentHints contentHints; 3551 FileContentHints contentHints;
3001 /** The time at which the file was created (RFC 3339 date-time). */ 3552 /** The time at which the file was created (RFC 3339 date-time). */
3002 core.DateTime createdTime; 3553 core.DateTime createdTime;
3003 /** A short description of the file. */ 3554 /** A short description of the file. */
3004 core.String description; 3555 core.String description;
(...skipping 15 matching lines...) Expand all
3020 */ 3571 */
3021 core.String folderColorRgb; 3572 core.String folderColorRgb;
3022 /** 3573 /**
3023 * The full file extension extracted from the name field. May contain multiple 3574 * The full file extension extracted from the name field. May contain multiple
3024 * concatenated extensions, such as "tar.gz". This is only available for files 3575 * concatenated extensions, such as "tar.gz". This is only available for files
3025 * with binary content in Drive. 3576 * with binary content in Drive.
3026 * This is automatically updated when the name field changes, however it is 3577 * This is automatically updated when the name field changes, however it is
3027 * not cleared if the new name does not contain a valid extension. 3578 * not cleared if the new name does not contain a valid extension.
3028 */ 3579 */
3029 core.String fullFileExtension; 3580 core.String fullFileExtension;
3581 /**
3582 * Whether any users are granted file access directly on this file. This field
3583 * is only populated for Team Drive files.
3584 */
3585 core.bool hasAugmentedPermissions;
3030 /** Whether this file has a thumbnail. */ 3586 /** Whether this file has a thumbnail. */
3031 core.bool hasThumbnail; 3587 core.bool hasThumbnail;
3032 /** 3588 /**
3033 * The ID of the file's head revision. This is currently only available for 3589 * The ID of the file's head revision. This is currently only available for
3034 * files with binary content in Drive. 3590 * files with binary content in Drive.
3035 */ 3591 */
3036 core.String headRevisionId; 3592 core.String headRevisionId;
3037 /** A static, unauthenticated link to the file's icon. */ 3593 /** A static, unauthenticated link to the file's icon. */
3038 core.String iconLink; 3594 core.String iconLink;
3039 /** The ID of the file. */ 3595 /** The ID of the file. */
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3075 */ 3631 */
3076 core.DateTime modifiedTime; 3632 core.DateTime modifiedTime;
3077 /** The name of the file. This is not necessarily unique within a folder. */ 3633 /** The name of the file. This is not necessarily unique within a folder. */
3078 core.String name; 3634 core.String name;
3079 /** 3635 /**
3080 * The original filename of the uploaded content if available, or else the 3636 * The original filename of the uploaded content if available, or else the
3081 * original value of the name field. This is only available for files with 3637 * original value of the name field. This is only available for files with
3082 * binary content in Drive. 3638 * binary content in Drive.
3083 */ 3639 */
3084 core.String originalFilename; 3640 core.String originalFilename;
3085 /** Whether the user owns the file. */ 3641 /** Whether the user owns the file. Not populated for Team Drive files. */
3086 core.bool ownedByMe; 3642 core.bool ownedByMe;
3087 /** 3643 /**
3088 * The owners of the file. Currently, only certain legacy files may have more 3644 * The owners of the file. Currently, only certain legacy files may have more
3089 * than one owner. 3645 * than one owner. Not populated for Team Drive files.
3090 */ 3646 */
3091 core.List<User> owners; 3647 core.List<User> owners;
3092 /** 3648 /**
3093 * The IDs of the parent folders which contain the file. 3649 * The IDs of the parent folders which contain the file.
3094 * If not specified as part of a create request, the file will be placed 3650 * If not specified as part of a create request, the file will be placed
3095 * directly in the My Drive folder. Update requests must use the addParents 3651 * directly in the My Drive folder. Update requests must use the addParents
3096 * and removeParents parameters to modify the values. 3652 * and removeParents parameters to modify the values.
3097 */ 3653 */
3098 core.List<core.String> parents; 3654 core.List<core.String> parents;
3099 /** 3655 /**
3100 * The full list of permissions for the file. This is only available if the 3656 * The full list of permissions for the file. This is only available if the
3101 * requesting user can share the file. 3657 * requesting user can share the file. Not populated for Team Drive files.
3102 */ 3658 */
3103 core.List<Permission> permissions; 3659 core.List<Permission> permissions;
3104 /** 3660 /**
3105 * A collection of arbitrary key-value pairs which are visible to all apps. 3661 * A collection of arbitrary key-value pairs which are visible to all apps.
3106 * Entries with null values are cleared in update and copy requests. 3662 * Entries with null values are cleared in update and copy requests.
3107 */ 3663 */
3108 core.Map<core.String, core.String> properties; 3664 core.Map<core.String, core.String> properties;
3109 /** 3665 /**
3110 * The number of storage quota bytes used by the file. This includes the head 3666 * The number of storage quota bytes used by the file. This includes the head
3111 * revision as well as previous revisions with keepForever enabled. 3667 * revision as well as previous revisions with keepForever enabled.
3112 */ 3668 */
3113 core.String quotaBytesUsed; 3669 core.String quotaBytesUsed;
3114 /** Whether the file has been shared. */ 3670 /** Whether the file has been shared. Not populated for Team Drive files. */
3115 core.bool shared; 3671 core.bool shared;
3116 /** 3672 /**
3117 * The time at which the file was shared with the user, if applicable (RFC 3673 * The time at which the file was shared with the user, if applicable (RFC
3118 * 3339 date-time). 3674 * 3339 date-time).
3119 */ 3675 */
3120 core.DateTime sharedWithMeTime; 3676 core.DateTime sharedWithMeTime;
3121 /** The user who shared the file with the requesting user, if applicable. */ 3677 /** The user who shared the file with the requesting user, if applicable. */
3122 User sharingUser; 3678 User sharingUser;
3123 /** 3679 /**
3124 * The size of the file's content in bytes. This is only applicable to files 3680 * The size of the file's content in bytes. This is only applicable to files
3125 * with binary content in Drive. 3681 * with binary content in Drive.
3126 */ 3682 */
3127 core.String size; 3683 core.String size;
3128 /** 3684 /**
3129 * The list of spaces which contain the file. The currently supported values 3685 * The list of spaces which contain the file. The currently supported values
3130 * are 'drive', 'appDataFolder' and 'photos'. 3686 * are 'drive', 'appDataFolder' and 'photos'.
3131 */ 3687 */
3132 core.List<core.String> spaces; 3688 core.List<core.String> spaces;
3133 /** Whether the user has starred the file. */ 3689 /** Whether the user has starred the file. */
3134 core.bool starred; 3690 core.bool starred;
3691 /** ID of the Team Drive the file resides in. */
3692 core.String teamDriveId;
3135 /** 3693 /**
3136 * A short-lived link to the file's thumbnail, if available. Typically lasts 3694 * A short-lived link to the file's thumbnail, if available. Typically lasts
3137 * on the order of hours. Only populated when the requesting app can access 3695 * on the order of hours. Only populated when the requesting app can access
3138 * the file's content. 3696 * the file's content.
3139 */ 3697 */
3140 core.String thumbnailLink; 3698 core.String thumbnailLink;
3141 /** The thumbnail version for use in thumbnail cache invalidation. */ 3699 /** The thumbnail version for use in thumbnail cache invalidation. */
3142 core.String thumbnailVersion; 3700 core.String thumbnailVersion;
3143 /** 3701 /**
3144 * Whether the file has been trashed, either explicitly or from a trashed 3702 * Whether the file has been trashed, either explicitly or from a trashed
3145 * parent folder. Only the owner may trash a file, and other users cannot see 3703 * parent folder. Only the owner may trash a file, and other users cannot see
3146 * files in the owner's trash. 3704 * files in the owner's trash.
3147 */ 3705 */
3148 core.bool trashed; 3706 core.bool trashed;
3149 /** 3707 /**
3708 * The time that the item was trashed (RFC 3339 date-time). Only populated for
3709 * Team Drive files.
3710 */
3711 core.DateTime trashedTime;
3712 /**
3713 * If the file has been explicitly trashed, the user who trashed it. Only
3714 * populated for Team Drive files.
3715 */
3716 User trashingUser;
3717 /**
3150 * A monotonically increasing version number for the file. This reflects every 3718 * A monotonically increasing version number for the file. This reflects every
3151 * change made to the file on the server, even those not visible to the user. 3719 * change made to the file on the server, even those not visible to the user.
3152 */ 3720 */
3153 core.String version; 3721 core.String version;
3154 /** 3722 /**
3155 * Additional metadata about video media. This may not be available 3723 * Additional metadata about video media. This may not be available
3156 * immediately upon upload. 3724 * immediately upon upload.
3157 */ 3725 */
3158 FileVideoMediaMetadata videoMediaMetadata; 3726 FileVideoMediaMetadata videoMediaMetadata;
3159 /** Whether the file has been viewed by this user. */ 3727 /** Whether the file has been viewed by this user. */
(...skipping 10 matching lines...) Expand all
3170 * available for files with binary content in Drive. 3738 * available for files with binary content in Drive.
3171 */ 3739 */
3172 core.String webContentLink; 3740 core.String webContentLink;
3173 /** 3741 /**
3174 * A link for opening the file in a relevant Google editor or viewer in a 3742 * A link for opening the file in a relevant Google editor or viewer in a
3175 * browser. 3743 * browser.
3176 */ 3744 */
3177 core.String webViewLink; 3745 core.String webViewLink;
3178 /** 3746 /**
3179 * Whether users with only writer permission can modify the file's 3747 * Whether users with only writer permission can modify the file's
3180 * permissions. 3748 * permissions. Not populated for Team Drive files.
3181 */ 3749 */
3182 core.bool writersCanShare; 3750 core.bool writersCanShare;
3183 3751
3184 File(); 3752 File();
3185 3753
3186 File.fromJson(core.Map _json) { 3754 File.fromJson(core.Map _json) {
3187 if (_json.containsKey("appProperties")) { 3755 if (_json.containsKey("appProperties")) {
3188 appProperties = _json["appProperties"]; 3756 appProperties = _json["appProperties"];
3189 } 3757 }
3190 if (_json.containsKey("capabilities")) { 3758 if (_json.containsKey("capabilities")) {
(...skipping 13 matching lines...) Expand all
3204 } 3772 }
3205 if (_json.containsKey("fileExtension")) { 3773 if (_json.containsKey("fileExtension")) {
3206 fileExtension = _json["fileExtension"]; 3774 fileExtension = _json["fileExtension"];
3207 } 3775 }
3208 if (_json.containsKey("folderColorRgb")) { 3776 if (_json.containsKey("folderColorRgb")) {
3209 folderColorRgb = _json["folderColorRgb"]; 3777 folderColorRgb = _json["folderColorRgb"];
3210 } 3778 }
3211 if (_json.containsKey("fullFileExtension")) { 3779 if (_json.containsKey("fullFileExtension")) {
3212 fullFileExtension = _json["fullFileExtension"]; 3780 fullFileExtension = _json["fullFileExtension"];
3213 } 3781 }
3782 if (_json.containsKey("hasAugmentedPermissions")) {
3783 hasAugmentedPermissions = _json["hasAugmentedPermissions"];
3784 }
3214 if (_json.containsKey("hasThumbnail")) { 3785 if (_json.containsKey("hasThumbnail")) {
3215 hasThumbnail = _json["hasThumbnail"]; 3786 hasThumbnail = _json["hasThumbnail"];
3216 } 3787 }
3217 if (_json.containsKey("headRevisionId")) { 3788 if (_json.containsKey("headRevisionId")) {
3218 headRevisionId = _json["headRevisionId"]; 3789 headRevisionId = _json["headRevisionId"];
3219 } 3790 }
3220 if (_json.containsKey("iconLink")) { 3791 if (_json.containsKey("iconLink")) {
3221 iconLink = _json["iconLink"]; 3792 iconLink = _json["iconLink"];
3222 } 3793 }
3223 if (_json.containsKey("id")) { 3794 if (_json.containsKey("id")) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
3285 } 3856 }
3286 if (_json.containsKey("size")) { 3857 if (_json.containsKey("size")) {
3287 size = _json["size"]; 3858 size = _json["size"];
3288 } 3859 }
3289 if (_json.containsKey("spaces")) { 3860 if (_json.containsKey("spaces")) {
3290 spaces = _json["spaces"]; 3861 spaces = _json["spaces"];
3291 } 3862 }
3292 if (_json.containsKey("starred")) { 3863 if (_json.containsKey("starred")) {
3293 starred = _json["starred"]; 3864 starred = _json["starred"];
3294 } 3865 }
3866 if (_json.containsKey("teamDriveId")) {
3867 teamDriveId = _json["teamDriveId"];
3868 }
3295 if (_json.containsKey("thumbnailLink")) { 3869 if (_json.containsKey("thumbnailLink")) {
3296 thumbnailLink = _json["thumbnailLink"]; 3870 thumbnailLink = _json["thumbnailLink"];
3297 } 3871 }
3298 if (_json.containsKey("thumbnailVersion")) { 3872 if (_json.containsKey("thumbnailVersion")) {
3299 thumbnailVersion = _json["thumbnailVersion"]; 3873 thumbnailVersion = _json["thumbnailVersion"];
3300 } 3874 }
3301 if (_json.containsKey("trashed")) { 3875 if (_json.containsKey("trashed")) {
3302 trashed = _json["trashed"]; 3876 trashed = _json["trashed"];
3303 } 3877 }
3878 if (_json.containsKey("trashedTime")) {
3879 trashedTime = core.DateTime.parse(_json["trashedTime"]);
3880 }
3881 if (_json.containsKey("trashingUser")) {
3882 trashingUser = new User.fromJson(_json["trashingUser"]);
3883 }
3304 if (_json.containsKey("version")) { 3884 if (_json.containsKey("version")) {
3305 version = _json["version"]; 3885 version = _json["version"];
3306 } 3886 }
3307 if (_json.containsKey("videoMediaMetadata")) { 3887 if (_json.containsKey("videoMediaMetadata")) {
3308 videoMediaMetadata = new FileVideoMediaMetadata.fromJson(_json["videoMedia Metadata"]); 3888 videoMediaMetadata = new FileVideoMediaMetadata.fromJson(_json["videoMedia Metadata"]);
3309 } 3889 }
3310 if (_json.containsKey("viewedByMe")) { 3890 if (_json.containsKey("viewedByMe")) {
3311 viewedByMe = _json["viewedByMe"]; 3891 viewedByMe = _json["viewedByMe"];
3312 } 3892 }
3313 if (_json.containsKey("viewedByMeTime")) { 3893 if (_json.containsKey("viewedByMeTime")) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3349 } 3929 }
3350 if (fileExtension != null) { 3930 if (fileExtension != null) {
3351 _json["fileExtension"] = fileExtension; 3931 _json["fileExtension"] = fileExtension;
3352 } 3932 }
3353 if (folderColorRgb != null) { 3933 if (folderColorRgb != null) {
3354 _json["folderColorRgb"] = folderColorRgb; 3934 _json["folderColorRgb"] = folderColorRgb;
3355 } 3935 }
3356 if (fullFileExtension != null) { 3936 if (fullFileExtension != null) {
3357 _json["fullFileExtension"] = fullFileExtension; 3937 _json["fullFileExtension"] = fullFileExtension;
3358 } 3938 }
3939 if (hasAugmentedPermissions != null) {
3940 _json["hasAugmentedPermissions"] = hasAugmentedPermissions;
3941 }
3359 if (hasThumbnail != null) { 3942 if (hasThumbnail != null) {
3360 _json["hasThumbnail"] = hasThumbnail; 3943 _json["hasThumbnail"] = hasThumbnail;
3361 } 3944 }
3362 if (headRevisionId != null) { 3945 if (headRevisionId != null) {
3363 _json["headRevisionId"] = headRevisionId; 3946 _json["headRevisionId"] = headRevisionId;
3364 } 3947 }
3365 if (iconLink != null) { 3948 if (iconLink != null) {
3366 _json["iconLink"] = iconLink; 3949 _json["iconLink"] = iconLink;
3367 } 3950 }
3368 if (id != null) { 3951 if (id != null) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
3430 } 4013 }
3431 if (size != null) { 4014 if (size != null) {
3432 _json["size"] = size; 4015 _json["size"] = size;
3433 } 4016 }
3434 if (spaces != null) { 4017 if (spaces != null) {
3435 _json["spaces"] = spaces; 4018 _json["spaces"] = spaces;
3436 } 4019 }
3437 if (starred != null) { 4020 if (starred != null) {
3438 _json["starred"] = starred; 4021 _json["starred"] = starred;
3439 } 4022 }
4023 if (teamDriveId != null) {
4024 _json["teamDriveId"] = teamDriveId;
4025 }
3440 if (thumbnailLink != null) { 4026 if (thumbnailLink != null) {
3441 _json["thumbnailLink"] = thumbnailLink; 4027 _json["thumbnailLink"] = thumbnailLink;
3442 } 4028 }
3443 if (thumbnailVersion != null) { 4029 if (thumbnailVersion != null) {
3444 _json["thumbnailVersion"] = thumbnailVersion; 4030 _json["thumbnailVersion"] = thumbnailVersion;
3445 } 4031 }
3446 if (trashed != null) { 4032 if (trashed != null) {
3447 _json["trashed"] = trashed; 4033 _json["trashed"] = trashed;
3448 } 4034 }
4035 if (trashedTime != null) {
4036 _json["trashedTime"] = (trashedTime).toIso8601String();
4037 }
4038 if (trashingUser != null) {
4039 _json["trashingUser"] = (trashingUser).toJson();
4040 }
3449 if (version != null) { 4041 if (version != null) {
3450 _json["version"] = version; 4042 _json["version"] = version;
3451 } 4043 }
3452 if (videoMediaMetadata != null) { 4044 if (videoMediaMetadata != null) {
3453 _json["videoMediaMetadata"] = (videoMediaMetadata).toJson(); 4045 _json["videoMediaMetadata"] = (videoMediaMetadata).toJson();
3454 } 4046 }
3455 if (viewedByMe != null) { 4047 if (viewedByMe != null) {
3456 _json["viewedByMe"] = viewedByMe; 4048 _json["viewedByMe"] = viewedByMe;
3457 } 4049 }
3458 if (viewedByMeTime != null) { 4050 if (viewedByMeTime != null) {
(...skipping 16 matching lines...) Expand all
3475 } 4067 }
3476 4068
3477 /** A list of files. */ 4069 /** A list of files. */
3478 class FileList { 4070 class FileList {
3479 /** 4071 /**
3480 * The list of files. If nextPageToken is populated, then this list may be 4072 * The list of files. If nextPageToken is populated, then this list may be
3481 * incomplete and an additional page of results should be fetched. 4073 * incomplete and an additional page of results should be fetched.
3482 */ 4074 */
3483 core.List<File> files; 4075 core.List<File> files;
3484 /** 4076 /**
4077 * Whether the search process was incomplete. If true, then some search
4078 * results may be missing, since all documents were not searched. This may
4079 * occur when searching multiple Team Drives with the "user,allTeamDrives"
4080 * corpora, but all corpora could not be searched. When this happens, it is
4081 * suggested that clients narrow their query by choosing a different corpus
4082 * such as "user" or "teamDrive".
4083 */
4084 core.bool incompleteSearch;
4085 /**
3485 * Identifies what kind of resource this is. Value: the fixed string 4086 * Identifies what kind of resource this is. Value: the fixed string
3486 * "drive#fileList". 4087 * "drive#fileList".
3487 */ 4088 */
3488 core.String kind; 4089 core.String kind;
3489 /** 4090 /**
3490 * The page token for the next page of files. This will be absent if the end 4091 * The page token for the next page of files. This will be absent if the end
3491 * of the files list has been reached. If the token is rejected for any 4092 * of the files list has been reached. If the token is rejected for any
3492 * reason, it should be discarded, and pagination should be restarted from the 4093 * reason, it should be discarded, and pagination should be restarted from the
3493 * first page of results. 4094 * first page of results.
3494 */ 4095 */
3495 core.String nextPageToken; 4096 core.String nextPageToken;
3496 4097
3497 FileList(); 4098 FileList();
3498 4099
3499 FileList.fromJson(core.Map _json) { 4100 FileList.fromJson(core.Map _json) {
3500 if (_json.containsKey("files")) { 4101 if (_json.containsKey("files")) {
3501 files = _json["files"].map((value) => new File.fromJson(value)).toList(); 4102 files = _json["files"].map((value) => new File.fromJson(value)).toList();
3502 } 4103 }
4104 if (_json.containsKey("incompleteSearch")) {
4105 incompleteSearch = _json["incompleteSearch"];
4106 }
3503 if (_json.containsKey("kind")) { 4107 if (_json.containsKey("kind")) {
3504 kind = _json["kind"]; 4108 kind = _json["kind"];
3505 } 4109 }
3506 if (_json.containsKey("nextPageToken")) { 4110 if (_json.containsKey("nextPageToken")) {
3507 nextPageToken = _json["nextPageToken"]; 4111 nextPageToken = _json["nextPageToken"];
3508 } 4112 }
3509 } 4113 }
3510 4114
3511 core.Map toJson() { 4115 core.Map toJson() {
3512 var _json = new core.Map(); 4116 var _json = new core.Map();
3513 if (files != null) { 4117 if (files != null) {
3514 _json["files"] = files.map((value) => (value).toJson()).toList(); 4118 _json["files"] = files.map((value) => (value).toJson()).toList();
3515 } 4119 }
4120 if (incompleteSearch != null) {
4121 _json["incompleteSearch"] = incompleteSearch;
4122 }
3516 if (kind != null) { 4123 if (kind != null) {
3517 _json["kind"] = kind; 4124 _json["kind"] = kind;
3518 } 4125 }
3519 if (nextPageToken != null) { 4126 if (nextPageToken != null) {
3520 _json["nextPageToken"] = nextPageToken; 4127 _json["nextPageToken"] = nextPageToken;
3521 } 4128 }
3522 return _json; 4129 return _json;
3523 } 4130 }
3524 } 4131 }
3525 4132
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3557 if (kind != null) { 4164 if (kind != null) {
3558 _json["kind"] = kind; 4165 _json["kind"] = kind;
3559 } 4166 }
3560 if (space != null) { 4167 if (space != null) {
3561 _json["space"] = space; 4168 _json["space"] = space;
3562 } 4169 }
3563 return _json; 4170 return _json;
3564 } 4171 }
3565 } 4172 }
3566 4173
4174 class PermissionTeamDrivePermissionDetails {
4175 /**
4176 * Whether this permission is inherited. This field is always populated. This
4177 * is an output-only field.
4178 */
4179 core.bool inherited;
4180 /**
4181 * The ID of the item from which this permission is inherited. This is an
4182 * output-only field and is only populated for members of the Team Drive.
4183 */
4184 core.String inheritedFrom;
4185 /**
4186 * The primary role for this user. While new values may be added in the
4187 * future, the following are currently possible:
4188 * - organizer
4189 * - writer
4190 * - commenter
4191 * - reader
4192 */
4193 core.String role;
4194 /**
4195 * The Team Drive permission type for this user. While new values may be added
4196 * in future, the following are currently possible:
4197 * - file
4198 * -
4199 * - member
4200 */
4201 core.String teamDrivePermissionType;
4202
4203 PermissionTeamDrivePermissionDetails();
4204
4205 PermissionTeamDrivePermissionDetails.fromJson(core.Map _json) {
4206 if (_json.containsKey("inherited")) {
4207 inherited = _json["inherited"];
4208 }
4209 if (_json.containsKey("inheritedFrom")) {
4210 inheritedFrom = _json["inheritedFrom"];
4211 }
4212 if (_json.containsKey("role")) {
4213 role = _json["role"];
4214 }
4215 if (_json.containsKey("teamDrivePermissionType")) {
4216 teamDrivePermissionType = _json["teamDrivePermissionType"];
4217 }
4218 }
4219
4220 core.Map toJson() {
4221 var _json = new core.Map();
4222 if (inherited != null) {
4223 _json["inherited"] = inherited;
4224 }
4225 if (inheritedFrom != null) {
4226 _json["inheritedFrom"] = inheritedFrom;
4227 }
4228 if (role != null) {
4229 _json["role"] = role;
4230 }
4231 if (teamDrivePermissionType != null) {
4232 _json["teamDrivePermissionType"] = teamDrivePermissionType;
4233 }
4234 return _json;
4235 }
4236 }
4237
3567 /** 4238 /**
3568 * A permission for a file. A permission grants a user, group, domain or the 4239 * A permission for a file. A permission grants a user, group, domain or the
3569 * world access to a file or a folder hierarchy. 4240 * world access to a file or a folder hierarchy.
3570 */ 4241 */
3571 class Permission { 4242 class Permission {
3572 /** 4243 /**
3573 * Whether the permission allows the file to be discovered through search. 4244 * Whether the permission allows the file to be discovered through search.
3574 * This is only applicable for permissions of type domain or anyone. 4245 * This is only applicable for permissions of type domain or anyone.
3575 */ 4246 */
3576 core.bool allowFileDiscovery; 4247 core.bool allowFileDiscovery;
3577 /** A displayable name for users, groups or domains. */ 4248 /** A displayable name for users, groups or domains. */
3578 core.String displayName; 4249 core.String displayName;
3579 /** The domain to which this permission refers. */ 4250 /** The domain to which this permission refers. */
3580 core.String domain; 4251 core.String domain;
3581 /** 4252 /**
3582 * The email address of the user or group to which this permission refers. 4253 * The email address of the user or group to which this permission refers.
3583 */ 4254 */
3584 core.String emailAddress; 4255 core.String emailAddress;
3585 /** The time at which this permission will expire (RFC 3339 date-time). */ 4256 /**
4257 * The time at which this permission will expire (RFC 3339 date-time).
4258 * Expiration times have the following restrictions:
4259 * - They can only be set on user and group permissions
4260 * - The time must be in the future
4261 * - The time cannot be more than a year in the future
4262 */
3586 core.DateTime expirationTime; 4263 core.DateTime expirationTime;
3587 /** 4264 /**
3588 * The ID of this permission. This is a unique identifier for the grantee, and 4265 * The ID of this permission. This is a unique identifier for the grantee, and
3589 * is published in User resources as permissionId. 4266 * is published in User resources as permissionId.
3590 */ 4267 */
3591 core.String id; 4268 core.String id;
3592 /** 4269 /**
3593 * Identifies what kind of resource this is. Value: the fixed string 4270 * Identifies what kind of resource this is. Value: the fixed string
3594 * "drive#permission". 4271 * "drive#permission".
3595 */ 4272 */
3596 core.String kind; 4273 core.String kind;
3597 /** A link to the user's profile photo, if available. */ 4274 /** A link to the user's profile photo, if available. */
3598 core.String photoLink; 4275 core.String photoLink;
3599 /** 4276 /**
3600 * The role granted by this permission. Valid values are: 4277 * The role granted by this permission. While new values may be supported in
4278 * the future, the following are currently allowed:
4279 * - organizer
3601 * - owner 4280 * - owner
3602 * - writer 4281 * - writer
3603 * - commenter 4282 * - commenter
3604 * - reader 4283 * - reader
3605 */ 4284 */
3606 core.String role; 4285 core.String role;
3607 /** 4286 /**
4287 * Details of whether the Permissions on this Team Drive item are inherited or
4288 * directly on this item. This is an output-only field which is present only
4289 * for Team Drive items.
4290 */
4291 core.List<PermissionTeamDrivePermissionDetails> teamDrivePermissionDetails;
4292 /**
3608 * The type of the grantee. Valid values are: 4293 * The type of the grantee. Valid values are:
3609 * - user 4294 * - user
3610 * - group 4295 * - group
3611 * - domain 4296 * - domain
3612 * - anyone 4297 * - anyone
3613 */ 4298 */
3614 core.String type; 4299 core.String type;
3615 4300
3616 Permission(); 4301 Permission();
3617 4302
(...skipping 18 matching lines...) Expand all
3636 } 4321 }
3637 if (_json.containsKey("kind")) { 4322 if (_json.containsKey("kind")) {
3638 kind = _json["kind"]; 4323 kind = _json["kind"];
3639 } 4324 }
3640 if (_json.containsKey("photoLink")) { 4325 if (_json.containsKey("photoLink")) {
3641 photoLink = _json["photoLink"]; 4326 photoLink = _json["photoLink"];
3642 } 4327 }
3643 if (_json.containsKey("role")) { 4328 if (_json.containsKey("role")) {
3644 role = _json["role"]; 4329 role = _json["role"];
3645 } 4330 }
4331 if (_json.containsKey("teamDrivePermissionDetails")) {
4332 teamDrivePermissionDetails = _json["teamDrivePermissionDetails"].map((valu e) => new PermissionTeamDrivePermissionDetails.fromJson(value)).toList();
4333 }
3646 if (_json.containsKey("type")) { 4334 if (_json.containsKey("type")) {
3647 type = _json["type"]; 4335 type = _json["type"];
3648 } 4336 }
3649 } 4337 }
3650 4338
3651 core.Map toJson() { 4339 core.Map toJson() {
3652 var _json = new core.Map(); 4340 var _json = new core.Map();
3653 if (allowFileDiscovery != null) { 4341 if (allowFileDiscovery != null) {
3654 _json["allowFileDiscovery"] = allowFileDiscovery; 4342 _json["allowFileDiscovery"] = allowFileDiscovery;
3655 } 4343 }
(...skipping 14 matching lines...) Expand all
3670 } 4358 }
3671 if (kind != null) { 4359 if (kind != null) {
3672 _json["kind"] = kind; 4360 _json["kind"] = kind;
3673 } 4361 }
3674 if (photoLink != null) { 4362 if (photoLink != null) {
3675 _json["photoLink"] = photoLink; 4363 _json["photoLink"] = photoLink;
3676 } 4364 }
3677 if (role != null) { 4365 if (role != null) {
3678 _json["role"] = role; 4366 _json["role"] = role;
3679 } 4367 }
4368 if (teamDrivePermissionDetails != null) {
4369 _json["teamDrivePermissionDetails"] = teamDrivePermissionDetails.map((valu e) => (value).toJson()).toList();
4370 }
3680 if (type != null) { 4371 if (type != null) {
3681 _json["type"] = type; 4372 _json["type"] = type;
3682 } 4373 }
3683 return _json; 4374 return _json;
3684 } 4375 }
3685 } 4376 }
3686 4377
3687 /** A list of permissions for a file. */ 4378 /** A list of permissions for a file. */
3688 class PermissionList { 4379 class PermissionList {
3689 /** 4380 /**
3690 * Identifies what kind of resource this is. Value: the fixed string 4381 * Identifies what kind of resource this is. Value: the fixed string
3691 * "drive#permissionList". 4382 * "drive#permissionList".
3692 */ 4383 */
3693 core.String kind; 4384 core.String kind;
3694 /** The list of permissions. */ 4385 /**
4386 * The page token for the next page of permissions. This field will be absent
4387 * if the end of the permissions list has been reached. If the token is
4388 * rejected for any reason, it should be discarded, and pagination should be
4389 * restarted from the first page of results.
4390 */
4391 core.String nextPageToken;
4392 /**
4393 * The list of permissions. If nextPageToken is populated, then this list may
4394 * be incomplete and an additional page of results should be fetched.
4395 */
3695 core.List<Permission> permissions; 4396 core.List<Permission> permissions;
3696 4397
3697 PermissionList(); 4398 PermissionList();
3698 4399
3699 PermissionList.fromJson(core.Map _json) { 4400 PermissionList.fromJson(core.Map _json) {
3700 if (_json.containsKey("kind")) { 4401 if (_json.containsKey("kind")) {
3701 kind = _json["kind"]; 4402 kind = _json["kind"];
3702 } 4403 }
4404 if (_json.containsKey("nextPageToken")) {
4405 nextPageToken = _json["nextPageToken"];
4406 }
3703 if (_json.containsKey("permissions")) { 4407 if (_json.containsKey("permissions")) {
3704 permissions = _json["permissions"].map((value) => new Permission.fromJson( value)).toList(); 4408 permissions = _json["permissions"].map((value) => new Permission.fromJson( value)).toList();
3705 } 4409 }
3706 } 4410 }
3707 4411
3708 core.Map toJson() { 4412 core.Map toJson() {
3709 var _json = new core.Map(); 4413 var _json = new core.Map();
3710 if (kind != null) { 4414 if (kind != null) {
3711 _json["kind"] = kind; 4415 _json["kind"] = kind;
3712 } 4416 }
4417 if (nextPageToken != null) {
4418 _json["nextPageToken"] = nextPageToken;
4419 }
3713 if (permissions != null) { 4420 if (permissions != null) {
3714 _json["permissions"] = permissions.map((value) => (value).toJson()).toList (); 4421 _json["permissions"] = permissions.map((value) => (value).toJson()).toList ();
3715 } 4422 }
3716 return _json; 4423 return _json;
3717 } 4424 }
3718 } 4425 }
3719 4426
3720 /** A reply to a comment on a file. */ 4427 /** A reply to a comment on a file. */
3721 class Reply { 4428 class Reply {
3722 /** 4429 /**
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
4073 if (kind != null) { 4780 if (kind != null) {
4074 _json["kind"] = kind; 4781 _json["kind"] = kind;
4075 } 4782 }
4076 if (startPageToken != null) { 4783 if (startPageToken != null) {
4077 _json["startPageToken"] = startPageToken; 4784 _json["startPageToken"] = startPageToken;
4078 } 4785 }
4079 return _json; 4786 return _json;
4080 } 4787 }
4081 } 4788 }
4082 4789
4790 /** Capabilities the current user has on this Team Drive. */
4791 class TeamDriveCapabilities {
4792 /**
4793 * Whether the current user can add children to folders in this Team Drive.
4794 */
4795 core.bool canAddChildren;
4796 /** Whether the current user can comment on files in this Team Drive. */
4797 core.bool canComment;
4798 /** Whether files in this Team Drive can be copied by the current user. */
4799 core.bool canCopy;
4800 /** Whether this Team Drive can be deleted by the current user. */
4801 core.bool canDeleteTeamDrive;
4802 /**
4803 * Whether files in this Team Drive can be downloaded by the current user.
4804 */
4805 core.bool canDownload;
4806 /** Whether files in this Team Drive can be edited by the current user. */
4807 core.bool canEdit;
4808 /**
4809 * Whether the current user can list the children of folders in this Team
4810 * Drive.
4811 */
4812 core.bool canListChildren;
4813 /**
4814 * Whether the current user can add members to this Team Drive or remove them
4815 * or change their role.
4816 */
4817 core.bool canManageMembers;
4818 /**
4819 * Whether the current user has read access to the Revisions resource of files
4820 * in this Team Drive.
4821 */
4822 core.bool canReadRevisions;
4823 /**
4824 * Whether the current user can remove children from folders in this Team
4825 * Drive.
4826 */
4827 core.bool canRemoveChildren;
4828 /**
4829 * Whether files or folders in this Team Drive can be renamed by the current
4830 * user.
4831 */
4832 core.bool canRename;
4833 /** Whether this Team Drive can be renamed by the current user. */
4834 core.bool canRenameTeamDrive;
4835 /**
4836 * Whether the current user can share files or folders in this Team Drive.
4837 */
4838 core.bool canShare;
4839
4840 TeamDriveCapabilities();
4841
4842 TeamDriveCapabilities.fromJson(core.Map _json) {
4843 if (_json.containsKey("canAddChildren")) {
4844 canAddChildren = _json["canAddChildren"];
4845 }
4846 if (_json.containsKey("canComment")) {
4847 canComment = _json["canComment"];
4848 }
4849 if (_json.containsKey("canCopy")) {
4850 canCopy = _json["canCopy"];
4851 }
4852 if (_json.containsKey("canDeleteTeamDrive")) {
4853 canDeleteTeamDrive = _json["canDeleteTeamDrive"];
4854 }
4855 if (_json.containsKey("canDownload")) {
4856 canDownload = _json["canDownload"];
4857 }
4858 if (_json.containsKey("canEdit")) {
4859 canEdit = _json["canEdit"];
4860 }
4861 if (_json.containsKey("canListChildren")) {
4862 canListChildren = _json["canListChildren"];
4863 }
4864 if (_json.containsKey("canManageMembers")) {
4865 canManageMembers = _json["canManageMembers"];
4866 }
4867 if (_json.containsKey("canReadRevisions")) {
4868 canReadRevisions = _json["canReadRevisions"];
4869 }
4870 if (_json.containsKey("canRemoveChildren")) {
4871 canRemoveChildren = _json["canRemoveChildren"];
4872 }
4873 if (_json.containsKey("canRename")) {
4874 canRename = _json["canRename"];
4875 }
4876 if (_json.containsKey("canRenameTeamDrive")) {
4877 canRenameTeamDrive = _json["canRenameTeamDrive"];
4878 }
4879 if (_json.containsKey("canShare")) {
4880 canShare = _json["canShare"];
4881 }
4882 }
4883
4884 core.Map toJson() {
4885 var _json = new core.Map();
4886 if (canAddChildren != null) {
4887 _json["canAddChildren"] = canAddChildren;
4888 }
4889 if (canComment != null) {
4890 _json["canComment"] = canComment;
4891 }
4892 if (canCopy != null) {
4893 _json["canCopy"] = canCopy;
4894 }
4895 if (canDeleteTeamDrive != null) {
4896 _json["canDeleteTeamDrive"] = canDeleteTeamDrive;
4897 }
4898 if (canDownload != null) {
4899 _json["canDownload"] = canDownload;
4900 }
4901 if (canEdit != null) {
4902 _json["canEdit"] = canEdit;
4903 }
4904 if (canListChildren != null) {
4905 _json["canListChildren"] = canListChildren;
4906 }
4907 if (canManageMembers != null) {
4908 _json["canManageMembers"] = canManageMembers;
4909 }
4910 if (canReadRevisions != null) {
4911 _json["canReadRevisions"] = canReadRevisions;
4912 }
4913 if (canRemoveChildren != null) {
4914 _json["canRemoveChildren"] = canRemoveChildren;
4915 }
4916 if (canRename != null) {
4917 _json["canRename"] = canRename;
4918 }
4919 if (canRenameTeamDrive != null) {
4920 _json["canRenameTeamDrive"] = canRenameTeamDrive;
4921 }
4922 if (canShare != null) {
4923 _json["canShare"] = canShare;
4924 }
4925 return _json;
4926 }
4927 }
4928
4929 /** Representation of a Team Drive. */
4930 class TeamDrive {
4931 /** Capabilities the current user has on this Team Drive. */
4932 TeamDriveCapabilities capabilities;
4933 /**
4934 * The ID of this Team Drive which is also the ID of the top level folder for
4935 * this Team Drive.
4936 */
4937 core.String id;
4938 /**
4939 * Identifies what kind of resource this is. Value: the fixed string
4940 * "drive#teamDrive".
4941 */
4942 core.String kind;
4943 /** The name of this Team Drive. */
4944 core.String name;
4945
4946 TeamDrive();
4947
4948 TeamDrive.fromJson(core.Map _json) {
4949 if (_json.containsKey("capabilities")) {
4950 capabilities = new TeamDriveCapabilities.fromJson(_json["capabilities"]);
4951 }
4952 if (_json.containsKey("id")) {
4953 id = _json["id"];
4954 }
4955 if (_json.containsKey("kind")) {
4956 kind = _json["kind"];
4957 }
4958 if (_json.containsKey("name")) {
4959 name = _json["name"];
4960 }
4961 }
4962
4963 core.Map toJson() {
4964 var _json = new core.Map();
4965 if (capabilities != null) {
4966 _json["capabilities"] = (capabilities).toJson();
4967 }
4968 if (id != null) {
4969 _json["id"] = id;
4970 }
4971 if (kind != null) {
4972 _json["kind"] = kind;
4973 }
4974 if (name != null) {
4975 _json["name"] = name;
4976 }
4977 return _json;
4978 }
4979 }
4980
4981 /** A list of Team Drives. */
4982 class TeamDriveList {
4983 /**
4984 * Identifies what kind of resource this is. Value: the fixed string
4985 * "drive#teamDriveList".
4986 */
4987 core.String kind;
4988 /**
4989 * The page token for the next page of Team Drives. This will be absent if the
4990 * end of the Team Drives list has been reached. If the token is rejected for
4991 * any reason, it should be discarded, and pagination should be restarted from
4992 * the first page of results.
4993 */
4994 core.String nextPageToken;
4995 /**
4996 * The list of Team Drives. If nextPageToken is populated, then this list may
4997 * be incomplete and an additional page of results should be fetched.
4998 */
4999 core.List<TeamDrive> teamDrives;
5000
5001 TeamDriveList();
5002
5003 TeamDriveList.fromJson(core.Map _json) {
5004 if (_json.containsKey("kind")) {
5005 kind = _json["kind"];
5006 }
5007 if (_json.containsKey("nextPageToken")) {
5008 nextPageToken = _json["nextPageToken"];
5009 }
5010 if (_json.containsKey("teamDrives")) {
5011 teamDrives = _json["teamDrives"].map((value) => new TeamDrive.fromJson(val ue)).toList();
5012 }
5013 }
5014
5015 core.Map toJson() {
5016 var _json = new core.Map();
5017 if (kind != null) {
5018 _json["kind"] = kind;
5019 }
5020 if (nextPageToken != null) {
5021 _json["nextPageToken"] = nextPageToken;
5022 }
5023 if (teamDrives != null) {
5024 _json["teamDrives"] = teamDrives.map((value) => (value).toJson()).toList() ;
5025 }
5026 return _json;
5027 }
5028 }
5029
4083 /** Information about a Drive user. */ 5030 /** Information about a Drive user. */
4084 class User { 5031 class User {
4085 /** A plain text displayable name for this user. */ 5032 /** A plain text displayable name for this user. */
4086 core.String displayName; 5033 core.String displayName;
4087 /** 5034 /**
4088 * The email address of the user. This may not be present in certain contexts 5035 * The email address of the user. This may not be present in certain contexts
4089 * if the user has not made their email address visible to the requester. 5036 * if the user has not made their email address visible to the requester.
4090 */ 5037 */
4091 core.String emailAddress; 5038 core.String emailAddress;
4092 /** 5039 /**
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
4140 } 5087 }
4141 if (permissionId != null) { 5088 if (permissionId != null) {
4142 _json["permissionId"] = permissionId; 5089 _json["permissionId"] = permissionId;
4143 } 5090 }
4144 if (photoLink != null) { 5091 if (photoLink != null) {
4145 _json["photoLink"] = photoLink; 5092 _json["photoLink"] = photoLink;
4146 } 5093 }
4147 return _json; 5094 return _json;
4148 } 5095 }
4149 } 5096 }
OLDNEW
« no previous file with comments | « generated/googleapis/lib/drive/v2.dart ('k') | generated/googleapis/lib/firebaserules/v1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698