@@ -32,29 +32,104 @@ declare namespace GoogleAppsScript {
32
32
export interface DriveApp {
33
33
Access : typeof Access ;
34
34
Permission : typeof Permission ;
35
+ /**
36
+ * Adds the given file to the root of the user's Drive.
37
+ * This method does not move the file out of its existing parent folder;
38
+ * a file can have more than one parent simultaneously.
39
+ */
35
40
addFile ( child : File ) : Folder ;
41
+ /**
42
+ * Adds the given folder to the root of the user's Drive.
43
+ * This method does not move the folder out of its existing parent folder;
44
+ * a folder can have more than one parent simultaneously.
45
+ */
36
46
addFolder ( child : Folder ) : Folder ;
47
+ /**
48
+ * Resumes a file iteration using a continuation token from a previous iterator.
49
+ * This method is useful if processing an iterator in one execution would exceed
50
+ * the maximum execution time. Continuation tokens are generally valid for one week.
51
+ */
37
52
continueFileIterator ( continuationToken : string ) : FileIterator ;
53
+ /**
54
+ * Resumes a folder iteration using a continuation token from a previous iterator.
55
+ * This method is useful if processing an iterator in one execution would exceed
56
+ * the maximum execution time. Continuation tokens are generally valid for one week.
57
+ */
38
58
continueFolderIterator ( continuationToken : string ) : FolderIterator ;
59
+ /** Creates a file in the root of the user's Drive from a given Blob of arbitrary data. */
39
60
createFile ( blob : Base . BlobSource ) : File ;
61
+ /**
62
+ * Creates a text file in the root of the user's Drive with the given name
63
+ * and contents. Throws an exception if content is larger than 50 MB.
64
+ */
40
65
createFile ( name : string , content : string ) : File ;
66
+ /**
67
+ * Creates a file in the root of the user's Drive with the given name, contents, and MIME type.
68
+ * Throws an exception if content is larger than 10MB.
69
+ */
41
70
createFile ( name : string , content : string , mimeType : string ) : File ;
71
+ /** Creates a folder in the root of the user's Drive with the given name. */
42
72
createFolder ( name : string ) : Folder ;
73
+ /**
74
+ * Gets the file with the given ID.
75
+ * Throws a scripting exception if the file does not exist or
76
+ * the user does not have permission to access it.
77
+ */
43
78
getFileById ( id : string ) : File ;
79
+ /** Gets a collection of all files in the user's Drive. */
44
80
getFiles ( ) : FileIterator ;
81
+ /** Gets a collection of all files in the user's Drive that have the given name. */
45
82
getFilesByName ( name : string ) : FileIterator ;
83
+ /** Gets a collection of all files in the user's Drive that have the given MIME type. */
46
84
getFilesByType ( mimeType : string ) : FileIterator ;
85
+ /**
86
+ * Gets the folder with the given ID. Throws a scripting exception if the folder
87
+ * does not exist or the user does not have permission to access it.
88
+ */
47
89
getFolderById ( id : string ) : Folder ;
90
+ /** Gets a collection of all folders in the user's Drive. */
48
91
getFolders ( ) : FolderIterator ;
92
+ /** Gets a collection of all folders in the user's Drive that have the given name. */
49
93
getFoldersByName ( name : string ) : FolderIterator ;
94
+ /** Gets the folder at the root of the user's Drive. */
50
95
getRootFolder ( ) : Folder ;
96
+ /** Gets the number of bytes the user is allowed to store in Drive. */
51
97
getStorageLimit ( ) : Integer ;
98
+ /** Gets the number of bytes the user is currently storing in Drive. */
52
99
getStorageUsed ( ) : Integer ;
100
+ /** Gets a collection of all the files in the trash of the user's Drive. */
53
101
getTrashedFiles ( ) : FileIterator ;
102
+ /** Gets a collection of all the folders in the trash of the user's Drive. */
54
103
getTrashedFolders ( ) : FolderIterator ;
104
+ /**
105
+ * Removes the given file from the root of the user's Drive.
106
+ * This method does not delete the file, but if a file is removed from all
107
+ * of its parents, it cannot be seen in Drive except by searching for it
108
+ * or using the "All items" view.
109
+ */
55
110
removeFile ( child : File ) : Folder ;
111
+ /**
112
+ * Removes the given folder from the root of the user's Drive.
113
+ * This method does not delete the folder or its contents, but if a folder
114
+ * is removed from all of its parents, it cannot be seen in Drive except
115
+ * by searching for it or using the "All items" view.
116
+ */
56
117
removeFolder ( child : Folder ) : Folder ;
118
+ /**
119
+ * Gets a collection of all files in the user's Drive that match the given search criteria.
120
+ * The search criteria are detailed the Google Drive SDK documentation.
121
+ * Note that the params argument is a query string that may contain string values,
122
+ * so take care to escape quotation marks correctly
123
+ * (for example "title contains 'Gulliver\\'s Travels'" or 'title contains "Gulliver\'s Travels"').
124
+ */
57
125
searchFiles ( params : string ) : FileIterator ;
126
+ /**
127
+ * Gets a collection of all folders in the user's Drive that match the given search criteria.
128
+ * The search criteria are detailed the Google Drive SDK documentation.
129
+ * Note that the params argument is a query string that may contain string values,
130
+ * so take care to escape quotation marks correctly
131
+ * (for example "title contains 'Gulliver\\'s Travels'" or 'title contains "Gulliver\'s Travels"').
132
+ */
58
133
searchFolders ( params : string ) : FolderIterator ;
59
134
}
60
135
@@ -138,8 +213,18 @@ declare namespace GoogleAppsScript {
138
213
* }
139
214
*/
140
215
export interface FileIterator {
216
+ /**
217
+ * Gets a token that can be used to resume this iteration at a later time.
218
+ * This method is useful if processing an iterator in one execution would
219
+ * exceed the maximum execution time. Continuation tokens are generally valid for one week.
220
+ */
141
221
getContinuationToken ( ) : string ;
222
+ /** Determines whether calling next() will return an item. */
142
223
hasNext ( ) : boolean ;
224
+ /**
225
+ * Gets the next item in the collection of files or folders.
226
+ * Throws an exception if no items remain.
227
+ */
143
228
next ( ) : File ;
144
229
}
145
230
@@ -249,13 +334,26 @@ declare namespace GoogleAppsScript {
249
334
* }
250
335
*/
251
336
export interface User {
337
+ /** Gets the domain name associated with the user's account. */
252
338
getDomain ( ) : string ;
339
+ /**
340
+ * Gets the user's email address. The user's email address is only available
341
+ * if the user has chosen to share the address from the Google+ account settings
342
+ * page, or if the user belongs to the same domain as the user running the script
343
+ * and the domain administrator has allowed all users within the domain to see
344
+ * other users' email addresses.
345
+ */
253
346
getEmail ( ) : string ;
347
+ /** Gets the user's name. This method returns null if the user's name is not available. */
254
348
getName ( ) : string ;
349
+ /** Gets the URL for the user's photo. This method returns null if the user's photo is not available. */
255
350
getPhotoUrl ( ) : string ;
351
+ /**
352
+ * Gets the user's email address.
353
+ * @deprecated As of June 24, 2013, replaced by getEmail()
354
+ */
256
355
getUserLoginId ( ) : string ;
257
356
}
258
-
259
357
}
260
358
}
261
359
0 commit comments