-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
drive-gen.go
9365 lines (8644 loc) · 352 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
// Copyright 2024 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package drive provides access to the Google Drive API.
//
// For product documentation, see: https://developers.google.com/drive/
//
// # Library status
//
// These client libraries are officially supported by Google. However, this
// library is considered complete and is in maintenance mode. This means
// that we will address critical bugs and security issues but will not add
// any new features.
//
// When possible, we recommend using our newer
// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
// that are still actively being worked and iterated on.
//
// # Creating a client
//
// Usage example:
//
// import "google.golang.org/api/drive/v3"
// ...
// ctx := context.Background()
// driveService, err := drive.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for
// authentication. For information on how to create and obtain Application
// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// # Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate.
// To restrict scopes, use [google.golang.org/api/option.WithScopes]:
//
// driveService, err := drive.NewService(ctx, option.WithScopes(drive.DriveScriptsScope))
//
// To use an API key for authentication (note: some APIs do not support API
// keys), use [google.golang.org/api/option.WithAPIKey]:
//
// driveService, err := drive.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
// flow, use [google.golang.org/api/option.WithTokenSource]:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// driveService, err := drive.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See [google.golang.org/api/option.ClientOption] for details on options.
package drive // import "google.golang.org/api/drive/v3"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
internal "google.golang.org/api/internal"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// 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 _ = internaloption.WithDefaultEndpoint
var _ = internal.Version
const apiId = "drive:v3"
const apiName = "drive"
const apiVersion = "v3"
const basePath = "https://www.googleapis.com/drive/v3/"
const basePathTemplate = "https://www.UNIVERSE_DOMAIN/drive/v3/"
const mtlsBasePath = "https://www.mtls.googleapis.com/drive/v3/"
// OAuth2 scopes used by this API.
const (
// See, edit, create, and delete all of your Google Drive files
DriveScope = "https://www.googleapis.com/auth/drive"
// See, create, and delete 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"
// See, edit, create, and delete only the specific Google Drive files you use
// with this app
DriveFileScope = "https://www.googleapis.com/auth/drive.file"
// See and download your Google Drive files that were created or edited by
// Google Meet.
DriveMeetReadonlyScope = "https://www.googleapis.com/auth/drive.meet.readonly"
// View and manage metadata of files in your Google Drive
DriveMetadataScope = "https://www.googleapis.com/auth/drive.metadata"
// See information about your Google Drive files
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"
// See and download all your Google Drive files
DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly"
// Modify your Google Apps Script scripts' behavior
DriveScriptsScope = "https://www.googleapis.com/auth/drive.scripts"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := internaloption.WithDefaultScopes(
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.appdata",
"https://www.googleapis.com/auth/drive.apps.readonly",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive.meet.readonly",
"https://www.googleapis.com/auth/drive.metadata",
"https://www.googleapis.com/auth/drive.metadata.readonly",
"https://www.googleapis.com/auth/drive.photos.readonly",
"https://www.googleapis.com/auth/drive.readonly",
"https://www.googleapis.com/auth/drive.scripts",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
opts = append(opts, internaloption.EnableNewAuthLibrary())
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
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.Comments = NewCommentsService(s)
s.Drives = NewDrivesService(s)
s.Files = NewFilesService(s)
s.Permissions = NewPermissionsService(s)
s.Replies = NewRepliesService(s)
s.Revisions = NewRevisionsService(s)
s.Teamdrives = NewTeamdrivesService(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
Comments *CommentsService
Drives *DrivesService
Files *FilesService
Permissions *PermissionsService
Replies *RepliesService
Revisions *RevisionsService
Teamdrives *TeamdrivesService
}
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 NewCommentsService(s *Service) *CommentsService {
rs := &CommentsService{s: s}
return rs
}
type CommentsService struct {
s *Service
}
func NewDrivesService(s *Service) *DrivesService {
rs := &DrivesService{s: s}
return rs
}
type DrivesService 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
}
func NewTeamdrivesService(s *Service) *TeamdrivesService {
rs := &TeamdrivesService{s: s}
return rs
}
type TeamdrivesService 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"`
// CanCreateDrives: Whether the user can create shared drives.
CanCreateDrives bool `json:"canCreateDrives,omitempty"`
// CanCreateTeamDrives: Deprecated: Use `canCreateDrives` instead.
CanCreateTeamDrives bool `json:"canCreateTeamDrives,omitempty"`
// DriveThemes: A list of themes that are supported for shared drives.
DriveThemes []*AboutDriveThemes `json:"driveThemes,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: Identifies what kind of resource this is. Value: the fixed string
// "drive#about".
Kind string `json:"kind,omitempty"`
// MaxImportSizes: A map of maximum import sizes by MIME type, in bytes.
MaxImportSizes map[string]string `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. For users that are
// part of an organization with pooled storage, information about the limit and
// usage across all services is for the organization, rather than the
// individual user. All fields are measured in bytes.
StorageQuota *AboutStorageQuota `json:"storageQuota,omitempty"`
// TeamDriveThemes: Deprecated: Use `driveThemes` instead.
TeamDriveThemes []*AboutTeamDriveThemes `json:"teamDriveThemes,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 or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AppInstalled") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s About) MarshalJSON() ([]byte, error) {
type NoMethod About
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AboutDriveThemes struct {
// BackgroundImageLink: A link to this theme's background image.
BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
// ColorRgb: The color of this theme as an RGB hex string.
ColorRgb string `json:"colorRgb,omitempty"`
// Id: The ID of the theme.
Id string `json:"id,omitempty"`
// ForceSendFields is a list of field names (e.g. "BackgroundImageLink") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BackgroundImageLink") to include
// in API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s AboutDriveThemes) MarshalJSON() ([]byte, error) {
type NoMethod AboutDriveThemes
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AboutStorageQuota: The user's storage quota limits and usage. For users that
// are part of an organization with pooled storage, information about the limit
// and usage across all services is for the organization, rather than the
// individual user. 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. For users that are part of an organization with
// pooled storage, this is the limit for the organization, rather than the
// individual user.
Limit int64 `json:"limit,omitempty,string"`
// Usage: The total usage across all services. For users that are part of an
// organization with pooled storage, this is the usage across all services for
// the organization, rather than the individual user.
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 or default values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Limit") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s AboutStorageQuota) MarshalJSON() ([]byte, error) {
type NoMethod AboutStorageQuota
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AboutTeamDriveThemes struct {
// BackgroundImageLink: Deprecated: Use `driveThemes/backgroundImageLink`
// instead.
BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
// ColorRgb: Deprecated: Use `driveThemes/colorRgb` instead.
ColorRgb string `json:"colorRgb,omitempty"`
// Id: Deprecated: Use `driveThemes/id` instead.
Id string `json:"id,omitempty"`
// ForceSendFields is a list of field names (e.g. "BackgroundImageLink") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BackgroundImageLink") to include
// in API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s AboutTeamDriveThemes) MarshalJSON() ([]byte, error) {
type NoMethod AboutTeamDriveThemes
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// App: 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.
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 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 `json:"createInFolderTemplate,omitempty"`
// CreateUrl: The URL to create a 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: Output only. Identifies what kind of resource this is. Value: the
// fixed string "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 such as a 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 contains {ids} or {exportIds} to be replaced by the actual file
// IDs. For more information, 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 objects.
SupportsCreate bool `json:"supportsCreate,omitempty"`
// SupportsImport: Whether this app supports importing from 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 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"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Authorized") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Authorized") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s App) MarshalJSON() ([]byte, error) {
type NoMethod App
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type AppIcons struct {
// Category: 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 `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"`
// ForceSendFields is a list of field names (e.g. "Category") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Category") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s AppIcons) MarshalJSON() ([]byte, error) {
type NoMethod AppIcons
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// AppList: A list of third-party applications which the user has installed or
// given access to Google Drive.
type AppList struct {
// DefaultAppIds: 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 `json:"defaultAppIds,omitempty"`
// Items: The list of apps.
Items []*App `json:"items,omitempty"`
// Kind: Output only. Identifies what kind of resource this is. Value: the
// fixed string "drive#appList".
Kind string `json:"kind,omitempty"`
// SelfLink: A link back to this list.
SelfLink string `json:"selfLink,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "DefaultAppIds") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DefaultAppIds") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s AppList) MarshalJSON() ([]byte, error) {
type NoMethod AppList
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Change: A change to a file or shared drive.
type Change struct {
// ChangeType: The type of the change. Possible values are `file` and `drive`.
ChangeType string `json:"changeType,omitempty"`
// Drive: 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 *Drive `json:"drive,omitempty"`
// DriveId: The ID of the shared drive associated with this change.
DriveId string `json:"driveId,omitempty"`
// File: 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 *File `json:"file,omitempty"`
// FileId: The ID of the file which has changed.
FileId string `json:"fileId,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed string
// "drive#change".
Kind string `json:"kind,omitempty"`
// Removed: Whether the file or shared drive has been removed from this list of
// changes, for example by deletion or loss of access.
Removed bool `json:"removed,omitempty"`
// TeamDrive: Deprecated: Use `drive` instead.
TeamDrive *TeamDrive `json:"teamDrive,omitempty"`
// TeamDriveId: Deprecated: Use `driveId` instead.
TeamDriveId string `json:"teamDriveId,omitempty"`
// Time: The time of this change (RFC 3339 date-time).
Time string `json:"time,omitempty"`
// Type: Deprecated: Use `changeType` instead.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "ChangeType") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ChangeType") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s Change) MarshalJSON() ([]byte, error) {
type NoMethod Change
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ChangeList: A list of changes for a user.
type ChangeList struct {
// Changes: The list of changes. If nextPageToken is populated, then this list
// may be incomplete and an additional page of results should be fetched.
Changes []*Change `json:"changes,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed string
// "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. The
// page token doesn't expire.
NewStartPageToken string `json:"newStartPageToken,omitempty"`
// NextPageToken: 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 `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 or default values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Changes") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s ChangeList) MarshalJSON() ([]byte, error) {
type NoMethod ChangeList
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Channel: A 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, which is `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. Valid values are
// "web_hook" or "webhook".
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 or default values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Address") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s Channel) MarshalJSON() ([]byte, error) {
type NoMethod Channel
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Comment: 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.
type Comment struct {
// Anchor: 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 `json:"anchor,omitempty"`
// Author: Output only. The author of the comment. The author's email address
// and permission ID will not be populated.
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: Output only. Whether the comment has been deleted. A deleted
// comment has no content.
Deleted bool `json:"deleted,omitempty"`
// HtmlContent: Output only. The content of the comment with HTML formatting.
HtmlContent string `json:"htmlContent,omitempty"`
// Id: Output only. The ID of the comment.
Id string `json:"id,omitempty"`
// Kind: Output only. Identifies what kind of resource this is. Value: the
// fixed string "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: Output only. The full list of replies to the comment in
// chronological order.
Replies []*Reply `json:"replies,omitempty"`
// Resolved: Output only. 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 or default values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Anchor") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s Comment) MarshalJSON() ([]byte, error) {
type NoMethod Comment
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// 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 or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "MimeType") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s CommentQuotedFileContent) MarshalJSON() ([]byte, error) {
type NoMethod CommentQuotedFileContent
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// CommentList: A list of comments on a file.
type CommentList struct {
// Comments: The list of comments. If nextPageToken is populated, then this
// list may be incomplete and an additional page of results should be fetched.
Comments []*Comment `json:"comments,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed string
// "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. 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 `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 or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Comments") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s CommentList) MarshalJSON() ([]byte, error) {
type NoMethod CommentList
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// ContentRestriction: A restriction for accessing the content of the file.
type ContentRestriction struct {
// OwnerRestricted: 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 bool `json:"ownerRestricted,omitempty"`
// ReadOnly: 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 bool `json:"readOnly,omitempty"`
// Reason: Reason for why the content of the file is restricted. This is only
// mutable on requests that also set `readOnly=true`.
Reason string `json:"reason,omitempty"`
// RestrictingUser: Output only. The user who set the content restriction. Only
// populated if `readOnly` is true.
RestrictingUser *User `json:"restrictingUser,omitempty"`
// RestrictionTime: The time at which the content restriction was set
// (formatted RFC 3339 timestamp). Only populated if readOnly is true.
RestrictionTime string `json:"restrictionTime,omitempty"`
// SystemRestricted: 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 bool `json:"systemRestricted,omitempty"`
// Type: Output only. The type of the content restriction. Currently the only
// possible value is `globalContentRestriction`.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "OwnerRestricted") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "OwnerRestricted") to include in
// API requests with the JSON null value. By default, fields with empty values
// are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s ContentRestriction) MarshalJSON() ([]byte, error) {
type NoMethod ContentRestriction
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// Drive: 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.
type Drive struct {
// BackgroundImageFile: 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 *DriveBackgroundImageFile `json:"backgroundImageFile,omitempty"`
// BackgroundImageLink: Output only. A short-lived link to this shared drive's
// background image.
BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
// Capabilities: Output only. Capabilities the current user has on this shared
// drive.
Capabilities *DriveCapabilities `json:"capabilities,omitempty"`
// ColorRgb: 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 `json:"colorRgb,omitempty"`
// CreatedTime: The time at which the shared drive was created (RFC 3339
// date-time).
CreatedTime string `json:"createdTime,omitempty"`
// Hidden: Whether the shared drive is hidden from default view.
Hidden bool `json:"hidden,omitempty"`
// Id: Output only. The ID of this shared drive which is also the ID of the top
// level folder of this shared drive.
Id string `json:"id,omitempty"`
// Kind: Output only. Identifies what kind of resource this is. Value: the
// fixed string "drive#drive".
Kind string `json:"kind,omitempty"`
// Name: The name of this shared drive.
Name string `json:"name,omitempty"`
// OrgUnitId: 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 `json:"orgUnitId,omitempty"`
// Restrictions: 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 *DriveRestrictions `json:"restrictions,omitempty"`
// ThemeId: 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 `json:"themeId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "BackgroundImageFile") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BackgroundImageFile") to include
// in API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s Drive) MarshalJSON() ([]byte, error) {
type NoMethod Drive
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// DriveBackgroundImageFile: 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.
type DriveBackgroundImageFile struct {
// Id: The ID of an image file in Google Drive to use for the background image.
Id string `json:"id,omitempty"`
// Width: The width of the cropped image in the closed range of 0 to 1. This
// value represents the width of the cropped image divided by the width of the
// entire image. The height is computed by applying a width to height aspect
// ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and
// 144 pixels high.