forked from googleapis/google-api-go-client
/
drive-gen.go
8230 lines (7424 loc) · 244 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/v2"
// ...
// driveService, err := drive.New(oauthHttpClient)
package drive
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"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 _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Background
const apiId = "drive:v2"
const apiName = "drive"
const apiVersion = "v2"
const basePath = "https://www.googleapis.com/drive/v2/"
// 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 your Google Drive apps
DriveAppsReadonlyScope = "https://www.googleapis.com/auth/drive.apps.readonly"
// View and manage Google Drive files 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 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.Apps = NewAppsService(s)
s.Changes = NewChangesService(s)
s.Channels = NewChannelsService(s)
s.Children = NewChildrenService(s)
s.Comments = NewCommentsService(s)
s.Files = NewFilesService(s)
s.Parents = NewParentsService(s)
s.Permissions = NewPermissionsService(s)
s.Properties = NewPropertiesService(s)
s.Realtime = NewRealtimeService(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
Apps *AppsService
Changes *ChangesService
Channels *ChannelsService
Children *ChildrenService
Comments *CommentsService
Files *FilesService
Parents *ParentsService
Permissions *PermissionsService
Properties *PropertiesService
Realtime *RealtimeService
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 NewAppsService(s *Service) *AppsService {
rs := &AppsService{s: s}
return rs
}
type AppsService 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 NewChildrenService(s *Service) *ChildrenService {
rs := &ChildrenService{s: s}
return rs
}
type ChildrenService 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 NewParentsService(s *Service) *ParentsService {
rs := &ParentsService{s: s}
return rs
}
type ParentsService struct {
s *Service
}
func NewPermissionsService(s *Service) *PermissionsService {
rs := &PermissionsService{s: s}
return rs
}
type PermissionsService struct {
s *Service
}
func NewPropertiesService(s *Service) *PropertiesService {
rs := &PropertiesService{s: s}
return rs
}
type PropertiesService struct {
s *Service
}
func NewRealtimeService(s *Service) *RealtimeService {
rs := &RealtimeService{s: s}
return rs
}
type RealtimeService 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
}
type About struct {
// AdditionalRoleInfo: Information about supported additional roles per
// file type. The most specific type takes precedence.
AdditionalRoleInfo []*AboutAdditionalRoleInfo `json:"additionalRoleInfo,omitempty"`
// DomainSharingPolicy: The domain sharing policy for the current user.
DomainSharingPolicy string `json:"domainSharingPolicy,omitempty"`
// Etag: The ETag of the item.
Etag string `json:"etag,omitempty"`
// ExportFormats: The allowable export formats.
ExportFormats []*AboutExportFormats `json:"exportFormats,omitempty"`
// Features: List of additional features enabled on this account.
Features []*AboutFeatures `json:"features,omitempty"`
// FolderColorPalette: The palette of allowable folder colors as RGB hex
// strings.
FolderColorPalette []string `json:"folderColorPalette,omitempty"`
// ImportFormats: The allowable import formats.
ImportFormats []*AboutImportFormats `json:"importFormats,omitempty"`
// IsCurrentAppInstalled: A boolean indicating whether the authenticated
// app is installed by the authenticated user.
IsCurrentAppInstalled bool `json:"isCurrentAppInstalled,omitempty"`
// Kind: This is always drive#about.
Kind string `json:"kind,omitempty"`
// LanguageCode: The user's language or locale code, as defined by BCP
// 47, with some extensions from Unicode's LDML format
// (http://www.unicode.org/reports/tr35/).
LanguageCode string `json:"languageCode,omitempty"`
// LargestChangeId: The largest change id.
LargestChangeId int64 `json:"largestChangeId,omitempty,string"`
// MaxUploadSizes: List of max upload sizes for each file type. The most
// specific type takes precedence.
MaxUploadSizes []*AboutMaxUploadSizes `json:"maxUploadSizes,omitempty"`
// Name: The name of the current user.
Name string `json:"name,omitempty"`
// PermissionId: The current user's ID as visible in the permissions
// collection.
PermissionId string `json:"permissionId,omitempty"`
// QuotaBytesByService: The amount of storage quota used by different
// Google services.
QuotaBytesByService []*AboutQuotaBytesByService `json:"quotaBytesByService,omitempty"`
// QuotaBytesTotal: The total number of quota bytes.
QuotaBytesTotal int64 `json:"quotaBytesTotal,omitempty,string"`
// QuotaBytesUsed: The number of quota bytes used by Google Drive.
QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"`
// QuotaBytesUsedAggregate: The number of quota bytes used by all Google
// apps (Drive, Picasa, etc.).
QuotaBytesUsedAggregate int64 `json:"quotaBytesUsedAggregate,omitempty,string"`
// QuotaBytesUsedInTrash: The number of quota bytes used by trashed
// items.
QuotaBytesUsedInTrash int64 `json:"quotaBytesUsedInTrash,omitempty,string"`
// QuotaType: The type of the user's storage quota. Possible values are:
//
// - LIMITED
// - UNLIMITED
QuotaType string `json:"quotaType,omitempty"`
// RemainingChangeIds: The number of remaining change ids.
RemainingChangeIds int64 `json:"remainingChangeIds,omitempty,string"`
// RootFolderId: The id of the root folder.
RootFolderId string `json:"rootFolderId,omitempty"`
// SelfLink: A link back to this item.
SelfLink string `json:"selfLink,omitempty"`
// User: The authenticated user.
User *User `json:"user,omitempty"`
}
type AboutAdditionalRoleInfo struct {
// RoleSets: The supported additional roles per primary role.
RoleSets []*AboutAdditionalRoleInfoRoleSets `json:"roleSets,omitempty"`
// Type: The content type that this additional role info applies to.
Type string `json:"type,omitempty"`
}
type AboutAdditionalRoleInfoRoleSets struct {
// AdditionalRoles: The supported additional roles with the primary
// role.
AdditionalRoles []string `json:"additionalRoles,omitempty"`
// PrimaryRole: A primary permission role.
PrimaryRole string `json:"primaryRole,omitempty"`
}
type AboutExportFormats struct {
// Source: The content type to convert from.
Source string `json:"source,omitempty"`
// Targets: The possible content types to convert to.
Targets []string `json:"targets,omitempty"`
}
type AboutFeatures struct {
// FeatureName: The name of the feature.
FeatureName string `json:"featureName,omitempty"`
// FeatureRate: The request limit rate for this feature, in queries per
// second.
FeatureRate float64 `json:"featureRate,omitempty"`
}
type AboutImportFormats struct {
// Source: The imported file's content type to convert from.
Source string `json:"source,omitempty"`
// Targets: The possible content types to convert to.
Targets []string `json:"targets,omitempty"`
}
type AboutMaxUploadSizes struct {
// Size: The max upload size for this type.
Size int64 `json:"size,omitempty,string"`
// Type: The file type.
Type string `json:"type,omitempty"`
}
type AboutQuotaBytesByService struct {
// BytesUsed: The storage quota bytes used by the service.
BytesUsed int64 `json:"bytesUsed,omitempty,string"`
// ServiceName: The service's name, e.g. DRIVE, GMAIL, or PHOTOS.
ServiceName string `json:"serviceName,omitempty"`
}
type App struct {
// Authorized: Whether the app is authorized to access data on the
// user's Drive.
Authorized bool `json:"authorized,omitempty"`
// CreateInFolderTemplate: The template url to create a new file with
// this app in a given folder. The template will contain {folderId} to
// be replaced by the folder to create the new file in.
CreateInFolderTemplate string `json:"createInFolderTemplate,omitempty"`
// CreateUrl: The url to create a new file with this app.
CreateUrl string `json:"createUrl,omitempty"`
// HasDriveWideScope: Whether the app has drive-wide scope. An app with
// drive-wide scope can access all files in the user's drive.
HasDriveWideScope bool `json:"hasDriveWideScope,omitempty"`
// Icons: The various icons for the app.
Icons []*AppIcons `json:"icons,omitempty"`
// Id: The ID of the app.
Id string `json:"id,omitempty"`
// Installed: Whether the app is installed.
Installed bool `json:"installed,omitempty"`
// Kind: This is always drive#app.
Kind string `json:"kind,omitempty"`
// LongDescription: A long description of the app.
LongDescription string `json:"longDescription,omitempty"`
// Name: The name of the app.
Name string `json:"name,omitempty"`
// ObjectType: The type of object this app creates (e.g. Chart). If
// empty, the app name should be used instead.
ObjectType string `json:"objectType,omitempty"`
// OpenUrlTemplate: The template url for opening files with this app.
// The template will contain {ids} and/or {exportIds} to be replaced by
// the actual file ids. See Open Files for the full documentation.
OpenUrlTemplate string `json:"openUrlTemplate,omitempty"`
// PrimaryFileExtensions: The list of primary file extensions.
PrimaryFileExtensions []string `json:"primaryFileExtensions,omitempty"`
// PrimaryMimeTypes: The list of primary mime types.
PrimaryMimeTypes []string `json:"primaryMimeTypes,omitempty"`
// ProductId: The ID of the product listing for this app.
ProductId string `json:"productId,omitempty"`
// ProductUrl: A link to the product listing for this app.
ProductUrl string `json:"productUrl,omitempty"`
// SecondaryFileExtensions: The list of secondary file extensions.
SecondaryFileExtensions []string `json:"secondaryFileExtensions,omitempty"`
// SecondaryMimeTypes: The list of secondary mime types.
SecondaryMimeTypes []string `json:"secondaryMimeTypes,omitempty"`
// ShortDescription: A short description of the app.
ShortDescription string `json:"shortDescription,omitempty"`
// SupportsCreate: Whether this app supports creating new objects.
SupportsCreate bool `json:"supportsCreate,omitempty"`
// SupportsImport: Whether this app supports importing Google Docs.
SupportsImport bool `json:"supportsImport,omitempty"`
// SupportsMultiOpen: Whether this app supports opening more than one
// file.
SupportsMultiOpen bool `json:"supportsMultiOpen,omitempty"`
// SupportsOfflineCreate: Whether this app supports creating new files
// when offline.
SupportsOfflineCreate bool `json:"supportsOfflineCreate,omitempty"`
// UseByDefault: Whether the app is selected as the default handler for
// the types it supports.
UseByDefault bool `json:"useByDefault,omitempty"`
}
type AppIcons struct {
// Category: Category of the icon. Allowed values are:
// - application - icon for the application
// - document - icon for a file associated with the app
// - documentShared - icon for a shared file associated with the app
Category string `json:"category,omitempty"`
// IconUrl: URL for the icon.
IconUrl string `json:"iconUrl,omitempty"`
// Size: Size of the icon. Represented as the maximum of the width and
// height.
Size int64 `json:"size,omitempty"`
}
type AppList struct {
// DefaultAppIds: 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 `json:"defaultAppIds,omitempty"`
// Etag: The ETag of the list.
Etag string `json:"etag,omitempty"`
// Items: The actual list of apps.
Items []*App `json:"items,omitempty"`
// Kind: This is always drive#appList.
Kind string `json:"kind,omitempty"`
// SelfLink: A link back to this list.
SelfLink string `json:"selfLink,omitempty"`
}
type Change struct {
// Deleted: Whether the file has been deleted.
Deleted bool `json:"deleted,omitempty"`
// File: The updated state of the file. Present if the file has not been
// deleted.
File *File `json:"file,omitempty"`
// FileId: The ID of the file associated with this change.
FileId string `json:"fileId,omitempty"`
// Id: The ID of the change.
Id int64 `json:"id,omitempty,string"`
// Kind: This is always drive#change.
Kind string `json:"kind,omitempty"`
// ModificationDate: The time of this modification.
ModificationDate string `json:"modificationDate,omitempty"`
// SelfLink: A link back to this change.
SelfLink string `json:"selfLink,omitempty"`
}
type ChangeList struct {
// Etag: The ETag of the list.
Etag string `json:"etag,omitempty"`
// Items: The actual list of changes.
Items []*Change `json:"items,omitempty"`
// Kind: This is always drive#changeList.
Kind string `json:"kind,omitempty"`
// LargestChangeId: The current largest change ID.
LargestChangeId int64 `json:"largestChangeId,omitempty,string"`
// NextLink: A link to the next page of changes.
NextLink string `json:"nextLink,omitempty"`
// NextPageToken: The page token for the next page of changes.
NextPageToken string `json:"nextPageToken,omitempty"`
// SelfLink: A link back to this list.
SelfLink string `json:"selfLink,omitempty"`
}
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"`
}
type ChildList struct {
// Etag: The ETag of the list.
Etag string `json:"etag,omitempty"`
// Items: The actual list of children.
Items []*ChildReference `json:"items,omitempty"`
// Kind: This is always drive#childList.
Kind string `json:"kind,omitempty"`
// NextLink: A link to the next page of children.
NextLink string `json:"nextLink,omitempty"`
// NextPageToken: The page token for the next page of children.
NextPageToken string `json:"nextPageToken,omitempty"`
// SelfLink: A link back to this list.
SelfLink string `json:"selfLink,omitempty"`
}
type ChildReference struct {
// ChildLink: A link to the child.
ChildLink string `json:"childLink,omitempty"`
// Id: The ID of the child.
Id string `json:"id,omitempty"`
// Kind: This is always drive#childReference.
Kind string `json:"kind,omitempty"`
// SelfLink: A link back to this reference.
SelfLink string `json:"selfLink,omitempty"`
}
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 wrote this comment.
Author *User `json:"author,omitempty"`
// CommentId: The ID of the comment.
CommentId string `json:"commentId,omitempty"`
// Content: The plain text content used to create this comment. This is
// not HTML safe and should only be used as a starting point to make
// edits to a comment's content.
Content string `json:"content,omitempty"`
// Context: The context of the file which is being commented on.
Context *CommentContext `json:"context,omitempty"`
// CreatedDate: The date when this comment was first created.
CreatedDate string `json:"createdDate,omitempty"`
// Deleted: Whether this comment has been deleted. If a comment has been
// deleted the content will be cleared and this will only represent a
// comment that once existed.
Deleted bool `json:"deleted,omitempty"`
// FileId: The file which this comment is addressing.
FileId string `json:"fileId,omitempty"`
// FileTitle: The title of the file which this comment is addressing.
FileTitle string `json:"fileTitle,omitempty"`
// HtmlContent: HTML formatted content for this comment.
HtmlContent string `json:"htmlContent,omitempty"`
// Kind: This is always drive#comment.
Kind string `json:"kind,omitempty"`
// ModifiedDate: The date when this comment or any of its replies were
// last modified.
ModifiedDate string `json:"modifiedDate,omitempty"`
// Replies: Replies to this post.
Replies []*CommentReply `json:"replies,omitempty"`
// SelfLink: A link back to this comment.
SelfLink string `json:"selfLink,omitempty"`
// Status: The status of this comment. Status can be changed by posting
// a reply to a comment with the desired status.
// - "open" - The comment is still open.
// - "resolved" - The comment has been resolved by one of its replies.
Status string `json:"status,omitempty"`
}
type CommentContext struct {
// Type: The MIME type of the context snippet.
Type string `json:"type,omitempty"`
// Value: Data representation of the segment of the file being commented
// on. In the case of a text file for example, this would be the actual
// text that the comment is about.
Value string `json:"value,omitempty"`
}
type CommentList struct {
// Items: List of comments.
Items []*Comment `json:"items,omitempty"`
// Kind: This is always drive#commentList.
Kind string `json:"kind,omitempty"`
// NextLink: A link to the next page of comments.
NextLink string `json:"nextLink,omitempty"`
// NextPageToken: The token to use to request the next page of results.
NextPageToken string `json:"nextPageToken,omitempty"`
// SelfLink: A link back to this list.
SelfLink string `json:"selfLink,omitempty"`
}
type CommentReply struct {
// Author: The user who wrote this reply.
Author *User `json:"author,omitempty"`
// Content: The plain text content used to create this reply. This is
// not HTML safe and should only be used as a starting point to make
// edits to a reply's content. This field is required on inserts if no
// verb is specified (resolve/reopen).
Content string `json:"content,omitempty"`
// CreatedDate: The date when this reply was first created.
CreatedDate string `json:"createdDate,omitempty"`
// Deleted: Whether this reply has been deleted. If a reply has been
// deleted the content will be cleared and this will only represent a
// reply that once existed.
Deleted bool `json:"deleted,omitempty"`
// HtmlContent: HTML formatted content for this reply.
HtmlContent string `json:"htmlContent,omitempty"`
// Kind: This is always drive#commentReply.
Kind string `json:"kind,omitempty"`
// ModifiedDate: The date when this reply was last modified.
ModifiedDate string `json:"modifiedDate,omitempty"`
// ReplyId: The ID of the reply.
ReplyId string `json:"replyId,omitempty"`
// Verb: The action this reply performed to the parent comment. When
// creating a new reply this is the action to be perform to the parent
// comment. Possible values are:
// - "resolve" - To resolve a comment.
// - "reopen" - To reopen (un-resolve) a comment.
Verb string `json:"verb,omitempty"`
}
type CommentReplyList struct {
// Items: List of reply.
Items []*CommentReply `json:"items,omitempty"`
// Kind: This is always drive#commentReplyList.
Kind string `json:"kind,omitempty"`
// NextLink: A link to the next page of replies.
NextLink string `json:"nextLink,omitempty"`
// NextPageToken: The token to use to request the next page of results.
NextPageToken string `json:"nextPageToken,omitempty"`
// SelfLink: A link back to this list.
SelfLink string `json:"selfLink,omitempty"`
}
type File struct {
// AlternateLink: A link for opening the file in a relevant Google
// editor or viewer.
AlternateLink string `json:"alternateLink,omitempty"`
// AppDataContents: Whether this file is in the Application Data folder.
AppDataContents bool `json:"appDataContents,omitempty"`
// Copyable: Whether the file can be copied by the current user.
Copyable bool `json:"copyable,omitempty"`
// CreatedDate: Create time for this file (formatted RFC 3339
// timestamp).
CreatedDate string `json:"createdDate,omitempty"`
// DefaultOpenWithLink: A link to open this file with the user's default
// app for this file. Only populated when the drive.apps.readonly scope
// is used.
DefaultOpenWithLink string `json:"defaultOpenWithLink,omitempty"`
// Description: A short description of the file.
Description string `json:"description,omitempty"`
// DownloadUrl: Short lived download URL for the file. This is only
// populated for files with content stored in Drive.
DownloadUrl string `json:"downloadUrl,omitempty"`
// Editable: Whether the file can be edited by the current user.
Editable bool `json:"editable,omitempty"`
// EmbedLink: A link for embedding the file.
EmbedLink string `json:"embedLink,omitempty"`
// Etag: ETag of the file.
Etag string `json:"etag,omitempty"`
// ExplicitlyTrashed: Whether this file has been explicitly trashed, as
// opposed to recursively trashed. This will only be populated if the
// file is trashed.
ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"`
// ExportLinks: Links for exporting Google Docs to specific formats.
ExportLinks map[string]string `json:"exportLinks,omitempty"`
// FileExtension: The file extension used when downloading this file.
// This field is read only. To set the extension, include it in the
// title when creating the file. This is only populated for files with
// content stored in Drive.
FileExtension string `json:"fileExtension,omitempty"`
// FileSize: The size of the file in bytes. This is only populated for
// files with content stored in Drive.
FileSize int64 `json:"fileSize,omitempty,string"`
// FolderColorRgb: Folder color as an RGB hex string if the file is a
// folder. The list of supported colors is available in the
// folderColorPalette field of the About resource. If an unsupported
// color is specified, it will be changed to the closest color in the
// palette.
FolderColorRgb string `json:"folderColorRgb,omitempty"`
// HeadRevisionId: The ID of the file's head revision. This will only be
// populated for files with content stored in Drive.
HeadRevisionId string `json:"headRevisionId,omitempty"`
// IconLink: A link to the file's icon.
IconLink string `json:"iconLink,omitempty"`
// Id: The ID of the file.
Id string `json:"id,omitempty"`
// ImageMediaMetadata: Metadata about image media. This will only be
// present for image types, and its contents will depend on what can be
// parsed from the image content.
ImageMediaMetadata *FileImageMediaMetadata `json:"imageMediaMetadata,omitempty"`
// IndexableText: Indexable text attributes for the file (can only be
// written)
IndexableText *FileIndexableText `json:"indexableText,omitempty"`
// Kind: The type of file. This is always drive#file.
Kind string `json:"kind,omitempty"`
// Labels: A group of labels for the file.
Labels *FileLabels `json:"labels,omitempty"`
// LastModifyingUser: The last user to modify this file.
LastModifyingUser *User `json:"lastModifyingUser,omitempty"`
// LastModifyingUserName: Name of the last user to modify this file.
LastModifyingUserName string `json:"lastModifyingUserName,omitempty"`
// LastViewedByMeDate: Last time this file was viewed by the user
// (formatted RFC 3339 timestamp).
LastViewedByMeDate string `json:"lastViewedByMeDate,omitempty"`
// MarkedViewedByMeDate: Time this file was explicitly marked viewed by
// the user (formatted RFC 3339 timestamp).
MarkedViewedByMeDate string `json:"markedViewedByMeDate,omitempty"`
// Md5Checksum: An MD5 checksum for the content of this file. This is
// populated only for files with content stored in Drive.
Md5Checksum string `json:"md5Checksum,omitempty"`
// MimeType: The MIME type of the file. This is only mutable on update
// when uploading new content. This field can be left blank, and the
// mimetype will be determined from the uploaded content's MIME type.
MimeType string `json:"mimeType,omitempty"`
// ModifiedByMeDate: Last time this file was modified by the user
// (formatted RFC 3339 timestamp). Note that setting modifiedDate will
// also update the modifiedByMe date for the user which set the date.
ModifiedByMeDate string `json:"modifiedByMeDate,omitempty"`
// ModifiedDate: Last time this file was modified by anyone (formatted
// RFC 3339 timestamp). This is only mutable on update when the
// setModifiedDate parameter is set.
ModifiedDate string `json:"modifiedDate,omitempty"`
// OpenWithLinks: A map of the id of each of the user's apps to a link
// to open this file with that app. Only populated when the
// drive.apps.readonly scope is used.
OpenWithLinks map[string]string `json:"openWithLinks,omitempty"`
// OriginalFilename: The original filename if the file was uploaded
// manually, or the original title if the file was inserted through the
// API. Note that renames of the title will not change the original
// filename. This will only be populated on files with content stored in
// Drive.
OriginalFilename string `json:"originalFilename,omitempty"`
// OwnerNames: Name(s) of the owner(s) of this file.
OwnerNames []string `json:"ownerNames,omitempty"`
// Owners: The owner(s) of this file.
Owners []*User `json:"owners,omitempty"`
// Parents: Collection of parent folders which contain this
// file.
// Setting this field will put the file in all of the provided folders.
// On insert, if no folders are provided, the file will be placed in the
// default root folder.
Parents []*ParentReference `json:"parents,omitempty"`
// Permissions: The list of permissions for users with access to this
// file.
Permissions []*Permission `json:"permissions,omitempty"`
// Properties: The list of properties.
Properties []*Property `json:"properties,omitempty"`
// QuotaBytesUsed: The number of quota bytes used by this file.
QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"`
// SelfLink: A link back to this file.
SelfLink string `json:"selfLink,omitempty"`
// Shared: Whether the file has been shared.
Shared bool `json:"shared,omitempty"`
// SharedWithMeDate: Time at which this file was shared with the user
// (formatted RFC 3339 timestamp).
SharedWithMeDate string `json:"sharedWithMeDate,omitempty"`
// SharingUser: User that shared the item with the current user, if
// available.
SharingUser *User `json:"sharingUser,omitempty"`
// Thumbnail: Thumbnail for the file. Only accepted on upload and for
// files that are not already thumbnailed by Google.
Thumbnail *FileThumbnail `json:"thumbnail,omitempty"`
// ThumbnailLink: A short-lived link to the file's thumbnail. Typically
// lasts on the order of hours.
ThumbnailLink string `json:"thumbnailLink,omitempty"`
// Title: The title of this file.
Title string `json:"title,omitempty"`
// UserPermission: The permissions for the authenticated user on this
// file.
UserPermission *Permission `json:"userPermission,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 requesting user.
Version int64 `json:"version,omitempty,string"`
// VideoMediaMetadata: Metadata about video media. This will only be
// present for video types.
VideoMediaMetadata *FileVideoMediaMetadata `json:"videoMediaMetadata,omitempty"`
// WebContentLink: A link for downloading the content of the file in a
// browser using cookie based authentication. In cases where the content
// is shared publicly, the content can be downloaded without any
// credentials.
WebContentLink string `json:"webContentLink,omitempty"`
// WebViewLink: A link only available on public folders for viewing
// their static web assets (HTML, CSS, JS, etc) via Google Drive's
// Website Hosting.
WebViewLink string `json:"webViewLink,omitempty"`
// WritersCanShare: Whether writers can share the document with other
// users.
WritersCanShare bool `json:"writersCanShare,omitempty"`
}
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"`
// Date: The date and time the photo was taken (EXIF format timestamp).
Date string `json:"date,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.