forked from googleapis/google-api-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
drive-gen.go
6433 lines (5804 loc) · 208 KB
/
drive-gen.go
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
// Package drive provides access to the Drive API.
//
// See https://developers.google.com/drive/
//
// Usage example:
//
// import "google.golang.org/api/drive/v3"
// ...
// driveService, err := drive.New(oauthHttpClient)
package drive // import "google.golang.org/api/drive/v3"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
context "golang.org/x/net/context"
ctxhttp "golang.org/x/net/context/ctxhttp"
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "drive:v3"
const apiName = "drive"
const apiVersion = "v3"
const basePath = "https://www.googleapis.com/drive/v3/"
// OAuth2 scopes used by this API.
const (
// View and manage the files in your Google Drive
DriveScope = "https://www.googleapis.com/auth/drive"
// View and manage its own configuration data in your Google Drive
DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata"
// View and manage Google Drive files and folders that you have opened
// or created with this app
DriveFileScope = "https://www.googleapis.com/auth/drive.file"
// View and manage metadata of files in your Google Drive
DriveMetadataScope = "https://www.googleapis.com/auth/drive.metadata"
// View metadata for files in your Google Drive
DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly"
// View the photos, videos and albums in your Google Photos
DrivePhotosReadonlyScope = "https://www.googleapis.com/auth/drive.photos.readonly"
// View the files in your Google Drive
DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly"
// Modify your Google Apps Script scripts' behavior
DriveScriptsScope = "https://www.googleapis.com/auth/drive.scripts"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.About = NewAboutService(s)
s.Changes = NewChangesService(s)
s.Channels = NewChannelsService(s)
s.Comments = NewCommentsService(s)
s.Files = NewFilesService(s)
s.Permissions = NewPermissionsService(s)
s.Replies = NewRepliesService(s)
s.Revisions = NewRevisionsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
About *AboutService
Changes *ChangesService
Channels *ChannelsService
Comments *CommentsService
Files *FilesService
Permissions *PermissionsService
Replies *RepliesService
Revisions *RevisionsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewAboutService(s *Service) *AboutService {
rs := &AboutService{s: s}
return rs
}
type AboutService struct {
s *Service
}
func NewChangesService(s *Service) *ChangesService {
rs := &ChangesService{s: s}
return rs
}
type ChangesService struct {
s *Service
}
func NewChannelsService(s *Service) *ChannelsService {
rs := &ChannelsService{s: s}
return rs
}
type ChannelsService struct {
s *Service
}
func NewCommentsService(s *Service) *CommentsService {
rs := &CommentsService{s: s}
return rs
}
type CommentsService struct {
s *Service
}
func NewFilesService(s *Service) *FilesService {
rs := &FilesService{s: s}
return rs
}
type FilesService struct {
s *Service
}
func NewPermissionsService(s *Service) *PermissionsService {
rs := &PermissionsService{s: s}
return rs
}
type PermissionsService struct {
s *Service
}
func NewRepliesService(s *Service) *RepliesService {
rs := &RepliesService{s: s}
return rs
}
type RepliesService struct {
s *Service
}
func NewRevisionsService(s *Service) *RevisionsService {
rs := &RevisionsService{s: s}
return rs
}
type RevisionsService struct {
s *Service
}
// About: Information about the user, the user's Drive, and system
// capabilities.
type About struct {
// AppInstalled: Whether the user has installed the requesting app.
AppInstalled bool `json:"appInstalled,omitempty"`
// ExportFormats: A map of source MIME type to possible targets for all
// supported exports.
ExportFormats map[string][]string `json:"exportFormats,omitempty"`
// FolderColorPalette: The currently supported folder colors as RGB hex
// strings.
FolderColorPalette []string `json:"folderColorPalette,omitempty"`
// ImportFormats: A map of source MIME type to possible targets for all
// supported imports.
ImportFormats map[string][]string `json:"importFormats,omitempty"`
// Kind: This is always drive#about.
Kind string `json:"kind,omitempty"`
// MaxImportSizes: A map of maximum import sizes by MIME type, in bytes.
MaxImportSizes map[string]int64 `json:"maxImportSizes,omitempty"`
// MaxUploadSize: The maximum upload size in bytes.
MaxUploadSize int64 `json:"maxUploadSize,omitempty,string"`
// StorageQuota: The user's storage quota limits and usage. All fields
// are measured in bytes.
StorageQuota *AboutStorageQuota `json:"storageQuota,omitempty"`
// User: The authenticated user.
User *User `json:"user,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AppInstalled") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *About) MarshalJSON() ([]byte, error) {
type noMethod About
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// AboutStorageQuota: The user's storage quota limits and usage. All
// fields are measured in bytes.
type AboutStorageQuota struct {
// Limit: The usage limit, if applicable. This will not be present if
// the user has unlimited storage.
Limit int64 `json:"limit,omitempty,string"`
// Usage: The total usage across all services.
Usage int64 `json:"usage,omitempty,string"`
// UsageInDrive: The usage by all files in Google Drive.
UsageInDrive int64 `json:"usageInDrive,omitempty,string"`
// UsageInDriveTrash: The usage by trashed files in Google Drive.
UsageInDriveTrash int64 `json:"usageInDriveTrash,omitempty,string"`
// ForceSendFields is a list of field names (e.g. "Limit") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *AboutStorageQuota) MarshalJSON() ([]byte, error) {
type noMethod AboutStorageQuota
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// Change: A change to a file.
type Change struct {
// File: The updated state of the file. Present if the file has not been
// removed.
File *File `json:"file,omitempty"`
// FileId: The ID of the file which has changed.
FileId string `json:"fileId,omitempty"`
// Kind: This is always drive#change.
Kind string `json:"kind,omitempty"`
// Removed: Whether the file has been removed from the view of the
// changes list, for example by deletion or lost access.
Removed bool `json:"removed,omitempty"`
// Time: The time of this change (RFC 3339 date-time).
Time string `json:"time,omitempty"`
// ForceSendFields is a list of field names (e.g. "File") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Change) MarshalJSON() ([]byte, error) {
type noMethod Change
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// ChangeList: A list of changes for a user.
type ChangeList struct {
// Changes: The page of changes.
Changes []*Change `json:"changes,omitempty"`
// Kind: This is always drive#changeList.
Kind string `json:"kind,omitempty"`
// NewStartPageToken: The starting page token for future changes. This
// will be present only if the end of the current changes list has been
// reached.
NewStartPageToken string `json:"newStartPageToken,omitempty"`
// NextPageToken: The page token for the next page of changes. This will
// be absent if the end of the current changes list has been reached.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Changes") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *ChangeList) MarshalJSON() ([]byte, error) {
type noMethod ChangeList
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// Channel: An notification channel used to watch for resource changes.
type Channel struct {
// Address: The address where notifications are delivered for this
// channel.
Address string `json:"address,omitempty"`
// Expiration: Date and time of notification channel expiration,
// expressed as a Unix timestamp, in milliseconds. Optional.
Expiration int64 `json:"expiration,omitempty,string"`
// Id: A UUID or similar unique string that identifies this channel.
Id string `json:"id,omitempty"`
// Kind: Identifies this as a notification channel used to watch for
// changes to a resource. Value: the fixed string "api#channel".
Kind string `json:"kind,omitempty"`
// Params: Additional parameters controlling delivery channel behavior.
// Optional.
Params map[string]string `json:"params,omitempty"`
// Payload: A Boolean value to indicate whether payload is wanted.
// Optional.
Payload bool `json:"payload,omitempty"`
// ResourceId: An opaque ID that identifies the resource being watched
// on this channel. Stable across different API versions.
ResourceId string `json:"resourceId,omitempty"`
// ResourceUri: A version-specific identifier for the watched resource.
ResourceUri string `json:"resourceUri,omitempty"`
// Token: An arbitrary string delivered to the target address with each
// notification delivered over this channel. Optional.
Token string `json:"token,omitempty"`
// Type: The type of delivery mechanism used for this channel.
Type string `json:"type,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Address") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Channel) MarshalJSON() ([]byte, error) {
type noMethod Channel
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// Comment: A comment on a file.
type Comment struct {
// Anchor: A region of the document represented as a JSON string. See
// anchor documentation for details on how to define and interpret
// anchor properties.
Anchor string `json:"anchor,omitempty"`
// Author: The user who created the comment.
Author *User `json:"author,omitempty"`
// Content: The plain text content of the comment. This field is used
// for setting the content, while htmlContent should be displayed.
Content string `json:"content,omitempty"`
// CreatedTime: The time at which the comment was created (RFC 3339
// date-time).
CreatedTime string `json:"createdTime,omitempty"`
// Deleted: Whether the comment has been deleted. A deleted comment has
// no content.
Deleted bool `json:"deleted,omitempty"`
// HtmlContent: The content of the comment with HTML formatting.
HtmlContent string `json:"htmlContent,omitempty"`
// Id: The ID of the comment.
Id string `json:"id,omitempty"`
// Kind: This is always drive#comment.
Kind string `json:"kind,omitempty"`
// ModifiedTime: The last time the comment or any of its replies was
// modified (RFC 3339 date-time).
ModifiedTime string `json:"modifiedTime,omitempty"`
// QuotedFileContent: 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 *CommentQuotedFileContent `json:"quotedFileContent,omitempty"`
// Replies: The full list of replies to the comment in chronological
// order.
Replies []*Reply `json:"replies,omitempty"`
// Resolved: Whether the comment has been resolved by one of its
// replies.
Resolved bool `json:"resolved,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Anchor") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *Comment) MarshalJSON() ([]byte, error) {
type noMethod Comment
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// CommentQuotedFileContent: 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.
type CommentQuotedFileContent struct {
// MimeType: The MIME type of the quoted content.
MimeType string `json:"mimeType,omitempty"`
// Value: The quoted content itself. This is interpreted as plain text
// if set through the API.
Value string `json:"value,omitempty"`
// ForceSendFields is a list of field names (e.g. "MimeType") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *CommentQuotedFileContent) MarshalJSON() ([]byte, error) {
type noMethod CommentQuotedFileContent
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// CommentList: A list of comments on a file.
type CommentList struct {
// Comments: The page of comments.
Comments []*Comment `json:"comments,omitempty"`
// Kind: This is always drive#commentList.
Kind string `json:"kind,omitempty"`
// NextPageToken: The page token for the next page of comments. This
// will be absent if the end of the comments list has been reached.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Comments") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *CommentList) MarshalJSON() ([]byte, error) {
type noMethod CommentList
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// File: The metadata for a file.
type File struct {
// AppProperties: 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.
AppProperties map[string]string `json:"appProperties,omitempty"`
// Capabilities: Capabilities the current user has on the file.
Capabilities *FileCapabilities `json:"capabilities,omitempty"`
// ContentHints: Additional information about the content of the file.
// These fields are never populated in responses.
ContentHints *FileContentHints `json:"contentHints,omitempty"`
// CreatedTime: The time at which the file was created (RFC 3339
// date-time).
CreatedTime string `json:"createdTime,omitempty"`
// Description: A short description of the file.
Description string `json:"description,omitempty"`
// ExplicitlyTrashed: Whether the file has been explicitly trashed, as
// opposed to recursively trashed from a parent folder.
ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"`
// FileExtension: The final component of fullFileExtension. This is only
// available for files with binary content in Drive.
FileExtension string `json:"fileExtension,omitempty"`
// FolderColorRgb: The color for 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 will be used instead.
FolderColorRgb string `json:"folderColorRgb,omitempty"`
// FullFileExtension: 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
// 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 `json:"fullFileExtension,omitempty"`
// HeadRevisionId: The ID of the file's head revision. This is currently
// only available for files with binary content in Drive.
HeadRevisionId string `json:"headRevisionId,omitempty"`
// IconLink: A static, unauthenticated link to the file's icon.
IconLink string `json:"iconLink,omitempty"`
// Id: The ID of the file.
Id string `json:"id,omitempty"`
// ImageMediaMetadata: Additional metadata about image media, if
// available.
ImageMediaMetadata *FileImageMediaMetadata `json:"imageMediaMetadata,omitempty"`
// IsAppAuthorized: Whether the file was created or opened by the
// requesting app.
IsAppAuthorized bool `json:"isAppAuthorized,omitempty"`
// Kind: This is always drive#file.
Kind string `json:"kind,omitempty"`
// LastModifyingUser: The last user to modify the file.
LastModifyingUser *User `json:"lastModifyingUser,omitempty"`
// Md5Checksum: The MD5 checksum for the content of the file. This is
// only applicable to files with binary content in Drive.
Md5Checksum string `json:"md5Checksum,omitempty"`
// MimeType: The MIME type of the file.
// Drive will attempt 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 will be imported if possible. The supported import formats
// are published in the About resource.
MimeType string `json:"mimeType,omitempty"`
// ModifiedByMeTime: The last time the file was modified by the user
// (RFC 3339 date-time).
ModifiedByMeTime string `json:"modifiedByMeTime,omitempty"`
// ModifiedTime: The 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 `json:"modifiedTime,omitempty"`
// Name: The name of the file. This is not necessarily unique within a
// folder.
Name string `json:"name,omitempty"`
// OriginalFilename: 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 Drive.
OriginalFilename string `json:"originalFilename,omitempty"`
// OwnedByMe: Whether the user owns the file.
OwnedByMe bool `json:"ownedByMe,omitempty"`
// Owners: The owners of the file. Currently, only certain legacy files
// may have more than one owner.
Owners []*User `json:"owners,omitempty"`
// Parents: The IDs of the parent folders which contain the file.
// If not specified as part of a create request, the file will be placed
// directly in the My Drive folder. Update requests must use the
// addParents and removeParents parameters to modify the values.
Parents []string `json:"parents,omitempty"`
// Permissions: The full list of permissions for the file. This is only
// available if the requesting user can share the file.
Permissions []*Permission `json:"permissions,omitempty"`
// Properties: 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 map[string]string `json:"properties,omitempty"`
// QuotaBytesUsed: The number of storage quota bytes used by the file.
// This includes the head revision as well as previous revisions with
// keepForever enabled.
QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"`
// Shared: Whether the file has been shared.
Shared bool `json:"shared,omitempty"`
// SharedWithMeTime: The time at which the file was shared with the
// user, if applicable (RFC 3339 date-time).
SharedWithMeTime string `json:"sharedWithMeTime,omitempty"`
// SharingUser: The user who shared the file with the requesting user,
// if applicable.
SharingUser *User `json:"sharingUser,omitempty"`
// Size: The size of the file's content in bytes. This is only
// applicable to files with binary content in Drive.
Size int64 `json:"size,omitempty,string"`
// Spaces: The list of spaces which contain the file. The currently
// supported values are 'drive', 'appDataFolder' and 'photos'.
Spaces []string `json:"spaces,omitempty"`
// Starred: Whether the user has starred the file.
Starred bool `json:"starred,omitempty"`
// ThumbnailLink: A short-lived link to the file's thumbnail, if
// available. Typically lasts on the order of hours.
ThumbnailLink string `json:"thumbnailLink,omitempty"`
// Trashed: 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 bool `json:"trashed,omitempty"`
// Version: 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 int64 `json:"version,omitempty,string"`
// VideoMediaMetadata: Additional metadata about video media. This may
// not be available immediately upon upload.
VideoMediaMetadata *FileVideoMediaMetadata `json:"videoMediaMetadata,omitempty"`
// ViewedByMe: Whether the file has been viewed by this user.
ViewedByMe bool `json:"viewedByMe,omitempty"`
// ViewedByMeTime: The last time the file was viewed by the user (RFC
// 3339 date-time).
ViewedByMeTime string `json:"viewedByMeTime,omitempty"`
// ViewersCanCopyContent: Whether users with only reader or commenter
// permission can copy the file's content. This affects copy, download,
// and print operations.
ViewersCanCopyContent bool `json:"viewersCanCopyContent,omitempty"`
// WebContentLink: A link for downloading the content of the file in a
// browser. This is only available for files with binary content in
// Drive.
WebContentLink string `json:"webContentLink,omitempty"`
// WebViewLink: A link for opening the file in a relevant Google editor
// or viewer in a browser.
WebViewLink string `json:"webViewLink,omitempty"`
// WritersCanShare: Whether users with only writer permission can modify
// the file's permissions.
WritersCanShare bool `json:"writersCanShare,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AppProperties") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *File) MarshalJSON() ([]byte, error) {
type noMethod File
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// FileCapabilities: Capabilities the current user has on the file.
type FileCapabilities struct {
// CanComment: Whether the user can comment on the file.
CanComment bool `json:"canComment,omitempty"`
// CanCopy: Whether the user can copy the file.
CanCopy bool `json:"canCopy,omitempty"`
// CanEdit: Whether the user can edit the file's content.
CanEdit bool `json:"canEdit,omitempty"`
// CanReadRevisions: Whether the current user has read access to the
// Revisions resource of the file.
CanReadRevisions bool `json:"canReadRevisions,omitempty"`
// CanShare: Whether the user can modify the file's permissions and
// sharing settings.
CanShare bool `json:"canShare,omitempty"`
// ForceSendFields is a list of field names (e.g. "CanComment") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *FileCapabilities) MarshalJSON() ([]byte, error) {
type noMethod FileCapabilities
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// FileContentHints: Additional information about the content of the
// file. These fields are never populated in responses.
type FileContentHints struct {
// IndexableText: Text to be indexed for the file to improve fullText
// queries. This is limited to 128KB in length and may contain HTML
// elements.
IndexableText string `json:"indexableText,omitempty"`
// Thumbnail: A thumbnail for the file. This will only be used if Drive
// cannot generate a standard thumbnail.
Thumbnail *FileContentHintsThumbnail `json:"thumbnail,omitempty"`
// ForceSendFields is a list of field names (e.g. "IndexableText") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *FileContentHints) MarshalJSON() ([]byte, error) {
type noMethod FileContentHints
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// FileContentHintsThumbnail: A thumbnail for the file. This will only
// be used if Drive cannot generate a standard thumbnail.
type FileContentHintsThumbnail struct {
// Image: The thumbnail data encoded with URL-safe Base64 (RFC 4648
// section 5).
Image string `json:"image,omitempty"`
// MimeType: The MIME type of the thumbnail.
MimeType string `json:"mimeType,omitempty"`
// ForceSendFields is a list of field names (e.g. "Image") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *FileContentHintsThumbnail) MarshalJSON() ([]byte, error) {
type noMethod FileContentHintsThumbnail
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// FileImageMediaMetadata: Additional metadata about image media, if
// available.
type FileImageMediaMetadata struct {
// Aperture: The aperture used to create the photo (f-number).
Aperture float64 `json:"aperture,omitempty"`
// CameraMake: The make of the camera used to create the photo.
CameraMake string `json:"cameraMake,omitempty"`
// CameraModel: The model of the camera used to create the photo.
CameraModel string `json:"cameraModel,omitempty"`
// ColorSpace: The color space of the photo.
ColorSpace string `json:"colorSpace,omitempty"`
// ExposureBias: The exposure bias of the photo (APEX value).
ExposureBias float64 `json:"exposureBias,omitempty"`
// ExposureMode: The exposure mode used to create the photo.
ExposureMode string `json:"exposureMode,omitempty"`
// ExposureTime: The length of the exposure, in seconds.
ExposureTime float64 `json:"exposureTime,omitempty"`
// FlashUsed: Whether a flash was used to create the photo.
FlashUsed bool `json:"flashUsed,omitempty"`
// FocalLength: The focal length used to create the photo, in
// millimeters.
FocalLength float64 `json:"focalLength,omitempty"`
// Height: The height of the image in pixels.
Height int64 `json:"height,omitempty"`
// IsoSpeed: The ISO speed used to create the photo.
IsoSpeed int64 `json:"isoSpeed,omitempty"`
// Lens: The lens used to create the photo.
Lens string `json:"lens,omitempty"`
// Location: Geographic location information stored in the image.
Location *FileImageMediaMetadataLocation `json:"location,omitempty"`
// MaxApertureValue: The smallest f-number of the lens at the focal
// length used to create the photo (APEX value).
MaxApertureValue float64 `json:"maxApertureValue,omitempty"`
// MeteringMode: The metering mode used to create the photo.
MeteringMode string `json:"meteringMode,omitempty"`
// Rotation: The rotation in clockwise degrees from the image's original
// orientation.
Rotation int64 `json:"rotation,omitempty"`
// Sensor: The type of sensor used to create the photo.
Sensor string `json:"sensor,omitempty"`
// SubjectDistance: The distance to the subject of the photo, in meters.
SubjectDistance int64 `json:"subjectDistance,omitempty"`
// Time: The date and time the photo was taken (EXIF DateTime).
Time string `json:"time,omitempty"`
// WhiteBalance: The white balance mode used to create the photo.
WhiteBalance string `json:"whiteBalance,omitempty"`
// Width: The width of the image in pixels.
Width int64 `json:"width,omitempty"`
// ForceSendFields is a list of field names (e.g. "Aperture") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *FileImageMediaMetadata) MarshalJSON() ([]byte, error) {
type noMethod FileImageMediaMetadata
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// FileImageMediaMetadataLocation: Geographic location information
// stored in the image.
type FileImageMediaMetadataLocation struct {
// Altitude: The altitude stored in the image.
Altitude float64 `json:"altitude,omitempty"`
// Latitude: The latitude stored in the image.
Latitude float64 `json:"latitude,omitempty"`
// Longitude: The longitude stored in the image.
Longitude float64 `json:"longitude,omitempty"`
// ForceSendFields is a list of field names (e.g. "Altitude") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *FileImageMediaMetadataLocation) MarshalJSON() ([]byte, error) {
type noMethod FileImageMediaMetadataLocation
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// FileVideoMediaMetadata: Additional metadata about video media. This
// may not be available immediately upon upload.
type FileVideoMediaMetadata struct {
// DurationMillis: The duration of the video in milliseconds.
DurationMillis int64 `json:"durationMillis,omitempty,string"`
// Height: The height of the video in pixels.
Height int64 `json:"height,omitempty"`
// Width: The width of the video in pixels.
Width int64 `json:"width,omitempty"`
// ForceSendFields is a list of field names (e.g. "DurationMillis") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *FileVideoMediaMetadata) MarshalJSON() ([]byte, error) {
type noMethod FileVideoMediaMetadata
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// FileList: A list of files.
type FileList struct {
// Files: The page of files.
Files []*File `json:"files,omitempty"`
// Kind: This is always drive#fileList.
Kind string `json:"kind,omitempty"`
// NextPageToken: The page token for the next page of files. This will
// be absent if the end of the files list has been reached.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Files") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
}
func (s *FileList) MarshalJSON() ([]byte, error) {
type noMethod FileList
raw := noMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields)
}
// GeneratedIds: A list of generated file IDs which can be provided in
// create requests.
type GeneratedIds struct {
// Ids: The IDs generated for the requesting user in the specified
// space.
Ids []string `json:"ids,omitempty"`