/
v3.ts
6974 lines (6722 loc) · 237 KB
/
v3.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2020 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-interface */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable no-irregular-whitespace */
import {
OAuth2Client,
JWT,
Compute,
UserRefreshClient,
BaseExternalAccountClient,
GaxiosPromise,
GoogleConfigurable,
createAPIRequest,
MethodOptions,
StreamMethodOptions,
GlobalOptions,
GoogleAuth,
BodyResponseCallback,
APIRequestContext,
} from 'googleapis-common';
import {Readable} from 'stream';
export namespace drive_v3 {
export interface Options extends GlobalOptions {
version: 'v3';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?:
| string
| OAuth2Client
| JWT
| Compute
| UserRefreshClient
| BaseExternalAccountClient
| GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* Google Drive API
*
* The Google Drive API allows clients to access resources from Google Drive.
*
* @example
* ```js
* const {google} = require('googleapis');
* const drive = google.drive('v3');
* ```
*/
export class Drive {
context: APIRequestContext;
about: Resource$About;
apps: Resource$Apps;
changes: Resource$Changes;
channels: Resource$Channels;
comments: Resource$Comments;
drives: Resource$Drives;
files: Resource$Files;
permissions: Resource$Permissions;
replies: Resource$Replies;
revisions: Resource$Revisions;
teamdrives: Resource$Teamdrives;
constructor(options: GlobalOptions, google?: GoogleConfigurable) {
this.context = {
_options: options || {},
google,
};
this.about = new Resource$About(this.context);
this.apps = new Resource$Apps(this.context);
this.changes = new Resource$Changes(this.context);
this.channels = new Resource$Channels(this.context);
this.comments = new Resource$Comments(this.context);
this.drives = new Resource$Drives(this.context);
this.files = new Resource$Files(this.context);
this.permissions = new Resource$Permissions(this.context);
this.replies = new Resource$Replies(this.context);
this.revisions = new Resource$Revisions(this.context);
this.teamdrives = new Resource$Teamdrives(this.context);
}
}
/**
* Information about the user, the user's Drive, and system capabilities.
*/
export interface Schema$About {
/**
* Whether the user has installed the requesting app.
*/
appInstalled?: boolean | null;
/**
* Whether the user can create shared drives.
*/
canCreateDrives?: boolean | null;
/**
* Deprecated: Use `canCreateDrives` instead.
*/
canCreateTeamDrives?: boolean | null;
/**
* A list of themes that are supported for shared drives.
*/
driveThemes?: Array<{
backgroundImageLink?: string;
colorRgb?: string;
id?: string;
}> | null;
/**
* A map of source MIME type to possible targets for all supported exports.
*/
exportFormats?: {[key: string]: string[]} | null;
/**
* The currently supported folder colors as RGB hex strings.
*/
folderColorPalette?: string[] | null;
/**
* A map of source MIME type to possible targets for all supported imports.
*/
importFormats?: {[key: string]: string[]} | null;
/**
* Identifies what kind of resource this is. Value: the fixed string `"drive#about"`.
*/
kind?: string | null;
/**
* A map of maximum import sizes by MIME type, in bytes.
*/
maxImportSizes?: {[key: string]: string} | null;
/**
* The maximum upload size in bytes.
*/
maxUploadSize?: string | null;
/**
* The user's storage quota limits and usage. All fields are measured in bytes.
*/
storageQuota?: {
limit?: string;
usage?: string;
usageInDrive?: string;
usageInDriveTrash?: string;
} | null;
/**
* Deprecated: Use `driveThemes` instead.
*/
teamDriveThemes?: Array<{
backgroundImageLink?: string;
colorRgb?: string;
id?: string;
}> | null;
/**
* The authenticated user.
*/
user?: Schema$User;
}
/**
* The `apps` resource provides a list of apps that a user has installed, with information about each app's supported MIME types, file extensions, and other details. Some resource methods (such as `apps.get`) require an `appId`. Use the `apps.list` method to retrieve the ID for an installed application.
*/
export interface Schema$App {
/**
* Whether the app is authorized to access data on the user's Drive.
*/
authorized?: boolean | null;
/**
* The template URL to create a file with this app in a given folder. The template contains the {folderId\} to be replaced by the folder ID house the new file.
*/
createInFolderTemplate?: string | null;
/**
* The URL to create a file with this app.
*/
createUrl?: string | null;
/**
* Whether the app has Drive-wide scope. An app with Drive-wide scope can access all files in the user's Drive.
*/
hasDriveWideScope?: boolean | null;
/**
* The various icons for the app.
*/
icons?: Schema$AppIcons[];
/**
* The ID of the app.
*/
id?: string | null;
/**
* Whether the app is installed.
*/
installed?: boolean | null;
/**
* Output only. Identifies what kind of resource this is. Value: the fixed string "drive#app".
*/
kind?: string | null;
/**
* A long description of the app.
*/
longDescription?: string | null;
/**
* The name of the app.
*/
name?: string | null;
/**
* The type of object this app creates such as a Chart. If empty, the app name should be used instead.
*/
objectType?: string | null;
/**
* The template URL for opening files with this app. The template contains {ids\} or {exportIds\} to be replaced by the actual file IDs. For more information, see Open Files for the full documentation.
*/
openUrlTemplate?: string | null;
/**
* The list of primary file extensions.
*/
primaryFileExtensions?: string[] | null;
/**
* The list of primary MIME types.
*/
primaryMimeTypes?: string[] | null;
/**
* The ID of the product listing for this app.
*/
productId?: string | null;
/**
* A link to the product listing for this app.
*/
productUrl?: string | null;
/**
* The list of secondary file extensions.
*/
secondaryFileExtensions?: string[] | null;
/**
* The list of secondary MIME types.
*/
secondaryMimeTypes?: string[] | null;
/**
* A short description of the app.
*/
shortDescription?: string | null;
/**
* Whether this app supports creating objects.
*/
supportsCreate?: boolean | null;
/**
* Whether this app supports importing from Google Docs.
*/
supportsImport?: boolean | null;
/**
* Whether this app supports opening more than one file.
*/
supportsMultiOpen?: boolean | null;
/**
* Whether this app supports creating files when offline.
*/
supportsOfflineCreate?: boolean | null;
/**
* Whether the app is selected as the default handler for the types it supports.
*/
useByDefault?: boolean | null;
}
export interface Schema$AppIcons {
/**
* Category of the icon. Allowed values are: * `application` - The icon for the application. * `document` - The icon for a file associated with the app. * `documentShared` - The icon for a shared file associated with the app.
*/
category?: string | null;
/**
* URL for the icon.
*/
iconUrl?: string | null;
/**
* Size of the icon. Represented as the maximum of the width and height.
*/
size?: number | null;
}
/**
* A list of third-party applications which the user has installed or given access to Google Drive.
*/
export interface Schema$AppList {
/**
* The list of app IDs that the user has specified to use by default. The list is in reverse-priority order (lowest to highest).
*/
defaultAppIds?: string[] | null;
/**
* The list of apps.
*/
items?: Schema$App[];
/**
* Output only. Identifies what kind of resource this is. Value: the fixed string "drive#appList".
*/
kind?: string | null;
/**
* A link back to this list.
*/
selfLink?: string | null;
}
/**
* A change to a file or shared drive.
*/
export interface Schema$Change {
/**
* The type of the change. Possible values are `file` and `drive`.
*/
changeType?: string | null;
/**
* The updated state of the shared drive. Present if the changeType is drive, the user is still a member of the shared drive, and the shared drive has not been deleted.
*/
drive?: Schema$Drive;
/**
* The ID of the shared drive associated with this change.
*/
driveId?: string | null;
/**
* The updated state of the file. Present if the type is file and the file has not been removed from this list of changes.
*/
file?: Schema$File;
/**
* The ID of the file which has changed.
*/
fileId?: string | null;
/**
* Identifies what kind of resource this is. Value: the fixed string `"drive#change"`.
*/
kind?: string | null;
/**
* Whether the file or shared drive has been removed from this list of changes, for example by deletion or loss of access.
*/
removed?: boolean | null;
/**
* Deprecated: Use `drive` instead.
*/
teamDrive?: Schema$TeamDrive;
/**
* Deprecated: Use `driveId` instead.
*/
teamDriveId?: string | null;
/**
* The time of this change (RFC 3339 date-time).
*/
time?: string | null;
/**
* Deprecated: Use `changeType` instead.
*/
type?: string | null;
}
/**
* A list of changes for a user.
*/
export interface Schema$ChangeList {
/**
* The list of changes. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
changes?: Schema$Change[];
/**
* Identifies what kind of resource this is. Value: the fixed string `"drive#changeList"`.
*/
kind?: string | null;
/**
* The starting page token for future changes. This will be present only if the end of the current changes list has been reached. The page token doesn't expire.
*/
newStartPageToken?: string | null;
/**
* The page token for the next page of changes. This will be absent if the end of the changes list has been reached. The page token doesn't expire.
*/
nextPageToken?: string | null;
}
/**
* A notification channel used to watch for resource changes.
*/
export interface Schema$Channel {
/**
* The address where notifications are delivered for this channel.
*/
address?: string | null;
/**
* Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
*/
expiration?: string | null;
/**
* A UUID or similar unique string that identifies this channel.
*/
id?: string | null;
/**
* Identifies this as a notification channel used to watch for changes to a resource, which is `api#channel`.
*/
kind?: string | null;
/**
* Additional parameters controlling delivery channel behavior. Optional.
*/
params?: {[key: string]: string} | null;
/**
* A Boolean value to indicate whether payload is wanted. Optional.
*/
payload?: boolean | null;
/**
* An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
*/
resourceId?: string | null;
/**
* A version-specific identifier for the watched resource.
*/
resourceUri?: string | null;
/**
* An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
*/
token?: string | null;
/**
* The type of delivery mechanism used for this channel. Valid values are "web_hook" or "webhook".
*/
type?: string | null;
}
/**
* A comment on a file. Some resource methods (such as `comments.update`) require a `commentId`. Use the `comments.list` method to retrieve the ID for a comment in a file.
*/
export interface Schema$Comment {
/**
* A region of the document represented as a JSON string. For details on defining anchor properties, refer to [Manage comments and replies](https://developers.google.com/drive/api/v3/manage-comments).
*/
anchor?: string | null;
/**
* Output only. The author of the comment. The author's email address and permission ID will not be populated.
*/
author?: Schema$User;
/**
* The plain text content of the comment. This field is used for setting the content, while `htmlContent` should be displayed.
*/
content?: string | null;
/**
* The time at which the comment was created (RFC 3339 date-time).
*/
createdTime?: string | null;
/**
* Output only. Whether the comment has been deleted. A deleted comment has no content.
*/
deleted?: boolean | null;
/**
* Output only. The content of the comment with HTML formatting.
*/
htmlContent?: string | null;
/**
* Output only. The ID of the comment.
*/
id?: string | null;
/**
* Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#comment"`.
*/
kind?: string | null;
/**
* The last time the comment or any of its replies was modified (RFC 3339 date-time).
*/
modifiedTime?: string | null;
/**
* The file content to which the comment refers, typically within the anchor region. For a text file, for example, this would be the text at the location of the comment.
*/
quotedFileContent?: {mimeType?: string; value?: string} | null;
/**
* Output only. The full list of replies to the comment in chronological order.
*/
replies?: Schema$Reply[];
/**
* Output only. Whether the comment has been resolved by one of its replies.
*/
resolved?: boolean | null;
}
/**
* A list of comments on a file.
*/
export interface Schema$CommentList {
/**
* The list of comments. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
comments?: Schema$Comment[];
/**
* Identifies what kind of resource this is. Value: the fixed string `"drive#commentList"`.
*/
kind?: string | null;
/**
* The page token for the next page of comments. This will be absent if the end of the comments list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. The page token is typically valid for several hours. However, if new items are added or removed, your expected results might differ.
*/
nextPageToken?: string | null;
}
/**
* A restriction for accessing the content of the file.
*/
export interface Schema$ContentRestriction {
/**
* Whether the content restriction can only be modified or removed by a user who owns the file. For files in shared drives, any user with `organizer` capabilities can modify or remove this content restriction.
*/
ownerRestricted?: boolean | null;
/**
* Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified.
*/
readOnly?: boolean | null;
/**
* Reason for why the content of the file is restricted. This is only mutable on requests that also set `readOnly=true`.
*/
reason?: string | null;
/**
* Output only. The user who set the content restriction. Only populated if `readOnly` is true.
*/
restrictingUser?: Schema$User;
/**
* The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true.
*/
restrictionTime?: string | null;
/**
* Output only. Whether the content restriction was applied by the system, for example due to an esignature. Users cannot modify or remove system restricted content restrictions.
*/
systemRestricted?: boolean | null;
/**
* Output only. The type of the content restriction. Currently the only possible value is `globalContentRestriction`.
*/
type?: string | null;
}
/**
* Representation of a shared drive. Some resource methods (such as `drives.update`) require a `driveId`. Use the `drives.list` method to retrieve the ID for a shared drive.
*/
export interface Schema$Drive {
/**
* An image file and cropping parameters from which a background image for this shared drive is set. This is a write only field; it can only be set on `drive.drives.update` requests that don't set `themeId`. When specified, all fields of the `backgroundImageFile` must be set.
*/
backgroundImageFile?: {
id?: string;
width?: number;
xCoordinate?: number;
yCoordinate?: number;
} | null;
/**
* Output only. A short-lived link to this shared drive's background image.
*/
backgroundImageLink?: string | null;
/**
* Output only. Capabilities the current user has on this shared drive.
*/
capabilities?: {
canAddChildren?: boolean;
canChangeCopyRequiresWriterPermissionRestriction?: boolean;
canChangeDomainUsersOnlyRestriction?: boolean;
canChangeDriveBackground?: boolean;
canChangeDriveMembersOnlyRestriction?: boolean;
canChangeSharingFoldersRequiresOrganizerPermissionRestriction?: boolean;
canComment?: boolean;
canCopy?: boolean;
canDeleteChildren?: boolean;
canDeleteDrive?: boolean;
canDownload?: boolean;
canEdit?: boolean;
canListChildren?: boolean;
canManageMembers?: boolean;
canReadRevisions?: boolean;
canRename?: boolean;
canRenameDrive?: boolean;
canResetDriveRestrictions?: boolean;
canShare?: boolean;
canTrashChildren?: boolean;
} | null;
/**
* The color of this shared drive as an RGB hex string. It can only be set on a `drive.drives.update` request that does not set `themeId`.
*/
colorRgb?: string | null;
/**
* The time at which the shared drive was created (RFC 3339 date-time).
*/
createdTime?: string | null;
/**
* Whether the shared drive is hidden from default view.
*/
hidden?: boolean | null;
/**
* Output only. The ID of this shared drive which is also the ID of the top level folder of this shared drive.
*/
id?: string | null;
/**
* Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#drive"`.
*/
kind?: string | null;
/**
* The name of this shared drive.
*/
name?: string | null;
/**
* Output only. The organizational unit of this shared drive. This field is only populated on `drives.list` responses when the `useDomainAdminAccess` parameter is set to `true`.
*/
orgUnitId?: string | null;
/**
* A set of restrictions that apply to this shared drive or items inside this shared drive. Note that restrictions can't be set when creating a shared drive. To add a restriction, first create a shared drive and then use `drives.update` to add restrictions.
*/
restrictions?: {
adminManagedRestrictions?: boolean;
copyRequiresWriterPermission?: boolean;
domainUsersOnly?: boolean;
driveMembersOnly?: boolean;
sharingFoldersRequiresOrganizerPermission?: boolean;
} | null;
/**
* The ID of the theme from which the background image and color will be set. The set of possible `driveThemes` can be retrieved from a `drive.about.get` response. When not specified on a `drive.drives.create` request, a random theme is chosen from which the background image and color are set. This is a write-only field; it can only be set on requests that don't set `colorRgb` or `backgroundImageFile`.
*/
themeId?: string | null;
}
/**
* A list of shared drives.
*/
export interface Schema$DriveList {
/**
* The list of shared drives. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
*/
drives?: Schema$Drive[];
/**
* Identifies what kind of resource this is. Value: the fixed string `"drive#driveList"`.
*/
kind?: string | null;
/**
* The page token for the next page of shared drives. This will be absent if the end of the list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. The page token is typically valid for several hours. However, if new items are added or removed, your expected results might differ.
*/
nextPageToken?: string | null;
}
/**
* The metadata for a file. Some resource methods (such as `files.update`) require a `fileId`. Use the `files.list` method to retrieve the ID for a file.
*/
export interface Schema$File {
/**
* A collection of arbitrary key-value pairs which are private to the requesting app.
* Entries with null values are cleared in update and copy requests. These properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties.
*/
appProperties?: {[key: string]: string} | null;
/**
* Output only. Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
*/
capabilities?: {
canAcceptOwnership?: boolean;
canAddChildren?: boolean;
canAddFolderFromAnotherDrive?: boolean;
canAddMyDriveParent?: boolean;
canChangeCopyRequiresWriterPermission?: boolean;
canChangeSecurityUpdateEnabled?: boolean;
canChangeViewersCanCopyContent?: boolean;
canComment?: boolean;
canCopy?: boolean;
canDelete?: boolean;
canDeleteChildren?: boolean;
canDownload?: boolean;
canEdit?: boolean;
canListChildren?: boolean;
canModifyContent?: boolean;
canModifyContentRestriction?: boolean;
canModifyEditorContentRestriction?: boolean;
canModifyLabels?: boolean;
canModifyOwnerContentRestriction?: boolean;
canMoveChildrenOutOfDrive?: boolean;
canMoveChildrenOutOfTeamDrive?: boolean;
canMoveChildrenWithinDrive?: boolean;
canMoveChildrenWithinTeamDrive?: boolean;
canMoveItemIntoTeamDrive?: boolean;
canMoveItemOutOfDrive?: boolean;
canMoveItemOutOfTeamDrive?: boolean;
canMoveItemWithinDrive?: boolean;
canMoveItemWithinTeamDrive?: boolean;
canMoveTeamDriveItem?: boolean;
canReadDrive?: boolean;
canReadLabels?: boolean;
canReadRevisions?: boolean;
canReadTeamDrive?: boolean;
canRemoveChildren?: boolean;
canRemoveContentRestriction?: boolean;
canRemoveMyDriveParent?: boolean;
canRename?: boolean;
canShare?: boolean;
canTrash?: boolean;
canTrashChildren?: boolean;
canUntrash?: boolean;
} | null;
/**
* Additional information about the content of the file. These fields are never populated in responses.
*/
contentHints?: {
indexableText?: string;
thumbnail?: {image?: string; mimeType?: string};
} | null;
/**
* Restrictions for accessing the content of the file. Only populated if such a restriction exists.
*/
contentRestrictions?: Schema$ContentRestriction[];
/**
* Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
*/
copyRequiresWriterPermission?: boolean | null;
/**
* The time at which the file was created (RFC 3339 date-time).
*/
createdTime?: string | null;
/**
* A short description of the file.
*/
description?: string | null;
/**
* Output only. ID of the shared drive the file resides in. Only populated for items in shared drives.
*/
driveId?: string | null;
/**
* Output only. Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
*/
explicitlyTrashed?: boolean | null;
/**
* Output only. Links for exporting Docs Editors files to specific formats.
*/
exportLinks?: {[key: string]: string} | null;
/**
* Output only. The final component of `fullFileExtension`. This is only available for files with binary content in Google Drive.
*/
fileExtension?: string | null;
/**
* The color for a folder or a shortcut to a folder as an RGB hex string. The supported colors are published in the `folderColorPalette` field of the About resource. If an unsupported color is specified, the closest color in the palette is used instead.
*/
folderColorRgb?: string | null;
/**
* Output only. The full file extension extracted from the `name` field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. This is automatically updated when the `name` field changes, however it is not cleared if the new name does not contain a valid extension.
*/
fullFileExtension?: string | null;
/**
* Output only. Whether there are permissions directly on this file. This field is only populated for items in shared drives.
*/
hasAugmentedPermissions?: boolean | null;
/**
* Output only. Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field.
*/
hasThumbnail?: boolean | null;
/**
* Output only. The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
*/
headRevisionId?: string | null;
/**
* Output only. A static, unauthenticated link to the file's icon.
*/
iconLink?: string | null;
/**
* The ID of the file.
*/
id?: string | null;
/**
* Output only. Additional metadata about image media, if available.
*/
imageMediaMetadata?: {
aperture?: number;
cameraMake?: string;
cameraModel?: string;
colorSpace?: string;
exposureBias?: number;
exposureMode?: string;
exposureTime?: number;
flashUsed?: boolean;
focalLength?: number;
height?: number;
isoSpeed?: number;
lens?: string;
location?: {altitude?: number; latitude?: number; longitude?: number};
maxApertureValue?: number;
meteringMode?: string;
rotation?: number;
sensor?: string;
subjectDistance?: number;
time?: string;
whiteBalance?: string;
width?: number;
} | null;
/**
* Output only. Whether the file was created or opened by the requesting app.
*/
isAppAuthorized?: boolean | null;
/**
* Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#file"`.
*/
kind?: string | null;
/**
* Output only. An overview of the labels on the file.
*/
labelInfo?: {labels?: Schema$Label[]} | null;
/**
* Output only. The last user to modify the file.
*/
lastModifyingUser?: Schema$User;
/**
* Contains details about the link URLs that clients are using to refer to this item.
*/
linkShareMetadata?: {
securityUpdateEligible?: boolean;
securityUpdateEnabled?: boolean;
} | null;
/**
* Output only. The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
*/
md5Checksum?: string | null;
/**
* The MIME type of the file. Google Drive attempts to automatically detect an appropriate value from uploaded content, if no value is provided. The value cannot be changed unless a new revision is uploaded. If a file is created with a Google Doc MIME type, the uploaded content is imported, if possible. The supported import formats are published in the About resource.
*/
mimeType?: string | null;
/**
* Output only. Whether the file has been modified by this user.
*/
modifiedByMe?: boolean | null;
/**
* The last time the file was modified by the user (RFC 3339 date-time).
*/
modifiedByMeTime?: string | null;
/**
* he last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user.
*/
modifiedTime?: string | null;
/**
* The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant.
*/
name?: string | null;
/**
* The original filename of the uploaded content if available, or else the original value of the `name` field. This is only available for files with binary content in Google Drive.
*/
originalFilename?: string | null;
/**
* Output only. Whether the user owns the file. Not populated for items in shared drives.
*/
ownedByMe?: boolean | null;
/**
* Output only. The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives.
*/
owners?: Schema$User[];
/**
* The IDs of the parent folders which contain the file. If not specified as part of a create request, the file is placed directly in the user's My Drive folder. If not specified as part of a copy request, the file inherits any discoverable parents of the source file. Update requests must use the `addParents` and `removeParents` parameters to modify the parents list.
*/
parents?: string[] | null;
/**
* Output only. List of permission IDs for users with access to this file.
*/
permissionIds?: string[] | null;
/**
* Output only. The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives.
*/
permissions?: Schema$Permission[];
/**
* A collection of arbitrary key-value pairs which are visible to all apps.
* Entries with null values are cleared in update and copy requests.
*/
properties?: {[key: string]: string} | null;
/**
* Output only. The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with `keepForever` enabled.
*/
quotaBytesUsed?: string | null;
/**
* Output only. A key needed to access the item via a shared link.
*/
resourceKey?: string | null;
/**
* Output only. The SHA1 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
*/
sha1Checksum?: string | null;
/**
* Output only. The SHA256 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
*/
sha256Checksum?: string | null;
/**
* Output only. Whether the file has been shared. Not populated for items in shared drives.
*/
shared?: boolean | null;
/**
* The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
*/
sharedWithMeTime?: string | null;
/**
* Output only. The user who shared the file with the requesting user, if applicable.
*/
sharingUser?: Schema$User;
/**
* Shortcut file details. Only populated for shortcut files, which have the mimeType field set to `application/vnd.google-apps.shortcut`.
*/
shortcutDetails?: {
targetId?: string;
targetMimeType?: string;
targetResourceKey?: string;
} | null;
/**
* Output only. Size in bytes of blobs and first party editor files. Won't be populated for files that have no size, like shortcuts and folders.
*/
size?: string | null;
/**
* Output only. The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
*/
spaces?: string[] | null;
/**
* Whether the user has starred the file.
*/
starred?: boolean | null;
/**
* Deprecated: Output only. Use `driveId` instead.
*/
teamDriveId?: string | null;
/**
* Output only. A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. If the file isn't shared publicly, the URL returned in `Files.thumbnailLink` must be fetched using a credentialed request.
*/
thumbnailLink?: string | null;
/**
* Output only. The thumbnail version for use in thumbnail cache invalidation.
*/
thumbnailVersion?: string | null;
/**
* Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
*/
trashed?: boolean | null;
/**
* The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
*/
trashedTime?: string | null;
/**
* Output only. If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives.
*/
trashingUser?: Schema$User;
/**
* Output only. A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the user.
*/
version?: string | null;
/**
* Output only. Additional metadata about video media. This may not be available immediately upon upload.
*/
videoMediaMetadata?: {
durationMillis?: string;
height?: number;
width?: number;
} | null;
/**
* Output only. Whether the file has been viewed by this user.
*/
viewedByMe?: boolean | null;
/**
* The last time the file was viewed by the user (RFC 3339 date-time).
*/
viewedByMeTime?: string | null;
/**
* Deprecated: Use `copyRequiresWriterPermission` instead.
*/
viewersCanCopyContent?: boolean | null;
/**
* Output only. A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.
*/
webContentLink?: string | null;
/**
* Output only. A link for opening the file in a relevant Google editor or viewer in a browser.
*/
webViewLink?: string | null;