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 package drive
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "net/http"
66 "net/url"
67 "strconv"
68 "strings"
69
70 googleapi "google.golang.org/api/googleapi"
71 internal "google.golang.org/api/internal"
72 gensupport "google.golang.org/api/internal/gensupport"
73 option "google.golang.org/api/option"
74 internaloption "google.golang.org/api/option/internaloption"
75 htransport "google.golang.org/api/transport/http"
76 )
77
78
79
80 var _ = bytes.NewBuffer
81 var _ = strconv.Itoa
82 var _ = fmt.Sprintf
83 var _ = json.NewDecoder
84 var _ = io.Copy
85 var _ = url.Parse
86 var _ = gensupport.MarshalJSON
87 var _ = googleapi.Version
88 var _ = errors.New
89 var _ = strings.Replace
90 var _ = context.Canceled
91 var _ = internaloption.WithDefaultEndpoint
92 var _ = internal.Version
93
94 const apiId = "drive:v3"
95 const apiName = "drive"
96 const apiVersion = "v3"
97 const basePath = "https://www.googleapis.com/drive/v3/"
98 const basePathTemplate = "https://www.UNIVERSE_DOMAIN/drive/v3/"
99 const mtlsBasePath = "https://www.mtls.googleapis.com/drive/v3/"
100
101
102 const (
103
104 DriveScope = "https://www.googleapis.com/auth/drive"
105
106
107 DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata"
108
109
110 DriveAppsReadonlyScope = "https://www.googleapis.com/auth/drive.apps.readonly"
111
112
113
114 DriveFileScope = "https://www.googleapis.com/auth/drive.file"
115
116
117 DriveMetadataScope = "https://www.googleapis.com/auth/drive.metadata"
118
119
120 DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly"
121
122
123 DrivePhotosReadonlyScope = "https://www.googleapis.com/auth/drive.photos.readonly"
124
125
126 DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly"
127
128
129 DriveScriptsScope = "https://www.googleapis.com/auth/drive.scripts"
130 )
131
132
133 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
134 scopesOption := internaloption.WithDefaultScopes(
135 "https://www.googleapis.com/auth/drive",
136 "https://www.googleapis.com/auth/drive.appdata",
137 "https://www.googleapis.com/auth/drive.apps.readonly",
138 "https://www.googleapis.com/auth/drive.file",
139 "https://www.googleapis.com/auth/drive.metadata",
140 "https://www.googleapis.com/auth/drive.metadata.readonly",
141 "https://www.googleapis.com/auth/drive.photos.readonly",
142 "https://www.googleapis.com/auth/drive.readonly",
143 "https://www.googleapis.com/auth/drive.scripts",
144 )
145
146 opts = append([]option.ClientOption{scopesOption}, opts...)
147 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
148 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
149 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
150 opts = append(opts, internaloption.EnableNewAuthLibrary())
151 client, endpoint, err := htransport.NewClient(ctx, opts...)
152 if err != nil {
153 return nil, err
154 }
155 s, err := New(client)
156 if err != nil {
157 return nil, err
158 }
159 if endpoint != "" {
160 s.BasePath = endpoint
161 }
162 return s, nil
163 }
164
165
166
167
168
169
170 func New(client *http.Client) (*Service, error) {
171 if client == nil {
172 return nil, errors.New("client is nil")
173 }
174 s := &Service{client: client, BasePath: basePath}
175 s.About = NewAboutService(s)
176 s.Apps = NewAppsService(s)
177 s.Changes = NewChangesService(s)
178 s.Channels = NewChannelsService(s)
179 s.Comments = NewCommentsService(s)
180 s.Drives = NewDrivesService(s)
181 s.Files = NewFilesService(s)
182 s.Permissions = NewPermissionsService(s)
183 s.Replies = NewRepliesService(s)
184 s.Revisions = NewRevisionsService(s)
185 s.Teamdrives = NewTeamdrivesService(s)
186 return s, nil
187 }
188
189 type Service struct {
190 client *http.Client
191 BasePath string
192 UserAgent string
193
194 About *AboutService
195
196 Apps *AppsService
197
198 Changes *ChangesService
199
200 Channels *ChannelsService
201
202 Comments *CommentsService
203
204 Drives *DrivesService
205
206 Files *FilesService
207
208 Permissions *PermissionsService
209
210 Replies *RepliesService
211
212 Revisions *RevisionsService
213
214 Teamdrives *TeamdrivesService
215 }
216
217 func (s *Service) userAgent() string {
218 if s.UserAgent == "" {
219 return googleapi.UserAgent
220 }
221 return googleapi.UserAgent + " " + s.UserAgent
222 }
223
224 func NewAboutService(s *Service) *AboutService {
225 rs := &AboutService{s: s}
226 return rs
227 }
228
229 type AboutService struct {
230 s *Service
231 }
232
233 func NewAppsService(s *Service) *AppsService {
234 rs := &AppsService{s: s}
235 return rs
236 }
237
238 type AppsService struct {
239 s *Service
240 }
241
242 func NewChangesService(s *Service) *ChangesService {
243 rs := &ChangesService{s: s}
244 return rs
245 }
246
247 type ChangesService struct {
248 s *Service
249 }
250
251 func NewChannelsService(s *Service) *ChannelsService {
252 rs := &ChannelsService{s: s}
253 return rs
254 }
255
256 type ChannelsService struct {
257 s *Service
258 }
259
260 func NewCommentsService(s *Service) *CommentsService {
261 rs := &CommentsService{s: s}
262 return rs
263 }
264
265 type CommentsService struct {
266 s *Service
267 }
268
269 func NewDrivesService(s *Service) *DrivesService {
270 rs := &DrivesService{s: s}
271 return rs
272 }
273
274 type DrivesService struct {
275 s *Service
276 }
277
278 func NewFilesService(s *Service) *FilesService {
279 rs := &FilesService{s: s}
280 return rs
281 }
282
283 type FilesService struct {
284 s *Service
285 }
286
287 func NewPermissionsService(s *Service) *PermissionsService {
288 rs := &PermissionsService{s: s}
289 return rs
290 }
291
292 type PermissionsService struct {
293 s *Service
294 }
295
296 func NewRepliesService(s *Service) *RepliesService {
297 rs := &RepliesService{s: s}
298 return rs
299 }
300
301 type RepliesService struct {
302 s *Service
303 }
304
305 func NewRevisionsService(s *Service) *RevisionsService {
306 rs := &RevisionsService{s: s}
307 return rs
308 }
309
310 type RevisionsService struct {
311 s *Service
312 }
313
314 func NewTeamdrivesService(s *Service) *TeamdrivesService {
315 rs := &TeamdrivesService{s: s}
316 return rs
317 }
318
319 type TeamdrivesService struct {
320 s *Service
321 }
322
323
324
325 type About struct {
326
327 AppInstalled bool `json:"appInstalled,omitempty"`
328
329 CanCreateDrives bool `json:"canCreateDrives,omitempty"`
330
331 CanCreateTeamDrives bool `json:"canCreateTeamDrives,omitempty"`
332
333 DriveThemes []*AboutDriveThemes `json:"driveThemes,omitempty"`
334
335
336 ExportFormats map[string][]string `json:"exportFormats,omitempty"`
337
338
339 FolderColorPalette []string `json:"folderColorPalette,omitempty"`
340
341
342 ImportFormats map[string][]string `json:"importFormats,omitempty"`
343
344
345 Kind string `json:"kind,omitempty"`
346
347 MaxImportSizes map[string]string `json:"maxImportSizes,omitempty"`
348
349 MaxUploadSize int64 `json:"maxUploadSize,omitempty,string"`
350
351
352 StorageQuota *AboutStorageQuota `json:"storageQuota,omitempty"`
353
354 TeamDriveThemes []*AboutTeamDriveThemes `json:"teamDriveThemes,omitempty"`
355
356 User *User `json:"user,omitempty"`
357
358
359 googleapi.ServerResponse `json:"-"`
360
361
362
363
364
365 ForceSendFields []string `json:"-"`
366
367
368
369
370 NullFields []string `json:"-"`
371 }
372
373 func (s *About) MarshalJSON() ([]byte, error) {
374 type NoMethod About
375 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
376 }
377
378 type AboutDriveThemes struct {
379
380 BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
381
382 ColorRgb string `json:"colorRgb,omitempty"`
383
384 Id string `json:"id,omitempty"`
385
386
387
388
389
390 ForceSendFields []string `json:"-"`
391
392
393
394
395 NullFields []string `json:"-"`
396 }
397
398 func (s *AboutDriveThemes) MarshalJSON() ([]byte, error) {
399 type NoMethod AboutDriveThemes
400 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
401 }
402
403
404
405 type AboutStorageQuota struct {
406
407
408 Limit int64 `json:"limit,omitempty,string"`
409
410 Usage int64 `json:"usage,omitempty,string"`
411
412 UsageInDrive int64 `json:"usageInDrive,omitempty,string"`
413
414 UsageInDriveTrash int64 `json:"usageInDriveTrash,omitempty,string"`
415
416
417
418
419
420 ForceSendFields []string `json:"-"`
421
422
423
424
425 NullFields []string `json:"-"`
426 }
427
428 func (s *AboutStorageQuota) MarshalJSON() ([]byte, error) {
429 type NoMethod AboutStorageQuota
430 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
431 }
432
433 type AboutTeamDriveThemes struct {
434
435
436 BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
437
438 ColorRgb string `json:"colorRgb,omitempty"`
439
440 Id string `json:"id,omitempty"`
441
442
443
444
445
446 ForceSendFields []string `json:"-"`
447
448
449
450
451 NullFields []string `json:"-"`
452 }
453
454 func (s *AboutTeamDriveThemes) MarshalJSON() ([]byte, error) {
455 type NoMethod AboutTeamDriveThemes
456 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
457 }
458
459
460
461
462
463
464 type App struct {
465
466
467 Authorized bool `json:"authorized,omitempty"`
468
469
470
471 CreateInFolderTemplate string `json:"createInFolderTemplate,omitempty"`
472
473 CreateUrl string `json:"createUrl,omitempty"`
474
475
476 HasDriveWideScope bool `json:"hasDriveWideScope,omitempty"`
477
478 Icons []*AppIcons `json:"icons,omitempty"`
479
480 Id string `json:"id,omitempty"`
481
482 Installed bool `json:"installed,omitempty"`
483
484
485 Kind string `json:"kind,omitempty"`
486
487 LongDescription string `json:"longDescription,omitempty"`
488
489 Name string `json:"name,omitempty"`
490
491
492 ObjectType string `json:"objectType,omitempty"`
493
494
495
496 OpenUrlTemplate string `json:"openUrlTemplate,omitempty"`
497
498 PrimaryFileExtensions []string `json:"primaryFileExtensions,omitempty"`
499
500 PrimaryMimeTypes []string `json:"primaryMimeTypes,omitempty"`
501
502 ProductId string `json:"productId,omitempty"`
503
504 ProductUrl string `json:"productUrl,omitempty"`
505
506 SecondaryFileExtensions []string `json:"secondaryFileExtensions,omitempty"`
507
508 SecondaryMimeTypes []string `json:"secondaryMimeTypes,omitempty"`
509
510 ShortDescription string `json:"shortDescription,omitempty"`
511
512 SupportsCreate bool `json:"supportsCreate,omitempty"`
513
514 SupportsImport bool `json:"supportsImport,omitempty"`
515
516 SupportsMultiOpen bool `json:"supportsMultiOpen,omitempty"`
517
518
519 SupportsOfflineCreate bool `json:"supportsOfflineCreate,omitempty"`
520
521
522 UseByDefault bool `json:"useByDefault,omitempty"`
523
524
525 googleapi.ServerResponse `json:"-"`
526
527
528
529
530
531 ForceSendFields []string `json:"-"`
532
533
534
535
536 NullFields []string `json:"-"`
537 }
538
539 func (s *App) MarshalJSON() ([]byte, error) {
540 type NoMethod App
541 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
542 }
543
544 type AppIcons struct {
545
546
547
548
549 Category string `json:"category,omitempty"`
550
551 IconUrl string `json:"iconUrl,omitempty"`
552
553 Size int64 `json:"size,omitempty"`
554
555
556
557
558
559 ForceSendFields []string `json:"-"`
560
561
562
563
564 NullFields []string `json:"-"`
565 }
566
567 func (s *AppIcons) MarshalJSON() ([]byte, error) {
568 type NoMethod AppIcons
569 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
570 }
571
572
573
574 type AppList struct {
575
576
577 DefaultAppIds []string `json:"defaultAppIds,omitempty"`
578
579 Items []*App `json:"items,omitempty"`
580
581
582 Kind string `json:"kind,omitempty"`
583
584 SelfLink string `json:"selfLink,omitempty"`
585
586
587 googleapi.ServerResponse `json:"-"`
588
589
590
591
592
593 ForceSendFields []string `json:"-"`
594
595
596
597
598 NullFields []string `json:"-"`
599 }
600
601 func (s *AppList) MarshalJSON() ([]byte, error) {
602 type NoMethod AppList
603 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
604 }
605
606
607 type Change struct {
608
609 ChangeType string `json:"changeType,omitempty"`
610
611
612
613 Drive *Drive `json:"drive,omitempty"`
614
615 DriveId string `json:"driveId,omitempty"`
616
617
618 File *File `json:"file,omitempty"`
619
620 FileId string `json:"fileId,omitempty"`
621
622
623 Kind string `json:"kind,omitempty"`
624
625
626 Removed bool `json:"removed,omitempty"`
627
628 TeamDrive *TeamDrive `json:"teamDrive,omitempty"`
629
630 TeamDriveId string `json:"teamDriveId,omitempty"`
631
632 Time string `json:"time,omitempty"`
633
634 Type string `json:"type,omitempty"`
635
636
637
638
639
640 ForceSendFields []string `json:"-"`
641
642
643
644
645 NullFields []string `json:"-"`
646 }
647
648 func (s *Change) MarshalJSON() ([]byte, error) {
649 type NoMethod Change
650 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
651 }
652
653
654 type ChangeList struct {
655
656
657 Changes []*Change `json:"changes,omitempty"`
658
659
660 Kind string `json:"kind,omitempty"`
661
662
663
664 NewStartPageToken string `json:"newStartPageToken,omitempty"`
665
666
667
668 NextPageToken string `json:"nextPageToken,omitempty"`
669
670
671 googleapi.ServerResponse `json:"-"`
672
673
674
675
676
677 ForceSendFields []string `json:"-"`
678
679
680
681
682 NullFields []string `json:"-"`
683 }
684
685 func (s *ChangeList) MarshalJSON() ([]byte, error) {
686 type NoMethod ChangeList
687 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
688 }
689
690
691 type Channel struct {
692
693 Address string `json:"address,omitempty"`
694
695
696 Expiration int64 `json:"expiration,omitempty,string"`
697
698 Id string `json:"id,omitempty"`
699
700
701 Kind string `json:"kind,omitempty"`
702
703
704 Params map[string]string `json:"params,omitempty"`
705
706 Payload bool `json:"payload,omitempty"`
707
708
709 ResourceId string `json:"resourceId,omitempty"`
710
711 ResourceUri string `json:"resourceUri,omitempty"`
712
713
714 Token string `json:"token,omitempty"`
715
716
717 Type string `json:"type,omitempty"`
718
719
720 googleapi.ServerResponse `json:"-"`
721
722
723
724
725
726 ForceSendFields []string `json:"-"`
727
728
729
730
731 NullFields []string `json:"-"`
732 }
733
734 func (s *Channel) MarshalJSON() ([]byte, error) {
735 type NoMethod Channel
736 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
737 }
738
739
740
741
742 type Comment struct {
743
744
745
746 Anchor string `json:"anchor,omitempty"`
747
748
749 Author *User `json:"author,omitempty"`
750
751
752 Content string `json:"content,omitempty"`
753
754 CreatedTime string `json:"createdTime,omitempty"`
755
756
757 Deleted bool `json:"deleted,omitempty"`
758
759 HtmlContent string `json:"htmlContent,omitempty"`
760
761 Id string `json:"id,omitempty"`
762
763
764 Kind string `json:"kind,omitempty"`
765
766
767 ModifiedTime string `json:"modifiedTime,omitempty"`
768
769
770
771 QuotedFileContent *CommentQuotedFileContent `json:"quotedFileContent,omitempty"`
772
773
774 Replies []*Reply `json:"replies,omitempty"`
775
776
777 Resolved bool `json:"resolved,omitempty"`
778
779
780 googleapi.ServerResponse `json:"-"`
781
782
783
784
785
786 ForceSendFields []string `json:"-"`
787
788
789
790
791 NullFields []string `json:"-"`
792 }
793
794 func (s *Comment) MarshalJSON() ([]byte, error) {
795 type NoMethod Comment
796 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
797 }
798
799
800
801
802 type CommentQuotedFileContent struct {
803
804 MimeType string `json:"mimeType,omitempty"`
805
806
807 Value string `json:"value,omitempty"`
808
809
810
811
812
813 ForceSendFields []string `json:"-"`
814
815
816
817
818 NullFields []string `json:"-"`
819 }
820
821 func (s *CommentQuotedFileContent) MarshalJSON() ([]byte, error) {
822 type NoMethod CommentQuotedFileContent
823 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
824 }
825
826
827 type CommentList struct {
828
829
830 Comments []*Comment `json:"comments,omitempty"`
831
832
833 Kind string `json:"kind,omitempty"`
834
835
836
837
838
839
840 NextPageToken string `json:"nextPageToken,omitempty"`
841
842
843 googleapi.ServerResponse `json:"-"`
844
845
846
847
848
849 ForceSendFields []string `json:"-"`
850
851
852
853
854 NullFields []string `json:"-"`
855 }
856
857 func (s *CommentList) MarshalJSON() ([]byte, error) {
858 type NoMethod CommentList
859 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
860 }
861
862
863 type ContentRestriction struct {
864
865
866
867 OwnerRestricted bool `json:"ownerRestricted,omitempty"`
868
869
870
871 ReadOnly bool `json:"readOnly,omitempty"`
872
873
874 Reason string `json:"reason,omitempty"`
875
876
877 RestrictingUser *User `json:"restrictingUser,omitempty"`
878
879
880 RestrictionTime string `json:"restrictionTime,omitempty"`
881
882
883
884 SystemRestricted bool `json:"systemRestricted,omitempty"`
885
886
887 Type string `json:"type,omitempty"`
888
889
890
891
892
893 ForceSendFields []string `json:"-"`
894
895
896
897
898 NullFields []string `json:"-"`
899 }
900
901 func (s *ContentRestriction) MarshalJSON() ([]byte, error) {
902 type NoMethod ContentRestriction
903 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
904 }
905
906
907
908
909 type Drive struct {
910
911
912
913
914
915 BackgroundImageFile *DriveBackgroundImageFile `json:"backgroundImageFile,omitempty"`
916
917
918 BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
919
920
921 Capabilities *DriveCapabilities `json:"capabilities,omitempty"`
922
923
924 ColorRgb string `json:"colorRgb,omitempty"`
925
926
927 CreatedTime string `json:"createdTime,omitempty"`
928
929 Hidden bool `json:"hidden,omitempty"`
930
931
932 Id string `json:"id,omitempty"`
933
934
935 Kind string `json:"kind,omitempty"`
936
937 Name string `json:"name,omitempty"`
938
939
940
941 OrgUnitId string `json:"orgUnitId,omitempty"`
942
943
944
945
946 Restrictions *DriveRestrictions `json:"restrictions,omitempty"`
947
948
949
950
951
952
953 ThemeId string `json:"themeId,omitempty"`
954
955
956 googleapi.ServerResponse `json:"-"`
957
958
959
960
961
962 ForceSendFields []string `json:"-"`
963
964
965
966
967 NullFields []string `json:"-"`
968 }
969
970 func (s *Drive) MarshalJSON() ([]byte, error) {
971 type NoMethod Drive
972 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
973 }
974
975
976
977
978
979
980 type DriveBackgroundImageFile struct {
981
982 Id string `json:"id,omitempty"`
983
984
985
986
987
988 Width float64 `json:"width,omitempty"`
989
990
991
992
993
994 XCoordinate float64 `json:"xCoordinate,omitempty"`
995
996
997
998
999
1000 YCoordinate float64 `json:"yCoordinate,omitempty"`
1001
1002
1003
1004
1005
1006 ForceSendFields []string `json:"-"`
1007
1008
1009
1010
1011 NullFields []string `json:"-"`
1012 }
1013
1014 func (s *DriveBackgroundImageFile) MarshalJSON() ([]byte, error) {
1015 type NoMethod DriveBackgroundImageFile
1016 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1017 }
1018
1019 func (s *DriveBackgroundImageFile) UnmarshalJSON(data []byte) error {
1020 type NoMethod DriveBackgroundImageFile
1021 var s1 struct {
1022 Width gensupport.JSONFloat64 `json:"width"`
1023 XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"`
1024 YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"`
1025 *NoMethod
1026 }
1027 s1.NoMethod = (*NoMethod)(s)
1028 if err := json.Unmarshal(data, &s1); err != nil {
1029 return err
1030 }
1031 s.Width = float64(s1.Width)
1032 s.XCoordinate = float64(s1.XCoordinate)
1033 s.YCoordinate = float64(s1.YCoordinate)
1034 return nil
1035 }
1036
1037
1038
1039 type DriveCapabilities struct {
1040
1041
1042 CanAddChildren bool `json:"canAddChildren,omitempty"`
1043
1044
1045
1046 CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"`
1047
1048
1049 CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"`
1050
1051
1052 CanChangeDriveBackground bool `json:"canChangeDriveBackground,omitempty"`
1053
1054
1055 CanChangeDriveMembersOnlyRestriction bool `json:"canChangeDriveMembersOnlyRestriction,omitempty"`
1056
1057
1058
1059
1060 CanChangeSharingFoldersRequiresOrganizerPermissionRestriction bool `json:"canChangeSharingFoldersRequiresOrganizerPermissionRestriction,omitempty"`
1061
1062
1063 CanComment bool `json:"canComment,omitempty"`
1064
1065
1066 CanCopy bool `json:"canCopy,omitempty"`
1067
1068
1069 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"`
1070
1071
1072
1073 CanDeleteDrive bool `json:"canDeleteDrive,omitempty"`
1074
1075
1076 CanDownload bool `json:"canDownload,omitempty"`
1077
1078
1079 CanEdit bool `json:"canEdit,omitempty"`
1080
1081
1082 CanListChildren bool `json:"canListChildren,omitempty"`
1083
1084
1085 CanManageMembers bool `json:"canManageMembers,omitempty"`
1086
1087
1088 CanReadRevisions bool `json:"canReadRevisions,omitempty"`
1089
1090
1091 CanRename bool `json:"canRename,omitempty"`
1092
1093
1094 CanRenameDrive bool `json:"canRenameDrive,omitempty"`
1095
1096
1097 CanResetDriveRestrictions bool `json:"canResetDriveRestrictions,omitempty"`
1098
1099
1100 CanShare bool `json:"canShare,omitempty"`
1101
1102
1103 CanTrashChildren bool `json:"canTrashChildren,omitempty"`
1104
1105
1106
1107
1108
1109 ForceSendFields []string `json:"-"`
1110
1111
1112
1113
1114 NullFields []string `json:"-"`
1115 }
1116
1117 func (s *DriveCapabilities) MarshalJSON() ([]byte, error) {
1118 type NoMethod DriveCapabilities
1119 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1120 }
1121
1122
1123
1124
1125
1126 type DriveRestrictions struct {
1127
1128
1129 AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"`
1130
1131
1132
1133
1134 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"`
1135
1136
1137
1138
1139 DomainUsersOnly bool `json:"domainUsersOnly,omitempty"`
1140
1141
1142 DriveMembersOnly bool `json:"driveMembersOnly,omitempty"`
1143
1144
1145
1146 SharingFoldersRequiresOrganizerPermission bool `json:"sharingFoldersRequiresOrganizerPermission,omitempty"`
1147
1148
1149
1150
1151
1152 ForceSendFields []string `json:"-"`
1153
1154
1155
1156
1157 NullFields []string `json:"-"`
1158 }
1159
1160 func (s *DriveRestrictions) MarshalJSON() ([]byte, error) {
1161 type NoMethod DriveRestrictions
1162 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1163 }
1164
1165
1166 type DriveList struct {
1167
1168
1169 Drives []*Drive `json:"drives,omitempty"`
1170
1171
1172 Kind string `json:"kind,omitempty"`
1173
1174
1175
1176
1177
1178
1179 NextPageToken string `json:"nextPageToken,omitempty"`
1180
1181
1182 googleapi.ServerResponse `json:"-"`
1183
1184
1185
1186
1187
1188 ForceSendFields []string `json:"-"`
1189
1190
1191
1192
1193 NullFields []string `json:"-"`
1194 }
1195
1196 func (s *DriveList) MarshalJSON() ([]byte, error) {
1197 type NoMethod DriveList
1198 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1199 }
1200
1201
1202
1203
1204 type File struct {
1205
1206
1207
1208
1209
1210
1211 AppProperties map[string]string `json:"appProperties,omitempty"`
1212
1213
1214 Capabilities *FileCapabilities `json:"capabilities,omitempty"`
1215
1216
1217 ContentHints *FileContentHints `json:"contentHints,omitempty"`
1218
1219
1220 ContentRestrictions []*ContentRestriction `json:"contentRestrictions,omitempty"`
1221
1222
1223 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"`
1224
1225 CreatedTime string `json:"createdTime,omitempty"`
1226
1227 Description string `json:"description,omitempty"`
1228
1229
1230 DriveId string `json:"driveId,omitempty"`
1231
1232
1233 ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"`
1234
1235
1236 ExportLinks map[string]string `json:"exportLinks,omitempty"`
1237
1238
1239 FileExtension string `json:"fileExtension,omitempty"`
1240
1241
1242
1243
1244 FolderColorRgb string `json:"folderColorRgb,omitempty"`
1245
1246
1247
1248
1249
1250 FullFileExtension string `json:"fullFileExtension,omitempty"`
1251
1252
1253 HasAugmentedPermissions bool `json:"hasAugmentedPermissions,omitempty"`
1254
1255
1256
1257 HasThumbnail bool `json:"hasThumbnail,omitempty"`
1258
1259
1260 HeadRevisionId string `json:"headRevisionId,omitempty"`
1261
1262 IconLink string `json:"iconLink,omitempty"`
1263
1264 Id string `json:"id,omitempty"`
1265
1266
1267 ImageMediaMetadata *FileImageMediaMetadata `json:"imageMediaMetadata,omitempty"`
1268
1269
1270 IsAppAuthorized bool `json:"isAppAuthorized,omitempty"`
1271
1272
1273 Kind string `json:"kind,omitempty"`
1274
1275 LabelInfo *FileLabelInfo `json:"labelInfo,omitempty"`
1276
1277 LastModifyingUser *User `json:"lastModifyingUser,omitempty"`
1278
1279
1280 LinkShareMetadata *FileLinkShareMetadata `json:"linkShareMetadata,omitempty"`
1281
1282
1283 Md5Checksum string `json:"md5Checksum,omitempty"`
1284
1285
1286
1287
1288
1289 MimeType string `json:"mimeType,omitempty"`
1290
1291 ModifiedByMe bool `json:"modifiedByMe,omitempty"`
1292
1293
1294 ModifiedByMeTime string `json:"modifiedByMeTime,omitempty"`
1295
1296
1297
1298 ModifiedTime string `json:"modifiedTime,omitempty"`
1299
1300
1301
1302
1303 Name string `json:"name,omitempty"`
1304
1305
1306
1307 OriginalFilename string `json:"originalFilename,omitempty"`
1308
1309
1310 OwnedByMe bool `json:"ownedByMe,omitempty"`
1311
1312
1313
1314 Owners []*User `json:"owners,omitempty"`
1315
1316
1317
1318
1319
1320
1321 Parents []string `json:"parents,omitempty"`
1322
1323
1324 PermissionIds []string `json:"permissionIds,omitempty"`
1325
1326
1327
1328 Permissions []*Permission `json:"permissions,omitempty"`
1329
1330
1331
1332 Properties map[string]string `json:"properties,omitempty"`
1333
1334
1335
1336 QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"`
1337
1338 ResourceKey string `json:"resourceKey,omitempty"`
1339
1340
1341
1342 Sha1Checksum string `json:"sha1Checksum,omitempty"`
1343
1344
1345
1346 Sha256Checksum string `json:"sha256Checksum,omitempty"`
1347
1348
1349 Shared bool `json:"shared,omitempty"`
1350
1351
1352 SharedWithMeTime string `json:"sharedWithMeTime,omitempty"`
1353
1354
1355 SharingUser *User `json:"sharingUser,omitempty"`
1356
1357
1358 ShortcutDetails *FileShortcutDetails `json:"shortcutDetails,omitempty"`
1359
1360
1361 Size int64 `json:"size,omitempty,string"`
1362
1363
1364 Spaces []string `json:"spaces,omitempty"`
1365
1366 Starred bool `json:"starred,omitempty"`
1367
1368 TeamDriveId string `json:"teamDriveId,omitempty"`
1369
1370
1371
1372
1373
1374 ThumbnailLink string `json:"thumbnailLink,omitempty"`
1375
1376
1377 ThumbnailVersion int64 `json:"thumbnailVersion,omitempty,string"`
1378
1379
1380
1381 Trashed bool `json:"trashed,omitempty"`
1382
1383
1384 TrashedTime string `json:"trashedTime,omitempty"`
1385
1386
1387 TrashingUser *User `json:"trashingUser,omitempty"`
1388
1389
1390
1391 Version int64 `json:"version,omitempty,string"`
1392
1393
1394 VideoMediaMetadata *FileVideoMediaMetadata `json:"videoMediaMetadata,omitempty"`
1395
1396 ViewedByMe bool `json:"viewedByMe,omitempty"`
1397
1398
1399 ViewedByMeTime string `json:"viewedByMeTime,omitempty"`
1400
1401
1402 ViewersCanCopyContent bool `json:"viewersCanCopyContent,omitempty"`
1403
1404
1405
1406 WebContentLink string `json:"webContentLink,omitempty"`
1407
1408
1409 WebViewLink string `json:"webViewLink,omitempty"`
1410
1411
1412 WritersCanShare bool `json:"writersCanShare,omitempty"`
1413
1414
1415 googleapi.ServerResponse `json:"-"`
1416
1417
1418
1419
1420
1421 ForceSendFields []string `json:"-"`
1422
1423
1424
1425
1426 NullFields []string `json:"-"`
1427 }
1428
1429 func (s *File) MarshalJSON() ([]byte, error) {
1430 type NoMethod File
1431 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1432 }
1433
1434
1435
1436
1437 type FileCapabilities struct {
1438
1439
1440 CanAcceptOwnership bool `json:"canAcceptOwnership,omitempty"`
1441
1442
1443 CanAddChildren bool `json:"canAddChildren,omitempty"`
1444
1445
1446
1447
1448 CanAddFolderFromAnotherDrive bool `json:"canAddFolderFromAnotherDrive,omitempty"`
1449
1450
1451
1452 CanAddMyDriveParent bool `json:"canAddMyDriveParent,omitempty"`
1453
1454
1455 CanChangeCopyRequiresWriterPermission bool `json:"canChangeCopyRequiresWriterPermission,omitempty"`
1456
1457
1458 CanChangeSecurityUpdateEnabled bool `json:"canChangeSecurityUpdateEnabled,omitempty"`
1459
1460 CanChangeViewersCanCopyContent bool `json:"canChangeViewersCanCopyContent,omitempty"`
1461
1462 CanComment bool `json:"canComment,omitempty"`
1463
1464
1465
1466 CanCopy bool `json:"canCopy,omitempty"`
1467
1468 CanDelete bool `json:"canDelete,omitempty"`
1469
1470
1471
1472 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"`
1473
1474 CanDownload bool `json:"canDownload,omitempty"`
1475
1476
1477
1478 CanEdit bool `json:"canEdit,omitempty"`
1479
1480
1481 CanListChildren bool `json:"canListChildren,omitempty"`
1482
1483
1484 CanModifyContent bool `json:"canModifyContent,omitempty"`
1485
1486
1487
1488 CanModifyContentRestriction bool `json:"canModifyContentRestriction,omitempty"`
1489
1490
1491 CanModifyEditorContentRestriction bool `json:"canModifyEditorContentRestriction,omitempty"`
1492
1493
1494 CanModifyLabels bool `json:"canModifyLabels,omitempty"`
1495
1496
1497 CanModifyOwnerContentRestriction bool `json:"canModifyOwnerContentRestriction,omitempty"`
1498
1499
1500
1501 CanMoveChildrenOutOfDrive bool `json:"canMoveChildrenOutOfDrive,omitempty"`
1502
1503
1504 CanMoveChildrenOutOfTeamDrive bool `json:"canMoveChildrenOutOfTeamDrive,omitempty"`
1505
1506
1507
1508
1509 CanMoveChildrenWithinDrive bool `json:"canMoveChildrenWithinDrive,omitempty"`
1510
1511
1512 CanMoveChildrenWithinTeamDrive bool `json:"canMoveChildrenWithinTeamDrive,omitempty"`
1513
1514
1515 CanMoveItemIntoTeamDrive bool `json:"canMoveItemIntoTeamDrive,omitempty"`
1516
1517
1518
1519
1520 CanMoveItemOutOfDrive bool `json:"canMoveItemOutOfDrive,omitempty"`
1521
1522
1523 CanMoveItemOutOfTeamDrive bool `json:"canMoveItemOutOfTeamDrive,omitempty"`
1524
1525
1526
1527
1528 CanMoveItemWithinDrive bool `json:"canMoveItemWithinDrive,omitempty"`
1529
1530
1531 CanMoveItemWithinTeamDrive bool `json:"canMoveItemWithinTeamDrive,omitempty"`
1532
1533
1534 CanMoveTeamDriveItem bool `json:"canMoveTeamDriveItem,omitempty"`
1535
1536
1537 CanReadDrive bool `json:"canReadDrive,omitempty"`
1538
1539
1540 CanReadLabels bool `json:"canReadLabels,omitempty"`
1541
1542
1543
1544
1545 CanReadRevisions bool `json:"canReadRevisions,omitempty"`
1546
1547 CanReadTeamDrive bool `json:"canReadTeamDrive,omitempty"`
1548
1549
1550
1551
1552 CanRemoveChildren bool `json:"canRemoveChildren,omitempty"`
1553
1554
1555 CanRemoveContentRestriction bool `json:"canRemoveContentRestriction,omitempty"`
1556
1557
1558
1559 CanRemoveMyDriveParent bool `json:"canRemoveMyDriveParent,omitempty"`
1560
1561 CanRename bool `json:"canRename,omitempty"`
1562
1563
1564 CanShare bool `json:"canShare,omitempty"`
1565
1566 CanTrash bool `json:"canTrash,omitempty"`
1567
1568
1569
1570 CanTrashChildren bool `json:"canTrashChildren,omitempty"`
1571
1572
1573 CanUntrash bool `json:"canUntrash,omitempty"`
1574
1575
1576
1577
1578
1579 ForceSendFields []string `json:"-"`
1580
1581
1582
1583
1584 NullFields []string `json:"-"`
1585 }
1586
1587 func (s *FileCapabilities) MarshalJSON() ([]byte, error) {
1588 type NoMethod FileCapabilities
1589 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1590 }
1591
1592
1593
1594 type FileContentHints struct {
1595
1596
1597 IndexableText string `json:"indexableText,omitempty"`
1598
1599
1600 Thumbnail *FileContentHintsThumbnail `json:"thumbnail,omitempty"`
1601
1602
1603
1604
1605
1606 ForceSendFields []string `json:"-"`
1607
1608
1609
1610
1611 NullFields []string `json:"-"`
1612 }
1613
1614 func (s *FileContentHints) MarshalJSON() ([]byte, error) {
1615 type NoMethod FileContentHints
1616 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1617 }
1618
1619
1620
1621 type FileContentHintsThumbnail struct {
1622
1623 Image string `json:"image,omitempty"`
1624
1625 MimeType string `json:"mimeType,omitempty"`
1626
1627
1628
1629
1630
1631 ForceSendFields []string `json:"-"`
1632
1633
1634
1635
1636 NullFields []string `json:"-"`
1637 }
1638
1639 func (s *FileContentHintsThumbnail) MarshalJSON() ([]byte, error) {
1640 type NoMethod FileContentHintsThumbnail
1641 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1642 }
1643
1644
1645
1646 type FileImageMediaMetadata struct {
1647
1648 Aperture float64 `json:"aperture,omitempty"`
1649
1650 CameraMake string `json:"cameraMake,omitempty"`
1651
1652 CameraModel string `json:"cameraModel,omitempty"`
1653
1654 ColorSpace string `json:"colorSpace,omitempty"`
1655
1656 ExposureBias float64 `json:"exposureBias,omitempty"`
1657
1658 ExposureMode string `json:"exposureMode,omitempty"`
1659
1660 ExposureTime float64 `json:"exposureTime,omitempty"`
1661
1662 FlashUsed bool `json:"flashUsed,omitempty"`
1663
1664
1665 FocalLength float64 `json:"focalLength,omitempty"`
1666
1667 Height int64 `json:"height,omitempty"`
1668
1669 IsoSpeed int64 `json:"isoSpeed,omitempty"`
1670
1671 Lens string `json:"lens,omitempty"`
1672
1673 Location *FileImageMediaMetadataLocation `json:"location,omitempty"`
1674
1675
1676 MaxApertureValue float64 `json:"maxApertureValue,omitempty"`
1677
1678 MeteringMode string `json:"meteringMode,omitempty"`
1679
1680
1681 Rotation int64 `json:"rotation,omitempty"`
1682
1683 Sensor string `json:"sensor,omitempty"`
1684
1685
1686 SubjectDistance int64 `json:"subjectDistance,omitempty"`
1687
1688 Time string `json:"time,omitempty"`
1689
1690 WhiteBalance string `json:"whiteBalance,omitempty"`
1691
1692 Width int64 `json:"width,omitempty"`
1693
1694
1695
1696
1697
1698 ForceSendFields []string `json:"-"`
1699
1700
1701
1702
1703 NullFields []string `json:"-"`
1704 }
1705
1706 func (s *FileImageMediaMetadata) MarshalJSON() ([]byte, error) {
1707 type NoMethod FileImageMediaMetadata
1708 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1709 }
1710
1711 func (s *FileImageMediaMetadata) UnmarshalJSON(data []byte) error {
1712 type NoMethod FileImageMediaMetadata
1713 var s1 struct {
1714 Aperture gensupport.JSONFloat64 `json:"aperture"`
1715 ExposureBias gensupport.JSONFloat64 `json:"exposureBias"`
1716 ExposureTime gensupport.JSONFloat64 `json:"exposureTime"`
1717 FocalLength gensupport.JSONFloat64 `json:"focalLength"`
1718 MaxApertureValue gensupport.JSONFloat64 `json:"maxApertureValue"`
1719 *NoMethod
1720 }
1721 s1.NoMethod = (*NoMethod)(s)
1722 if err := json.Unmarshal(data, &s1); err != nil {
1723 return err
1724 }
1725 s.Aperture = float64(s1.Aperture)
1726 s.ExposureBias = float64(s1.ExposureBias)
1727 s.ExposureTime = float64(s1.ExposureTime)
1728 s.FocalLength = float64(s1.FocalLength)
1729 s.MaxApertureValue = float64(s1.MaxApertureValue)
1730 return nil
1731 }
1732
1733
1734
1735 type FileImageMediaMetadataLocation struct {
1736
1737 Altitude float64 `json:"altitude,omitempty"`
1738
1739 Latitude float64 `json:"latitude,omitempty"`
1740
1741 Longitude float64 `json:"longitude,omitempty"`
1742
1743
1744
1745
1746
1747 ForceSendFields []string `json:"-"`
1748
1749
1750
1751
1752 NullFields []string `json:"-"`
1753 }
1754
1755 func (s *FileImageMediaMetadataLocation) MarshalJSON() ([]byte, error) {
1756 type NoMethod FileImageMediaMetadataLocation
1757 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1758 }
1759
1760 func (s *FileImageMediaMetadataLocation) UnmarshalJSON(data []byte) error {
1761 type NoMethod FileImageMediaMetadataLocation
1762 var s1 struct {
1763 Altitude gensupport.JSONFloat64 `json:"altitude"`
1764 Latitude gensupport.JSONFloat64 `json:"latitude"`
1765 Longitude gensupport.JSONFloat64 `json:"longitude"`
1766 *NoMethod
1767 }
1768 s1.NoMethod = (*NoMethod)(s)
1769 if err := json.Unmarshal(data, &s1); err != nil {
1770 return err
1771 }
1772 s.Altitude = float64(s1.Altitude)
1773 s.Latitude = float64(s1.Latitude)
1774 s.Longitude = float64(s1.Longitude)
1775 return nil
1776 }
1777
1778
1779 type FileLabelInfo struct {
1780
1781
1782 Labels []*Label `json:"labels,omitempty"`
1783
1784
1785
1786
1787
1788 ForceSendFields []string `json:"-"`
1789
1790
1791
1792
1793 NullFields []string `json:"-"`
1794 }
1795
1796 func (s *FileLabelInfo) MarshalJSON() ([]byte, error) {
1797 type NoMethod FileLabelInfo
1798 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1799 }
1800
1801
1802
1803 type FileLinkShareMetadata struct {
1804
1805
1806 SecurityUpdateEligible bool `json:"securityUpdateEligible,omitempty"`
1807
1808
1809 SecurityUpdateEnabled bool `json:"securityUpdateEnabled,omitempty"`
1810
1811
1812
1813
1814
1815 ForceSendFields []string `json:"-"`
1816
1817
1818
1819
1820 NullFields []string `json:"-"`
1821 }
1822
1823 func (s *FileLinkShareMetadata) MarshalJSON() ([]byte, error) {
1824 type NoMethod FileLinkShareMetadata
1825 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1826 }
1827
1828
1829
1830
1831 type FileShortcutDetails struct {
1832
1833 TargetId string `json:"targetId,omitempty"`
1834
1835
1836
1837 TargetMimeType string `json:"targetMimeType,omitempty"`
1838
1839 TargetResourceKey string `json:"targetResourceKey,omitempty"`
1840
1841
1842
1843
1844
1845 ForceSendFields []string `json:"-"`
1846
1847
1848
1849
1850 NullFields []string `json:"-"`
1851 }
1852
1853 func (s *FileShortcutDetails) MarshalJSON() ([]byte, error) {
1854 type NoMethod FileShortcutDetails
1855 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1856 }
1857
1858
1859
1860 type FileVideoMediaMetadata struct {
1861
1862 DurationMillis int64 `json:"durationMillis,omitempty,string"`
1863
1864 Height int64 `json:"height,omitempty"`
1865
1866 Width int64 `json:"width,omitempty"`
1867
1868
1869
1870
1871
1872 ForceSendFields []string `json:"-"`
1873
1874
1875
1876
1877 NullFields []string `json:"-"`
1878 }
1879
1880 func (s *FileVideoMediaMetadata) MarshalJSON() ([]byte, error) {
1881 type NoMethod FileVideoMediaMetadata
1882 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1883 }
1884
1885
1886 type FileList struct {
1887
1888
1889 Files []*File `json:"files,omitempty"`
1890
1891
1892
1893
1894
1895
1896 IncompleteSearch bool `json:"incompleteSearch,omitempty"`
1897
1898
1899 Kind string `json:"kind,omitempty"`
1900
1901
1902
1903
1904
1905
1906 NextPageToken string `json:"nextPageToken,omitempty"`
1907
1908
1909 googleapi.ServerResponse `json:"-"`
1910
1911
1912
1913
1914
1915 ForceSendFields []string `json:"-"`
1916
1917
1918
1919
1920 NullFields []string `json:"-"`
1921 }
1922
1923 func (s *FileList) MarshalJSON() ([]byte, error) {
1924 type NoMethod FileList
1925 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1926 }
1927
1928
1929
1930 type GeneratedIds struct {
1931
1932 Ids []string `json:"ids,omitempty"`
1933
1934
1935 Kind string `json:"kind,omitempty"`
1936
1937 Space string `json:"space,omitempty"`
1938
1939
1940 googleapi.ServerResponse `json:"-"`
1941
1942
1943
1944
1945
1946 ForceSendFields []string `json:"-"`
1947
1948
1949
1950
1951 NullFields []string `json:"-"`
1952 }
1953
1954 func (s *GeneratedIds) MarshalJSON() ([]byte, error) {
1955 type NoMethod GeneratedIds
1956 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1957 }
1958
1959
1960 type Label struct {
1961
1962 Fields map[string]LabelField `json:"fields,omitempty"`
1963
1964 Id string `json:"id,omitempty"`
1965
1966 Kind string `json:"kind,omitempty"`
1967
1968 RevisionId string `json:"revisionId,omitempty"`
1969
1970
1971
1972
1973
1974 ForceSendFields []string `json:"-"`
1975
1976
1977
1978
1979 NullFields []string `json:"-"`
1980 }
1981
1982 func (s *Label) MarshalJSON() ([]byte, error) {
1983 type NoMethod Label
1984 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1985 }
1986
1987
1988 type LabelField struct {
1989
1990
1991 DateString []string `json:"dateString,omitempty"`
1992
1993 Id string `json:"id,omitempty"`
1994
1995 Integer googleapi.Int64s `json:"integer,omitempty"`
1996
1997 Kind string `json:"kind,omitempty"`
1998
1999 Selection []string `json:"selection,omitempty"`
2000
2001 Text []string `json:"text,omitempty"`
2002
2003 User []*User `json:"user,omitempty"`
2004
2005
2006
2007 ValueType string `json:"valueType,omitempty"`
2008
2009
2010
2011
2012
2013 ForceSendFields []string `json:"-"`
2014
2015
2016
2017
2018 NullFields []string `json:"-"`
2019 }
2020
2021 func (s *LabelField) MarshalJSON() ([]byte, error) {
2022 type NoMethod LabelField
2023 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2024 }
2025
2026
2027 type LabelFieldModification struct {
2028
2029 FieldId string `json:"fieldId,omitempty"`
2030
2031 Kind string `json:"kind,omitempty"`
2032
2033
2034 SetDateValues []string `json:"setDateValues,omitempty"`
2035
2036
2037 SetIntegerValues googleapi.Int64s `json:"setIntegerValues,omitempty"`
2038
2039 SetSelectionValues []string `json:"setSelectionValues,omitempty"`
2040
2041 SetTextValues []string `json:"setTextValues,omitempty"`
2042
2043
2044 SetUserValues []string `json:"setUserValues,omitempty"`
2045
2046 UnsetValues bool `json:"unsetValues,omitempty"`
2047
2048
2049
2050
2051
2052 ForceSendFields []string `json:"-"`
2053
2054
2055
2056
2057 NullFields []string `json:"-"`
2058 }
2059
2060 func (s *LabelFieldModification) MarshalJSON() ([]byte, error) {
2061 type NoMethod LabelFieldModification
2062 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2063 }
2064
2065
2066 type LabelList struct {
2067
2068 Kind string `json:"kind,omitempty"`
2069
2070 Labels []*Label `json:"labels,omitempty"`
2071
2072
2073
2074
2075
2076
2077 NextPageToken string `json:"nextPageToken,omitempty"`
2078
2079
2080 googleapi.ServerResponse `json:"-"`
2081
2082
2083
2084
2085
2086 ForceSendFields []string `json:"-"`
2087
2088
2089
2090
2091 NullFields []string `json:"-"`
2092 }
2093
2094 func (s *LabelList) MarshalJSON() ([]byte, error) {
2095 type NoMethod LabelList
2096 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2097 }
2098
2099
2100
2101
2102 type LabelModification struct {
2103
2104 FieldModifications []*LabelFieldModification `json:"fieldModifications,omitempty"`
2105
2106 Kind string `json:"kind,omitempty"`
2107
2108 LabelId string `json:"labelId,omitempty"`
2109
2110 RemoveLabel bool `json:"removeLabel,omitempty"`
2111
2112
2113
2114
2115
2116 ForceSendFields []string `json:"-"`
2117
2118
2119
2120
2121 NullFields []string `json:"-"`
2122 }
2123
2124 func (s *LabelModification) MarshalJSON() ([]byte, error) {
2125 type NoMethod LabelModification
2126 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2127 }
2128
2129
2130
2131
2132 type ModifyLabelsRequest struct {
2133
2134 Kind string `json:"kind,omitempty"`
2135
2136
2137 LabelModifications []*LabelModification `json:"labelModifications,omitempty"`
2138
2139
2140
2141
2142
2143 ForceSendFields []string `json:"-"`
2144
2145
2146
2147
2148 NullFields []string `json:"-"`
2149 }
2150
2151 func (s *ModifyLabelsRequest) MarshalJSON() ([]byte, error) {
2152 type NoMethod ModifyLabelsRequest
2153 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2154 }
2155
2156
2157
2158 type ModifyLabelsResponse struct {
2159
2160 Kind string `json:"kind,omitempty"`
2161
2162
2163 ModifiedLabels []*Label `json:"modifiedLabels,omitempty"`
2164
2165
2166 googleapi.ServerResponse `json:"-"`
2167
2168
2169
2170
2171
2172 ForceSendFields []string `json:"-"`
2173
2174
2175
2176
2177 NullFields []string `json:"-"`
2178 }
2179
2180 func (s *ModifyLabelsResponse) MarshalJSON() ([]byte, error) {
2181 type NoMethod ModifyLabelsResponse
2182 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2183 }
2184
2185
2186
2187
2188
2189
2190 type Permission struct {
2191
2192
2193
2194 AllowFileDiscovery bool `json:"allowFileDiscovery,omitempty"`
2195
2196
2197 Deleted bool `json:"deleted,omitempty"`
2198
2199
2200
2201
2202
2203
2204 DisplayName string `json:"displayName,omitempty"`
2205
2206 Domain string `json:"domain,omitempty"`
2207
2208
2209 EmailAddress string `json:"emailAddress,omitempty"`
2210
2211
2212
2213
2214 ExpirationTime string `json:"expirationTime,omitempty"`
2215
2216
2217
2218 Id string `json:"id,omitempty"`
2219
2220
2221 Kind string `json:"kind,omitempty"`
2222
2223
2224
2225 PendingOwner bool `json:"pendingOwner,omitempty"`
2226
2227
2228
2229 PermissionDetails []*PermissionPermissionDetails `json:"permissionDetails,omitempty"`
2230
2231 PhotoLink string `json:"photoLink,omitempty"`
2232
2233
2234
2235 Role string `json:"role,omitempty"`
2236
2237
2238 TeamDrivePermissionDetails []*PermissionTeamDrivePermissionDetails `json:"teamDrivePermissionDetails,omitempty"`
2239
2240
2241
2242
2243
2244 Type string `json:"type,omitempty"`
2245
2246
2247 View string `json:"view,omitempty"`
2248
2249
2250 googleapi.ServerResponse `json:"-"`
2251
2252
2253
2254
2255
2256 ForceSendFields []string `json:"-"`
2257
2258
2259
2260
2261 NullFields []string `json:"-"`
2262 }
2263
2264 func (s *Permission) MarshalJSON() ([]byte, error) {
2265 type NoMethod Permission
2266 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2267 }
2268
2269 type PermissionPermissionDetails struct {
2270
2271
2272 Inherited bool `json:"inherited,omitempty"`
2273
2274
2275 InheritedFrom string `json:"inheritedFrom,omitempty"`
2276
2277
2278
2279 PermissionType string `json:"permissionType,omitempty"`
2280
2281
2282
2283 Role string `json:"role,omitempty"`
2284
2285
2286
2287
2288
2289 ForceSendFields []string `json:"-"`
2290
2291
2292
2293
2294 NullFields []string `json:"-"`
2295 }
2296
2297 func (s *PermissionPermissionDetails) MarshalJSON() ([]byte, error) {
2298 type NoMethod PermissionPermissionDetails
2299 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2300 }
2301
2302 type PermissionTeamDrivePermissionDetails struct {
2303
2304
2305 Inherited bool `json:"inherited,omitempty"`
2306
2307
2308 InheritedFrom string `json:"inheritedFrom,omitempty"`
2309
2310 Role string `json:"role,omitempty"`
2311
2312
2313 TeamDrivePermissionType string `json:"teamDrivePermissionType,omitempty"`
2314
2315
2316
2317
2318
2319 ForceSendFields []string `json:"-"`
2320
2321
2322
2323
2324 NullFields []string `json:"-"`
2325 }
2326
2327 func (s *PermissionTeamDrivePermissionDetails) MarshalJSON() ([]byte, error) {
2328 type NoMethod PermissionTeamDrivePermissionDetails
2329 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2330 }
2331
2332
2333 type PermissionList struct {
2334
2335
2336 Kind string `json:"kind,omitempty"`
2337
2338
2339
2340
2341
2342
2343 NextPageToken string `json:"nextPageToken,omitempty"`
2344
2345
2346
2347 Permissions []*Permission `json:"permissions,omitempty"`
2348
2349
2350 googleapi.ServerResponse `json:"-"`
2351
2352
2353
2354
2355
2356 ForceSendFields []string `json:"-"`
2357
2358
2359
2360
2361 NullFields []string `json:"-"`
2362 }
2363
2364 func (s *PermissionList) MarshalJSON() ([]byte, error) {
2365 type NoMethod PermissionList
2366 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2367 }
2368
2369
2370
2371
2372 type Reply struct {
2373
2374
2375 Action string `json:"action,omitempty"`
2376
2377
2378 Author *User `json:"author,omitempty"`
2379
2380
2381
2382 Content string `json:"content,omitempty"`
2383
2384 CreatedTime string `json:"createdTime,omitempty"`
2385
2386
2387 Deleted bool `json:"deleted,omitempty"`
2388
2389 HtmlContent string `json:"htmlContent,omitempty"`
2390
2391 Id string `json:"id,omitempty"`
2392
2393
2394 Kind string `json:"kind,omitempty"`
2395
2396 ModifiedTime string `json:"modifiedTime,omitempty"`
2397
2398
2399 googleapi.ServerResponse `json:"-"`
2400
2401
2402
2403
2404
2405 ForceSendFields []string `json:"-"`
2406
2407
2408
2409
2410 NullFields []string `json:"-"`
2411 }
2412
2413 func (s *Reply) MarshalJSON() ([]byte, error) {
2414 type NoMethod Reply
2415 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2416 }
2417
2418
2419 type ReplyList struct {
2420
2421
2422 Kind string `json:"kind,omitempty"`
2423
2424
2425
2426
2427
2428
2429 NextPageToken string `json:"nextPageToken,omitempty"`
2430
2431
2432 Replies []*Reply `json:"replies,omitempty"`
2433
2434
2435 googleapi.ServerResponse `json:"-"`
2436
2437
2438
2439
2440
2441 ForceSendFields []string `json:"-"`
2442
2443
2444
2445
2446 NullFields []string `json:"-"`
2447 }
2448
2449 func (s *ReplyList) MarshalJSON() ([]byte, error) {
2450 type NoMethod ReplyList
2451 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2452 }
2453
2454
2455
2456
2457 type Revision struct {
2458
2459
2460 ExportLinks map[string]string `json:"exportLinks,omitempty"`
2461
2462 Id string `json:"id,omitempty"`
2463
2464
2465
2466
2467
2468 KeepForever bool `json:"keepForever,omitempty"`
2469
2470
2471 Kind string `json:"kind,omitempty"`
2472
2473 LastModifyingUser *User `json:"lastModifyingUser,omitempty"`
2474
2475
2476 Md5Checksum string `json:"md5Checksum,omitempty"`
2477
2478 MimeType string `json:"mimeType,omitempty"`
2479
2480 ModifiedTime string `json:"modifiedTime,omitempty"`
2481
2482
2483 OriginalFilename string `json:"originalFilename,omitempty"`
2484
2485
2486 PublishAuto bool `json:"publishAuto,omitempty"`
2487
2488
2489 Published bool `json:"published,omitempty"`
2490
2491
2492 PublishedLink string `json:"publishedLink,omitempty"`
2493
2494
2495 PublishedOutsideDomain bool `json:"publishedOutsideDomain,omitempty"`
2496
2497
2498 Size int64 `json:"size,omitempty,string"`
2499
2500
2501 googleapi.ServerResponse `json:"-"`
2502
2503
2504
2505
2506
2507 ForceSendFields []string `json:"-"`
2508
2509
2510
2511
2512 NullFields []string `json:"-"`
2513 }
2514
2515 func (s *Revision) MarshalJSON() ([]byte, error) {
2516 type NoMethod Revision
2517 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2518 }
2519
2520
2521 type RevisionList struct {
2522
2523
2524 Kind string `json:"kind,omitempty"`
2525
2526
2527
2528
2529
2530
2531 NextPageToken string `json:"nextPageToken,omitempty"`
2532
2533
2534 Revisions []*Revision `json:"revisions,omitempty"`
2535
2536
2537 googleapi.ServerResponse `json:"-"`
2538
2539
2540
2541
2542
2543 ForceSendFields []string `json:"-"`
2544
2545
2546
2547
2548 NullFields []string `json:"-"`
2549 }
2550
2551 func (s *RevisionList) MarshalJSON() ([]byte, error) {
2552 type NoMethod RevisionList
2553 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2554 }
2555
2556 type StartPageToken struct {
2557
2558
2559 Kind string `json:"kind,omitempty"`
2560
2561
2562 StartPageToken string `json:"startPageToken,omitempty"`
2563
2564
2565 googleapi.ServerResponse `json:"-"`
2566
2567
2568
2569
2570
2571 ForceSendFields []string `json:"-"`
2572
2573
2574
2575
2576 NullFields []string `json:"-"`
2577 }
2578
2579 func (s *StartPageToken) MarshalJSON() ([]byte, error) {
2580 type NoMethod StartPageToken
2581 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2582 }
2583
2584
2585 type TeamDrive struct {
2586
2587
2588
2589
2590
2591 BackgroundImageFile *TeamDriveBackgroundImageFile `json:"backgroundImageFile,omitempty"`
2592
2593
2594 BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
2595
2596 Capabilities *TeamDriveCapabilities `json:"capabilities,omitempty"`
2597
2598
2599 ColorRgb string `json:"colorRgb,omitempty"`
2600
2601
2602 CreatedTime string `json:"createdTime,omitempty"`
2603
2604
2605 Id string `json:"id,omitempty"`
2606
2607
2608 Kind string `json:"kind,omitempty"`
2609
2610 Name string `json:"name,omitempty"`
2611
2612
2613
2614 OrgUnitId string `json:"orgUnitId,omitempty"`
2615
2616
2617 Restrictions *TeamDriveRestrictions `json:"restrictions,omitempty"`
2618
2619
2620
2621
2622
2623
2624 ThemeId string `json:"themeId,omitempty"`
2625
2626
2627 googleapi.ServerResponse `json:"-"`
2628
2629
2630
2631
2632
2633 ForceSendFields []string `json:"-"`
2634
2635
2636
2637
2638 NullFields []string `json:"-"`
2639 }
2640
2641 func (s *TeamDrive) MarshalJSON() ([]byte, error) {
2642 type NoMethod TeamDrive
2643 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2644 }
2645
2646
2647
2648
2649
2650
2651 type TeamDriveBackgroundImageFile struct {
2652
2653 Id string `json:"id,omitempty"`
2654
2655
2656
2657
2658
2659 Width float64 `json:"width,omitempty"`
2660
2661
2662
2663
2664
2665 XCoordinate float64 `json:"xCoordinate,omitempty"`
2666
2667
2668
2669
2670
2671 YCoordinate float64 `json:"yCoordinate,omitempty"`
2672
2673
2674
2675
2676
2677 ForceSendFields []string `json:"-"`
2678
2679
2680
2681
2682 NullFields []string `json:"-"`
2683 }
2684
2685 func (s *TeamDriveBackgroundImageFile) MarshalJSON() ([]byte, error) {
2686 type NoMethod TeamDriveBackgroundImageFile
2687 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2688 }
2689
2690 func (s *TeamDriveBackgroundImageFile) UnmarshalJSON(data []byte) error {
2691 type NoMethod TeamDriveBackgroundImageFile
2692 var s1 struct {
2693 Width gensupport.JSONFloat64 `json:"width"`
2694 XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"`
2695 YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"`
2696 *NoMethod
2697 }
2698 s1.NoMethod = (*NoMethod)(s)
2699 if err := json.Unmarshal(data, &s1); err != nil {
2700 return err
2701 }
2702 s.Width = float64(s1.Width)
2703 s.XCoordinate = float64(s1.XCoordinate)
2704 s.YCoordinate = float64(s1.YCoordinate)
2705 return nil
2706 }
2707
2708
2709 type TeamDriveCapabilities struct {
2710
2711
2712 CanAddChildren bool `json:"canAddChildren,omitempty"`
2713
2714
2715
2716 CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"`
2717
2718
2719 CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"`
2720
2721
2722
2723 CanChangeSharingFoldersRequiresOrganizerPermissionRestriction bool `json:"canChangeSharingFoldersRequiresOrganizerPermissionRestriction,omitempty"`
2724
2725
2726 CanChangeTeamDriveBackground bool `json:"canChangeTeamDriveBackground,omitempty"`
2727
2728
2729 CanChangeTeamMembersOnlyRestriction bool `json:"canChangeTeamMembersOnlyRestriction,omitempty"`
2730
2731
2732 CanComment bool `json:"canComment,omitempty"`
2733
2734 CanCopy bool `json:"canCopy,omitempty"`
2735
2736
2737 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"`
2738
2739
2740
2741 CanDeleteTeamDrive bool `json:"canDeleteTeamDrive,omitempty"`
2742
2743 CanDownload bool `json:"canDownload,omitempty"`
2744
2745 CanEdit bool `json:"canEdit,omitempty"`
2746
2747
2748 CanListChildren bool `json:"canListChildren,omitempty"`
2749
2750
2751 CanManageMembers bool `json:"canManageMembers,omitempty"`
2752
2753
2754 CanReadRevisions bool `json:"canReadRevisions,omitempty"`
2755
2756
2757 CanRemoveChildren bool `json:"canRemoveChildren,omitempty"`
2758
2759
2760 CanRename bool `json:"canRename,omitempty"`
2761
2762 CanRenameTeamDrive bool `json:"canRenameTeamDrive,omitempty"`
2763
2764
2765 CanResetTeamDriveRestrictions bool `json:"canResetTeamDriveRestrictions,omitempty"`
2766
2767
2768 CanShare bool `json:"canShare,omitempty"`
2769
2770
2771 CanTrashChildren bool `json:"canTrashChildren,omitempty"`
2772
2773
2774
2775
2776
2777 ForceSendFields []string `json:"-"`
2778
2779
2780
2781
2782 NullFields []string `json:"-"`
2783 }
2784
2785 func (s *TeamDriveCapabilities) MarshalJSON() ([]byte, error) {
2786 type NoMethod TeamDriveCapabilities
2787 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2788 }
2789
2790
2791
2792 type TeamDriveRestrictions struct {
2793
2794
2795 AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"`
2796
2797
2798
2799
2800 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"`
2801
2802
2803
2804
2805 DomainUsersOnly bool `json:"domainUsersOnly,omitempty"`
2806
2807
2808
2809 SharingFoldersRequiresOrganizerPermission bool `json:"sharingFoldersRequiresOrganizerPermission,omitempty"`
2810
2811
2812 TeamMembersOnly bool `json:"teamMembersOnly,omitempty"`
2813
2814
2815
2816
2817
2818 ForceSendFields []string `json:"-"`
2819
2820
2821
2822
2823 NullFields []string `json:"-"`
2824 }
2825
2826 func (s *TeamDriveRestrictions) MarshalJSON() ([]byte, error) {
2827 type NoMethod TeamDriveRestrictions
2828 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2829 }
2830
2831
2832 type TeamDriveList struct {
2833
2834
2835 Kind string `json:"kind,omitempty"`
2836
2837
2838
2839
2840
2841
2842 NextPageToken string `json:"nextPageToken,omitempty"`
2843
2844
2845
2846 TeamDrives []*TeamDrive `json:"teamDrives,omitempty"`
2847
2848
2849 googleapi.ServerResponse `json:"-"`
2850
2851
2852
2853
2854
2855 ForceSendFields []string `json:"-"`
2856
2857
2858
2859
2860 NullFields []string `json:"-"`
2861 }
2862
2863 func (s *TeamDriveList) MarshalJSON() ([]byte, error) {
2864 type NoMethod TeamDriveList
2865 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2866 }
2867
2868
2869 type User struct {
2870
2871 DisplayName string `json:"displayName,omitempty"`
2872
2873
2874
2875 EmailAddress string `json:"emailAddress,omitempty"`
2876
2877
2878 Kind string `json:"kind,omitempty"`
2879
2880 Me bool `json:"me,omitempty"`
2881
2882 PermissionId string `json:"permissionId,omitempty"`
2883
2884 PhotoLink string `json:"photoLink,omitempty"`
2885
2886
2887
2888
2889
2890 ForceSendFields []string `json:"-"`
2891
2892
2893
2894
2895 NullFields []string `json:"-"`
2896 }
2897
2898 func (s *User) MarshalJSON() ([]byte, error) {
2899 type NoMethod User
2900 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2901 }
2902
2903 type AboutGetCall struct {
2904 s *Service
2905 urlParams_ gensupport.URLParams
2906 ifNoneMatch_ string
2907 ctx_ context.Context
2908 header_ http.Header
2909 }
2910
2911
2912
2913 func (r *AboutService) Get() *AboutGetCall {
2914 c := &AboutGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2915 return c
2916 }
2917
2918
2919
2920
2921 func (c *AboutGetCall) Fields(s ...googleapi.Field) *AboutGetCall {
2922 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2923 return c
2924 }
2925
2926
2927
2928
2929 func (c *AboutGetCall) IfNoneMatch(entityTag string) *AboutGetCall {
2930 c.ifNoneMatch_ = entityTag
2931 return c
2932 }
2933
2934
2935 func (c *AboutGetCall) Context(ctx context.Context) *AboutGetCall {
2936 c.ctx_ = ctx
2937 return c
2938 }
2939
2940
2941
2942 func (c *AboutGetCall) Header() http.Header {
2943 if c.header_ == nil {
2944 c.header_ = make(http.Header)
2945 }
2946 return c.header_
2947 }
2948
2949 func (c *AboutGetCall) doRequest(alt string) (*http.Response, error) {
2950 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2951 if c.ifNoneMatch_ != "" {
2952 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2953 }
2954 var body io.Reader = nil
2955 c.urlParams_.Set("alt", alt)
2956 c.urlParams_.Set("prettyPrint", "false")
2957 urls := googleapi.ResolveRelative(c.s.BasePath, "about")
2958 urls += "?" + c.urlParams_.Encode()
2959 req, err := http.NewRequest("GET", urls, body)
2960 if err != nil {
2961 return nil, err
2962 }
2963 req.Header = reqHeaders
2964 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2965 }
2966
2967
2968
2969
2970
2971
2972 func (c *AboutGetCall) Do(opts ...googleapi.CallOption) (*About, error) {
2973 gensupport.SetOptions(c.urlParams_, opts...)
2974 res, err := c.doRequest("json")
2975 if res != nil && res.StatusCode == http.StatusNotModified {
2976 if res.Body != nil {
2977 res.Body.Close()
2978 }
2979 return nil, gensupport.WrapError(&googleapi.Error{
2980 Code: res.StatusCode,
2981 Header: res.Header,
2982 })
2983 }
2984 if err != nil {
2985 return nil, err
2986 }
2987 defer googleapi.CloseBody(res)
2988 if err := googleapi.CheckResponse(res); err != nil {
2989 return nil, gensupport.WrapError(err)
2990 }
2991 ret := &About{
2992 ServerResponse: googleapi.ServerResponse{
2993 Header: res.Header,
2994 HTTPStatusCode: res.StatusCode,
2995 },
2996 }
2997 target := &ret
2998 if err := gensupport.DecodeResponse(target, res); err != nil {
2999 return nil, err
3000 }
3001 return ret, nil
3002 }
3003
3004 type AppsGetCall struct {
3005 s *Service
3006 appId string
3007 urlParams_ gensupport.URLParams
3008 ifNoneMatch_ string
3009 ctx_ context.Context
3010 header_ http.Header
3011 }
3012
3013
3014
3015
3016 func (r *AppsService) Get(appId string) *AppsGetCall {
3017 c := &AppsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3018 c.appId = appId
3019 return c
3020 }
3021
3022
3023
3024
3025 func (c *AppsGetCall) Fields(s ...googleapi.Field) *AppsGetCall {
3026 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3027 return c
3028 }
3029
3030
3031
3032
3033 func (c *AppsGetCall) IfNoneMatch(entityTag string) *AppsGetCall {
3034 c.ifNoneMatch_ = entityTag
3035 return c
3036 }
3037
3038
3039 func (c *AppsGetCall) Context(ctx context.Context) *AppsGetCall {
3040 c.ctx_ = ctx
3041 return c
3042 }
3043
3044
3045
3046 func (c *AppsGetCall) Header() http.Header {
3047 if c.header_ == nil {
3048 c.header_ = make(http.Header)
3049 }
3050 return c.header_
3051 }
3052
3053 func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) {
3054 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3055 if c.ifNoneMatch_ != "" {
3056 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3057 }
3058 var body io.Reader = nil
3059 c.urlParams_.Set("alt", alt)
3060 c.urlParams_.Set("prettyPrint", "false")
3061 urls := googleapi.ResolveRelative(c.s.BasePath, "apps/{appId}")
3062 urls += "?" + c.urlParams_.Encode()
3063 req, err := http.NewRequest("GET", urls, body)
3064 if err != nil {
3065 return nil, err
3066 }
3067 req.Header = reqHeaders
3068 googleapi.Expand(req.URL, map[string]string{
3069 "appId": c.appId,
3070 })
3071 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3072 }
3073
3074
3075
3076
3077
3078
3079 func (c *AppsGetCall) Do(opts ...googleapi.CallOption) (*App, error) {
3080 gensupport.SetOptions(c.urlParams_, opts...)
3081 res, err := c.doRequest("json")
3082 if res != nil && res.StatusCode == http.StatusNotModified {
3083 if res.Body != nil {
3084 res.Body.Close()
3085 }
3086 return nil, gensupport.WrapError(&googleapi.Error{
3087 Code: res.StatusCode,
3088 Header: res.Header,
3089 })
3090 }
3091 if err != nil {
3092 return nil, err
3093 }
3094 defer googleapi.CloseBody(res)
3095 if err := googleapi.CheckResponse(res); err != nil {
3096 return nil, gensupport.WrapError(err)
3097 }
3098 ret := &App{
3099 ServerResponse: googleapi.ServerResponse{
3100 Header: res.Header,
3101 HTTPStatusCode: res.StatusCode,
3102 },
3103 }
3104 target := &ret
3105 if err := gensupport.DecodeResponse(target, res); err != nil {
3106 return nil, err
3107 }
3108 return ret, nil
3109 }
3110
3111 type AppsListCall struct {
3112 s *Service
3113 urlParams_ gensupport.URLParams
3114 ifNoneMatch_ string
3115 ctx_ context.Context
3116 header_ http.Header
3117 }
3118
3119
3120 func (r *AppsService) List() *AppsListCall {
3121 c := &AppsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3122 return c
3123 }
3124
3125
3126
3127
3128
3129
3130 func (c *AppsListCall) AppFilterExtensions(appFilterExtensions string) *AppsListCall {
3131 c.urlParams_.Set("appFilterExtensions", appFilterExtensions)
3132 return c
3133 }
3134
3135
3136
3137
3138
3139
3140 func (c *AppsListCall) AppFilterMimeTypes(appFilterMimeTypes string) *AppsListCall {
3141 c.urlParams_.Set("appFilterMimeTypes", appFilterMimeTypes)
3142 return c
3143 }
3144
3145
3146
3147
3148 func (c *AppsListCall) LanguageCode(languageCode string) *AppsListCall {
3149 c.urlParams_.Set("languageCode", languageCode)
3150 return c
3151 }
3152
3153
3154
3155
3156 func (c *AppsListCall) Fields(s ...googleapi.Field) *AppsListCall {
3157 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3158 return c
3159 }
3160
3161
3162
3163
3164 func (c *AppsListCall) IfNoneMatch(entityTag string) *AppsListCall {
3165 c.ifNoneMatch_ = entityTag
3166 return c
3167 }
3168
3169
3170 func (c *AppsListCall) Context(ctx context.Context) *AppsListCall {
3171 c.ctx_ = ctx
3172 return c
3173 }
3174
3175
3176
3177 func (c *AppsListCall) Header() http.Header {
3178 if c.header_ == nil {
3179 c.header_ = make(http.Header)
3180 }
3181 return c.header_
3182 }
3183
3184 func (c *AppsListCall) doRequest(alt string) (*http.Response, error) {
3185 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3186 if c.ifNoneMatch_ != "" {
3187 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3188 }
3189 var body io.Reader = nil
3190 c.urlParams_.Set("alt", alt)
3191 c.urlParams_.Set("prettyPrint", "false")
3192 urls := googleapi.ResolveRelative(c.s.BasePath, "apps")
3193 urls += "?" + c.urlParams_.Encode()
3194 req, err := http.NewRequest("GET", urls, body)
3195 if err != nil {
3196 return nil, err
3197 }
3198 req.Header = reqHeaders
3199 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3200 }
3201
3202
3203
3204
3205
3206
3207 func (c *AppsListCall) Do(opts ...googleapi.CallOption) (*AppList, error) {
3208 gensupport.SetOptions(c.urlParams_, opts...)
3209 res, err := c.doRequest("json")
3210 if res != nil && res.StatusCode == http.StatusNotModified {
3211 if res.Body != nil {
3212 res.Body.Close()
3213 }
3214 return nil, gensupport.WrapError(&googleapi.Error{
3215 Code: res.StatusCode,
3216 Header: res.Header,
3217 })
3218 }
3219 if err != nil {
3220 return nil, err
3221 }
3222 defer googleapi.CloseBody(res)
3223 if err := googleapi.CheckResponse(res); err != nil {
3224 return nil, gensupport.WrapError(err)
3225 }
3226 ret := &AppList{
3227 ServerResponse: googleapi.ServerResponse{
3228 Header: res.Header,
3229 HTTPStatusCode: res.StatusCode,
3230 },
3231 }
3232 target := &ret
3233 if err := gensupport.DecodeResponse(target, res); err != nil {
3234 return nil, err
3235 }
3236 return ret, nil
3237 }
3238
3239 type ChangesGetStartPageTokenCall struct {
3240 s *Service
3241 urlParams_ gensupport.URLParams
3242 ifNoneMatch_ string
3243 ctx_ context.Context
3244 header_ http.Header
3245 }
3246
3247
3248 func (r *ChangesService) GetStartPageToken() *ChangesGetStartPageTokenCall {
3249 c := &ChangesGetStartPageTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3250 return c
3251 }
3252
3253
3254
3255
3256 func (c *ChangesGetStartPageTokenCall) DriveId(driveId string) *ChangesGetStartPageTokenCall {
3257 c.urlParams_.Set("driveId", driveId)
3258 return c
3259 }
3260
3261
3262
3263 func (c *ChangesGetStartPageTokenCall) SupportsAllDrives(supportsAllDrives bool) *ChangesGetStartPageTokenCall {
3264 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
3265 return c
3266 }
3267
3268
3269
3270 func (c *ChangesGetStartPageTokenCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesGetStartPageTokenCall {
3271 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
3272 return c
3273 }
3274
3275
3276
3277 func (c *ChangesGetStartPageTokenCall) TeamDriveId(teamDriveId string) *ChangesGetStartPageTokenCall {
3278 c.urlParams_.Set("teamDriveId", teamDriveId)
3279 return c
3280 }
3281
3282
3283
3284
3285 func (c *ChangesGetStartPageTokenCall) Fields(s ...googleapi.Field) *ChangesGetStartPageTokenCall {
3286 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3287 return c
3288 }
3289
3290
3291
3292
3293 func (c *ChangesGetStartPageTokenCall) IfNoneMatch(entityTag string) *ChangesGetStartPageTokenCall {
3294 c.ifNoneMatch_ = entityTag
3295 return c
3296 }
3297
3298
3299 func (c *ChangesGetStartPageTokenCall) Context(ctx context.Context) *ChangesGetStartPageTokenCall {
3300 c.ctx_ = ctx
3301 return c
3302 }
3303
3304
3305
3306 func (c *ChangesGetStartPageTokenCall) Header() http.Header {
3307 if c.header_ == nil {
3308 c.header_ = make(http.Header)
3309 }
3310 return c.header_
3311 }
3312
3313 func (c *ChangesGetStartPageTokenCall) doRequest(alt string) (*http.Response, error) {
3314 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3315 if c.ifNoneMatch_ != "" {
3316 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3317 }
3318 var body io.Reader = nil
3319 c.urlParams_.Set("alt", alt)
3320 c.urlParams_.Set("prettyPrint", "false")
3321 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/startPageToken")
3322 urls += "?" + c.urlParams_.Encode()
3323 req, err := http.NewRequest("GET", urls, body)
3324 if err != nil {
3325 return nil, err
3326 }
3327 req.Header = reqHeaders
3328 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3329 }
3330
3331
3332
3333
3334
3335
3336 func (c *ChangesGetStartPageTokenCall) Do(opts ...googleapi.CallOption) (*StartPageToken, error) {
3337 gensupport.SetOptions(c.urlParams_, opts...)
3338 res, err := c.doRequest("json")
3339 if res != nil && res.StatusCode == http.StatusNotModified {
3340 if res.Body != nil {
3341 res.Body.Close()
3342 }
3343 return nil, gensupport.WrapError(&googleapi.Error{
3344 Code: res.StatusCode,
3345 Header: res.Header,
3346 })
3347 }
3348 if err != nil {
3349 return nil, err
3350 }
3351 defer googleapi.CloseBody(res)
3352 if err := googleapi.CheckResponse(res); err != nil {
3353 return nil, gensupport.WrapError(err)
3354 }
3355 ret := &StartPageToken{
3356 ServerResponse: googleapi.ServerResponse{
3357 Header: res.Header,
3358 HTTPStatusCode: res.StatusCode,
3359 },
3360 }
3361 target := &ret
3362 if err := gensupport.DecodeResponse(target, res); err != nil {
3363 return nil, err
3364 }
3365 return ret, nil
3366 }
3367
3368 type ChangesListCall struct {
3369 s *Service
3370 urlParams_ gensupport.URLParams
3371 ifNoneMatch_ string
3372 ctx_ context.Context
3373 header_ http.Header
3374 }
3375
3376
3377
3378
3379
3380
3381 func (r *ChangesService) List(pageToken string) *ChangesListCall {
3382 c := &ChangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3383 c.urlParams_.Set("pageToken", pageToken)
3384 return c
3385 }
3386
3387
3388
3389
3390 func (c *ChangesListCall) DriveId(driveId string) *ChangesListCall {
3391 c.urlParams_.Set("driveId", driveId)
3392 return c
3393 }
3394
3395
3396
3397
3398
3399
3400 func (c *ChangesListCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesListCall {
3401 c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals))
3402 return c
3403 }
3404
3405
3406
3407
3408 func (c *ChangesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesListCall {
3409 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives))
3410 return c
3411 }
3412
3413
3414
3415 func (c *ChangesListCall) IncludeLabels(includeLabels string) *ChangesListCall {
3416 c.urlParams_.Set("includeLabels", includeLabels)
3417 return c
3418 }
3419
3420
3421
3422
3423 func (c *ChangesListCall) IncludePermissionsForView(includePermissionsForView string) *ChangesListCall {
3424 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
3425 return c
3426 }
3427
3428
3429
3430
3431 func (c *ChangesListCall) IncludeRemoved(includeRemoved bool) *ChangesListCall {
3432 c.urlParams_.Set("includeRemoved", fmt.Sprint(includeRemoved))
3433 return c
3434 }
3435
3436
3437
3438 func (c *ChangesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesListCall {
3439 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems))
3440 return c
3441 }
3442
3443
3444
3445 func (c *ChangesListCall) PageSize(pageSize int64) *ChangesListCall {
3446 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3447 return c
3448 }
3449
3450
3451
3452
3453
3454 func (c *ChangesListCall) RestrictToMyDrive(restrictToMyDrive bool) *ChangesListCall {
3455 c.urlParams_.Set("restrictToMyDrive", fmt.Sprint(restrictToMyDrive))
3456 return c
3457 }
3458
3459
3460
3461
3462 func (c *ChangesListCall) Spaces(spaces string) *ChangesListCall {
3463 c.urlParams_.Set("spaces", spaces)
3464 return c
3465 }
3466
3467
3468
3469 func (c *ChangesListCall) SupportsAllDrives(supportsAllDrives bool) *ChangesListCall {
3470 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
3471 return c
3472 }
3473
3474
3475
3476 func (c *ChangesListCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesListCall {
3477 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
3478 return c
3479 }
3480
3481
3482
3483 func (c *ChangesListCall) TeamDriveId(teamDriveId string) *ChangesListCall {
3484 c.urlParams_.Set("teamDriveId", teamDriveId)
3485 return c
3486 }
3487
3488
3489
3490
3491 func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall {
3492 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3493 return c
3494 }
3495
3496
3497
3498
3499 func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall {
3500 c.ifNoneMatch_ = entityTag
3501 return c
3502 }
3503
3504
3505 func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall {
3506 c.ctx_ = ctx
3507 return c
3508 }
3509
3510
3511
3512 func (c *ChangesListCall) Header() http.Header {
3513 if c.header_ == nil {
3514 c.header_ = make(http.Header)
3515 }
3516 return c.header_
3517 }
3518
3519 func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) {
3520 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3521 if c.ifNoneMatch_ != "" {
3522 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3523 }
3524 var body io.Reader = nil
3525 c.urlParams_.Set("alt", alt)
3526 c.urlParams_.Set("prettyPrint", "false")
3527 urls := googleapi.ResolveRelative(c.s.BasePath, "changes")
3528 urls += "?" + c.urlParams_.Encode()
3529 req, err := http.NewRequest("GET", urls, body)
3530 if err != nil {
3531 return nil, err
3532 }
3533 req.Header = reqHeaders
3534 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3535 }
3536
3537
3538
3539
3540
3541
3542 func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangeList, error) {
3543 gensupport.SetOptions(c.urlParams_, opts...)
3544 res, err := c.doRequest("json")
3545 if res != nil && res.StatusCode == http.StatusNotModified {
3546 if res.Body != nil {
3547 res.Body.Close()
3548 }
3549 return nil, gensupport.WrapError(&googleapi.Error{
3550 Code: res.StatusCode,
3551 Header: res.Header,
3552 })
3553 }
3554 if err != nil {
3555 return nil, err
3556 }
3557 defer googleapi.CloseBody(res)
3558 if err := googleapi.CheckResponse(res); err != nil {
3559 return nil, gensupport.WrapError(err)
3560 }
3561 ret := &ChangeList{
3562 ServerResponse: googleapi.ServerResponse{
3563 Header: res.Header,
3564 HTTPStatusCode: res.StatusCode,
3565 },
3566 }
3567 target := &ret
3568 if err := gensupport.DecodeResponse(target, res); err != nil {
3569 return nil, err
3570 }
3571 return ret, nil
3572 }
3573
3574 type ChangesWatchCall struct {
3575 s *Service
3576 channel *Channel
3577 urlParams_ gensupport.URLParams
3578 ctx_ context.Context
3579 header_ http.Header
3580 }
3581
3582
3583
3584
3585
3586
3587 func (r *ChangesService) Watch(pageToken string, channel *Channel) *ChangesWatchCall {
3588 c := &ChangesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3589 c.urlParams_.Set("pageToken", pageToken)
3590 c.channel = channel
3591 return c
3592 }
3593
3594
3595
3596
3597 func (c *ChangesWatchCall) DriveId(driveId string) *ChangesWatchCall {
3598 c.urlParams_.Set("driveId", driveId)
3599 return c
3600 }
3601
3602
3603
3604
3605
3606
3607 func (c *ChangesWatchCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesWatchCall {
3608 c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals))
3609 return c
3610 }
3611
3612
3613
3614
3615 func (c *ChangesWatchCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesWatchCall {
3616 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives))
3617 return c
3618 }
3619
3620
3621
3622 func (c *ChangesWatchCall) IncludeLabels(includeLabels string) *ChangesWatchCall {
3623 c.urlParams_.Set("includeLabels", includeLabels)
3624 return c
3625 }
3626
3627
3628
3629
3630 func (c *ChangesWatchCall) IncludePermissionsForView(includePermissionsForView string) *ChangesWatchCall {
3631 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
3632 return c
3633 }
3634
3635
3636
3637
3638 func (c *ChangesWatchCall) IncludeRemoved(includeRemoved bool) *ChangesWatchCall {
3639 c.urlParams_.Set("includeRemoved", fmt.Sprint(includeRemoved))
3640 return c
3641 }
3642
3643
3644
3645 func (c *ChangesWatchCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesWatchCall {
3646 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems))
3647 return c
3648 }
3649
3650
3651
3652 func (c *ChangesWatchCall) PageSize(pageSize int64) *ChangesWatchCall {
3653 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3654 return c
3655 }
3656
3657
3658
3659
3660
3661 func (c *ChangesWatchCall) RestrictToMyDrive(restrictToMyDrive bool) *ChangesWatchCall {
3662 c.urlParams_.Set("restrictToMyDrive", fmt.Sprint(restrictToMyDrive))
3663 return c
3664 }
3665
3666
3667
3668
3669 func (c *ChangesWatchCall) Spaces(spaces string) *ChangesWatchCall {
3670 c.urlParams_.Set("spaces", spaces)
3671 return c
3672 }
3673
3674
3675
3676 func (c *ChangesWatchCall) SupportsAllDrives(supportsAllDrives bool) *ChangesWatchCall {
3677 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
3678 return c
3679 }
3680
3681
3682
3683 func (c *ChangesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesWatchCall {
3684 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
3685 return c
3686 }
3687
3688
3689
3690 func (c *ChangesWatchCall) TeamDriveId(teamDriveId string) *ChangesWatchCall {
3691 c.urlParams_.Set("teamDriveId", teamDriveId)
3692 return c
3693 }
3694
3695
3696
3697
3698 func (c *ChangesWatchCall) Fields(s ...googleapi.Field) *ChangesWatchCall {
3699 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3700 return c
3701 }
3702
3703
3704 func (c *ChangesWatchCall) Context(ctx context.Context) *ChangesWatchCall {
3705 c.ctx_ = ctx
3706 return c
3707 }
3708
3709
3710
3711 func (c *ChangesWatchCall) Header() http.Header {
3712 if c.header_ == nil {
3713 c.header_ = make(http.Header)
3714 }
3715 return c.header_
3716 }
3717
3718 func (c *ChangesWatchCall) doRequest(alt string) (*http.Response, error) {
3719 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3720 var body io.Reader = nil
3721 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
3722 if err != nil {
3723 return nil, err
3724 }
3725 c.urlParams_.Set("alt", alt)
3726 c.urlParams_.Set("prettyPrint", "false")
3727 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/watch")
3728 urls += "?" + c.urlParams_.Encode()
3729 req, err := http.NewRequest("POST", urls, body)
3730 if err != nil {
3731 return nil, err
3732 }
3733 req.Header = reqHeaders
3734 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3735 }
3736
3737
3738
3739
3740
3741
3742 func (c *ChangesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
3743 gensupport.SetOptions(c.urlParams_, opts...)
3744 res, err := c.doRequest("json")
3745 if res != nil && res.StatusCode == http.StatusNotModified {
3746 if res.Body != nil {
3747 res.Body.Close()
3748 }
3749 return nil, gensupport.WrapError(&googleapi.Error{
3750 Code: res.StatusCode,
3751 Header: res.Header,
3752 })
3753 }
3754 if err != nil {
3755 return nil, err
3756 }
3757 defer googleapi.CloseBody(res)
3758 if err := googleapi.CheckResponse(res); err != nil {
3759 return nil, gensupport.WrapError(err)
3760 }
3761 ret := &Channel{
3762 ServerResponse: googleapi.ServerResponse{
3763 Header: res.Header,
3764 HTTPStatusCode: res.StatusCode,
3765 },
3766 }
3767 target := &ret
3768 if err := gensupport.DecodeResponse(target, res); err != nil {
3769 return nil, err
3770 }
3771 return ret, nil
3772 }
3773
3774 type ChannelsStopCall struct {
3775 s *Service
3776 channel *Channel
3777 urlParams_ gensupport.URLParams
3778 ctx_ context.Context
3779 header_ http.Header
3780 }
3781
3782
3783 func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
3784 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3785 c.channel = channel
3786 return c
3787 }
3788
3789
3790
3791
3792 func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
3793 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3794 return c
3795 }
3796
3797
3798 func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
3799 c.ctx_ = ctx
3800 return c
3801 }
3802
3803
3804
3805 func (c *ChannelsStopCall) Header() http.Header {
3806 if c.header_ == nil {
3807 c.header_ = make(http.Header)
3808 }
3809 return c.header_
3810 }
3811
3812 func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
3813 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3814 var body io.Reader = nil
3815 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
3816 if err != nil {
3817 return nil, err
3818 }
3819 c.urlParams_.Set("alt", alt)
3820 c.urlParams_.Set("prettyPrint", "false")
3821 urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
3822 urls += "?" + c.urlParams_.Encode()
3823 req, err := http.NewRequest("POST", urls, body)
3824 if err != nil {
3825 return nil, err
3826 }
3827 req.Header = reqHeaders
3828 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3829 }
3830
3831
3832 func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
3833 gensupport.SetOptions(c.urlParams_, opts...)
3834 res, err := c.doRequest("json")
3835 if err != nil {
3836 return err
3837 }
3838 defer googleapi.CloseBody(res)
3839 if err := googleapi.CheckResponse(res); err != nil {
3840 return gensupport.WrapError(err)
3841 }
3842 return nil
3843 }
3844
3845 type CommentsCreateCall struct {
3846 s *Service
3847 fileId string
3848 comment *Comment
3849 urlParams_ gensupport.URLParams
3850 ctx_ context.Context
3851 header_ http.Header
3852 }
3853
3854
3855
3856
3857 func (r *CommentsService) Create(fileId string, comment *Comment) *CommentsCreateCall {
3858 c := &CommentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3859 c.fileId = fileId
3860 c.comment = comment
3861 return c
3862 }
3863
3864
3865
3866
3867 func (c *CommentsCreateCall) Fields(s ...googleapi.Field) *CommentsCreateCall {
3868 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3869 return c
3870 }
3871
3872
3873 func (c *CommentsCreateCall) Context(ctx context.Context) *CommentsCreateCall {
3874 c.ctx_ = ctx
3875 return c
3876 }
3877
3878
3879
3880 func (c *CommentsCreateCall) Header() http.Header {
3881 if c.header_ == nil {
3882 c.header_ = make(http.Header)
3883 }
3884 return c.header_
3885 }
3886
3887 func (c *CommentsCreateCall) doRequest(alt string) (*http.Response, error) {
3888 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3889 var body io.Reader = nil
3890 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
3891 if err != nil {
3892 return nil, err
3893 }
3894 c.urlParams_.Set("alt", alt)
3895 c.urlParams_.Set("prettyPrint", "false")
3896 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments")
3897 urls += "?" + c.urlParams_.Encode()
3898 req, err := http.NewRequest("POST", urls, body)
3899 if err != nil {
3900 return nil, err
3901 }
3902 req.Header = reqHeaders
3903 googleapi.Expand(req.URL, map[string]string{
3904 "fileId": c.fileId,
3905 })
3906 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3907 }
3908
3909
3910
3911
3912
3913
3914 func (c *CommentsCreateCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
3915 gensupport.SetOptions(c.urlParams_, opts...)
3916 res, err := c.doRequest("json")
3917 if res != nil && res.StatusCode == http.StatusNotModified {
3918 if res.Body != nil {
3919 res.Body.Close()
3920 }
3921 return nil, gensupport.WrapError(&googleapi.Error{
3922 Code: res.StatusCode,
3923 Header: res.Header,
3924 })
3925 }
3926 if err != nil {
3927 return nil, err
3928 }
3929 defer googleapi.CloseBody(res)
3930 if err := googleapi.CheckResponse(res); err != nil {
3931 return nil, gensupport.WrapError(err)
3932 }
3933 ret := &Comment{
3934 ServerResponse: googleapi.ServerResponse{
3935 Header: res.Header,
3936 HTTPStatusCode: res.StatusCode,
3937 },
3938 }
3939 target := &ret
3940 if err := gensupport.DecodeResponse(target, res); err != nil {
3941 return nil, err
3942 }
3943 return ret, nil
3944 }
3945
3946 type CommentsDeleteCall struct {
3947 s *Service
3948 fileId string
3949 commentId string
3950 urlParams_ gensupport.URLParams
3951 ctx_ context.Context
3952 header_ http.Header
3953 }
3954
3955
3956
3957
3958
3959 func (r *CommentsService) Delete(fileId string, commentId string) *CommentsDeleteCall {
3960 c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3961 c.fileId = fileId
3962 c.commentId = commentId
3963 return c
3964 }
3965
3966
3967
3968
3969 func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall {
3970 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3971 return c
3972 }
3973
3974
3975 func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall {
3976 c.ctx_ = ctx
3977 return c
3978 }
3979
3980
3981
3982 func (c *CommentsDeleteCall) Header() http.Header {
3983 if c.header_ == nil {
3984 c.header_ = make(http.Header)
3985 }
3986 return c.header_
3987 }
3988
3989 func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) {
3990 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3991 var body io.Reader = nil
3992 c.urlParams_.Set("alt", alt)
3993 c.urlParams_.Set("prettyPrint", "false")
3994 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}")
3995 urls += "?" + c.urlParams_.Encode()
3996 req, err := http.NewRequest("DELETE", urls, body)
3997 if err != nil {
3998 return nil, err
3999 }
4000 req.Header = reqHeaders
4001 googleapi.Expand(req.URL, map[string]string{
4002 "fileId": c.fileId,
4003 "commentId": c.commentId,
4004 })
4005 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4006 }
4007
4008
4009 func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error {
4010 gensupport.SetOptions(c.urlParams_, opts...)
4011 res, err := c.doRequest("json")
4012 if err != nil {
4013 return err
4014 }
4015 defer googleapi.CloseBody(res)
4016 if err := googleapi.CheckResponse(res); err != nil {
4017 return gensupport.WrapError(err)
4018 }
4019 return nil
4020 }
4021
4022 type CommentsGetCall struct {
4023 s *Service
4024 fileId string
4025 commentId string
4026 urlParams_ gensupport.URLParams
4027 ifNoneMatch_ string
4028 ctx_ context.Context
4029 header_ http.Header
4030 }
4031
4032
4033
4034
4035
4036 func (r *CommentsService) Get(fileId string, commentId string) *CommentsGetCall {
4037 c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4038 c.fileId = fileId
4039 c.commentId = commentId
4040 return c
4041 }
4042
4043
4044
4045
4046 func (c *CommentsGetCall) IncludeDeleted(includeDeleted bool) *CommentsGetCall {
4047 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
4048 return c
4049 }
4050
4051
4052
4053
4054 func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall {
4055 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4056 return c
4057 }
4058
4059
4060
4061
4062 func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall {
4063 c.ifNoneMatch_ = entityTag
4064 return c
4065 }
4066
4067
4068 func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall {
4069 c.ctx_ = ctx
4070 return c
4071 }
4072
4073
4074
4075 func (c *CommentsGetCall) Header() http.Header {
4076 if c.header_ == nil {
4077 c.header_ = make(http.Header)
4078 }
4079 return c.header_
4080 }
4081
4082 func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) {
4083 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4084 if c.ifNoneMatch_ != "" {
4085 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4086 }
4087 var body io.Reader = nil
4088 c.urlParams_.Set("alt", alt)
4089 c.urlParams_.Set("prettyPrint", "false")
4090 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}")
4091 urls += "?" + c.urlParams_.Encode()
4092 req, err := http.NewRequest("GET", urls, body)
4093 if err != nil {
4094 return nil, err
4095 }
4096 req.Header = reqHeaders
4097 googleapi.Expand(req.URL, map[string]string{
4098 "fileId": c.fileId,
4099 "commentId": c.commentId,
4100 })
4101 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4102 }
4103
4104
4105
4106
4107
4108
4109 func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
4110 gensupport.SetOptions(c.urlParams_, opts...)
4111 res, err := c.doRequest("json")
4112 if res != nil && res.StatusCode == http.StatusNotModified {
4113 if res.Body != nil {
4114 res.Body.Close()
4115 }
4116 return nil, gensupport.WrapError(&googleapi.Error{
4117 Code: res.StatusCode,
4118 Header: res.Header,
4119 })
4120 }
4121 if err != nil {
4122 return nil, err
4123 }
4124 defer googleapi.CloseBody(res)
4125 if err := googleapi.CheckResponse(res); err != nil {
4126 return nil, gensupport.WrapError(err)
4127 }
4128 ret := &Comment{
4129 ServerResponse: googleapi.ServerResponse{
4130 Header: res.Header,
4131 HTTPStatusCode: res.StatusCode,
4132 },
4133 }
4134 target := &ret
4135 if err := gensupport.DecodeResponse(target, res); err != nil {
4136 return nil, err
4137 }
4138 return ret, nil
4139 }
4140
4141 type CommentsListCall struct {
4142 s *Service
4143 fileId string
4144 urlParams_ gensupport.URLParams
4145 ifNoneMatch_ string
4146 ctx_ context.Context
4147 header_ http.Header
4148 }
4149
4150
4151
4152
4153 func (r *CommentsService) List(fileId string) *CommentsListCall {
4154 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4155 c.fileId = fileId
4156 return c
4157 }
4158
4159
4160
4161
4162 func (c *CommentsListCall) IncludeDeleted(includeDeleted bool) *CommentsListCall {
4163 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
4164 return c
4165 }
4166
4167
4168
4169 func (c *CommentsListCall) PageSize(pageSize int64) *CommentsListCall {
4170 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4171 return c
4172 }
4173
4174
4175
4176
4177 func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
4178 c.urlParams_.Set("pageToken", pageToken)
4179 return c
4180 }
4181
4182
4183
4184
4185 func (c *CommentsListCall) StartModifiedTime(startModifiedTime string) *CommentsListCall {
4186 c.urlParams_.Set("startModifiedTime", startModifiedTime)
4187 return c
4188 }
4189
4190
4191
4192
4193 func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
4194 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4195 return c
4196 }
4197
4198
4199
4200
4201 func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall {
4202 c.ifNoneMatch_ = entityTag
4203 return c
4204 }
4205
4206
4207 func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall {
4208 c.ctx_ = ctx
4209 return c
4210 }
4211
4212
4213
4214 func (c *CommentsListCall) Header() http.Header {
4215 if c.header_ == nil {
4216 c.header_ = make(http.Header)
4217 }
4218 return c.header_
4219 }
4220
4221 func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) {
4222 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4223 if c.ifNoneMatch_ != "" {
4224 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4225 }
4226 var body io.Reader = nil
4227 c.urlParams_.Set("alt", alt)
4228 c.urlParams_.Set("prettyPrint", "false")
4229 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments")
4230 urls += "?" + c.urlParams_.Encode()
4231 req, err := http.NewRequest("GET", urls, body)
4232 if err != nil {
4233 return nil, err
4234 }
4235 req.Header = reqHeaders
4236 googleapi.Expand(req.URL, map[string]string{
4237 "fileId": c.fileId,
4238 })
4239 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4240 }
4241
4242
4243
4244
4245
4246
4247 func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) {
4248 gensupport.SetOptions(c.urlParams_, opts...)
4249 res, err := c.doRequest("json")
4250 if res != nil && res.StatusCode == http.StatusNotModified {
4251 if res.Body != nil {
4252 res.Body.Close()
4253 }
4254 return nil, gensupport.WrapError(&googleapi.Error{
4255 Code: res.StatusCode,
4256 Header: res.Header,
4257 })
4258 }
4259 if err != nil {
4260 return nil, err
4261 }
4262 defer googleapi.CloseBody(res)
4263 if err := googleapi.CheckResponse(res); err != nil {
4264 return nil, gensupport.WrapError(err)
4265 }
4266 ret := &CommentList{
4267 ServerResponse: googleapi.ServerResponse{
4268 Header: res.Header,
4269 HTTPStatusCode: res.StatusCode,
4270 },
4271 }
4272 target := &ret
4273 if err := gensupport.DecodeResponse(target, res); err != nil {
4274 return nil, err
4275 }
4276 return ret, nil
4277 }
4278
4279
4280
4281
4282 func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error {
4283 c.ctx_ = ctx
4284 defer c.PageToken(c.urlParams_.Get("pageToken"))
4285 for {
4286 x, err := c.Do()
4287 if err != nil {
4288 return err
4289 }
4290 if err := f(x); err != nil {
4291 return err
4292 }
4293 if x.NextPageToken == "" {
4294 return nil
4295 }
4296 c.PageToken(x.NextPageToken)
4297 }
4298 }
4299
4300 type CommentsUpdateCall struct {
4301 s *Service
4302 fileId string
4303 commentId string
4304 comment *Comment
4305 urlParams_ gensupport.URLParams
4306 ctx_ context.Context
4307 header_ http.Header
4308 }
4309
4310
4311
4312
4313
4314 func (r *CommentsService) Update(fileId string, commentId string, comment *Comment) *CommentsUpdateCall {
4315 c := &CommentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4316 c.fileId = fileId
4317 c.commentId = commentId
4318 c.comment = comment
4319 return c
4320 }
4321
4322
4323
4324
4325 func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall {
4326 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4327 return c
4328 }
4329
4330
4331 func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall {
4332 c.ctx_ = ctx
4333 return c
4334 }
4335
4336
4337
4338 func (c *CommentsUpdateCall) Header() http.Header {
4339 if c.header_ == nil {
4340 c.header_ = make(http.Header)
4341 }
4342 return c.header_
4343 }
4344
4345 func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) {
4346 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4347 var body io.Reader = nil
4348 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
4349 if err != nil {
4350 return nil, err
4351 }
4352 c.urlParams_.Set("alt", alt)
4353 c.urlParams_.Set("prettyPrint", "false")
4354 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}")
4355 urls += "?" + c.urlParams_.Encode()
4356 req, err := http.NewRequest("PATCH", urls, body)
4357 if err != nil {
4358 return nil, err
4359 }
4360 req.Header = reqHeaders
4361 googleapi.Expand(req.URL, map[string]string{
4362 "fileId": c.fileId,
4363 "commentId": c.commentId,
4364 })
4365 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4366 }
4367
4368
4369
4370
4371
4372
4373 func (c *CommentsUpdateCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
4374 gensupport.SetOptions(c.urlParams_, opts...)
4375 res, err := c.doRequest("json")
4376 if res != nil && res.StatusCode == http.StatusNotModified {
4377 if res.Body != nil {
4378 res.Body.Close()
4379 }
4380 return nil, gensupport.WrapError(&googleapi.Error{
4381 Code: res.StatusCode,
4382 Header: res.Header,
4383 })
4384 }
4385 if err != nil {
4386 return nil, err
4387 }
4388 defer googleapi.CloseBody(res)
4389 if err := googleapi.CheckResponse(res); err != nil {
4390 return nil, gensupport.WrapError(err)
4391 }
4392 ret := &Comment{
4393 ServerResponse: googleapi.ServerResponse{
4394 Header: res.Header,
4395 HTTPStatusCode: res.StatusCode,
4396 },
4397 }
4398 target := &ret
4399 if err := gensupport.DecodeResponse(target, res); err != nil {
4400 return nil, err
4401 }
4402 return ret, nil
4403 }
4404
4405 type DrivesCreateCall struct {
4406 s *Service
4407 drive *Drive
4408 urlParams_ gensupport.URLParams
4409 ctx_ context.Context
4410 header_ http.Header
4411 }
4412
4413
4414
4415
4416
4417
4418
4419
4420 func (r *DrivesService) Create(requestId string, drive *Drive) *DrivesCreateCall {
4421 c := &DrivesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4422 c.urlParams_.Set("requestId", requestId)
4423 c.drive = drive
4424 return c
4425 }
4426
4427
4428
4429
4430 func (c *DrivesCreateCall) Fields(s ...googleapi.Field) *DrivesCreateCall {
4431 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4432 return c
4433 }
4434
4435
4436 func (c *DrivesCreateCall) Context(ctx context.Context) *DrivesCreateCall {
4437 c.ctx_ = ctx
4438 return c
4439 }
4440
4441
4442
4443 func (c *DrivesCreateCall) Header() http.Header {
4444 if c.header_ == nil {
4445 c.header_ = make(http.Header)
4446 }
4447 return c.header_
4448 }
4449
4450 func (c *DrivesCreateCall) doRequest(alt string) (*http.Response, error) {
4451 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4452 var body io.Reader = nil
4453 body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive)
4454 if err != nil {
4455 return nil, err
4456 }
4457 c.urlParams_.Set("alt", alt)
4458 c.urlParams_.Set("prettyPrint", "false")
4459 urls := googleapi.ResolveRelative(c.s.BasePath, "drives")
4460 urls += "?" + c.urlParams_.Encode()
4461 req, err := http.NewRequest("POST", urls, body)
4462 if err != nil {
4463 return nil, err
4464 }
4465 req.Header = reqHeaders
4466 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4467 }
4468
4469
4470
4471
4472
4473
4474 func (c *DrivesCreateCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
4475 gensupport.SetOptions(c.urlParams_, opts...)
4476 res, err := c.doRequest("json")
4477 if res != nil && res.StatusCode == http.StatusNotModified {
4478 if res.Body != nil {
4479 res.Body.Close()
4480 }
4481 return nil, gensupport.WrapError(&googleapi.Error{
4482 Code: res.StatusCode,
4483 Header: res.Header,
4484 })
4485 }
4486 if err != nil {
4487 return nil, err
4488 }
4489 defer googleapi.CloseBody(res)
4490 if err := googleapi.CheckResponse(res); err != nil {
4491 return nil, gensupport.WrapError(err)
4492 }
4493 ret := &Drive{
4494 ServerResponse: googleapi.ServerResponse{
4495 Header: res.Header,
4496 HTTPStatusCode: res.StatusCode,
4497 },
4498 }
4499 target := &ret
4500 if err := gensupport.DecodeResponse(target, res); err != nil {
4501 return nil, err
4502 }
4503 return ret, nil
4504 }
4505
4506 type DrivesDeleteCall struct {
4507 s *Service
4508 driveId string
4509 urlParams_ gensupport.URLParams
4510 ctx_ context.Context
4511 header_ http.Header
4512 }
4513
4514
4515
4516
4517
4518 func (r *DrivesService) Delete(driveId string) *DrivesDeleteCall {
4519 c := &DrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4520 c.driveId = driveId
4521 return c
4522 }
4523
4524
4525
4526
4527 func (c *DrivesDeleteCall) AllowItemDeletion(allowItemDeletion bool) *DrivesDeleteCall {
4528 c.urlParams_.Set("allowItemDeletion", fmt.Sprint(allowItemDeletion))
4529 return c
4530 }
4531
4532
4533
4534
4535
4536 func (c *DrivesDeleteCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesDeleteCall {
4537 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
4538 return c
4539 }
4540
4541
4542
4543
4544 func (c *DrivesDeleteCall) Fields(s ...googleapi.Field) *DrivesDeleteCall {
4545 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4546 return c
4547 }
4548
4549
4550 func (c *DrivesDeleteCall) Context(ctx context.Context) *DrivesDeleteCall {
4551 c.ctx_ = ctx
4552 return c
4553 }
4554
4555
4556
4557 func (c *DrivesDeleteCall) Header() http.Header {
4558 if c.header_ == nil {
4559 c.header_ = make(http.Header)
4560 }
4561 return c.header_
4562 }
4563
4564 func (c *DrivesDeleteCall) doRequest(alt string) (*http.Response, error) {
4565 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4566 var body io.Reader = nil
4567 c.urlParams_.Set("alt", alt)
4568 c.urlParams_.Set("prettyPrint", "false")
4569 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}")
4570 urls += "?" + c.urlParams_.Encode()
4571 req, err := http.NewRequest("DELETE", urls, body)
4572 if err != nil {
4573 return nil, err
4574 }
4575 req.Header = reqHeaders
4576 googleapi.Expand(req.URL, map[string]string{
4577 "driveId": c.driveId,
4578 })
4579 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4580 }
4581
4582
4583 func (c *DrivesDeleteCall) Do(opts ...googleapi.CallOption) error {
4584 gensupport.SetOptions(c.urlParams_, opts...)
4585 res, err := c.doRequest("json")
4586 if err != nil {
4587 return err
4588 }
4589 defer googleapi.CloseBody(res)
4590 if err := googleapi.CheckResponse(res); err != nil {
4591 return gensupport.WrapError(err)
4592 }
4593 return nil
4594 }
4595
4596 type DrivesGetCall struct {
4597 s *Service
4598 driveId string
4599 urlParams_ gensupport.URLParams
4600 ifNoneMatch_ string
4601 ctx_ context.Context
4602 header_ http.Header
4603 }
4604
4605
4606
4607
4608 func (r *DrivesService) Get(driveId string) *DrivesGetCall {
4609 c := &DrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4610 c.driveId = driveId
4611 return c
4612 }
4613
4614
4615
4616
4617
4618 func (c *DrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesGetCall {
4619 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
4620 return c
4621 }
4622
4623
4624
4625
4626 func (c *DrivesGetCall) Fields(s ...googleapi.Field) *DrivesGetCall {
4627 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4628 return c
4629 }
4630
4631
4632
4633
4634 func (c *DrivesGetCall) IfNoneMatch(entityTag string) *DrivesGetCall {
4635 c.ifNoneMatch_ = entityTag
4636 return c
4637 }
4638
4639
4640 func (c *DrivesGetCall) Context(ctx context.Context) *DrivesGetCall {
4641 c.ctx_ = ctx
4642 return c
4643 }
4644
4645
4646
4647 func (c *DrivesGetCall) Header() http.Header {
4648 if c.header_ == nil {
4649 c.header_ = make(http.Header)
4650 }
4651 return c.header_
4652 }
4653
4654 func (c *DrivesGetCall) doRequest(alt string) (*http.Response, error) {
4655 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4656 if c.ifNoneMatch_ != "" {
4657 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4658 }
4659 var body io.Reader = nil
4660 c.urlParams_.Set("alt", alt)
4661 c.urlParams_.Set("prettyPrint", "false")
4662 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}")
4663 urls += "?" + c.urlParams_.Encode()
4664 req, err := http.NewRequest("GET", urls, body)
4665 if err != nil {
4666 return nil, err
4667 }
4668 req.Header = reqHeaders
4669 googleapi.Expand(req.URL, map[string]string{
4670 "driveId": c.driveId,
4671 })
4672 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4673 }
4674
4675
4676
4677
4678
4679
4680 func (c *DrivesGetCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
4681 gensupport.SetOptions(c.urlParams_, opts...)
4682 res, err := c.doRequest("json")
4683 if res != nil && res.StatusCode == http.StatusNotModified {
4684 if res.Body != nil {
4685 res.Body.Close()
4686 }
4687 return nil, gensupport.WrapError(&googleapi.Error{
4688 Code: res.StatusCode,
4689 Header: res.Header,
4690 })
4691 }
4692 if err != nil {
4693 return nil, err
4694 }
4695 defer googleapi.CloseBody(res)
4696 if err := googleapi.CheckResponse(res); err != nil {
4697 return nil, gensupport.WrapError(err)
4698 }
4699 ret := &Drive{
4700 ServerResponse: googleapi.ServerResponse{
4701 Header: res.Header,
4702 HTTPStatusCode: res.StatusCode,
4703 },
4704 }
4705 target := &ret
4706 if err := gensupport.DecodeResponse(target, res); err != nil {
4707 return nil, err
4708 }
4709 return ret, nil
4710 }
4711
4712 type DrivesHideCall struct {
4713 s *Service
4714 driveId string
4715 urlParams_ gensupport.URLParams
4716 ctx_ context.Context
4717 header_ http.Header
4718 }
4719
4720
4721
4722
4723 func (r *DrivesService) Hide(driveId string) *DrivesHideCall {
4724 c := &DrivesHideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4725 c.driveId = driveId
4726 return c
4727 }
4728
4729
4730
4731
4732 func (c *DrivesHideCall) Fields(s ...googleapi.Field) *DrivesHideCall {
4733 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4734 return c
4735 }
4736
4737
4738 func (c *DrivesHideCall) Context(ctx context.Context) *DrivesHideCall {
4739 c.ctx_ = ctx
4740 return c
4741 }
4742
4743
4744
4745 func (c *DrivesHideCall) Header() http.Header {
4746 if c.header_ == nil {
4747 c.header_ = make(http.Header)
4748 }
4749 return c.header_
4750 }
4751
4752 func (c *DrivesHideCall) doRequest(alt string) (*http.Response, error) {
4753 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4754 var body io.Reader = nil
4755 c.urlParams_.Set("alt", alt)
4756 c.urlParams_.Set("prettyPrint", "false")
4757 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/hide")
4758 urls += "?" + c.urlParams_.Encode()
4759 req, err := http.NewRequest("POST", urls, body)
4760 if err != nil {
4761 return nil, err
4762 }
4763 req.Header = reqHeaders
4764 googleapi.Expand(req.URL, map[string]string{
4765 "driveId": c.driveId,
4766 })
4767 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4768 }
4769
4770
4771
4772
4773
4774
4775 func (c *DrivesHideCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
4776 gensupport.SetOptions(c.urlParams_, opts...)
4777 res, err := c.doRequest("json")
4778 if res != nil && res.StatusCode == http.StatusNotModified {
4779 if res.Body != nil {
4780 res.Body.Close()
4781 }
4782 return nil, gensupport.WrapError(&googleapi.Error{
4783 Code: res.StatusCode,
4784 Header: res.Header,
4785 })
4786 }
4787 if err != nil {
4788 return nil, err
4789 }
4790 defer googleapi.CloseBody(res)
4791 if err := googleapi.CheckResponse(res); err != nil {
4792 return nil, gensupport.WrapError(err)
4793 }
4794 ret := &Drive{
4795 ServerResponse: googleapi.ServerResponse{
4796 Header: res.Header,
4797 HTTPStatusCode: res.StatusCode,
4798 },
4799 }
4800 target := &ret
4801 if err := gensupport.DecodeResponse(target, res); err != nil {
4802 return nil, err
4803 }
4804 return ret, nil
4805 }
4806
4807 type DrivesListCall struct {
4808 s *Service
4809 urlParams_ gensupport.URLParams
4810 ifNoneMatch_ string
4811 ctx_ context.Context
4812 header_ http.Header
4813 }
4814
4815
4816
4817
4818
4819 func (r *DrivesService) List() *DrivesListCall {
4820 c := &DrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4821 return c
4822 }
4823
4824
4825
4826 func (c *DrivesListCall) PageSize(pageSize int64) *DrivesListCall {
4827 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4828 return c
4829 }
4830
4831
4832
4833 func (c *DrivesListCall) PageToken(pageToken string) *DrivesListCall {
4834 c.urlParams_.Set("pageToken", pageToken)
4835 return c
4836 }
4837
4838
4839 func (c *DrivesListCall) Q(q string) *DrivesListCall {
4840 c.urlParams_.Set("q", q)
4841 return c
4842 }
4843
4844
4845
4846
4847
4848 func (c *DrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesListCall {
4849 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
4850 return c
4851 }
4852
4853
4854
4855
4856 func (c *DrivesListCall) Fields(s ...googleapi.Field) *DrivesListCall {
4857 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4858 return c
4859 }
4860
4861
4862
4863
4864 func (c *DrivesListCall) IfNoneMatch(entityTag string) *DrivesListCall {
4865 c.ifNoneMatch_ = entityTag
4866 return c
4867 }
4868
4869
4870 func (c *DrivesListCall) Context(ctx context.Context) *DrivesListCall {
4871 c.ctx_ = ctx
4872 return c
4873 }
4874
4875
4876
4877 func (c *DrivesListCall) Header() http.Header {
4878 if c.header_ == nil {
4879 c.header_ = make(http.Header)
4880 }
4881 return c.header_
4882 }
4883
4884 func (c *DrivesListCall) doRequest(alt string) (*http.Response, error) {
4885 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4886 if c.ifNoneMatch_ != "" {
4887 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4888 }
4889 var body io.Reader = nil
4890 c.urlParams_.Set("alt", alt)
4891 c.urlParams_.Set("prettyPrint", "false")
4892 urls := googleapi.ResolveRelative(c.s.BasePath, "drives")
4893 urls += "?" + c.urlParams_.Encode()
4894 req, err := http.NewRequest("GET", urls, body)
4895 if err != nil {
4896 return nil, err
4897 }
4898 req.Header = reqHeaders
4899 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4900 }
4901
4902
4903
4904
4905
4906
4907 func (c *DrivesListCall) Do(opts ...googleapi.CallOption) (*DriveList, error) {
4908 gensupport.SetOptions(c.urlParams_, opts...)
4909 res, err := c.doRequest("json")
4910 if res != nil && res.StatusCode == http.StatusNotModified {
4911 if res.Body != nil {
4912 res.Body.Close()
4913 }
4914 return nil, gensupport.WrapError(&googleapi.Error{
4915 Code: res.StatusCode,
4916 Header: res.Header,
4917 })
4918 }
4919 if err != nil {
4920 return nil, err
4921 }
4922 defer googleapi.CloseBody(res)
4923 if err := googleapi.CheckResponse(res); err != nil {
4924 return nil, gensupport.WrapError(err)
4925 }
4926 ret := &DriveList{
4927 ServerResponse: googleapi.ServerResponse{
4928 Header: res.Header,
4929 HTTPStatusCode: res.StatusCode,
4930 },
4931 }
4932 target := &ret
4933 if err := gensupport.DecodeResponse(target, res); err != nil {
4934 return nil, err
4935 }
4936 return ret, nil
4937 }
4938
4939
4940
4941
4942 func (c *DrivesListCall) Pages(ctx context.Context, f func(*DriveList) error) error {
4943 c.ctx_ = ctx
4944 defer c.PageToken(c.urlParams_.Get("pageToken"))
4945 for {
4946 x, err := c.Do()
4947 if err != nil {
4948 return err
4949 }
4950 if err := f(x); err != nil {
4951 return err
4952 }
4953 if x.NextPageToken == "" {
4954 return nil
4955 }
4956 c.PageToken(x.NextPageToken)
4957 }
4958 }
4959
4960 type DrivesUnhideCall struct {
4961 s *Service
4962 driveId string
4963 urlParams_ gensupport.URLParams
4964 ctx_ context.Context
4965 header_ http.Header
4966 }
4967
4968
4969
4970
4971 func (r *DrivesService) Unhide(driveId string) *DrivesUnhideCall {
4972 c := &DrivesUnhideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4973 c.driveId = driveId
4974 return c
4975 }
4976
4977
4978
4979
4980 func (c *DrivesUnhideCall) Fields(s ...googleapi.Field) *DrivesUnhideCall {
4981 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4982 return c
4983 }
4984
4985
4986 func (c *DrivesUnhideCall) Context(ctx context.Context) *DrivesUnhideCall {
4987 c.ctx_ = ctx
4988 return c
4989 }
4990
4991
4992
4993 func (c *DrivesUnhideCall) Header() http.Header {
4994 if c.header_ == nil {
4995 c.header_ = make(http.Header)
4996 }
4997 return c.header_
4998 }
4999
5000 func (c *DrivesUnhideCall) doRequest(alt string) (*http.Response, error) {
5001 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5002 var body io.Reader = nil
5003 c.urlParams_.Set("alt", alt)
5004 c.urlParams_.Set("prettyPrint", "false")
5005 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/unhide")
5006 urls += "?" + c.urlParams_.Encode()
5007 req, err := http.NewRequest("POST", urls, body)
5008 if err != nil {
5009 return nil, err
5010 }
5011 req.Header = reqHeaders
5012 googleapi.Expand(req.URL, map[string]string{
5013 "driveId": c.driveId,
5014 })
5015 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5016 }
5017
5018
5019
5020
5021
5022
5023 func (c *DrivesUnhideCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
5024 gensupport.SetOptions(c.urlParams_, opts...)
5025 res, err := c.doRequest("json")
5026 if res != nil && res.StatusCode == http.StatusNotModified {
5027 if res.Body != nil {
5028 res.Body.Close()
5029 }
5030 return nil, gensupport.WrapError(&googleapi.Error{
5031 Code: res.StatusCode,
5032 Header: res.Header,
5033 })
5034 }
5035 if err != nil {
5036 return nil, err
5037 }
5038 defer googleapi.CloseBody(res)
5039 if err := googleapi.CheckResponse(res); err != nil {
5040 return nil, gensupport.WrapError(err)
5041 }
5042 ret := &Drive{
5043 ServerResponse: googleapi.ServerResponse{
5044 Header: res.Header,
5045 HTTPStatusCode: res.StatusCode,
5046 },
5047 }
5048 target := &ret
5049 if err := gensupport.DecodeResponse(target, res); err != nil {
5050 return nil, err
5051 }
5052 return ret, nil
5053 }
5054
5055 type DrivesUpdateCall struct {
5056 s *Service
5057 driveId string
5058 drive *Drive
5059 urlParams_ gensupport.URLParams
5060 ctx_ context.Context
5061 header_ http.Header
5062 }
5063
5064
5065
5066
5067 func (r *DrivesService) Update(driveId string, drive *Drive) *DrivesUpdateCall {
5068 c := &DrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5069 c.driveId = driveId
5070 c.drive = drive
5071 return c
5072 }
5073
5074
5075
5076
5077
5078 func (c *DrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesUpdateCall {
5079 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
5080 return c
5081 }
5082
5083
5084
5085
5086 func (c *DrivesUpdateCall) Fields(s ...googleapi.Field) *DrivesUpdateCall {
5087 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5088 return c
5089 }
5090
5091
5092 func (c *DrivesUpdateCall) Context(ctx context.Context) *DrivesUpdateCall {
5093 c.ctx_ = ctx
5094 return c
5095 }
5096
5097
5098
5099 func (c *DrivesUpdateCall) Header() http.Header {
5100 if c.header_ == nil {
5101 c.header_ = make(http.Header)
5102 }
5103 return c.header_
5104 }
5105
5106 func (c *DrivesUpdateCall) doRequest(alt string) (*http.Response, error) {
5107 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5108 var body io.Reader = nil
5109 body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive)
5110 if err != nil {
5111 return nil, err
5112 }
5113 c.urlParams_.Set("alt", alt)
5114 c.urlParams_.Set("prettyPrint", "false")
5115 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}")
5116 urls += "?" + c.urlParams_.Encode()
5117 req, err := http.NewRequest("PATCH", urls, body)
5118 if err != nil {
5119 return nil, err
5120 }
5121 req.Header = reqHeaders
5122 googleapi.Expand(req.URL, map[string]string{
5123 "driveId": c.driveId,
5124 })
5125 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5126 }
5127
5128
5129
5130
5131
5132
5133 func (c *DrivesUpdateCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
5134 gensupport.SetOptions(c.urlParams_, opts...)
5135 res, err := c.doRequest("json")
5136 if res != nil && res.StatusCode == http.StatusNotModified {
5137 if res.Body != nil {
5138 res.Body.Close()
5139 }
5140 return nil, gensupport.WrapError(&googleapi.Error{
5141 Code: res.StatusCode,
5142 Header: res.Header,
5143 })
5144 }
5145 if err != nil {
5146 return nil, err
5147 }
5148 defer googleapi.CloseBody(res)
5149 if err := googleapi.CheckResponse(res); err != nil {
5150 return nil, gensupport.WrapError(err)
5151 }
5152 ret := &Drive{
5153 ServerResponse: googleapi.ServerResponse{
5154 Header: res.Header,
5155 HTTPStatusCode: res.StatusCode,
5156 },
5157 }
5158 target := &ret
5159 if err := gensupport.DecodeResponse(target, res); err != nil {
5160 return nil, err
5161 }
5162 return ret, nil
5163 }
5164
5165 type FilesCopyCall struct {
5166 s *Service
5167 fileId string
5168 file *File
5169 urlParams_ gensupport.URLParams
5170 ctx_ context.Context
5171 header_ http.Header
5172 }
5173
5174
5175
5176
5177
5178 func (r *FilesService) Copy(fileId string, file *File) *FilesCopyCall {
5179 c := &FilesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5180 c.fileId = fileId
5181 c.file = file
5182 return c
5183 }
5184
5185
5186
5187
5188 func (c *FilesCopyCall) EnforceSingleParent(enforceSingleParent bool) *FilesCopyCall {
5189 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
5190 return c
5191 }
5192
5193
5194
5195
5196
5197
5198
5199 func (c *FilesCopyCall) IgnoreDefaultVisibility(ignoreDefaultVisibility bool) *FilesCopyCall {
5200 c.urlParams_.Set("ignoreDefaultVisibility", fmt.Sprint(ignoreDefaultVisibility))
5201 return c
5202 }
5203
5204
5205
5206 func (c *FilesCopyCall) IncludeLabels(includeLabels string) *FilesCopyCall {
5207 c.urlParams_.Set("includeLabels", includeLabels)
5208 return c
5209 }
5210
5211
5212
5213
5214 func (c *FilesCopyCall) IncludePermissionsForView(includePermissionsForView string) *FilesCopyCall {
5215 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
5216 return c
5217 }
5218
5219
5220
5221
5222
5223
5224 func (c *FilesCopyCall) KeepRevisionForever(keepRevisionForever bool) *FilesCopyCall {
5225 c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever))
5226 return c
5227 }
5228
5229
5230
5231 func (c *FilesCopyCall) OcrLanguage(ocrLanguage string) *FilesCopyCall {
5232 c.urlParams_.Set("ocrLanguage", ocrLanguage)
5233 return c
5234 }
5235
5236
5237
5238 func (c *FilesCopyCall) SupportsAllDrives(supportsAllDrives bool) *FilesCopyCall {
5239 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
5240 return c
5241 }
5242
5243
5244
5245 func (c *FilesCopyCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesCopyCall {
5246 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
5247 return c
5248 }
5249
5250
5251
5252
5253 func (c *FilesCopyCall) Fields(s ...googleapi.Field) *FilesCopyCall {
5254 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5255 return c
5256 }
5257
5258
5259 func (c *FilesCopyCall) Context(ctx context.Context) *FilesCopyCall {
5260 c.ctx_ = ctx
5261 return c
5262 }
5263
5264
5265
5266 func (c *FilesCopyCall) Header() http.Header {
5267 if c.header_ == nil {
5268 c.header_ = make(http.Header)
5269 }
5270 return c.header_
5271 }
5272
5273 func (c *FilesCopyCall) doRequest(alt string) (*http.Response, error) {
5274 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5275 var body io.Reader = nil
5276 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file)
5277 if err != nil {
5278 return nil, err
5279 }
5280 c.urlParams_.Set("alt", alt)
5281 c.urlParams_.Set("prettyPrint", "false")
5282 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/copy")
5283 urls += "?" + c.urlParams_.Encode()
5284 req, err := http.NewRequest("POST", urls, body)
5285 if err != nil {
5286 return nil, err
5287 }
5288 req.Header = reqHeaders
5289 googleapi.Expand(req.URL, map[string]string{
5290 "fileId": c.fileId,
5291 })
5292 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5293 }
5294
5295
5296
5297
5298
5299
5300 func (c *FilesCopyCall) Do(opts ...googleapi.CallOption) (*File, error) {
5301 gensupport.SetOptions(c.urlParams_, opts...)
5302 res, err := c.doRequest("json")
5303 if res != nil && res.StatusCode == http.StatusNotModified {
5304 if res.Body != nil {
5305 res.Body.Close()
5306 }
5307 return nil, gensupport.WrapError(&googleapi.Error{
5308 Code: res.StatusCode,
5309 Header: res.Header,
5310 })
5311 }
5312 if err != nil {
5313 return nil, err
5314 }
5315 defer googleapi.CloseBody(res)
5316 if err := googleapi.CheckResponse(res); err != nil {
5317 return nil, gensupport.WrapError(err)
5318 }
5319 ret := &File{
5320 ServerResponse: googleapi.ServerResponse{
5321 Header: res.Header,
5322 HTTPStatusCode: res.StatusCode,
5323 },
5324 }
5325 target := &ret
5326 if err := gensupport.DecodeResponse(target, res); err != nil {
5327 return nil, err
5328 }
5329 return ret, nil
5330 }
5331
5332 type FilesCreateCall struct {
5333 s *Service
5334 file *File
5335 urlParams_ gensupport.URLParams
5336 mediaInfo_ *gensupport.MediaInfo
5337 ctx_ context.Context
5338 header_ http.Header
5339 }
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359 func (r *FilesService) Create(file *File) *FilesCreateCall {
5360 c := &FilesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5361 c.file = file
5362 return c
5363 }
5364
5365
5366
5367 func (c *FilesCreateCall) EnforceSingleParent(enforceSingleParent bool) *FilesCreateCall {
5368 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
5369 return c
5370 }
5371
5372
5373
5374
5375
5376
5377
5378 func (c *FilesCreateCall) IgnoreDefaultVisibility(ignoreDefaultVisibility bool) *FilesCreateCall {
5379 c.urlParams_.Set("ignoreDefaultVisibility", fmt.Sprint(ignoreDefaultVisibility))
5380 return c
5381 }
5382
5383
5384
5385 func (c *FilesCreateCall) IncludeLabels(includeLabels string) *FilesCreateCall {
5386 c.urlParams_.Set("includeLabels", includeLabels)
5387 return c
5388 }
5389
5390
5391
5392
5393 func (c *FilesCreateCall) IncludePermissionsForView(includePermissionsForView string) *FilesCreateCall {
5394 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
5395 return c
5396 }
5397
5398
5399
5400
5401
5402
5403 func (c *FilesCreateCall) KeepRevisionForever(keepRevisionForever bool) *FilesCreateCall {
5404 c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever))
5405 return c
5406 }
5407
5408
5409
5410 func (c *FilesCreateCall) OcrLanguage(ocrLanguage string) *FilesCreateCall {
5411 c.urlParams_.Set("ocrLanguage", ocrLanguage)
5412 return c
5413 }
5414
5415
5416
5417 func (c *FilesCreateCall) SupportsAllDrives(supportsAllDrives bool) *FilesCreateCall {
5418 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
5419 return c
5420 }
5421
5422
5423
5424 func (c *FilesCreateCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesCreateCall {
5425 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
5426 return c
5427 }
5428
5429
5430
5431
5432 func (c *FilesCreateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesCreateCall {
5433 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText))
5434 return c
5435 }
5436
5437
5438
5439
5440
5441
5442
5443
5444 func (c *FilesCreateCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesCreateCall {
5445 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
5446 return c
5447 }
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458 func (c *FilesCreateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesCreateCall {
5459 c.ctx_ = ctx
5460 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
5461 return c
5462 }
5463
5464
5465
5466
5467
5468 func (c *FilesCreateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesCreateCall {
5469 c.mediaInfo_.SetProgressUpdater(pu)
5470 return c
5471 }
5472
5473
5474
5475
5476 func (c *FilesCreateCall) Fields(s ...googleapi.Field) *FilesCreateCall {
5477 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5478 return c
5479 }
5480
5481
5482
5483
5484 func (c *FilesCreateCall) Context(ctx context.Context) *FilesCreateCall {
5485 c.ctx_ = ctx
5486 return c
5487 }
5488
5489
5490
5491 func (c *FilesCreateCall) Header() http.Header {
5492 if c.header_ == nil {
5493 c.header_ = make(http.Header)
5494 }
5495 return c.header_
5496 }
5497
5498 func (c *FilesCreateCall) doRequest(alt string) (*http.Response, error) {
5499 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5500 var body io.Reader = nil
5501 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file)
5502 if err != nil {
5503 return nil, err
5504 }
5505 c.urlParams_.Set("alt", alt)
5506 c.urlParams_.Set("prettyPrint", "false")
5507 urls := googleapi.ResolveRelative(c.s.BasePath, "files")
5508 if c.mediaInfo_ != nil {
5509 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v3/files")
5510 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
5511 }
5512 if body == nil {
5513 body = new(bytes.Buffer)
5514 reqHeaders.Set("Content-Type", "application/json")
5515 }
5516 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
5517 defer cleanup()
5518 urls += "?" + c.urlParams_.Encode()
5519 req, err := http.NewRequest("POST", urls, body)
5520 if err != nil {
5521 return nil, err
5522 }
5523 req.Header = reqHeaders
5524 req.GetBody = getBody
5525 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5526 }
5527
5528
5529
5530
5531
5532
5533 func (c *FilesCreateCall) Do(opts ...googleapi.CallOption) (*File, error) {
5534 gensupport.SetOptions(c.urlParams_, opts...)
5535 res, err := c.doRequest("json")
5536 if res != nil && res.StatusCode == http.StatusNotModified {
5537 if res.Body != nil {
5538 res.Body.Close()
5539 }
5540 return nil, gensupport.WrapError(&googleapi.Error{
5541 Code: res.StatusCode,
5542 Header: res.Header,
5543 })
5544 }
5545 if err != nil {
5546 return nil, err
5547 }
5548 defer googleapi.CloseBody(res)
5549 if err := googleapi.CheckResponse(res); err != nil {
5550 return nil, gensupport.WrapError(err)
5551 }
5552 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
5553 if rx != nil {
5554 rx.Client = c.s.client
5555 rx.UserAgent = c.s.userAgent()
5556 ctx := c.ctx_
5557 if ctx == nil {
5558 ctx = context.TODO()
5559 }
5560 res, err = rx.Upload(ctx)
5561 if err != nil {
5562 return nil, err
5563 }
5564 defer res.Body.Close()
5565 if err := googleapi.CheckResponse(res); err != nil {
5566 return nil, gensupport.WrapError(err)
5567 }
5568 }
5569 ret := &File{
5570 ServerResponse: googleapi.ServerResponse{
5571 Header: res.Header,
5572 HTTPStatusCode: res.StatusCode,
5573 },
5574 }
5575 target := &ret
5576 if err := gensupport.DecodeResponse(target, res); err != nil {
5577 return nil, err
5578 }
5579 return ret, nil
5580 }
5581
5582 type FilesDeleteCall struct {
5583 s *Service
5584 fileId string
5585 urlParams_ gensupport.URLParams
5586 ctx_ context.Context
5587 header_ http.Header
5588 }
5589
5590
5591
5592
5593
5594
5595
5596 func (r *FilesService) Delete(fileId string) *FilesDeleteCall {
5597 c := &FilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5598 c.fileId = fileId
5599 return c
5600 }
5601
5602
5603
5604
5605
5606 func (c *FilesDeleteCall) EnforceSingleParent(enforceSingleParent bool) *FilesDeleteCall {
5607 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
5608 return c
5609 }
5610
5611
5612
5613 func (c *FilesDeleteCall) SupportsAllDrives(supportsAllDrives bool) *FilesDeleteCall {
5614 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
5615 return c
5616 }
5617
5618
5619
5620 func (c *FilesDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesDeleteCall {
5621 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
5622 return c
5623 }
5624
5625
5626
5627
5628 func (c *FilesDeleteCall) Fields(s ...googleapi.Field) *FilesDeleteCall {
5629 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5630 return c
5631 }
5632
5633
5634 func (c *FilesDeleteCall) Context(ctx context.Context) *FilesDeleteCall {
5635 c.ctx_ = ctx
5636 return c
5637 }
5638
5639
5640
5641 func (c *FilesDeleteCall) Header() http.Header {
5642 if c.header_ == nil {
5643 c.header_ = make(http.Header)
5644 }
5645 return c.header_
5646 }
5647
5648 func (c *FilesDeleteCall) doRequest(alt string) (*http.Response, error) {
5649 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5650 var body io.Reader = nil
5651 c.urlParams_.Set("alt", alt)
5652 c.urlParams_.Set("prettyPrint", "false")
5653 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}")
5654 urls += "?" + c.urlParams_.Encode()
5655 req, err := http.NewRequest("DELETE", urls, body)
5656 if err != nil {
5657 return nil, err
5658 }
5659 req.Header = reqHeaders
5660 googleapi.Expand(req.URL, map[string]string{
5661 "fileId": c.fileId,
5662 })
5663 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5664 }
5665
5666
5667 func (c *FilesDeleteCall) Do(opts ...googleapi.CallOption) error {
5668 gensupport.SetOptions(c.urlParams_, opts...)
5669 res, err := c.doRequest("json")
5670 if err != nil {
5671 return err
5672 }
5673 defer googleapi.CloseBody(res)
5674 if err := googleapi.CheckResponse(res); err != nil {
5675 return gensupport.WrapError(err)
5676 }
5677 return nil
5678 }
5679
5680 type FilesEmptyTrashCall struct {
5681 s *Service
5682 urlParams_ gensupport.URLParams
5683 ctx_ context.Context
5684 header_ http.Header
5685 }
5686
5687
5688 func (r *FilesService) EmptyTrash() *FilesEmptyTrashCall {
5689 c := &FilesEmptyTrashCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5690 return c
5691 }
5692
5693
5694
5695 func (c *FilesEmptyTrashCall) DriveId(driveId string) *FilesEmptyTrashCall {
5696 c.urlParams_.Set("driveId", driveId)
5697 return c
5698 }
5699
5700
5701
5702
5703
5704 func (c *FilesEmptyTrashCall) EnforceSingleParent(enforceSingleParent bool) *FilesEmptyTrashCall {
5705 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
5706 return c
5707 }
5708
5709
5710
5711
5712 func (c *FilesEmptyTrashCall) Fields(s ...googleapi.Field) *FilesEmptyTrashCall {
5713 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5714 return c
5715 }
5716
5717
5718 func (c *FilesEmptyTrashCall) Context(ctx context.Context) *FilesEmptyTrashCall {
5719 c.ctx_ = ctx
5720 return c
5721 }
5722
5723
5724
5725 func (c *FilesEmptyTrashCall) Header() http.Header {
5726 if c.header_ == nil {
5727 c.header_ = make(http.Header)
5728 }
5729 return c.header_
5730 }
5731
5732 func (c *FilesEmptyTrashCall) doRequest(alt string) (*http.Response, error) {
5733 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5734 var body io.Reader = nil
5735 c.urlParams_.Set("alt", alt)
5736 c.urlParams_.Set("prettyPrint", "false")
5737 urls := googleapi.ResolveRelative(c.s.BasePath, "files/trash")
5738 urls += "?" + c.urlParams_.Encode()
5739 req, err := http.NewRequest("DELETE", urls, body)
5740 if err != nil {
5741 return nil, err
5742 }
5743 req.Header = reqHeaders
5744 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5745 }
5746
5747
5748 func (c *FilesEmptyTrashCall) Do(opts ...googleapi.CallOption) error {
5749 gensupport.SetOptions(c.urlParams_, opts...)
5750 res, err := c.doRequest("json")
5751 if err != nil {
5752 return err
5753 }
5754 defer googleapi.CloseBody(res)
5755 if err := googleapi.CheckResponse(res); err != nil {
5756 return gensupport.WrapError(err)
5757 }
5758 return nil
5759 }
5760
5761 type FilesExportCall struct {
5762 s *Service
5763 fileId string
5764 urlParams_ gensupport.URLParams
5765 ifNoneMatch_ string
5766 ctx_ context.Context
5767 header_ http.Header
5768 }
5769
5770
5771
5772
5773
5774
5775
5776 func (r *FilesService) Export(fileId string, mimeType string) *FilesExportCall {
5777 c := &FilesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5778 c.fileId = fileId
5779 c.urlParams_.Set("mimeType", mimeType)
5780 return c
5781 }
5782
5783
5784
5785
5786 func (c *FilesExportCall) Fields(s ...googleapi.Field) *FilesExportCall {
5787 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5788 return c
5789 }
5790
5791
5792
5793
5794 func (c *FilesExportCall) IfNoneMatch(entityTag string) *FilesExportCall {
5795 c.ifNoneMatch_ = entityTag
5796 return c
5797 }
5798
5799
5800 func (c *FilesExportCall) Context(ctx context.Context) *FilesExportCall {
5801 c.ctx_ = ctx
5802 return c
5803 }
5804
5805
5806
5807 func (c *FilesExportCall) Header() http.Header {
5808 if c.header_ == nil {
5809 c.header_ = make(http.Header)
5810 }
5811 return c.header_
5812 }
5813
5814 func (c *FilesExportCall) doRequest(alt string) (*http.Response, error) {
5815 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5816 if c.ifNoneMatch_ != "" {
5817 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5818 }
5819 var body io.Reader = nil
5820 c.urlParams_.Set("alt", alt)
5821 c.urlParams_.Set("prettyPrint", "false")
5822 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/export")
5823 urls += "?" + c.urlParams_.Encode()
5824 req, err := http.NewRequest("GET", urls, body)
5825 if err != nil {
5826 return nil, err
5827 }
5828 req.Header = reqHeaders
5829 googleapi.Expand(req.URL, map[string]string{
5830 "fileId": c.fileId,
5831 })
5832 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5833 }
5834
5835
5836
5837
5838 func (c *FilesExportCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
5839 gensupport.SetOptions(c.urlParams_, opts...)
5840 res, err := c.doRequest("media")
5841 if err != nil {
5842 return nil, err
5843 }
5844 if err := googleapi.CheckResponse(res); err != nil {
5845 res.Body.Close()
5846 return nil, gensupport.WrapError(err)
5847 }
5848 return res, nil
5849 }
5850
5851
5852 func (c *FilesExportCall) Do(opts ...googleapi.CallOption) error {
5853 gensupport.SetOptions(c.urlParams_, opts...)
5854 res, err := c.doRequest("json")
5855 if err != nil {
5856 return err
5857 }
5858 defer googleapi.CloseBody(res)
5859 if err := googleapi.CheckResponse(res); err != nil {
5860 return gensupport.WrapError(err)
5861 }
5862 return nil
5863 }
5864
5865 type FilesGenerateIdsCall struct {
5866 s *Service
5867 urlParams_ gensupport.URLParams
5868 ifNoneMatch_ string
5869 ctx_ context.Context
5870 header_ http.Header
5871 }
5872
5873
5874
5875 func (r *FilesService) GenerateIds() *FilesGenerateIdsCall {
5876 c := &FilesGenerateIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5877 return c
5878 }
5879
5880
5881 func (c *FilesGenerateIdsCall) Count(count int64) *FilesGenerateIdsCall {
5882 c.urlParams_.Set("count", fmt.Sprint(count))
5883 return c
5884 }
5885
5886
5887
5888
5889 func (c *FilesGenerateIdsCall) Space(space string) *FilesGenerateIdsCall {
5890 c.urlParams_.Set("space", space)
5891 return c
5892 }
5893
5894
5895
5896
5897 func (c *FilesGenerateIdsCall) Type(type_ string) *FilesGenerateIdsCall {
5898 c.urlParams_.Set("type", type_)
5899 return c
5900 }
5901
5902
5903
5904
5905 func (c *FilesGenerateIdsCall) Fields(s ...googleapi.Field) *FilesGenerateIdsCall {
5906 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5907 return c
5908 }
5909
5910
5911
5912
5913 func (c *FilesGenerateIdsCall) IfNoneMatch(entityTag string) *FilesGenerateIdsCall {
5914 c.ifNoneMatch_ = entityTag
5915 return c
5916 }
5917
5918
5919 func (c *FilesGenerateIdsCall) Context(ctx context.Context) *FilesGenerateIdsCall {
5920 c.ctx_ = ctx
5921 return c
5922 }
5923
5924
5925
5926 func (c *FilesGenerateIdsCall) Header() http.Header {
5927 if c.header_ == nil {
5928 c.header_ = make(http.Header)
5929 }
5930 return c.header_
5931 }
5932
5933 func (c *FilesGenerateIdsCall) doRequest(alt string) (*http.Response, error) {
5934 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5935 if c.ifNoneMatch_ != "" {
5936 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5937 }
5938 var body io.Reader = nil
5939 c.urlParams_.Set("alt", alt)
5940 c.urlParams_.Set("prettyPrint", "false")
5941 urls := googleapi.ResolveRelative(c.s.BasePath, "files/generateIds")
5942 urls += "?" + c.urlParams_.Encode()
5943 req, err := http.NewRequest("GET", urls, body)
5944 if err != nil {
5945 return nil, err
5946 }
5947 req.Header = reqHeaders
5948 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5949 }
5950
5951
5952
5953
5954
5955
5956 func (c *FilesGenerateIdsCall) Do(opts ...googleapi.CallOption) (*GeneratedIds, error) {
5957 gensupport.SetOptions(c.urlParams_, opts...)
5958 res, err := c.doRequest("json")
5959 if res != nil && res.StatusCode == http.StatusNotModified {
5960 if res.Body != nil {
5961 res.Body.Close()
5962 }
5963 return nil, gensupport.WrapError(&googleapi.Error{
5964 Code: res.StatusCode,
5965 Header: res.Header,
5966 })
5967 }
5968 if err != nil {
5969 return nil, err
5970 }
5971 defer googleapi.CloseBody(res)
5972 if err := googleapi.CheckResponse(res); err != nil {
5973 return nil, gensupport.WrapError(err)
5974 }
5975 ret := &GeneratedIds{
5976 ServerResponse: googleapi.ServerResponse{
5977 Header: res.Header,
5978 HTTPStatusCode: res.StatusCode,
5979 },
5980 }
5981 target := &ret
5982 if err := gensupport.DecodeResponse(target, res); err != nil {
5983 return nil, err
5984 }
5985 return ret, nil
5986 }
5987
5988 type FilesGetCall struct {
5989 s *Service
5990 fileId string
5991 urlParams_ gensupport.URLParams
5992 ifNoneMatch_ string
5993 ctx_ context.Context
5994 header_ http.Header
5995 }
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006 func (r *FilesService) Get(fileId string) *FilesGetCall {
6007 c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6008 c.fileId = fileId
6009 return c
6010 }
6011
6012
6013
6014
6015 func (c *FilesGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesGetCall {
6016 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse))
6017 return c
6018 }
6019
6020
6021
6022 func (c *FilesGetCall) IncludeLabels(includeLabels string) *FilesGetCall {
6023 c.urlParams_.Set("includeLabels", includeLabels)
6024 return c
6025 }
6026
6027
6028
6029
6030 func (c *FilesGetCall) IncludePermissionsForView(includePermissionsForView string) *FilesGetCall {
6031 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
6032 return c
6033 }
6034
6035
6036
6037 func (c *FilesGetCall) SupportsAllDrives(supportsAllDrives bool) *FilesGetCall {
6038 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
6039 return c
6040 }
6041
6042
6043
6044 func (c *FilesGetCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesGetCall {
6045 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
6046 return c
6047 }
6048
6049
6050
6051
6052 func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
6053 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6054 return c
6055 }
6056
6057
6058
6059
6060 func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
6061 c.ifNoneMatch_ = entityTag
6062 return c
6063 }
6064
6065
6066 func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
6067 c.ctx_ = ctx
6068 return c
6069 }
6070
6071
6072
6073 func (c *FilesGetCall) Header() http.Header {
6074 if c.header_ == nil {
6075 c.header_ = make(http.Header)
6076 }
6077 return c.header_
6078 }
6079
6080 func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
6081 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6082 if c.ifNoneMatch_ != "" {
6083 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6084 }
6085 var body io.Reader = nil
6086 c.urlParams_.Set("alt", alt)
6087 c.urlParams_.Set("prettyPrint", "false")
6088 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}")
6089 urls += "?" + c.urlParams_.Encode()
6090 req, err := http.NewRequest("GET", urls, body)
6091 if err != nil {
6092 return nil, err
6093 }
6094 req.Header = reqHeaders
6095 googleapi.Expand(req.URL, map[string]string{
6096 "fileId": c.fileId,
6097 })
6098 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6099 }
6100
6101
6102
6103
6104 func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
6105 gensupport.SetOptions(c.urlParams_, opts...)
6106 res, err := c.doRequest("media")
6107 if err != nil {
6108 return nil, err
6109 }
6110 if err := googleapi.CheckResponse(res); err != nil {
6111 res.Body.Close()
6112 return nil, gensupport.WrapError(err)
6113 }
6114 return res, nil
6115 }
6116
6117
6118
6119
6120
6121
6122 func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
6123 gensupport.SetOptions(c.urlParams_, opts...)
6124 res, err := c.doRequest("json")
6125 if res != nil && res.StatusCode == http.StatusNotModified {
6126 if res.Body != nil {
6127 res.Body.Close()
6128 }
6129 return nil, gensupport.WrapError(&googleapi.Error{
6130 Code: res.StatusCode,
6131 Header: res.Header,
6132 })
6133 }
6134 if err != nil {
6135 return nil, err
6136 }
6137 defer googleapi.CloseBody(res)
6138 if err := googleapi.CheckResponse(res); err != nil {
6139 return nil, gensupport.WrapError(err)
6140 }
6141 ret := &File{
6142 ServerResponse: googleapi.ServerResponse{
6143 Header: res.Header,
6144 HTTPStatusCode: res.StatusCode,
6145 },
6146 }
6147 target := &ret
6148 if err := gensupport.DecodeResponse(target, res); err != nil {
6149 return nil, err
6150 }
6151 return ret, nil
6152 }
6153
6154 type FilesListCall struct {
6155 s *Service
6156 urlParams_ gensupport.URLParams
6157 ifNoneMatch_ string
6158 ctx_ context.Context
6159 header_ http.Header
6160 }
6161
6162
6163
6164
6165
6166
6167
6168 func (r *FilesService) List() *FilesListCall {
6169 c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6170 return c
6171 }
6172
6173
6174
6175
6176
6177
6178 func (c *FilesListCall) Corpora(corpora string) *FilesListCall {
6179 c.urlParams_.Set("corpora", corpora)
6180 return c
6181 }
6182
6183
6184
6185
6186
6187
6188
6189
6190 func (c *FilesListCall) Corpus(corpus string) *FilesListCall {
6191 c.urlParams_.Set("corpus", corpus)
6192 return c
6193 }
6194
6195
6196
6197 func (c *FilesListCall) DriveId(driveId string) *FilesListCall {
6198 c.urlParams_.Set("driveId", driveId)
6199 return c
6200 }
6201
6202
6203
6204
6205 func (c *FilesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *FilesListCall {
6206 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives))
6207 return c
6208 }
6209
6210
6211
6212 func (c *FilesListCall) IncludeLabels(includeLabels string) *FilesListCall {
6213 c.urlParams_.Set("includeLabels", includeLabels)
6214 return c
6215 }
6216
6217
6218
6219
6220 func (c *FilesListCall) IncludePermissionsForView(includePermissionsForView string) *FilesListCall {
6221 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
6222 return c
6223 }
6224
6225
6226
6227 func (c *FilesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *FilesListCall {
6228 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems))
6229 return c
6230 }
6231
6232
6233
6234
6235
6236
6237
6238 func (c *FilesListCall) OrderBy(orderBy string) *FilesListCall {
6239 c.urlParams_.Set("orderBy", orderBy)
6240 return c
6241 }
6242
6243
6244
6245
6246 func (c *FilesListCall) PageSize(pageSize int64) *FilesListCall {
6247 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6248 return c
6249 }
6250
6251
6252
6253
6254 func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
6255 c.urlParams_.Set("pageToken", pageToken)
6256 return c
6257 }
6258
6259
6260
6261 func (c *FilesListCall) Q(q string) *FilesListCall {
6262 c.urlParams_.Set("q", q)
6263 return c
6264 }
6265
6266
6267
6268
6269 func (c *FilesListCall) Spaces(spaces string) *FilesListCall {
6270 c.urlParams_.Set("spaces", spaces)
6271 return c
6272 }
6273
6274
6275
6276 func (c *FilesListCall) SupportsAllDrives(supportsAllDrives bool) *FilesListCall {
6277 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
6278 return c
6279 }
6280
6281
6282
6283 func (c *FilesListCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesListCall {
6284 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
6285 return c
6286 }
6287
6288
6289
6290 func (c *FilesListCall) TeamDriveId(teamDriveId string) *FilesListCall {
6291 c.urlParams_.Set("teamDriveId", teamDriveId)
6292 return c
6293 }
6294
6295
6296
6297
6298 func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
6299 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6300 return c
6301 }
6302
6303
6304
6305
6306 func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
6307 c.ifNoneMatch_ = entityTag
6308 return c
6309 }
6310
6311
6312 func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
6313 c.ctx_ = ctx
6314 return c
6315 }
6316
6317
6318
6319 func (c *FilesListCall) Header() http.Header {
6320 if c.header_ == nil {
6321 c.header_ = make(http.Header)
6322 }
6323 return c.header_
6324 }
6325
6326 func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
6327 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6328 if c.ifNoneMatch_ != "" {
6329 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6330 }
6331 var body io.Reader = nil
6332 c.urlParams_.Set("alt", alt)
6333 c.urlParams_.Set("prettyPrint", "false")
6334 urls := googleapi.ResolveRelative(c.s.BasePath, "files")
6335 urls += "?" + c.urlParams_.Encode()
6336 req, err := http.NewRequest("GET", urls, body)
6337 if err != nil {
6338 return nil, err
6339 }
6340 req.Header = reqHeaders
6341 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6342 }
6343
6344
6345
6346
6347
6348
6349 func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
6350 gensupport.SetOptions(c.urlParams_, opts...)
6351 res, err := c.doRequest("json")
6352 if res != nil && res.StatusCode == http.StatusNotModified {
6353 if res.Body != nil {
6354 res.Body.Close()
6355 }
6356 return nil, gensupport.WrapError(&googleapi.Error{
6357 Code: res.StatusCode,
6358 Header: res.Header,
6359 })
6360 }
6361 if err != nil {
6362 return nil, err
6363 }
6364 defer googleapi.CloseBody(res)
6365 if err := googleapi.CheckResponse(res); err != nil {
6366 return nil, gensupport.WrapError(err)
6367 }
6368 ret := &FileList{
6369 ServerResponse: googleapi.ServerResponse{
6370 Header: res.Header,
6371 HTTPStatusCode: res.StatusCode,
6372 },
6373 }
6374 target := &ret
6375 if err := gensupport.DecodeResponse(target, res); err != nil {
6376 return nil, err
6377 }
6378 return ret, nil
6379 }
6380
6381
6382
6383
6384 func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
6385 c.ctx_ = ctx
6386 defer c.PageToken(c.urlParams_.Get("pageToken"))
6387 for {
6388 x, err := c.Do()
6389 if err != nil {
6390 return err
6391 }
6392 if err := f(x); err != nil {
6393 return err
6394 }
6395 if x.NextPageToken == "" {
6396 return nil
6397 }
6398 c.PageToken(x.NextPageToken)
6399 }
6400 }
6401
6402 type FilesListLabelsCall struct {
6403 s *Service
6404 fileId string
6405 urlParams_ gensupport.URLParams
6406 ifNoneMatch_ string
6407 ctx_ context.Context
6408 header_ http.Header
6409 }
6410
6411
6412
6413
6414 func (r *FilesService) ListLabels(fileId string) *FilesListLabelsCall {
6415 c := &FilesListLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6416 c.fileId = fileId
6417 return c
6418 }
6419
6420
6421
6422 func (c *FilesListLabelsCall) MaxResults(maxResults int64) *FilesListLabelsCall {
6423 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
6424 return c
6425 }
6426
6427
6428
6429
6430 func (c *FilesListLabelsCall) PageToken(pageToken string) *FilesListLabelsCall {
6431 c.urlParams_.Set("pageToken", pageToken)
6432 return c
6433 }
6434
6435
6436
6437
6438 func (c *FilesListLabelsCall) Fields(s ...googleapi.Field) *FilesListLabelsCall {
6439 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6440 return c
6441 }
6442
6443
6444
6445
6446 func (c *FilesListLabelsCall) IfNoneMatch(entityTag string) *FilesListLabelsCall {
6447 c.ifNoneMatch_ = entityTag
6448 return c
6449 }
6450
6451
6452 func (c *FilesListLabelsCall) Context(ctx context.Context) *FilesListLabelsCall {
6453 c.ctx_ = ctx
6454 return c
6455 }
6456
6457
6458
6459 func (c *FilesListLabelsCall) Header() http.Header {
6460 if c.header_ == nil {
6461 c.header_ = make(http.Header)
6462 }
6463 return c.header_
6464 }
6465
6466 func (c *FilesListLabelsCall) doRequest(alt string) (*http.Response, error) {
6467 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6468 if c.ifNoneMatch_ != "" {
6469 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6470 }
6471 var body io.Reader = nil
6472 c.urlParams_.Set("alt", alt)
6473 c.urlParams_.Set("prettyPrint", "false")
6474 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/listLabels")
6475 urls += "?" + c.urlParams_.Encode()
6476 req, err := http.NewRequest("GET", urls, body)
6477 if err != nil {
6478 return nil, err
6479 }
6480 req.Header = reqHeaders
6481 googleapi.Expand(req.URL, map[string]string{
6482 "fileId": c.fileId,
6483 })
6484 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6485 }
6486
6487
6488
6489
6490
6491
6492 func (c *FilesListLabelsCall) Do(opts ...googleapi.CallOption) (*LabelList, error) {
6493 gensupport.SetOptions(c.urlParams_, opts...)
6494 res, err := c.doRequest("json")
6495 if res != nil && res.StatusCode == http.StatusNotModified {
6496 if res.Body != nil {
6497 res.Body.Close()
6498 }
6499 return nil, gensupport.WrapError(&googleapi.Error{
6500 Code: res.StatusCode,
6501 Header: res.Header,
6502 })
6503 }
6504 if err != nil {
6505 return nil, err
6506 }
6507 defer googleapi.CloseBody(res)
6508 if err := googleapi.CheckResponse(res); err != nil {
6509 return nil, gensupport.WrapError(err)
6510 }
6511 ret := &LabelList{
6512 ServerResponse: googleapi.ServerResponse{
6513 Header: res.Header,
6514 HTTPStatusCode: res.StatusCode,
6515 },
6516 }
6517 target := &ret
6518 if err := gensupport.DecodeResponse(target, res); err != nil {
6519 return nil, err
6520 }
6521 return ret, nil
6522 }
6523
6524
6525
6526
6527 func (c *FilesListLabelsCall) Pages(ctx context.Context, f func(*LabelList) error) error {
6528 c.ctx_ = ctx
6529 defer c.PageToken(c.urlParams_.Get("pageToken"))
6530 for {
6531 x, err := c.Do()
6532 if err != nil {
6533 return err
6534 }
6535 if err := f(x); err != nil {
6536 return err
6537 }
6538 if x.NextPageToken == "" {
6539 return nil
6540 }
6541 c.PageToken(x.NextPageToken)
6542 }
6543 }
6544
6545 type FilesModifyLabelsCall struct {
6546 s *Service
6547 fileId string
6548 modifylabelsrequest *ModifyLabelsRequest
6549 urlParams_ gensupport.URLParams
6550 ctx_ context.Context
6551 header_ http.Header
6552 }
6553
6554
6555
6556
6557
6558 func (r *FilesService) ModifyLabels(fileId string, modifylabelsrequest *ModifyLabelsRequest) *FilesModifyLabelsCall {
6559 c := &FilesModifyLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6560 c.fileId = fileId
6561 c.modifylabelsrequest = modifylabelsrequest
6562 return c
6563 }
6564
6565
6566
6567
6568 func (c *FilesModifyLabelsCall) Fields(s ...googleapi.Field) *FilesModifyLabelsCall {
6569 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6570 return c
6571 }
6572
6573
6574 func (c *FilesModifyLabelsCall) Context(ctx context.Context) *FilesModifyLabelsCall {
6575 c.ctx_ = ctx
6576 return c
6577 }
6578
6579
6580
6581 func (c *FilesModifyLabelsCall) Header() http.Header {
6582 if c.header_ == nil {
6583 c.header_ = make(http.Header)
6584 }
6585 return c.header_
6586 }
6587
6588 func (c *FilesModifyLabelsCall) doRequest(alt string) (*http.Response, error) {
6589 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6590 var body io.Reader = nil
6591 body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifylabelsrequest)
6592 if err != nil {
6593 return nil, err
6594 }
6595 c.urlParams_.Set("alt", alt)
6596 c.urlParams_.Set("prettyPrint", "false")
6597 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/modifyLabels")
6598 urls += "?" + c.urlParams_.Encode()
6599 req, err := http.NewRequest("POST", urls, body)
6600 if err != nil {
6601 return nil, err
6602 }
6603 req.Header = reqHeaders
6604 googleapi.Expand(req.URL, map[string]string{
6605 "fileId": c.fileId,
6606 })
6607 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6608 }
6609
6610
6611
6612
6613
6614
6615
6616 func (c *FilesModifyLabelsCall) Do(opts ...googleapi.CallOption) (*ModifyLabelsResponse, error) {
6617 gensupport.SetOptions(c.urlParams_, opts...)
6618 res, err := c.doRequest("json")
6619 if res != nil && res.StatusCode == http.StatusNotModified {
6620 if res.Body != nil {
6621 res.Body.Close()
6622 }
6623 return nil, gensupport.WrapError(&googleapi.Error{
6624 Code: res.StatusCode,
6625 Header: res.Header,
6626 })
6627 }
6628 if err != nil {
6629 return nil, err
6630 }
6631 defer googleapi.CloseBody(res)
6632 if err := googleapi.CheckResponse(res); err != nil {
6633 return nil, gensupport.WrapError(err)
6634 }
6635 ret := &ModifyLabelsResponse{
6636 ServerResponse: googleapi.ServerResponse{
6637 Header: res.Header,
6638 HTTPStatusCode: res.StatusCode,
6639 },
6640 }
6641 target := &ret
6642 if err := gensupport.DecodeResponse(target, res); err != nil {
6643 return nil, err
6644 }
6645 return ret, nil
6646 }
6647
6648 type FilesUpdateCall struct {
6649 s *Service
6650 fileId string
6651 file *File
6652 urlParams_ gensupport.URLParams
6653 mediaInfo_ *gensupport.MediaInfo
6654 ctx_ context.Context
6655 header_ http.Header
6656 }
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670 func (r *FilesService) Update(fileId string, file *File) *FilesUpdateCall {
6671 c := &FilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6672 c.fileId = fileId
6673 c.file = file
6674 return c
6675 }
6676
6677
6678
6679 func (c *FilesUpdateCall) AddParents(addParents string) *FilesUpdateCall {
6680 c.urlParams_.Set("addParents", addParents)
6681 return c
6682 }
6683
6684
6685
6686
6687 func (c *FilesUpdateCall) EnforceSingleParent(enforceSingleParent bool) *FilesUpdateCall {
6688 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
6689 return c
6690 }
6691
6692
6693
6694 func (c *FilesUpdateCall) IncludeLabels(includeLabels string) *FilesUpdateCall {
6695 c.urlParams_.Set("includeLabels", includeLabels)
6696 return c
6697 }
6698
6699
6700
6701
6702 func (c *FilesUpdateCall) IncludePermissionsForView(includePermissionsForView string) *FilesUpdateCall {
6703 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
6704 return c
6705 }
6706
6707
6708
6709
6710
6711
6712 func (c *FilesUpdateCall) KeepRevisionForever(keepRevisionForever bool) *FilesUpdateCall {
6713 c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever))
6714 return c
6715 }
6716
6717
6718
6719 func (c *FilesUpdateCall) OcrLanguage(ocrLanguage string) *FilesUpdateCall {
6720 c.urlParams_.Set("ocrLanguage", ocrLanguage)
6721 return c
6722 }
6723
6724
6725
6726 func (c *FilesUpdateCall) RemoveParents(removeParents string) *FilesUpdateCall {
6727 c.urlParams_.Set("removeParents", removeParents)
6728 return c
6729 }
6730
6731
6732
6733 func (c *FilesUpdateCall) SupportsAllDrives(supportsAllDrives bool) *FilesUpdateCall {
6734 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
6735 return c
6736 }
6737
6738
6739
6740 func (c *FilesUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesUpdateCall {
6741 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
6742 return c
6743 }
6744
6745
6746
6747
6748 func (c *FilesUpdateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesUpdateCall {
6749 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText))
6750 return c
6751 }
6752
6753
6754
6755
6756
6757
6758
6759
6760 func (c *FilesUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesUpdateCall {
6761 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
6762 return c
6763 }
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774 func (c *FilesUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesUpdateCall {
6775 c.ctx_ = ctx
6776 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
6777 return c
6778 }
6779
6780
6781
6782
6783
6784 func (c *FilesUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesUpdateCall {
6785 c.mediaInfo_.SetProgressUpdater(pu)
6786 return c
6787 }
6788
6789
6790
6791
6792 func (c *FilesUpdateCall) Fields(s ...googleapi.Field) *FilesUpdateCall {
6793 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6794 return c
6795 }
6796
6797
6798
6799
6800 func (c *FilesUpdateCall) Context(ctx context.Context) *FilesUpdateCall {
6801 c.ctx_ = ctx
6802 return c
6803 }
6804
6805
6806
6807 func (c *FilesUpdateCall) Header() http.Header {
6808 if c.header_ == nil {
6809 c.header_ = make(http.Header)
6810 }
6811 return c.header_
6812 }
6813
6814 func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) {
6815 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6816 var body io.Reader = nil
6817 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file)
6818 if err != nil {
6819 return nil, err
6820 }
6821 c.urlParams_.Set("alt", alt)
6822 c.urlParams_.Set("prettyPrint", "false")
6823 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}")
6824 if c.mediaInfo_ != nil {
6825 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v3/files/{fileId}")
6826 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
6827 }
6828 if body == nil {
6829 body = new(bytes.Buffer)
6830 reqHeaders.Set("Content-Type", "application/json")
6831 }
6832 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
6833 defer cleanup()
6834 urls += "?" + c.urlParams_.Encode()
6835 req, err := http.NewRequest("PATCH", urls, body)
6836 if err != nil {
6837 return nil, err
6838 }
6839 req.Header = reqHeaders
6840 req.GetBody = getBody
6841 googleapi.Expand(req.URL, map[string]string{
6842 "fileId": c.fileId,
6843 })
6844 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6845 }
6846
6847
6848
6849
6850
6851
6852 func (c *FilesUpdateCall) Do(opts ...googleapi.CallOption) (*File, error) {
6853 gensupport.SetOptions(c.urlParams_, opts...)
6854 res, err := c.doRequest("json")
6855 if res != nil && res.StatusCode == http.StatusNotModified {
6856 if res.Body != nil {
6857 res.Body.Close()
6858 }
6859 return nil, gensupport.WrapError(&googleapi.Error{
6860 Code: res.StatusCode,
6861 Header: res.Header,
6862 })
6863 }
6864 if err != nil {
6865 return nil, err
6866 }
6867 defer googleapi.CloseBody(res)
6868 if err := googleapi.CheckResponse(res); err != nil {
6869 return nil, gensupport.WrapError(err)
6870 }
6871 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
6872 if rx != nil {
6873 rx.Client = c.s.client
6874 rx.UserAgent = c.s.userAgent()
6875 ctx := c.ctx_
6876 if ctx == nil {
6877 ctx = context.TODO()
6878 }
6879 res, err = rx.Upload(ctx)
6880 if err != nil {
6881 return nil, err
6882 }
6883 defer res.Body.Close()
6884 if err := googleapi.CheckResponse(res); err != nil {
6885 return nil, gensupport.WrapError(err)
6886 }
6887 }
6888 ret := &File{
6889 ServerResponse: googleapi.ServerResponse{
6890 Header: res.Header,
6891 HTTPStatusCode: res.StatusCode,
6892 },
6893 }
6894 target := &ret
6895 if err := gensupport.DecodeResponse(target, res); err != nil {
6896 return nil, err
6897 }
6898 return ret, nil
6899 }
6900
6901 type FilesWatchCall struct {
6902 s *Service
6903 fileId string
6904 channel *Channel
6905 urlParams_ gensupport.URLParams
6906 ctx_ context.Context
6907 header_ http.Header
6908 }
6909
6910
6911
6912
6913 func (r *FilesService) Watch(fileId string, channel *Channel) *FilesWatchCall {
6914 c := &FilesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6915 c.fileId = fileId
6916 c.channel = channel
6917 return c
6918 }
6919
6920
6921
6922
6923 func (c *FilesWatchCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesWatchCall {
6924 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse))
6925 return c
6926 }
6927
6928
6929
6930 func (c *FilesWatchCall) IncludeLabels(includeLabels string) *FilesWatchCall {
6931 c.urlParams_.Set("includeLabels", includeLabels)
6932 return c
6933 }
6934
6935
6936
6937
6938 func (c *FilesWatchCall) IncludePermissionsForView(includePermissionsForView string) *FilesWatchCall {
6939 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
6940 return c
6941 }
6942
6943
6944
6945 func (c *FilesWatchCall) SupportsAllDrives(supportsAllDrives bool) *FilesWatchCall {
6946 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
6947 return c
6948 }
6949
6950
6951
6952 func (c *FilesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesWatchCall {
6953 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
6954 return c
6955 }
6956
6957
6958
6959
6960 func (c *FilesWatchCall) Fields(s ...googleapi.Field) *FilesWatchCall {
6961 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6962 return c
6963 }
6964
6965
6966 func (c *FilesWatchCall) Context(ctx context.Context) *FilesWatchCall {
6967 c.ctx_ = ctx
6968 return c
6969 }
6970
6971
6972
6973 func (c *FilesWatchCall) Header() http.Header {
6974 if c.header_ == nil {
6975 c.header_ = make(http.Header)
6976 }
6977 return c.header_
6978 }
6979
6980 func (c *FilesWatchCall) doRequest(alt string) (*http.Response, error) {
6981 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6982 var body io.Reader = nil
6983 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
6984 if err != nil {
6985 return nil, err
6986 }
6987 c.urlParams_.Set("alt", alt)
6988 c.urlParams_.Set("prettyPrint", "false")
6989 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/watch")
6990 urls += "?" + c.urlParams_.Encode()
6991 req, err := http.NewRequest("POST", urls, body)
6992 if err != nil {
6993 return nil, err
6994 }
6995 req.Header = reqHeaders
6996 googleapi.Expand(req.URL, map[string]string{
6997 "fileId": c.fileId,
6998 })
6999 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7000 }
7001
7002
7003
7004
7005
7006
7007 func (c *FilesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
7008 gensupport.SetOptions(c.urlParams_, opts...)
7009 res, err := c.doRequest("json")
7010 if res != nil && res.StatusCode == http.StatusNotModified {
7011 if res.Body != nil {
7012 res.Body.Close()
7013 }
7014 return nil, gensupport.WrapError(&googleapi.Error{
7015 Code: res.StatusCode,
7016 Header: res.Header,
7017 })
7018 }
7019 if err != nil {
7020 return nil, err
7021 }
7022 defer googleapi.CloseBody(res)
7023 if err := googleapi.CheckResponse(res); err != nil {
7024 return nil, gensupport.WrapError(err)
7025 }
7026 ret := &Channel{
7027 ServerResponse: googleapi.ServerResponse{
7028 Header: res.Header,
7029 HTTPStatusCode: res.StatusCode,
7030 },
7031 }
7032 target := &ret
7033 if err := gensupport.DecodeResponse(target, res); err != nil {
7034 return nil, err
7035 }
7036 return ret, nil
7037 }
7038
7039 type PermissionsCreateCall struct {
7040 s *Service
7041 fileId string
7042 permission *Permission
7043 urlParams_ gensupport.URLParams
7044 ctx_ context.Context
7045 header_ http.Header
7046 }
7047
7048
7049
7050
7051
7052
7053 func (r *PermissionsService) Create(fileId string, permission *Permission) *PermissionsCreateCall {
7054 c := &PermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7055 c.fileId = fileId
7056 c.permission = permission
7057 return c
7058 }
7059
7060
7061
7062 func (c *PermissionsCreateCall) EmailMessage(emailMessage string) *PermissionsCreateCall {
7063 c.urlParams_.Set("emailMessage", emailMessage)
7064 return c
7065 }
7066
7067
7068
7069 func (c *PermissionsCreateCall) EnforceSingleParent(enforceSingleParent bool) *PermissionsCreateCall {
7070 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
7071 return c
7072 }
7073
7074
7075
7076
7077
7078
7079 func (c *PermissionsCreateCall) MoveToNewOwnersRoot(moveToNewOwnersRoot bool) *PermissionsCreateCall {
7080 c.urlParams_.Set("moveToNewOwnersRoot", fmt.Sprint(moveToNewOwnersRoot))
7081 return c
7082 }
7083
7084
7085
7086
7087
7088 func (c *PermissionsCreateCall) SendNotificationEmail(sendNotificationEmail bool) *PermissionsCreateCall {
7089 c.urlParams_.Set("sendNotificationEmail", fmt.Sprint(sendNotificationEmail))
7090 return c
7091 }
7092
7093
7094
7095 func (c *PermissionsCreateCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsCreateCall {
7096 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
7097 return c
7098 }
7099
7100
7101
7102 func (c *PermissionsCreateCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsCreateCall {
7103 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
7104 return c
7105 }
7106
7107
7108
7109
7110
7111 func (c *PermissionsCreateCall) TransferOwnership(transferOwnership bool) *PermissionsCreateCall {
7112 c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership))
7113 return c
7114 }
7115
7116
7117
7118
7119
7120
7121 func (c *PermissionsCreateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsCreateCall {
7122 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
7123 return c
7124 }
7125
7126
7127
7128
7129 func (c *PermissionsCreateCall) Fields(s ...googleapi.Field) *PermissionsCreateCall {
7130 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7131 return c
7132 }
7133
7134
7135 func (c *PermissionsCreateCall) Context(ctx context.Context) *PermissionsCreateCall {
7136 c.ctx_ = ctx
7137 return c
7138 }
7139
7140
7141
7142 func (c *PermissionsCreateCall) Header() http.Header {
7143 if c.header_ == nil {
7144 c.header_ = make(http.Header)
7145 }
7146 return c.header_
7147 }
7148
7149 func (c *PermissionsCreateCall) doRequest(alt string) (*http.Response, error) {
7150 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7151 var body io.Reader = nil
7152 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission)
7153 if err != nil {
7154 return nil, err
7155 }
7156 c.urlParams_.Set("alt", alt)
7157 c.urlParams_.Set("prettyPrint", "false")
7158 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions")
7159 urls += "?" + c.urlParams_.Encode()
7160 req, err := http.NewRequest("POST", urls, body)
7161 if err != nil {
7162 return nil, err
7163 }
7164 req.Header = reqHeaders
7165 googleapi.Expand(req.URL, map[string]string{
7166 "fileId": c.fileId,
7167 })
7168 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7169 }
7170
7171
7172
7173
7174
7175
7176 func (c *PermissionsCreateCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
7177 gensupport.SetOptions(c.urlParams_, opts...)
7178 res, err := c.doRequest("json")
7179 if res != nil && res.StatusCode == http.StatusNotModified {
7180 if res.Body != nil {
7181 res.Body.Close()
7182 }
7183 return nil, gensupport.WrapError(&googleapi.Error{
7184 Code: res.StatusCode,
7185 Header: res.Header,
7186 })
7187 }
7188 if err != nil {
7189 return nil, err
7190 }
7191 defer googleapi.CloseBody(res)
7192 if err := googleapi.CheckResponse(res); err != nil {
7193 return nil, gensupport.WrapError(err)
7194 }
7195 ret := &Permission{
7196 ServerResponse: googleapi.ServerResponse{
7197 Header: res.Header,
7198 HTTPStatusCode: res.StatusCode,
7199 },
7200 }
7201 target := &ret
7202 if err := gensupport.DecodeResponse(target, res); err != nil {
7203 return nil, err
7204 }
7205 return ret, nil
7206 }
7207
7208 type PermissionsDeleteCall struct {
7209 s *Service
7210 fileId string
7211 permissionId string
7212 urlParams_ gensupport.URLParams
7213 ctx_ context.Context
7214 header_ http.Header
7215 }
7216
7217
7218
7219
7220
7221
7222 func (r *PermissionsService) Delete(fileId string, permissionId string) *PermissionsDeleteCall {
7223 c := &PermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7224 c.fileId = fileId
7225 c.permissionId = permissionId
7226 return c
7227 }
7228
7229
7230
7231 func (c *PermissionsDeleteCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsDeleteCall {
7232 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
7233 return c
7234 }
7235
7236
7237
7238 func (c *PermissionsDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsDeleteCall {
7239 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
7240 return c
7241 }
7242
7243
7244
7245
7246
7247
7248 func (c *PermissionsDeleteCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsDeleteCall {
7249 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
7250 return c
7251 }
7252
7253
7254
7255
7256 func (c *PermissionsDeleteCall) Fields(s ...googleapi.Field) *PermissionsDeleteCall {
7257 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7258 return c
7259 }
7260
7261
7262 func (c *PermissionsDeleteCall) Context(ctx context.Context) *PermissionsDeleteCall {
7263 c.ctx_ = ctx
7264 return c
7265 }
7266
7267
7268
7269 func (c *PermissionsDeleteCall) Header() http.Header {
7270 if c.header_ == nil {
7271 c.header_ = make(http.Header)
7272 }
7273 return c.header_
7274 }
7275
7276 func (c *PermissionsDeleteCall) doRequest(alt string) (*http.Response, error) {
7277 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7278 var body io.Reader = nil
7279 c.urlParams_.Set("alt", alt)
7280 c.urlParams_.Set("prettyPrint", "false")
7281 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}")
7282 urls += "?" + c.urlParams_.Encode()
7283 req, err := http.NewRequest("DELETE", urls, body)
7284 if err != nil {
7285 return nil, err
7286 }
7287 req.Header = reqHeaders
7288 googleapi.Expand(req.URL, map[string]string{
7289 "fileId": c.fileId,
7290 "permissionId": c.permissionId,
7291 })
7292 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7293 }
7294
7295
7296 func (c *PermissionsDeleteCall) Do(opts ...googleapi.CallOption) error {
7297 gensupport.SetOptions(c.urlParams_, opts...)
7298 res, err := c.doRequest("json")
7299 if err != nil {
7300 return err
7301 }
7302 defer googleapi.CloseBody(res)
7303 if err := googleapi.CheckResponse(res); err != nil {
7304 return gensupport.WrapError(err)
7305 }
7306 return nil
7307 }
7308
7309 type PermissionsGetCall struct {
7310 s *Service
7311 fileId string
7312 permissionId string
7313 urlParams_ gensupport.URLParams
7314 ifNoneMatch_ string
7315 ctx_ context.Context
7316 header_ http.Header
7317 }
7318
7319
7320
7321
7322
7323 func (r *PermissionsService) Get(fileId string, permissionId string) *PermissionsGetCall {
7324 c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7325 c.fileId = fileId
7326 c.permissionId = permissionId
7327 return c
7328 }
7329
7330
7331
7332 func (c *PermissionsGetCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsGetCall {
7333 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
7334 return c
7335 }
7336
7337
7338
7339 func (c *PermissionsGetCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsGetCall {
7340 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
7341 return c
7342 }
7343
7344
7345
7346
7347
7348
7349 func (c *PermissionsGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsGetCall {
7350 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
7351 return c
7352 }
7353
7354
7355
7356
7357 func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall {
7358 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7359 return c
7360 }
7361
7362
7363
7364
7365 func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall {
7366 c.ifNoneMatch_ = entityTag
7367 return c
7368 }
7369
7370
7371 func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall {
7372 c.ctx_ = ctx
7373 return c
7374 }
7375
7376
7377
7378 func (c *PermissionsGetCall) Header() http.Header {
7379 if c.header_ == nil {
7380 c.header_ = make(http.Header)
7381 }
7382 return c.header_
7383 }
7384
7385 func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) {
7386 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7387 if c.ifNoneMatch_ != "" {
7388 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7389 }
7390 var body io.Reader = nil
7391 c.urlParams_.Set("alt", alt)
7392 c.urlParams_.Set("prettyPrint", "false")
7393 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}")
7394 urls += "?" + c.urlParams_.Encode()
7395 req, err := http.NewRequest("GET", urls, body)
7396 if err != nil {
7397 return nil, err
7398 }
7399 req.Header = reqHeaders
7400 googleapi.Expand(req.URL, map[string]string{
7401 "fileId": c.fileId,
7402 "permissionId": c.permissionId,
7403 })
7404 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7405 }
7406
7407
7408
7409
7410
7411
7412 func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
7413 gensupport.SetOptions(c.urlParams_, opts...)
7414 res, err := c.doRequest("json")
7415 if res != nil && res.StatusCode == http.StatusNotModified {
7416 if res.Body != nil {
7417 res.Body.Close()
7418 }
7419 return nil, gensupport.WrapError(&googleapi.Error{
7420 Code: res.StatusCode,
7421 Header: res.Header,
7422 })
7423 }
7424 if err != nil {
7425 return nil, err
7426 }
7427 defer googleapi.CloseBody(res)
7428 if err := googleapi.CheckResponse(res); err != nil {
7429 return nil, gensupport.WrapError(err)
7430 }
7431 ret := &Permission{
7432 ServerResponse: googleapi.ServerResponse{
7433 Header: res.Header,
7434 HTTPStatusCode: res.StatusCode,
7435 },
7436 }
7437 target := &ret
7438 if err := gensupport.DecodeResponse(target, res); err != nil {
7439 return nil, err
7440 }
7441 return ret, nil
7442 }
7443
7444 type PermissionsListCall struct {
7445 s *Service
7446 fileId string
7447 urlParams_ gensupport.URLParams
7448 ifNoneMatch_ string
7449 ctx_ context.Context
7450 header_ http.Header
7451 }
7452
7453
7454
7455
7456 func (r *PermissionsService) List(fileId string) *PermissionsListCall {
7457 c := &PermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7458 c.fileId = fileId
7459 return c
7460 }
7461
7462
7463
7464
7465 func (c *PermissionsListCall) IncludePermissionsForView(includePermissionsForView string) *PermissionsListCall {
7466 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
7467 return c
7468 }
7469
7470
7471
7472
7473
7474 func (c *PermissionsListCall) PageSize(pageSize int64) *PermissionsListCall {
7475 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7476 return c
7477 }
7478
7479
7480
7481
7482 func (c *PermissionsListCall) PageToken(pageToken string) *PermissionsListCall {
7483 c.urlParams_.Set("pageToken", pageToken)
7484 return c
7485 }
7486
7487
7488
7489 func (c *PermissionsListCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsListCall {
7490 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
7491 return c
7492 }
7493
7494
7495
7496 func (c *PermissionsListCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsListCall {
7497 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
7498 return c
7499 }
7500
7501
7502
7503
7504
7505
7506 func (c *PermissionsListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsListCall {
7507 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
7508 return c
7509 }
7510
7511
7512
7513
7514 func (c *PermissionsListCall) Fields(s ...googleapi.Field) *PermissionsListCall {
7515 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7516 return c
7517 }
7518
7519
7520
7521
7522 func (c *PermissionsListCall) IfNoneMatch(entityTag string) *PermissionsListCall {
7523 c.ifNoneMatch_ = entityTag
7524 return c
7525 }
7526
7527
7528 func (c *PermissionsListCall) Context(ctx context.Context) *PermissionsListCall {
7529 c.ctx_ = ctx
7530 return c
7531 }
7532
7533
7534
7535 func (c *PermissionsListCall) Header() http.Header {
7536 if c.header_ == nil {
7537 c.header_ = make(http.Header)
7538 }
7539 return c.header_
7540 }
7541
7542 func (c *PermissionsListCall) doRequest(alt string) (*http.Response, error) {
7543 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7544 if c.ifNoneMatch_ != "" {
7545 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7546 }
7547 var body io.Reader = nil
7548 c.urlParams_.Set("alt", alt)
7549 c.urlParams_.Set("prettyPrint", "false")
7550 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions")
7551 urls += "?" + c.urlParams_.Encode()
7552 req, err := http.NewRequest("GET", urls, body)
7553 if err != nil {
7554 return nil, err
7555 }
7556 req.Header = reqHeaders
7557 googleapi.Expand(req.URL, map[string]string{
7558 "fileId": c.fileId,
7559 })
7560 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7561 }
7562
7563
7564
7565
7566
7567
7568 func (c *PermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionList, error) {
7569 gensupport.SetOptions(c.urlParams_, opts...)
7570 res, err := c.doRequest("json")
7571 if res != nil && res.StatusCode == http.StatusNotModified {
7572 if res.Body != nil {
7573 res.Body.Close()
7574 }
7575 return nil, gensupport.WrapError(&googleapi.Error{
7576 Code: res.StatusCode,
7577 Header: res.Header,
7578 })
7579 }
7580 if err != nil {
7581 return nil, err
7582 }
7583 defer googleapi.CloseBody(res)
7584 if err := googleapi.CheckResponse(res); err != nil {
7585 return nil, gensupport.WrapError(err)
7586 }
7587 ret := &PermissionList{
7588 ServerResponse: googleapi.ServerResponse{
7589 Header: res.Header,
7590 HTTPStatusCode: res.StatusCode,
7591 },
7592 }
7593 target := &ret
7594 if err := gensupport.DecodeResponse(target, res); err != nil {
7595 return nil, err
7596 }
7597 return ret, nil
7598 }
7599
7600
7601
7602
7603 func (c *PermissionsListCall) Pages(ctx context.Context, f func(*PermissionList) error) error {
7604 c.ctx_ = ctx
7605 defer c.PageToken(c.urlParams_.Get("pageToken"))
7606 for {
7607 x, err := c.Do()
7608 if err != nil {
7609 return err
7610 }
7611 if err := f(x); err != nil {
7612 return err
7613 }
7614 if x.NextPageToken == "" {
7615 return nil
7616 }
7617 c.PageToken(x.NextPageToken)
7618 }
7619 }
7620
7621 type PermissionsUpdateCall struct {
7622 s *Service
7623 fileId string
7624 permissionId string
7625 permission *Permission
7626 urlParams_ gensupport.URLParams
7627 ctx_ context.Context
7628 header_ http.Header
7629 }
7630
7631
7632
7633
7634
7635
7636
7637 func (r *PermissionsService) Update(fileId string, permissionId string, permission *Permission) *PermissionsUpdateCall {
7638 c := &PermissionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7639 c.fileId = fileId
7640 c.permissionId = permissionId
7641 c.permission = permission
7642 return c
7643 }
7644
7645
7646
7647 func (c *PermissionsUpdateCall) RemoveExpiration(removeExpiration bool) *PermissionsUpdateCall {
7648 c.urlParams_.Set("removeExpiration", fmt.Sprint(removeExpiration))
7649 return c
7650 }
7651
7652
7653
7654 func (c *PermissionsUpdateCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsUpdateCall {
7655 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
7656 return c
7657 }
7658
7659
7660
7661 func (c *PermissionsUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsUpdateCall {
7662 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
7663 return c
7664 }
7665
7666
7667
7668
7669
7670 func (c *PermissionsUpdateCall) TransferOwnership(transferOwnership bool) *PermissionsUpdateCall {
7671 c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership))
7672 return c
7673 }
7674
7675
7676
7677
7678
7679
7680 func (c *PermissionsUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsUpdateCall {
7681 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
7682 return c
7683 }
7684
7685
7686
7687
7688 func (c *PermissionsUpdateCall) Fields(s ...googleapi.Field) *PermissionsUpdateCall {
7689 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7690 return c
7691 }
7692
7693
7694 func (c *PermissionsUpdateCall) Context(ctx context.Context) *PermissionsUpdateCall {
7695 c.ctx_ = ctx
7696 return c
7697 }
7698
7699
7700
7701 func (c *PermissionsUpdateCall) Header() http.Header {
7702 if c.header_ == nil {
7703 c.header_ = make(http.Header)
7704 }
7705 return c.header_
7706 }
7707
7708 func (c *PermissionsUpdateCall) doRequest(alt string) (*http.Response, error) {
7709 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7710 var body io.Reader = nil
7711 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission)
7712 if err != nil {
7713 return nil, err
7714 }
7715 c.urlParams_.Set("alt", alt)
7716 c.urlParams_.Set("prettyPrint", "false")
7717 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}")
7718 urls += "?" + c.urlParams_.Encode()
7719 req, err := http.NewRequest("PATCH", urls, body)
7720 if err != nil {
7721 return nil, err
7722 }
7723 req.Header = reqHeaders
7724 googleapi.Expand(req.URL, map[string]string{
7725 "fileId": c.fileId,
7726 "permissionId": c.permissionId,
7727 })
7728 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7729 }
7730
7731
7732
7733
7734
7735
7736 func (c *PermissionsUpdateCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
7737 gensupport.SetOptions(c.urlParams_, opts...)
7738 res, err := c.doRequest("json")
7739 if res != nil && res.StatusCode == http.StatusNotModified {
7740 if res.Body != nil {
7741 res.Body.Close()
7742 }
7743 return nil, gensupport.WrapError(&googleapi.Error{
7744 Code: res.StatusCode,
7745 Header: res.Header,
7746 })
7747 }
7748 if err != nil {
7749 return nil, err
7750 }
7751 defer googleapi.CloseBody(res)
7752 if err := googleapi.CheckResponse(res); err != nil {
7753 return nil, gensupport.WrapError(err)
7754 }
7755 ret := &Permission{
7756 ServerResponse: googleapi.ServerResponse{
7757 Header: res.Header,
7758 HTTPStatusCode: res.StatusCode,
7759 },
7760 }
7761 target := &ret
7762 if err := gensupport.DecodeResponse(target, res); err != nil {
7763 return nil, err
7764 }
7765 return ret, nil
7766 }
7767
7768 type RepliesCreateCall struct {
7769 s *Service
7770 fileId string
7771 commentId string
7772 reply *Reply
7773 urlParams_ gensupport.URLParams
7774 ctx_ context.Context
7775 header_ http.Header
7776 }
7777
7778
7779
7780
7781
7782 func (r *RepliesService) Create(fileId string, commentId string, reply *Reply) *RepliesCreateCall {
7783 c := &RepliesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7784 c.fileId = fileId
7785 c.commentId = commentId
7786 c.reply = reply
7787 return c
7788 }
7789
7790
7791
7792
7793 func (c *RepliesCreateCall) Fields(s ...googleapi.Field) *RepliesCreateCall {
7794 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7795 return c
7796 }
7797
7798
7799 func (c *RepliesCreateCall) Context(ctx context.Context) *RepliesCreateCall {
7800 c.ctx_ = ctx
7801 return c
7802 }
7803
7804
7805
7806 func (c *RepliesCreateCall) Header() http.Header {
7807 if c.header_ == nil {
7808 c.header_ = make(http.Header)
7809 }
7810 return c.header_
7811 }
7812
7813 func (c *RepliesCreateCall) doRequest(alt string) (*http.Response, error) {
7814 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7815 var body io.Reader = nil
7816 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reply)
7817 if err != nil {
7818 return nil, err
7819 }
7820 c.urlParams_.Set("alt", alt)
7821 c.urlParams_.Set("prettyPrint", "false")
7822 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies")
7823 urls += "?" + c.urlParams_.Encode()
7824 req, err := http.NewRequest("POST", urls, body)
7825 if err != nil {
7826 return nil, err
7827 }
7828 req.Header = reqHeaders
7829 googleapi.Expand(req.URL, map[string]string{
7830 "fileId": c.fileId,
7831 "commentId": c.commentId,
7832 })
7833 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7834 }
7835
7836
7837
7838
7839
7840
7841 func (c *RepliesCreateCall) Do(opts ...googleapi.CallOption) (*Reply, error) {
7842 gensupport.SetOptions(c.urlParams_, opts...)
7843 res, err := c.doRequest("json")
7844 if res != nil && res.StatusCode == http.StatusNotModified {
7845 if res.Body != nil {
7846 res.Body.Close()
7847 }
7848 return nil, gensupport.WrapError(&googleapi.Error{
7849 Code: res.StatusCode,
7850 Header: res.Header,
7851 })
7852 }
7853 if err != nil {
7854 return nil, err
7855 }
7856 defer googleapi.CloseBody(res)
7857 if err := googleapi.CheckResponse(res); err != nil {
7858 return nil, gensupport.WrapError(err)
7859 }
7860 ret := &Reply{
7861 ServerResponse: googleapi.ServerResponse{
7862 Header: res.Header,
7863 HTTPStatusCode: res.StatusCode,
7864 },
7865 }
7866 target := &ret
7867 if err := gensupport.DecodeResponse(target, res); err != nil {
7868 return nil, err
7869 }
7870 return ret, nil
7871 }
7872
7873 type RepliesDeleteCall struct {
7874 s *Service
7875 fileId string
7876 commentId string
7877 replyId string
7878 urlParams_ gensupport.URLParams
7879 ctx_ context.Context
7880 header_ http.Header
7881 }
7882
7883
7884
7885
7886
7887
7888 func (r *RepliesService) Delete(fileId string, commentId string, replyId string) *RepliesDeleteCall {
7889 c := &RepliesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7890 c.fileId = fileId
7891 c.commentId = commentId
7892 c.replyId = replyId
7893 return c
7894 }
7895
7896
7897
7898
7899 func (c *RepliesDeleteCall) Fields(s ...googleapi.Field) *RepliesDeleteCall {
7900 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7901 return c
7902 }
7903
7904
7905 func (c *RepliesDeleteCall) Context(ctx context.Context) *RepliesDeleteCall {
7906 c.ctx_ = ctx
7907 return c
7908 }
7909
7910
7911
7912 func (c *RepliesDeleteCall) Header() http.Header {
7913 if c.header_ == nil {
7914 c.header_ = make(http.Header)
7915 }
7916 return c.header_
7917 }
7918
7919 func (c *RepliesDeleteCall) doRequest(alt string) (*http.Response, error) {
7920 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7921 var body io.Reader = nil
7922 c.urlParams_.Set("alt", alt)
7923 c.urlParams_.Set("prettyPrint", "false")
7924 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}")
7925 urls += "?" + c.urlParams_.Encode()
7926 req, err := http.NewRequest("DELETE", urls, body)
7927 if err != nil {
7928 return nil, err
7929 }
7930 req.Header = reqHeaders
7931 googleapi.Expand(req.URL, map[string]string{
7932 "fileId": c.fileId,
7933 "commentId": c.commentId,
7934 "replyId": c.replyId,
7935 })
7936 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7937 }
7938
7939
7940 func (c *RepliesDeleteCall) Do(opts ...googleapi.CallOption) error {
7941 gensupport.SetOptions(c.urlParams_, opts...)
7942 res, err := c.doRequest("json")
7943 if err != nil {
7944 return err
7945 }
7946 defer googleapi.CloseBody(res)
7947 if err := googleapi.CheckResponse(res); err != nil {
7948 return gensupport.WrapError(err)
7949 }
7950 return nil
7951 }
7952
7953 type RepliesGetCall struct {
7954 s *Service
7955 fileId string
7956 commentId string
7957 replyId string
7958 urlParams_ gensupport.URLParams
7959 ifNoneMatch_ string
7960 ctx_ context.Context
7961 header_ http.Header
7962 }
7963
7964
7965
7966
7967
7968
7969 func (r *RepliesService) Get(fileId string, commentId string, replyId string) *RepliesGetCall {
7970 c := &RepliesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7971 c.fileId = fileId
7972 c.commentId = commentId
7973 c.replyId = replyId
7974 return c
7975 }
7976
7977
7978
7979
7980 func (c *RepliesGetCall) IncludeDeleted(includeDeleted bool) *RepliesGetCall {
7981 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
7982 return c
7983 }
7984
7985
7986
7987
7988 func (c *RepliesGetCall) Fields(s ...googleapi.Field) *RepliesGetCall {
7989 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7990 return c
7991 }
7992
7993
7994
7995
7996 func (c *RepliesGetCall) IfNoneMatch(entityTag string) *RepliesGetCall {
7997 c.ifNoneMatch_ = entityTag
7998 return c
7999 }
8000
8001
8002 func (c *RepliesGetCall) Context(ctx context.Context) *RepliesGetCall {
8003 c.ctx_ = ctx
8004 return c
8005 }
8006
8007
8008
8009 func (c *RepliesGetCall) Header() http.Header {
8010 if c.header_ == nil {
8011 c.header_ = make(http.Header)
8012 }
8013 return c.header_
8014 }
8015
8016 func (c *RepliesGetCall) doRequest(alt string) (*http.Response, error) {
8017 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8018 if c.ifNoneMatch_ != "" {
8019 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8020 }
8021 var body io.Reader = nil
8022 c.urlParams_.Set("alt", alt)
8023 c.urlParams_.Set("prettyPrint", "false")
8024 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}")
8025 urls += "?" + c.urlParams_.Encode()
8026 req, err := http.NewRequest("GET", urls, body)
8027 if err != nil {
8028 return nil, err
8029 }
8030 req.Header = reqHeaders
8031 googleapi.Expand(req.URL, map[string]string{
8032 "fileId": c.fileId,
8033 "commentId": c.commentId,
8034 "replyId": c.replyId,
8035 })
8036 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8037 }
8038
8039
8040
8041
8042
8043
8044 func (c *RepliesGetCall) Do(opts ...googleapi.CallOption) (*Reply, error) {
8045 gensupport.SetOptions(c.urlParams_, opts...)
8046 res, err := c.doRequest("json")
8047 if res != nil && res.StatusCode == http.StatusNotModified {
8048 if res.Body != nil {
8049 res.Body.Close()
8050 }
8051 return nil, gensupport.WrapError(&googleapi.Error{
8052 Code: res.StatusCode,
8053 Header: res.Header,
8054 })
8055 }
8056 if err != nil {
8057 return nil, err
8058 }
8059 defer googleapi.CloseBody(res)
8060 if err := googleapi.CheckResponse(res); err != nil {
8061 return nil, gensupport.WrapError(err)
8062 }
8063 ret := &Reply{
8064 ServerResponse: googleapi.ServerResponse{
8065 Header: res.Header,
8066 HTTPStatusCode: res.StatusCode,
8067 },
8068 }
8069 target := &ret
8070 if err := gensupport.DecodeResponse(target, res); err != nil {
8071 return nil, err
8072 }
8073 return ret, nil
8074 }
8075
8076 type RepliesListCall struct {
8077 s *Service
8078 fileId string
8079 commentId string
8080 urlParams_ gensupport.URLParams
8081 ifNoneMatch_ string
8082 ctx_ context.Context
8083 header_ http.Header
8084 }
8085
8086
8087
8088
8089
8090 func (r *RepliesService) List(fileId string, commentId string) *RepliesListCall {
8091 c := &RepliesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8092 c.fileId = fileId
8093 c.commentId = commentId
8094 return c
8095 }
8096
8097
8098
8099
8100 func (c *RepliesListCall) IncludeDeleted(includeDeleted bool) *RepliesListCall {
8101 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
8102 return c
8103 }
8104
8105
8106
8107 func (c *RepliesListCall) PageSize(pageSize int64) *RepliesListCall {
8108 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8109 return c
8110 }
8111
8112
8113
8114
8115 func (c *RepliesListCall) PageToken(pageToken string) *RepliesListCall {
8116 c.urlParams_.Set("pageToken", pageToken)
8117 return c
8118 }
8119
8120
8121
8122
8123 func (c *RepliesListCall) Fields(s ...googleapi.Field) *RepliesListCall {
8124 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8125 return c
8126 }
8127
8128
8129
8130
8131 func (c *RepliesListCall) IfNoneMatch(entityTag string) *RepliesListCall {
8132 c.ifNoneMatch_ = entityTag
8133 return c
8134 }
8135
8136
8137 func (c *RepliesListCall) Context(ctx context.Context) *RepliesListCall {
8138 c.ctx_ = ctx
8139 return c
8140 }
8141
8142
8143
8144 func (c *RepliesListCall) Header() http.Header {
8145 if c.header_ == nil {
8146 c.header_ = make(http.Header)
8147 }
8148 return c.header_
8149 }
8150
8151 func (c *RepliesListCall) doRequest(alt string) (*http.Response, error) {
8152 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8153 if c.ifNoneMatch_ != "" {
8154 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8155 }
8156 var body io.Reader = nil
8157 c.urlParams_.Set("alt", alt)
8158 c.urlParams_.Set("prettyPrint", "false")
8159 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies")
8160 urls += "?" + c.urlParams_.Encode()
8161 req, err := http.NewRequest("GET", urls, body)
8162 if err != nil {
8163 return nil, err
8164 }
8165 req.Header = reqHeaders
8166 googleapi.Expand(req.URL, map[string]string{
8167 "fileId": c.fileId,
8168 "commentId": c.commentId,
8169 })
8170 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8171 }
8172
8173
8174
8175
8176
8177
8178 func (c *RepliesListCall) Do(opts ...googleapi.CallOption) (*ReplyList, error) {
8179 gensupport.SetOptions(c.urlParams_, opts...)
8180 res, err := c.doRequest("json")
8181 if res != nil && res.StatusCode == http.StatusNotModified {
8182 if res.Body != nil {
8183 res.Body.Close()
8184 }
8185 return nil, gensupport.WrapError(&googleapi.Error{
8186 Code: res.StatusCode,
8187 Header: res.Header,
8188 })
8189 }
8190 if err != nil {
8191 return nil, err
8192 }
8193 defer googleapi.CloseBody(res)
8194 if err := googleapi.CheckResponse(res); err != nil {
8195 return nil, gensupport.WrapError(err)
8196 }
8197 ret := &ReplyList{
8198 ServerResponse: googleapi.ServerResponse{
8199 Header: res.Header,
8200 HTTPStatusCode: res.StatusCode,
8201 },
8202 }
8203 target := &ret
8204 if err := gensupport.DecodeResponse(target, res); err != nil {
8205 return nil, err
8206 }
8207 return ret, nil
8208 }
8209
8210
8211
8212
8213 func (c *RepliesListCall) Pages(ctx context.Context, f func(*ReplyList) error) error {
8214 c.ctx_ = ctx
8215 defer c.PageToken(c.urlParams_.Get("pageToken"))
8216 for {
8217 x, err := c.Do()
8218 if err != nil {
8219 return err
8220 }
8221 if err := f(x); err != nil {
8222 return err
8223 }
8224 if x.NextPageToken == "" {
8225 return nil
8226 }
8227 c.PageToken(x.NextPageToken)
8228 }
8229 }
8230
8231 type RepliesUpdateCall struct {
8232 s *Service
8233 fileId string
8234 commentId string
8235 replyId string
8236 reply *Reply
8237 urlParams_ gensupport.URLParams
8238 ctx_ context.Context
8239 header_ http.Header
8240 }
8241
8242
8243
8244
8245
8246
8247 func (r *RepliesService) Update(fileId string, commentId string, replyId string, reply *Reply) *RepliesUpdateCall {
8248 c := &RepliesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8249 c.fileId = fileId
8250 c.commentId = commentId
8251 c.replyId = replyId
8252 c.reply = reply
8253 return c
8254 }
8255
8256
8257
8258
8259 func (c *RepliesUpdateCall) Fields(s ...googleapi.Field) *RepliesUpdateCall {
8260 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8261 return c
8262 }
8263
8264
8265 func (c *RepliesUpdateCall) Context(ctx context.Context) *RepliesUpdateCall {
8266 c.ctx_ = ctx
8267 return c
8268 }
8269
8270
8271
8272 func (c *RepliesUpdateCall) Header() http.Header {
8273 if c.header_ == nil {
8274 c.header_ = make(http.Header)
8275 }
8276 return c.header_
8277 }
8278
8279 func (c *RepliesUpdateCall) doRequest(alt string) (*http.Response, error) {
8280 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8281 var body io.Reader = nil
8282 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reply)
8283 if err != nil {
8284 return nil, err
8285 }
8286 c.urlParams_.Set("alt", alt)
8287 c.urlParams_.Set("prettyPrint", "false")
8288 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}")
8289 urls += "?" + c.urlParams_.Encode()
8290 req, err := http.NewRequest("PATCH", urls, body)
8291 if err != nil {
8292 return nil, err
8293 }
8294 req.Header = reqHeaders
8295 googleapi.Expand(req.URL, map[string]string{
8296 "fileId": c.fileId,
8297 "commentId": c.commentId,
8298 "replyId": c.replyId,
8299 })
8300 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8301 }
8302
8303
8304
8305
8306
8307
8308 func (c *RepliesUpdateCall) Do(opts ...googleapi.CallOption) (*Reply, error) {
8309 gensupport.SetOptions(c.urlParams_, opts...)
8310 res, err := c.doRequest("json")
8311 if res != nil && res.StatusCode == http.StatusNotModified {
8312 if res.Body != nil {
8313 res.Body.Close()
8314 }
8315 return nil, gensupport.WrapError(&googleapi.Error{
8316 Code: res.StatusCode,
8317 Header: res.Header,
8318 })
8319 }
8320 if err != nil {
8321 return nil, err
8322 }
8323 defer googleapi.CloseBody(res)
8324 if err := googleapi.CheckResponse(res); err != nil {
8325 return nil, gensupport.WrapError(err)
8326 }
8327 ret := &Reply{
8328 ServerResponse: googleapi.ServerResponse{
8329 Header: res.Header,
8330 HTTPStatusCode: res.StatusCode,
8331 },
8332 }
8333 target := &ret
8334 if err := gensupport.DecodeResponse(target, res); err != nil {
8335 return nil, err
8336 }
8337 return ret, nil
8338 }
8339
8340 type RevisionsDeleteCall struct {
8341 s *Service
8342 fileId string
8343 revisionId string
8344 urlParams_ gensupport.URLParams
8345 ctx_ context.Context
8346 header_ http.Header
8347 }
8348
8349
8350
8351
8352
8353
8354
8355
8356 func (r *RevisionsService) Delete(fileId string, revisionId string) *RevisionsDeleteCall {
8357 c := &RevisionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8358 c.fileId = fileId
8359 c.revisionId = revisionId
8360 return c
8361 }
8362
8363
8364
8365
8366 func (c *RevisionsDeleteCall) Fields(s ...googleapi.Field) *RevisionsDeleteCall {
8367 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8368 return c
8369 }
8370
8371
8372 func (c *RevisionsDeleteCall) Context(ctx context.Context) *RevisionsDeleteCall {
8373 c.ctx_ = ctx
8374 return c
8375 }
8376
8377
8378
8379 func (c *RevisionsDeleteCall) Header() http.Header {
8380 if c.header_ == nil {
8381 c.header_ = make(http.Header)
8382 }
8383 return c.header_
8384 }
8385
8386 func (c *RevisionsDeleteCall) doRequest(alt string) (*http.Response, error) {
8387 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8388 var body io.Reader = nil
8389 c.urlParams_.Set("alt", alt)
8390 c.urlParams_.Set("prettyPrint", "false")
8391 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}")
8392 urls += "?" + c.urlParams_.Encode()
8393 req, err := http.NewRequest("DELETE", urls, body)
8394 if err != nil {
8395 return nil, err
8396 }
8397 req.Header = reqHeaders
8398 googleapi.Expand(req.URL, map[string]string{
8399 "fileId": c.fileId,
8400 "revisionId": c.revisionId,
8401 })
8402 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8403 }
8404
8405
8406 func (c *RevisionsDeleteCall) Do(opts ...googleapi.CallOption) error {
8407 gensupport.SetOptions(c.urlParams_, opts...)
8408 res, err := c.doRequest("json")
8409 if err != nil {
8410 return err
8411 }
8412 defer googleapi.CloseBody(res)
8413 if err := googleapi.CheckResponse(res); err != nil {
8414 return gensupport.WrapError(err)
8415 }
8416 return nil
8417 }
8418
8419 type RevisionsGetCall struct {
8420 s *Service
8421 fileId string
8422 revisionId string
8423 urlParams_ gensupport.URLParams
8424 ifNoneMatch_ string
8425 ctx_ context.Context
8426 header_ http.Header
8427 }
8428
8429
8430
8431
8432
8433 func (r *RevisionsService) Get(fileId string, revisionId string) *RevisionsGetCall {
8434 c := &RevisionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8435 c.fileId = fileId
8436 c.revisionId = revisionId
8437 return c
8438 }
8439
8440
8441
8442
8443 func (c *RevisionsGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *RevisionsGetCall {
8444 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse))
8445 return c
8446 }
8447
8448
8449
8450
8451 func (c *RevisionsGetCall) Fields(s ...googleapi.Field) *RevisionsGetCall {
8452 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8453 return c
8454 }
8455
8456
8457
8458
8459 func (c *RevisionsGetCall) IfNoneMatch(entityTag string) *RevisionsGetCall {
8460 c.ifNoneMatch_ = entityTag
8461 return c
8462 }
8463
8464
8465 func (c *RevisionsGetCall) Context(ctx context.Context) *RevisionsGetCall {
8466 c.ctx_ = ctx
8467 return c
8468 }
8469
8470
8471
8472 func (c *RevisionsGetCall) Header() http.Header {
8473 if c.header_ == nil {
8474 c.header_ = make(http.Header)
8475 }
8476 return c.header_
8477 }
8478
8479 func (c *RevisionsGetCall) doRequest(alt string) (*http.Response, error) {
8480 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8481 if c.ifNoneMatch_ != "" {
8482 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8483 }
8484 var body io.Reader = nil
8485 c.urlParams_.Set("alt", alt)
8486 c.urlParams_.Set("prettyPrint", "false")
8487 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}")
8488 urls += "?" + c.urlParams_.Encode()
8489 req, err := http.NewRequest("GET", urls, body)
8490 if err != nil {
8491 return nil, err
8492 }
8493 req.Header = reqHeaders
8494 googleapi.Expand(req.URL, map[string]string{
8495 "fileId": c.fileId,
8496 "revisionId": c.revisionId,
8497 })
8498 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8499 }
8500
8501
8502
8503
8504 func (c *RevisionsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
8505 gensupport.SetOptions(c.urlParams_, opts...)
8506 res, err := c.doRequest("media")
8507 if err != nil {
8508 return nil, err
8509 }
8510 if err := googleapi.CheckResponse(res); err != nil {
8511 res.Body.Close()
8512 return nil, gensupport.WrapError(err)
8513 }
8514 return res, nil
8515 }
8516
8517
8518
8519
8520
8521
8522 func (c *RevisionsGetCall) Do(opts ...googleapi.CallOption) (*Revision, error) {
8523 gensupport.SetOptions(c.urlParams_, opts...)
8524 res, err := c.doRequest("json")
8525 if res != nil && res.StatusCode == http.StatusNotModified {
8526 if res.Body != nil {
8527 res.Body.Close()
8528 }
8529 return nil, gensupport.WrapError(&googleapi.Error{
8530 Code: res.StatusCode,
8531 Header: res.Header,
8532 })
8533 }
8534 if err != nil {
8535 return nil, err
8536 }
8537 defer googleapi.CloseBody(res)
8538 if err := googleapi.CheckResponse(res); err != nil {
8539 return nil, gensupport.WrapError(err)
8540 }
8541 ret := &Revision{
8542 ServerResponse: googleapi.ServerResponse{
8543 Header: res.Header,
8544 HTTPStatusCode: res.StatusCode,
8545 },
8546 }
8547 target := &ret
8548 if err := gensupport.DecodeResponse(target, res); err != nil {
8549 return nil, err
8550 }
8551 return ret, nil
8552 }
8553
8554 type RevisionsListCall struct {
8555 s *Service
8556 fileId string
8557 urlParams_ gensupport.URLParams
8558 ifNoneMatch_ string
8559 ctx_ context.Context
8560 header_ http.Header
8561 }
8562
8563
8564
8565
8566 func (r *RevisionsService) List(fileId string) *RevisionsListCall {
8567 c := &RevisionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8568 c.fileId = fileId
8569 return c
8570 }
8571
8572
8573
8574 func (c *RevisionsListCall) PageSize(pageSize int64) *RevisionsListCall {
8575 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8576 return c
8577 }
8578
8579
8580
8581
8582 func (c *RevisionsListCall) PageToken(pageToken string) *RevisionsListCall {
8583 c.urlParams_.Set("pageToken", pageToken)
8584 return c
8585 }
8586
8587
8588
8589
8590 func (c *RevisionsListCall) Fields(s ...googleapi.Field) *RevisionsListCall {
8591 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8592 return c
8593 }
8594
8595
8596
8597
8598 func (c *RevisionsListCall) IfNoneMatch(entityTag string) *RevisionsListCall {
8599 c.ifNoneMatch_ = entityTag
8600 return c
8601 }
8602
8603
8604 func (c *RevisionsListCall) Context(ctx context.Context) *RevisionsListCall {
8605 c.ctx_ = ctx
8606 return c
8607 }
8608
8609
8610
8611 func (c *RevisionsListCall) Header() http.Header {
8612 if c.header_ == nil {
8613 c.header_ = make(http.Header)
8614 }
8615 return c.header_
8616 }
8617
8618 func (c *RevisionsListCall) doRequest(alt string) (*http.Response, error) {
8619 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8620 if c.ifNoneMatch_ != "" {
8621 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8622 }
8623 var body io.Reader = nil
8624 c.urlParams_.Set("alt", alt)
8625 c.urlParams_.Set("prettyPrint", "false")
8626 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions")
8627 urls += "?" + c.urlParams_.Encode()
8628 req, err := http.NewRequest("GET", urls, body)
8629 if err != nil {
8630 return nil, err
8631 }
8632 req.Header = reqHeaders
8633 googleapi.Expand(req.URL, map[string]string{
8634 "fileId": c.fileId,
8635 })
8636 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8637 }
8638
8639
8640
8641
8642
8643
8644 func (c *RevisionsListCall) Do(opts ...googleapi.CallOption) (*RevisionList, error) {
8645 gensupport.SetOptions(c.urlParams_, opts...)
8646 res, err := c.doRequest("json")
8647 if res != nil && res.StatusCode == http.StatusNotModified {
8648 if res.Body != nil {
8649 res.Body.Close()
8650 }
8651 return nil, gensupport.WrapError(&googleapi.Error{
8652 Code: res.StatusCode,
8653 Header: res.Header,
8654 })
8655 }
8656 if err != nil {
8657 return nil, err
8658 }
8659 defer googleapi.CloseBody(res)
8660 if err := googleapi.CheckResponse(res); err != nil {
8661 return nil, gensupport.WrapError(err)
8662 }
8663 ret := &RevisionList{
8664 ServerResponse: googleapi.ServerResponse{
8665 Header: res.Header,
8666 HTTPStatusCode: res.StatusCode,
8667 },
8668 }
8669 target := &ret
8670 if err := gensupport.DecodeResponse(target, res); err != nil {
8671 return nil, err
8672 }
8673 return ret, nil
8674 }
8675
8676
8677
8678
8679 func (c *RevisionsListCall) Pages(ctx context.Context, f func(*RevisionList) error) error {
8680 c.ctx_ = ctx
8681 defer c.PageToken(c.urlParams_.Get("pageToken"))
8682 for {
8683 x, err := c.Do()
8684 if err != nil {
8685 return err
8686 }
8687 if err := f(x); err != nil {
8688 return err
8689 }
8690 if x.NextPageToken == "" {
8691 return nil
8692 }
8693 c.PageToken(x.NextPageToken)
8694 }
8695 }
8696
8697 type RevisionsUpdateCall struct {
8698 s *Service
8699 fileId string
8700 revisionId string
8701 revision *Revision
8702 urlParams_ gensupport.URLParams
8703 ctx_ context.Context
8704 header_ http.Header
8705 }
8706
8707
8708
8709
8710
8711 func (r *RevisionsService) Update(fileId string, revisionId string, revision *Revision) *RevisionsUpdateCall {
8712 c := &RevisionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8713 c.fileId = fileId
8714 c.revisionId = revisionId
8715 c.revision = revision
8716 return c
8717 }
8718
8719
8720
8721
8722 func (c *RevisionsUpdateCall) Fields(s ...googleapi.Field) *RevisionsUpdateCall {
8723 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8724 return c
8725 }
8726
8727
8728 func (c *RevisionsUpdateCall) Context(ctx context.Context) *RevisionsUpdateCall {
8729 c.ctx_ = ctx
8730 return c
8731 }
8732
8733
8734
8735 func (c *RevisionsUpdateCall) Header() http.Header {
8736 if c.header_ == nil {
8737 c.header_ = make(http.Header)
8738 }
8739 return c.header_
8740 }
8741
8742 func (c *RevisionsUpdateCall) doRequest(alt string) (*http.Response, error) {
8743 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8744 var body io.Reader = nil
8745 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision)
8746 if err != nil {
8747 return nil, err
8748 }
8749 c.urlParams_.Set("alt", alt)
8750 c.urlParams_.Set("prettyPrint", "false")
8751 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}")
8752 urls += "?" + c.urlParams_.Encode()
8753 req, err := http.NewRequest("PATCH", urls, body)
8754 if err != nil {
8755 return nil, err
8756 }
8757 req.Header = reqHeaders
8758 googleapi.Expand(req.URL, map[string]string{
8759 "fileId": c.fileId,
8760 "revisionId": c.revisionId,
8761 })
8762 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8763 }
8764
8765
8766
8767
8768
8769
8770 func (c *RevisionsUpdateCall) Do(opts ...googleapi.CallOption) (*Revision, error) {
8771 gensupport.SetOptions(c.urlParams_, opts...)
8772 res, err := c.doRequest("json")
8773 if res != nil && res.StatusCode == http.StatusNotModified {
8774 if res.Body != nil {
8775 res.Body.Close()
8776 }
8777 return nil, gensupport.WrapError(&googleapi.Error{
8778 Code: res.StatusCode,
8779 Header: res.Header,
8780 })
8781 }
8782 if err != nil {
8783 return nil, err
8784 }
8785 defer googleapi.CloseBody(res)
8786 if err := googleapi.CheckResponse(res); err != nil {
8787 return nil, gensupport.WrapError(err)
8788 }
8789 ret := &Revision{
8790 ServerResponse: googleapi.ServerResponse{
8791 Header: res.Header,
8792 HTTPStatusCode: res.StatusCode,
8793 },
8794 }
8795 target := &ret
8796 if err := gensupport.DecodeResponse(target, res); err != nil {
8797 return nil, err
8798 }
8799 return ret, nil
8800 }
8801
8802 type TeamdrivesCreateCall struct {
8803 s *Service
8804 teamdrive *TeamDrive
8805 urlParams_ gensupport.URLParams
8806 ctx_ context.Context
8807 header_ http.Header
8808 }
8809
8810
8811
8812
8813
8814
8815
8816
8817 func (r *TeamdrivesService) Create(requestId string, teamdrive *TeamDrive) *TeamdrivesCreateCall {
8818 c := &TeamdrivesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8819 c.urlParams_.Set("requestId", requestId)
8820 c.teamdrive = teamdrive
8821 return c
8822 }
8823
8824
8825
8826
8827 func (c *TeamdrivesCreateCall) Fields(s ...googleapi.Field) *TeamdrivesCreateCall {
8828 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8829 return c
8830 }
8831
8832
8833 func (c *TeamdrivesCreateCall) Context(ctx context.Context) *TeamdrivesCreateCall {
8834 c.ctx_ = ctx
8835 return c
8836 }
8837
8838
8839
8840 func (c *TeamdrivesCreateCall) Header() http.Header {
8841 if c.header_ == nil {
8842 c.header_ = make(http.Header)
8843 }
8844 return c.header_
8845 }
8846
8847 func (c *TeamdrivesCreateCall) doRequest(alt string) (*http.Response, error) {
8848 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8849 var body io.Reader = nil
8850 body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive)
8851 if err != nil {
8852 return nil, err
8853 }
8854 c.urlParams_.Set("alt", alt)
8855 c.urlParams_.Set("prettyPrint", "false")
8856 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives")
8857 urls += "?" + c.urlParams_.Encode()
8858 req, err := http.NewRequest("POST", urls, body)
8859 if err != nil {
8860 return nil, err
8861 }
8862 req.Header = reqHeaders
8863 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8864 }
8865
8866
8867
8868
8869
8870
8871 func (c *TeamdrivesCreateCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) {
8872 gensupport.SetOptions(c.urlParams_, opts...)
8873 res, err := c.doRequest("json")
8874 if res != nil && res.StatusCode == http.StatusNotModified {
8875 if res.Body != nil {
8876 res.Body.Close()
8877 }
8878 return nil, gensupport.WrapError(&googleapi.Error{
8879 Code: res.StatusCode,
8880 Header: res.Header,
8881 })
8882 }
8883 if err != nil {
8884 return nil, err
8885 }
8886 defer googleapi.CloseBody(res)
8887 if err := googleapi.CheckResponse(res); err != nil {
8888 return nil, gensupport.WrapError(err)
8889 }
8890 ret := &TeamDrive{
8891 ServerResponse: googleapi.ServerResponse{
8892 Header: res.Header,
8893 HTTPStatusCode: res.StatusCode,
8894 },
8895 }
8896 target := &ret
8897 if err := gensupport.DecodeResponse(target, res); err != nil {
8898 return nil, err
8899 }
8900 return ret, nil
8901 }
8902
8903 type TeamdrivesDeleteCall struct {
8904 s *Service
8905 teamDriveId string
8906 urlParams_ gensupport.URLParams
8907 ctx_ context.Context
8908 header_ http.Header
8909 }
8910
8911
8912
8913
8914 func (r *TeamdrivesService) Delete(teamDriveId string) *TeamdrivesDeleteCall {
8915 c := &TeamdrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8916 c.teamDriveId = teamDriveId
8917 return c
8918 }
8919
8920
8921
8922
8923 func (c *TeamdrivesDeleteCall) Fields(s ...googleapi.Field) *TeamdrivesDeleteCall {
8924 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8925 return c
8926 }
8927
8928
8929 func (c *TeamdrivesDeleteCall) Context(ctx context.Context) *TeamdrivesDeleteCall {
8930 c.ctx_ = ctx
8931 return c
8932 }
8933
8934
8935
8936 func (c *TeamdrivesDeleteCall) Header() http.Header {
8937 if c.header_ == nil {
8938 c.header_ = make(http.Header)
8939 }
8940 return c.header_
8941 }
8942
8943 func (c *TeamdrivesDeleteCall) doRequest(alt string) (*http.Response, error) {
8944 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8945 var body io.Reader = nil
8946 c.urlParams_.Set("alt", alt)
8947 c.urlParams_.Set("prettyPrint", "false")
8948 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}")
8949 urls += "?" + c.urlParams_.Encode()
8950 req, err := http.NewRequest("DELETE", urls, body)
8951 if err != nil {
8952 return nil, err
8953 }
8954 req.Header = reqHeaders
8955 googleapi.Expand(req.URL, map[string]string{
8956 "teamDriveId": c.teamDriveId,
8957 })
8958 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8959 }
8960
8961
8962 func (c *TeamdrivesDeleteCall) Do(opts ...googleapi.CallOption) error {
8963 gensupport.SetOptions(c.urlParams_, opts...)
8964 res, err := c.doRequest("json")
8965 if err != nil {
8966 return err
8967 }
8968 defer googleapi.CloseBody(res)
8969 if err := googleapi.CheckResponse(res); err != nil {
8970 return gensupport.WrapError(err)
8971 }
8972 return nil
8973 }
8974
8975 type TeamdrivesGetCall struct {
8976 s *Service
8977 teamDriveId string
8978 urlParams_ gensupport.URLParams
8979 ifNoneMatch_ string
8980 ctx_ context.Context
8981 header_ http.Header
8982 }
8983
8984
8985
8986
8987 func (r *TeamdrivesService) Get(teamDriveId string) *TeamdrivesGetCall {
8988 c := &TeamdrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8989 c.teamDriveId = teamDriveId
8990 return c
8991 }
8992
8993
8994
8995
8996
8997 func (c *TeamdrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesGetCall {
8998 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
8999 return c
9000 }
9001
9002
9003
9004
9005 func (c *TeamdrivesGetCall) Fields(s ...googleapi.Field) *TeamdrivesGetCall {
9006 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9007 return c
9008 }
9009
9010
9011
9012
9013 func (c *TeamdrivesGetCall) IfNoneMatch(entityTag string) *TeamdrivesGetCall {
9014 c.ifNoneMatch_ = entityTag
9015 return c
9016 }
9017
9018
9019 func (c *TeamdrivesGetCall) Context(ctx context.Context) *TeamdrivesGetCall {
9020 c.ctx_ = ctx
9021 return c
9022 }
9023
9024
9025
9026 func (c *TeamdrivesGetCall) Header() http.Header {
9027 if c.header_ == nil {
9028 c.header_ = make(http.Header)
9029 }
9030 return c.header_
9031 }
9032
9033 func (c *TeamdrivesGetCall) doRequest(alt string) (*http.Response, error) {
9034 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9035 if c.ifNoneMatch_ != "" {
9036 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9037 }
9038 var body io.Reader = nil
9039 c.urlParams_.Set("alt", alt)
9040 c.urlParams_.Set("prettyPrint", "false")
9041 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}")
9042 urls += "?" + c.urlParams_.Encode()
9043 req, err := http.NewRequest("GET", urls, body)
9044 if err != nil {
9045 return nil, err
9046 }
9047 req.Header = reqHeaders
9048 googleapi.Expand(req.URL, map[string]string{
9049 "teamDriveId": c.teamDriveId,
9050 })
9051 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9052 }
9053
9054
9055
9056
9057
9058
9059 func (c *TeamdrivesGetCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) {
9060 gensupport.SetOptions(c.urlParams_, opts...)
9061 res, err := c.doRequest("json")
9062 if res != nil && res.StatusCode == http.StatusNotModified {
9063 if res.Body != nil {
9064 res.Body.Close()
9065 }
9066 return nil, gensupport.WrapError(&googleapi.Error{
9067 Code: res.StatusCode,
9068 Header: res.Header,
9069 })
9070 }
9071 if err != nil {
9072 return nil, err
9073 }
9074 defer googleapi.CloseBody(res)
9075 if err := googleapi.CheckResponse(res); err != nil {
9076 return nil, gensupport.WrapError(err)
9077 }
9078 ret := &TeamDrive{
9079 ServerResponse: googleapi.ServerResponse{
9080 Header: res.Header,
9081 HTTPStatusCode: res.StatusCode,
9082 },
9083 }
9084 target := &ret
9085 if err := gensupport.DecodeResponse(target, res); err != nil {
9086 return nil, err
9087 }
9088 return ret, nil
9089 }
9090
9091 type TeamdrivesListCall struct {
9092 s *Service
9093 urlParams_ gensupport.URLParams
9094 ifNoneMatch_ string
9095 ctx_ context.Context
9096 header_ http.Header
9097 }
9098
9099
9100 func (r *TeamdrivesService) List() *TeamdrivesListCall {
9101 c := &TeamdrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9102 return c
9103 }
9104
9105
9106
9107 func (c *TeamdrivesListCall) PageSize(pageSize int64) *TeamdrivesListCall {
9108 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9109 return c
9110 }
9111
9112
9113
9114 func (c *TeamdrivesListCall) PageToken(pageToken string) *TeamdrivesListCall {
9115 c.urlParams_.Set("pageToken", pageToken)
9116 return c
9117 }
9118
9119
9120 func (c *TeamdrivesListCall) Q(q string) *TeamdrivesListCall {
9121 c.urlParams_.Set("q", q)
9122 return c
9123 }
9124
9125
9126
9127
9128
9129 func (c *TeamdrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesListCall {
9130 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
9131 return c
9132 }
9133
9134
9135
9136
9137 func (c *TeamdrivesListCall) Fields(s ...googleapi.Field) *TeamdrivesListCall {
9138 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9139 return c
9140 }
9141
9142
9143
9144
9145 func (c *TeamdrivesListCall) IfNoneMatch(entityTag string) *TeamdrivesListCall {
9146 c.ifNoneMatch_ = entityTag
9147 return c
9148 }
9149
9150
9151 func (c *TeamdrivesListCall) Context(ctx context.Context) *TeamdrivesListCall {
9152 c.ctx_ = ctx
9153 return c
9154 }
9155
9156
9157
9158 func (c *TeamdrivesListCall) Header() http.Header {
9159 if c.header_ == nil {
9160 c.header_ = make(http.Header)
9161 }
9162 return c.header_
9163 }
9164
9165 func (c *TeamdrivesListCall) doRequest(alt string) (*http.Response, error) {
9166 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9167 if c.ifNoneMatch_ != "" {
9168 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9169 }
9170 var body io.Reader = nil
9171 c.urlParams_.Set("alt", alt)
9172 c.urlParams_.Set("prettyPrint", "false")
9173 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives")
9174 urls += "?" + c.urlParams_.Encode()
9175 req, err := http.NewRequest("GET", urls, body)
9176 if err != nil {
9177 return nil, err
9178 }
9179 req.Header = reqHeaders
9180 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9181 }
9182
9183
9184
9185
9186
9187
9188 func (c *TeamdrivesListCall) Do(opts ...googleapi.CallOption) (*TeamDriveList, error) {
9189 gensupport.SetOptions(c.urlParams_, opts...)
9190 res, err := c.doRequest("json")
9191 if res != nil && res.StatusCode == http.StatusNotModified {
9192 if res.Body != nil {
9193 res.Body.Close()
9194 }
9195 return nil, gensupport.WrapError(&googleapi.Error{
9196 Code: res.StatusCode,
9197 Header: res.Header,
9198 })
9199 }
9200 if err != nil {
9201 return nil, err
9202 }
9203 defer googleapi.CloseBody(res)
9204 if err := googleapi.CheckResponse(res); err != nil {
9205 return nil, gensupport.WrapError(err)
9206 }
9207 ret := &TeamDriveList{
9208 ServerResponse: googleapi.ServerResponse{
9209 Header: res.Header,
9210 HTTPStatusCode: res.StatusCode,
9211 },
9212 }
9213 target := &ret
9214 if err := gensupport.DecodeResponse(target, res); err != nil {
9215 return nil, err
9216 }
9217 return ret, nil
9218 }
9219
9220
9221
9222
9223 func (c *TeamdrivesListCall) Pages(ctx context.Context, f func(*TeamDriveList) error) error {
9224 c.ctx_ = ctx
9225 defer c.PageToken(c.urlParams_.Get("pageToken"))
9226 for {
9227 x, err := c.Do()
9228 if err != nil {
9229 return err
9230 }
9231 if err := f(x); err != nil {
9232 return err
9233 }
9234 if x.NextPageToken == "" {
9235 return nil
9236 }
9237 c.PageToken(x.NextPageToken)
9238 }
9239 }
9240
9241 type TeamdrivesUpdateCall struct {
9242 s *Service
9243 teamDriveId string
9244 teamdrive *TeamDrive
9245 urlParams_ gensupport.URLParams
9246 ctx_ context.Context
9247 header_ http.Header
9248 }
9249
9250
9251
9252
9253 func (r *TeamdrivesService) Update(teamDriveId string, teamdrive *TeamDrive) *TeamdrivesUpdateCall {
9254 c := &TeamdrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9255 c.teamDriveId = teamDriveId
9256 c.teamdrive = teamdrive
9257 return c
9258 }
9259
9260
9261
9262
9263
9264 func (c *TeamdrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesUpdateCall {
9265 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
9266 return c
9267 }
9268
9269
9270
9271
9272 func (c *TeamdrivesUpdateCall) Fields(s ...googleapi.Field) *TeamdrivesUpdateCall {
9273 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9274 return c
9275 }
9276
9277
9278 func (c *TeamdrivesUpdateCall) Context(ctx context.Context) *TeamdrivesUpdateCall {
9279 c.ctx_ = ctx
9280 return c
9281 }
9282
9283
9284
9285 func (c *TeamdrivesUpdateCall) Header() http.Header {
9286 if c.header_ == nil {
9287 c.header_ = make(http.Header)
9288 }
9289 return c.header_
9290 }
9291
9292 func (c *TeamdrivesUpdateCall) doRequest(alt string) (*http.Response, error) {
9293 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9294 var body io.Reader = nil
9295 body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive)
9296 if err != nil {
9297 return nil, err
9298 }
9299 c.urlParams_.Set("alt", alt)
9300 c.urlParams_.Set("prettyPrint", "false")
9301 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}")
9302 urls += "?" + c.urlParams_.Encode()
9303 req, err := http.NewRequest("PATCH", urls, body)
9304 if err != nil {
9305 return nil, err
9306 }
9307 req.Header = reqHeaders
9308 googleapi.Expand(req.URL, map[string]string{
9309 "teamDriveId": c.teamDriveId,
9310 })
9311 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9312 }
9313
9314
9315
9316
9317
9318
9319 func (c *TeamdrivesUpdateCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) {
9320 gensupport.SetOptions(c.urlParams_, opts...)
9321 res, err := c.doRequest("json")
9322 if res != nil && res.StatusCode == http.StatusNotModified {
9323 if res.Body != nil {
9324 res.Body.Close()
9325 }
9326 return nil, gensupport.WrapError(&googleapi.Error{
9327 Code: res.StatusCode,
9328 Header: res.Header,
9329 })
9330 }
9331 if err != nil {
9332 return nil, err
9333 }
9334 defer googleapi.CloseBody(res)
9335 if err := googleapi.CheckResponse(res); err != nil {
9336 return nil, gensupport.WrapError(err)
9337 }
9338 ret := &TeamDrive{
9339 ServerResponse: googleapi.ServerResponse{
9340 Header: res.Header,
9341 HTTPStatusCode: res.StatusCode,
9342 },
9343 }
9344 target := &ret
9345 if err := gensupport.DecodeResponse(target, res); err != nil {
9346 return nil, err
9347 }
9348 return ret, nil
9349 }
9350
View as plain text