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:v2"
95 const apiName = "drive"
96 const apiVersion = "v2"
97 const basePath = "https://www.googleapis.com/drive/v2/"
98 const basePathTemplate = "https://www.UNIVERSE_DOMAIN/drive/v2/"
99 const mtlsBasePath = "https://www.mtls.googleapis.com/drive/v2/"
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.Children = NewChildrenService(s)
180 s.Comments = NewCommentsService(s)
181 s.Drives = NewDrivesService(s)
182 s.Files = NewFilesService(s)
183 s.Parents = NewParentsService(s)
184 s.Permissions = NewPermissionsService(s)
185 s.Properties = NewPropertiesService(s)
186 s.Replies = NewRepliesService(s)
187 s.Revisions = NewRevisionsService(s)
188 s.Teamdrives = NewTeamdrivesService(s)
189 return s, nil
190 }
191
192 type Service struct {
193 client *http.Client
194 BasePath string
195 UserAgent string
196
197 About *AboutService
198
199 Apps *AppsService
200
201 Changes *ChangesService
202
203 Channels *ChannelsService
204
205 Children *ChildrenService
206
207 Comments *CommentsService
208
209 Drives *DrivesService
210
211 Files *FilesService
212
213 Parents *ParentsService
214
215 Permissions *PermissionsService
216
217 Properties *PropertiesService
218
219 Replies *RepliesService
220
221 Revisions *RevisionsService
222
223 Teamdrives *TeamdrivesService
224 }
225
226 func (s *Service) userAgent() string {
227 if s.UserAgent == "" {
228 return googleapi.UserAgent
229 }
230 return googleapi.UserAgent + " " + s.UserAgent
231 }
232
233 func NewAboutService(s *Service) *AboutService {
234 rs := &AboutService{s: s}
235 return rs
236 }
237
238 type AboutService struct {
239 s *Service
240 }
241
242 func NewAppsService(s *Service) *AppsService {
243 rs := &AppsService{s: s}
244 return rs
245 }
246
247 type AppsService struct {
248 s *Service
249 }
250
251 func NewChangesService(s *Service) *ChangesService {
252 rs := &ChangesService{s: s}
253 return rs
254 }
255
256 type ChangesService struct {
257 s *Service
258 }
259
260 func NewChannelsService(s *Service) *ChannelsService {
261 rs := &ChannelsService{s: s}
262 return rs
263 }
264
265 type ChannelsService struct {
266 s *Service
267 }
268
269 func NewChildrenService(s *Service) *ChildrenService {
270 rs := &ChildrenService{s: s}
271 return rs
272 }
273
274 type ChildrenService struct {
275 s *Service
276 }
277
278 func NewCommentsService(s *Service) *CommentsService {
279 rs := &CommentsService{s: s}
280 return rs
281 }
282
283 type CommentsService struct {
284 s *Service
285 }
286
287 func NewDrivesService(s *Service) *DrivesService {
288 rs := &DrivesService{s: s}
289 return rs
290 }
291
292 type DrivesService struct {
293 s *Service
294 }
295
296 func NewFilesService(s *Service) *FilesService {
297 rs := &FilesService{s: s}
298 return rs
299 }
300
301 type FilesService struct {
302 s *Service
303 }
304
305 func NewParentsService(s *Service) *ParentsService {
306 rs := &ParentsService{s: s}
307 return rs
308 }
309
310 type ParentsService struct {
311 s *Service
312 }
313
314 func NewPermissionsService(s *Service) *PermissionsService {
315 rs := &PermissionsService{s: s}
316 return rs
317 }
318
319 type PermissionsService struct {
320 s *Service
321 }
322
323 func NewPropertiesService(s *Service) *PropertiesService {
324 rs := &PropertiesService{s: s}
325 return rs
326 }
327
328 type PropertiesService struct {
329 s *Service
330 }
331
332 func NewRepliesService(s *Service) *RepliesService {
333 rs := &RepliesService{s: s}
334 return rs
335 }
336
337 type RepliesService struct {
338 s *Service
339 }
340
341 func NewRevisionsService(s *Service) *RevisionsService {
342 rs := &RevisionsService{s: s}
343 return rs
344 }
345
346 type RevisionsService struct {
347 s *Service
348 }
349
350 func NewTeamdrivesService(s *Service) *TeamdrivesService {
351 rs := &TeamdrivesService{s: s}
352 return rs
353 }
354
355 type TeamdrivesService struct {
356 s *Service
357 }
358
359
360 type About struct {
361
362
363 AdditionalRoleInfo []*AboutAdditionalRoleInfo `json:"additionalRoleInfo,omitempty"`
364
365 CanCreateDrives bool `json:"canCreateDrives,omitempty"`
366
367 CanCreateTeamDrives bool `json:"canCreateTeamDrives,omitempty"`
368
369
370
371 DomainSharingPolicy string `json:"domainSharingPolicy,omitempty"`
372
373 DriveThemes []*AboutDriveThemes `json:"driveThemes,omitempty"`
374
375 Etag string `json:"etag,omitempty"`
376
377 ExportFormats []*AboutExportFormats `json:"exportFormats,omitempty"`
378
379 Features []*AboutFeatures `json:"features,omitempty"`
380
381
382 FolderColorPalette []string `json:"folderColorPalette,omitempty"`
383
384 ImportFormats []*AboutImportFormats `json:"importFormats,omitempty"`
385
386
387 IsCurrentAppInstalled bool `json:"isCurrentAppInstalled,omitempty"`
388
389 Kind string `json:"kind,omitempty"`
390
391
392
393 LanguageCode string `json:"languageCode,omitempty"`
394
395 LargestChangeId int64 `json:"largestChangeId,omitempty,string"`
396
397
398 MaxUploadSizes []*AboutMaxUploadSizes `json:"maxUploadSizes,omitempty"`
399
400 Name string `json:"name,omitempty"`
401
402
403 PermissionId string `json:"permissionId,omitempty"`
404
405
406 QuotaBytesByService []*AboutQuotaBytesByService `json:"quotaBytesByService,omitempty"`
407
408
409 QuotaBytesTotal int64 `json:"quotaBytesTotal,omitempty,string"`
410
411 QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"`
412
413
414 QuotaBytesUsedAggregate int64 `json:"quotaBytesUsedAggregate,omitempty,string"`
415
416 QuotaBytesUsedInTrash int64 `json:"quotaBytesUsedInTrash,omitempty,string"`
417
418
419 QuotaType string `json:"quotaType,omitempty"`
420
421
422 RemainingChangeIds int64 `json:"remainingChangeIds,omitempty,string"`
423
424 RootFolderId string `json:"rootFolderId,omitempty"`
425
426 SelfLink string `json:"selfLink,omitempty"`
427
428 TeamDriveThemes []*AboutTeamDriveThemes `json:"teamDriveThemes,omitempty"`
429
430 User *User `json:"user,omitempty"`
431
432
433 googleapi.ServerResponse `json:"-"`
434
435
436
437
438
439 ForceSendFields []string `json:"-"`
440
441
442
443
444 NullFields []string `json:"-"`
445 }
446
447 func (s *About) MarshalJSON() ([]byte, error) {
448 type NoMethod About
449 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
450 }
451
452 type AboutAdditionalRoleInfo struct {
453
454 RoleSets []*AboutAdditionalRoleInfoRoleSets `json:"roleSets,omitempty"`
455
456 Type string `json:"type,omitempty"`
457
458
459
460
461
462 ForceSendFields []string `json:"-"`
463
464
465
466
467 NullFields []string `json:"-"`
468 }
469
470 func (s *AboutAdditionalRoleInfo) MarshalJSON() ([]byte, error) {
471 type NoMethod AboutAdditionalRoleInfo
472 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
473 }
474
475 type AboutAdditionalRoleInfoRoleSets struct {
476
477 AdditionalRoles []string `json:"additionalRoles,omitempty"`
478
479 PrimaryRole string `json:"primaryRole,omitempty"`
480
481
482
483
484
485 ForceSendFields []string `json:"-"`
486
487
488
489
490 NullFields []string `json:"-"`
491 }
492
493 func (s *AboutAdditionalRoleInfoRoleSets) MarshalJSON() ([]byte, error) {
494 type NoMethod AboutAdditionalRoleInfoRoleSets
495 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
496 }
497
498 type AboutDriveThemes struct {
499
500 BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
501
502 ColorRgb string `json:"colorRgb,omitempty"`
503
504 Id string `json:"id,omitempty"`
505
506
507
508
509
510 ForceSendFields []string `json:"-"`
511
512
513
514
515 NullFields []string `json:"-"`
516 }
517
518 func (s *AboutDriveThemes) MarshalJSON() ([]byte, error) {
519 type NoMethod AboutDriveThemes
520 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
521 }
522
523 type AboutExportFormats struct {
524
525 Source string `json:"source,omitempty"`
526
527 Targets []string `json:"targets,omitempty"`
528
529
530
531
532
533 ForceSendFields []string `json:"-"`
534
535
536
537
538 NullFields []string `json:"-"`
539 }
540
541 func (s *AboutExportFormats) MarshalJSON() ([]byte, error) {
542 type NoMethod AboutExportFormats
543 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
544 }
545
546 type AboutFeatures struct {
547
548 FeatureName string `json:"featureName,omitempty"`
549
550 FeatureRate float64 `json:"featureRate,omitempty"`
551
552
553
554
555
556 ForceSendFields []string `json:"-"`
557
558
559
560
561 NullFields []string `json:"-"`
562 }
563
564 func (s *AboutFeatures) MarshalJSON() ([]byte, error) {
565 type NoMethod AboutFeatures
566 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
567 }
568
569 func (s *AboutFeatures) UnmarshalJSON(data []byte) error {
570 type NoMethod AboutFeatures
571 var s1 struct {
572 FeatureRate gensupport.JSONFloat64 `json:"featureRate"`
573 *NoMethod
574 }
575 s1.NoMethod = (*NoMethod)(s)
576 if err := json.Unmarshal(data, &s1); err != nil {
577 return err
578 }
579 s.FeatureRate = float64(s1.FeatureRate)
580 return nil
581 }
582
583 type AboutImportFormats struct {
584
585 Source string `json:"source,omitempty"`
586
587 Targets []string `json:"targets,omitempty"`
588
589
590
591
592
593 ForceSendFields []string `json:"-"`
594
595
596
597
598 NullFields []string `json:"-"`
599 }
600
601 func (s *AboutImportFormats) MarshalJSON() ([]byte, error) {
602 type NoMethod AboutImportFormats
603 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
604 }
605
606 type AboutMaxUploadSizes struct {
607
608 Size int64 `json:"size,omitempty,string"`
609
610 Type string `json:"type,omitempty"`
611
612
613
614
615
616 ForceSendFields []string `json:"-"`
617
618
619
620
621 NullFields []string `json:"-"`
622 }
623
624 func (s *AboutMaxUploadSizes) MarshalJSON() ([]byte, error) {
625 type NoMethod AboutMaxUploadSizes
626 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
627 }
628
629 type AboutQuotaBytesByService struct {
630
631 BytesUsed int64 `json:"bytesUsed,omitempty,string"`
632
633 ServiceName string `json:"serviceName,omitempty"`
634
635
636
637
638
639 ForceSendFields []string `json:"-"`
640
641
642
643
644 NullFields []string `json:"-"`
645 }
646
647 func (s *AboutQuotaBytesByService) MarshalJSON() ([]byte, error) {
648 type NoMethod AboutQuotaBytesByService
649 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
650 }
651
652 type AboutTeamDriveThemes struct {
653
654
655 BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
656
657 ColorRgb string `json:"colorRgb,omitempty"`
658
659 Id string `json:"id,omitempty"`
660
661
662
663
664
665 ForceSendFields []string `json:"-"`
666
667
668
669
670 NullFields []string `json:"-"`
671 }
672
673 func (s *AboutTeamDriveThemes) MarshalJSON() ([]byte, error) {
674 type NoMethod AboutTeamDriveThemes
675 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
676 }
677
678
679
680
681
682
683 type App struct {
684
685
686 Authorized bool `json:"authorized,omitempty"`
687
688
689
690 CreateInFolderTemplate string `json:"createInFolderTemplate,omitempty"`
691
692 CreateUrl string `json:"createUrl,omitempty"`
693
694
695 HasDriveWideScope bool `json:"hasDriveWideScope,omitempty"`
696
697 Icons []*AppIcons `json:"icons,omitempty"`
698
699 Id string `json:"id,omitempty"`
700
701 Installed bool `json:"installed,omitempty"`
702
703 Kind string `json:"kind,omitempty"`
704
705 LongDescription string `json:"longDescription,omitempty"`
706
707 Name string `json:"name,omitempty"`
708
709
710 ObjectType string `json:"objectType,omitempty"`
711
712
713
714 OpenUrlTemplate string `json:"openUrlTemplate,omitempty"`
715
716 PrimaryFileExtensions []string `json:"primaryFileExtensions,omitempty"`
717
718 PrimaryMimeTypes []string `json:"primaryMimeTypes,omitempty"`
719
720 ProductId string `json:"productId,omitempty"`
721
722 ProductUrl string `json:"productUrl,omitempty"`
723
724 SecondaryFileExtensions []string `json:"secondaryFileExtensions,omitempty"`
725
726 SecondaryMimeTypes []string `json:"secondaryMimeTypes,omitempty"`
727
728 ShortDescription string `json:"shortDescription,omitempty"`
729
730 SupportsCreate bool `json:"supportsCreate,omitempty"`
731
732 SupportsImport bool `json:"supportsImport,omitempty"`
733
734 SupportsMultiOpen bool `json:"supportsMultiOpen,omitempty"`
735
736
737 SupportsOfflineCreate bool `json:"supportsOfflineCreate,omitempty"`
738
739
740 UseByDefault bool `json:"useByDefault,omitempty"`
741
742
743 googleapi.ServerResponse `json:"-"`
744
745
746
747
748
749 ForceSendFields []string `json:"-"`
750
751
752
753
754 NullFields []string `json:"-"`
755 }
756
757 func (s *App) MarshalJSON() ([]byte, error) {
758 type NoMethod App
759 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
760 }
761
762 type AppIcons struct {
763
764
765
766 Category string `json:"category,omitempty"`
767
768 IconUrl string `json:"iconUrl,omitempty"`
769
770 Size int64 `json:"size,omitempty"`
771
772
773
774
775
776 ForceSendFields []string `json:"-"`
777
778
779
780
781 NullFields []string `json:"-"`
782 }
783
784 func (s *AppIcons) MarshalJSON() ([]byte, error) {
785 type NoMethod AppIcons
786 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
787 }
788
789
790
791 type AppList struct {
792
793
794 DefaultAppIds []string `json:"defaultAppIds,omitempty"`
795
796 Etag string `json:"etag,omitempty"`
797
798 Items []*App `json:"items,omitempty"`
799
800 Kind string `json:"kind,omitempty"`
801
802 SelfLink string `json:"selfLink,omitempty"`
803
804
805 googleapi.ServerResponse `json:"-"`
806
807
808
809
810
811 ForceSendFields []string `json:"-"`
812
813
814
815
816 NullFields []string `json:"-"`
817 }
818
819 func (s *AppList) MarshalJSON() ([]byte, error) {
820 type NoMethod AppList
821 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
822 }
823
824
825 type Change struct {
826
827 ChangeType string `json:"changeType,omitempty"`
828
829
830 Deleted bool `json:"deleted,omitempty"`
831
832
833
834 Drive *Drive `json:"drive,omitempty"`
835
836 DriveId string `json:"driveId,omitempty"`
837
838
839 File *File `json:"file,omitempty"`
840
841 FileId string `json:"fileId,omitempty"`
842
843 Id int64 `json:"id,omitempty,string"`
844
845 Kind string `json:"kind,omitempty"`
846
847 ModificationDate string `json:"modificationDate,omitempty"`
848
849 SelfLink string `json:"selfLink,omitempty"`
850
851 TeamDrive *TeamDrive `json:"teamDrive,omitempty"`
852
853 TeamDriveId string `json:"teamDriveId,omitempty"`
854
855 Type string `json:"type,omitempty"`
856
857
858 googleapi.ServerResponse `json:"-"`
859
860
861
862
863
864 ForceSendFields []string `json:"-"`
865
866
867
868
869 NullFields []string `json:"-"`
870 }
871
872 func (s *Change) MarshalJSON() ([]byte, error) {
873 type NoMethod Change
874 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
875 }
876
877
878 type ChangeList struct {
879
880 Etag string `json:"etag,omitempty"`
881
882
883 Items []*Change `json:"items,omitempty"`
884
885 Kind string `json:"kind,omitempty"`
886
887 LargestChangeId int64 `json:"largestChangeId,omitempty,string"`
888
889
890 NewStartPageToken string `json:"newStartPageToken,omitempty"`
891
892 NextLink string `json:"nextLink,omitempty"`
893
894
895
896
897 NextPageToken string `json:"nextPageToken,omitempty"`
898
899 SelfLink string `json:"selfLink,omitempty"`
900
901
902 googleapi.ServerResponse `json:"-"`
903
904
905
906
907
908 ForceSendFields []string `json:"-"`
909
910
911
912
913 NullFields []string `json:"-"`
914 }
915
916 func (s *ChangeList) MarshalJSON() ([]byte, error) {
917 type NoMethod ChangeList
918 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
919 }
920
921
922 type Channel struct {
923
924 Address string `json:"address,omitempty"`
925
926
927 Expiration int64 `json:"expiration,omitempty,string"`
928
929 Id string `json:"id,omitempty"`
930
931
932 Kind string `json:"kind,omitempty"`
933
934
935 Params map[string]string `json:"params,omitempty"`
936
937 Payload bool `json:"payload,omitempty"`
938
939
940 ResourceId string `json:"resourceId,omitempty"`
941
942 ResourceUri string `json:"resourceUri,omitempty"`
943
944
945 Token string `json:"token,omitempty"`
946
947
948 Type string `json:"type,omitempty"`
949
950
951 googleapi.ServerResponse `json:"-"`
952
953
954
955
956
957 ForceSendFields []string `json:"-"`
958
959
960
961
962 NullFields []string `json:"-"`
963 }
964
965 func (s *Channel) MarshalJSON() ([]byte, error) {
966 type NoMethod Channel
967 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
968 }
969
970
971 type ChildList struct {
972
973 Etag string `json:"etag,omitempty"`
974
975
976 Items []*ChildReference `json:"items,omitempty"`
977
978 Kind string `json:"kind,omitempty"`
979
980 NextLink string `json:"nextLink,omitempty"`
981
982
983
984
985 NextPageToken string `json:"nextPageToken,omitempty"`
986
987 SelfLink string `json:"selfLink,omitempty"`
988
989
990 googleapi.ServerResponse `json:"-"`
991
992
993
994
995
996 ForceSendFields []string `json:"-"`
997
998
999
1000
1001 NullFields []string `json:"-"`
1002 }
1003
1004 func (s *ChildList) MarshalJSON() ([]byte, error) {
1005 type NoMethod ChildList
1006 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1007 }
1008
1009
1010
1011
1012 type ChildReference struct {
1013
1014 ChildLink string `json:"childLink,omitempty"`
1015
1016 Id string `json:"id,omitempty"`
1017
1018 Kind string `json:"kind,omitempty"`
1019
1020 SelfLink string `json:"selfLink,omitempty"`
1021
1022
1023 googleapi.ServerResponse `json:"-"`
1024
1025
1026
1027
1028
1029 ForceSendFields []string `json:"-"`
1030
1031
1032
1033
1034 NullFields []string `json:"-"`
1035 }
1036
1037 func (s *ChildReference) MarshalJSON() ([]byte, error) {
1038 type NoMethod ChildReference
1039 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1040 }
1041
1042
1043
1044
1045 type Comment struct {
1046
1047
1048
1049 Anchor string `json:"anchor,omitempty"`
1050
1051
1052 Author *User `json:"author,omitempty"`
1053
1054 CommentId string `json:"commentId,omitempty"`
1055
1056
1057
1058 Content string `json:"content,omitempty"`
1059
1060 Context *CommentContext `json:"context,omitempty"`
1061
1062 CreatedDate string `json:"createdDate,omitempty"`
1063
1064
1065
1066 Deleted bool `json:"deleted,omitempty"`
1067
1068 FileId string `json:"fileId,omitempty"`
1069
1070
1071 FileTitle string `json:"fileTitle,omitempty"`
1072
1073 HtmlContent string `json:"htmlContent,omitempty"`
1074
1075 Kind string `json:"kind,omitempty"`
1076
1077
1078 ModifiedDate string `json:"modifiedDate,omitempty"`
1079
1080 Replies []*CommentReply `json:"replies,omitempty"`
1081
1082 SelfLink string `json:"selfLink,omitempty"`
1083
1084
1085
1086
1087 Status string `json:"status,omitempty"`
1088
1089
1090 googleapi.ServerResponse `json:"-"`
1091
1092
1093
1094
1095
1096 ForceSendFields []string `json:"-"`
1097
1098
1099
1100
1101 NullFields []string `json:"-"`
1102 }
1103
1104 func (s *Comment) MarshalJSON() ([]byte, error) {
1105 type NoMethod Comment
1106 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1107 }
1108
1109
1110 type CommentContext struct {
1111
1112 Type string `json:"type,omitempty"`
1113
1114
1115
1116 Value string `json:"value,omitempty"`
1117
1118
1119
1120
1121
1122 ForceSendFields []string `json:"-"`
1123
1124
1125
1126
1127 NullFields []string `json:"-"`
1128 }
1129
1130 func (s *CommentContext) MarshalJSON() ([]byte, error) {
1131 type NoMethod CommentContext
1132 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1133 }
1134
1135
1136 type CommentList struct {
1137
1138
1139 Items []*Comment `json:"items,omitempty"`
1140
1141 Kind string `json:"kind,omitempty"`
1142
1143 NextLink string `json:"nextLink,omitempty"`
1144
1145
1146
1147
1148 NextPageToken string `json:"nextPageToken,omitempty"`
1149
1150 SelfLink string `json:"selfLink,omitempty"`
1151
1152
1153 googleapi.ServerResponse `json:"-"`
1154
1155
1156
1157
1158
1159 ForceSendFields []string `json:"-"`
1160
1161
1162
1163
1164 NullFields []string `json:"-"`
1165 }
1166
1167 func (s *CommentList) MarshalJSON() ([]byte, error) {
1168 type NoMethod CommentList
1169 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1170 }
1171
1172
1173
1174
1175 type CommentReply struct {
1176
1177
1178 Author *User `json:"author,omitempty"`
1179
1180
1181
1182
1183 Content string `json:"content,omitempty"`
1184
1185 CreatedDate string `json:"createdDate,omitempty"`
1186
1187
1188
1189 Deleted bool `json:"deleted,omitempty"`
1190
1191 HtmlContent string `json:"htmlContent,omitempty"`
1192
1193 Kind string `json:"kind,omitempty"`
1194
1195 ModifiedDate string `json:"modifiedDate,omitempty"`
1196
1197 ReplyId string `json:"replyId,omitempty"`
1198
1199
1200
1201
1202 Verb string `json:"verb,omitempty"`
1203
1204
1205 googleapi.ServerResponse `json:"-"`
1206
1207
1208
1209
1210
1211 ForceSendFields []string `json:"-"`
1212
1213
1214
1215
1216 NullFields []string `json:"-"`
1217 }
1218
1219 func (s *CommentReply) MarshalJSON() ([]byte, error) {
1220 type NoMethod CommentReply
1221 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1222 }
1223
1224
1225 type CommentReplyList struct {
1226
1227
1228 Items []*CommentReply `json:"items,omitempty"`
1229
1230 Kind string `json:"kind,omitempty"`
1231
1232 NextLink string `json:"nextLink,omitempty"`
1233
1234
1235
1236
1237 NextPageToken string `json:"nextPageToken,omitempty"`
1238
1239 SelfLink string `json:"selfLink,omitempty"`
1240
1241
1242 googleapi.ServerResponse `json:"-"`
1243
1244
1245
1246
1247
1248 ForceSendFields []string `json:"-"`
1249
1250
1251
1252
1253 NullFields []string `json:"-"`
1254 }
1255
1256 func (s *CommentReplyList) MarshalJSON() ([]byte, error) {
1257 type NoMethod CommentReplyList
1258 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1259 }
1260
1261
1262 type ContentRestriction struct {
1263
1264
1265
1266 OwnerRestricted bool `json:"ownerRestricted,omitempty"`
1267
1268
1269
1270 ReadOnly bool `json:"readOnly,omitempty"`
1271
1272
1273 Reason string `json:"reason,omitempty"`
1274
1275
1276 RestrictingUser *User `json:"restrictingUser,omitempty"`
1277
1278
1279 RestrictionDate string `json:"restrictionDate,omitempty"`
1280
1281
1282
1283 SystemRestricted bool `json:"systemRestricted,omitempty"`
1284
1285
1286 Type string `json:"type,omitempty"`
1287
1288
1289
1290
1291
1292 ForceSendFields []string `json:"-"`
1293
1294
1295
1296
1297 NullFields []string `json:"-"`
1298 }
1299
1300 func (s *ContentRestriction) MarshalJSON() ([]byte, error) {
1301 type NoMethod ContentRestriction
1302 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1303 }
1304
1305
1306
1307
1308 type Drive struct {
1309
1310
1311
1312
1313
1314 BackgroundImageFile *DriveBackgroundImageFile `json:"backgroundImageFile,omitempty"`
1315
1316
1317 BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
1318
1319
1320 Capabilities *DriveCapabilities `json:"capabilities,omitempty"`
1321
1322
1323 ColorRgb string `json:"colorRgb,omitempty"`
1324
1325
1326 CreatedDate string `json:"createdDate,omitempty"`
1327
1328 Hidden bool `json:"hidden,omitempty"`
1329
1330
1331 Id string `json:"id,omitempty"`
1332
1333 Kind string `json:"kind,omitempty"`
1334
1335 Name string `json:"name,omitempty"`
1336
1337
1338
1339 OrgUnitId string `json:"orgUnitId,omitempty"`
1340
1341
1342 Restrictions *DriveRestrictions `json:"restrictions,omitempty"`
1343
1344
1345
1346
1347
1348
1349 ThemeId string `json:"themeId,omitempty"`
1350
1351
1352 googleapi.ServerResponse `json:"-"`
1353
1354
1355
1356
1357
1358 ForceSendFields []string `json:"-"`
1359
1360
1361
1362
1363 NullFields []string `json:"-"`
1364 }
1365
1366 func (s *Drive) MarshalJSON() ([]byte, error) {
1367 type NoMethod Drive
1368 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1369 }
1370
1371
1372
1373
1374
1375
1376 type DriveBackgroundImageFile struct {
1377
1378 Id string `json:"id,omitempty"`
1379
1380
1381
1382
1383
1384 Width float64 `json:"width,omitempty"`
1385
1386
1387
1388
1389
1390 XCoordinate float64 `json:"xCoordinate,omitempty"`
1391
1392
1393
1394
1395
1396 YCoordinate float64 `json:"yCoordinate,omitempty"`
1397
1398
1399
1400
1401
1402 ForceSendFields []string `json:"-"`
1403
1404
1405
1406
1407 NullFields []string `json:"-"`
1408 }
1409
1410 func (s *DriveBackgroundImageFile) MarshalJSON() ([]byte, error) {
1411 type NoMethod DriveBackgroundImageFile
1412 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1413 }
1414
1415 func (s *DriveBackgroundImageFile) UnmarshalJSON(data []byte) error {
1416 type NoMethod DriveBackgroundImageFile
1417 var s1 struct {
1418 Width gensupport.JSONFloat64 `json:"width"`
1419 XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"`
1420 YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"`
1421 *NoMethod
1422 }
1423 s1.NoMethod = (*NoMethod)(s)
1424 if err := json.Unmarshal(data, &s1); err != nil {
1425 return err
1426 }
1427 s.Width = float64(s1.Width)
1428 s.XCoordinate = float64(s1.XCoordinate)
1429 s.YCoordinate = float64(s1.YCoordinate)
1430 return nil
1431 }
1432
1433
1434
1435 type DriveCapabilities struct {
1436
1437
1438 CanAddChildren bool `json:"canAddChildren,omitempty"`
1439
1440
1441
1442 CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"`
1443
1444
1445 CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"`
1446
1447
1448 CanChangeDriveBackground bool `json:"canChangeDriveBackground,omitempty"`
1449
1450
1451 CanChangeDriveMembersOnlyRestriction bool `json:"canChangeDriveMembersOnlyRestriction,omitempty"`
1452
1453
1454
1455
1456 CanChangeSharingFoldersRequiresOrganizerPermissionRestriction bool `json:"canChangeSharingFoldersRequiresOrganizerPermissionRestriction,omitempty"`
1457
1458
1459 CanComment bool `json:"canComment,omitempty"`
1460
1461
1462 CanCopy bool `json:"canCopy,omitempty"`
1463
1464
1465 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"`
1466
1467
1468
1469 CanDeleteDrive bool `json:"canDeleteDrive,omitempty"`
1470
1471
1472 CanDownload bool `json:"canDownload,omitempty"`
1473
1474
1475 CanEdit bool `json:"canEdit,omitempty"`
1476
1477
1478 CanListChildren bool `json:"canListChildren,omitempty"`
1479
1480
1481 CanManageMembers bool `json:"canManageMembers,omitempty"`
1482
1483
1484 CanReadRevisions bool `json:"canReadRevisions,omitempty"`
1485
1486
1487 CanRename bool `json:"canRename,omitempty"`
1488
1489
1490 CanRenameDrive bool `json:"canRenameDrive,omitempty"`
1491
1492
1493 CanResetDriveRestrictions bool `json:"canResetDriveRestrictions,omitempty"`
1494
1495
1496 CanShare bool `json:"canShare,omitempty"`
1497
1498
1499 CanTrashChildren bool `json:"canTrashChildren,omitempty"`
1500
1501
1502
1503
1504
1505 ForceSendFields []string `json:"-"`
1506
1507
1508
1509
1510 NullFields []string `json:"-"`
1511 }
1512
1513 func (s *DriveCapabilities) MarshalJSON() ([]byte, error) {
1514 type NoMethod DriveCapabilities
1515 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1516 }
1517
1518
1519
1520 type DriveRestrictions struct {
1521
1522
1523 AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"`
1524
1525
1526
1527
1528 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"`
1529
1530
1531
1532
1533 DomainUsersOnly bool `json:"domainUsersOnly,omitempty"`
1534
1535
1536 DriveMembersOnly bool `json:"driveMembersOnly,omitempty"`
1537
1538
1539
1540 SharingFoldersRequiresOrganizerPermission bool `json:"sharingFoldersRequiresOrganizerPermission,omitempty"`
1541
1542
1543
1544
1545
1546 ForceSendFields []string `json:"-"`
1547
1548
1549
1550
1551 NullFields []string `json:"-"`
1552 }
1553
1554 func (s *DriveRestrictions) MarshalJSON() ([]byte, error) {
1555 type NoMethod DriveRestrictions
1556 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1557 }
1558
1559
1560 type DriveList struct {
1561
1562
1563 Items []*Drive `json:"items,omitempty"`
1564
1565 Kind string `json:"kind,omitempty"`
1566
1567
1568
1569
1570 NextPageToken string `json:"nextPageToken,omitempty"`
1571
1572
1573 googleapi.ServerResponse `json:"-"`
1574
1575
1576
1577
1578
1579 ForceSendFields []string `json:"-"`
1580
1581
1582
1583
1584 NullFields []string `json:"-"`
1585 }
1586
1587 func (s *DriveList) MarshalJSON() ([]byte, error) {
1588 type NoMethod DriveList
1589 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1590 }
1591
1592
1593
1594
1595 type File struct {
1596
1597
1598 AlternateLink string `json:"alternateLink,omitempty"`
1599
1600
1601 AppDataContents bool `json:"appDataContents,omitempty"`
1602
1603 CanComment bool `json:"canComment,omitempty"`
1604
1605
1606 CanReadRevisions bool `json:"canReadRevisions,omitempty"`
1607
1608
1609 Capabilities *FileCapabilities `json:"capabilities,omitempty"`
1610
1611
1612 ContentRestrictions []*ContentRestriction `json:"contentRestrictions,omitempty"`
1613
1614
1615 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"`
1616
1617 Copyable bool `json:"copyable,omitempty"`
1618
1619 CreatedDate string `json:"createdDate,omitempty"`
1620
1621
1622
1623 DefaultOpenWithLink string `json:"defaultOpenWithLink,omitempty"`
1624
1625 Description string `json:"description,omitempty"`
1626
1627
1628
1629 DownloadUrl string `json:"downloadUrl,omitempty"`
1630
1631
1632 DriveId string `json:"driveId,omitempty"`
1633
1634 Editable bool `json:"editable,omitempty"`
1635
1636 EmbedLink string `json:"embedLink,omitempty"`
1637
1638 Etag string `json:"etag,omitempty"`
1639
1640
1641 ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"`
1642
1643
1644 ExportLinks map[string]string `json:"exportLinks,omitempty"`
1645
1646
1647
1648
1649 FileExtension string `json:"fileExtension,omitempty"`
1650
1651
1652 FileSize int64 `json:"fileSize,omitempty,string"`
1653
1654
1655
1656
1657 FolderColorRgb string `json:"folderColorRgb,omitempty"`
1658
1659
1660
1661
1662
1663
1664 FullFileExtension string `json:"fullFileExtension,omitempty"`
1665
1666
1667 HasAugmentedPermissions bool `json:"hasAugmentedPermissions,omitempty"`
1668
1669
1670
1671 HasThumbnail bool `json:"hasThumbnail,omitempty"`
1672
1673
1674
1675 HeadRevisionId string `json:"headRevisionId,omitempty"`
1676
1677 IconLink string `json:"iconLink,omitempty"`
1678
1679 Id string `json:"id,omitempty"`
1680
1681
1682
1683 ImageMediaMetadata *FileImageMediaMetadata `json:"imageMediaMetadata,omitempty"`
1684
1685 IndexableText *FileIndexableText `json:"indexableText,omitempty"`
1686
1687
1688 IsAppAuthorized bool `json:"isAppAuthorized,omitempty"`
1689
1690 Kind string `json:"kind,omitempty"`
1691
1692 LabelInfo *FileLabelInfo `json:"labelInfo,omitempty"`
1693
1694 Labels *FileLabels `json:"labels,omitempty"`
1695
1696 LastModifyingUser *User `json:"lastModifyingUser,omitempty"`
1697
1698
1699 LastModifyingUserName string `json:"lastModifyingUserName,omitempty"`
1700
1701
1702 LastViewedByMeDate string `json:"lastViewedByMeDate,omitempty"`
1703
1704
1705 LinkShareMetadata *FileLinkShareMetadata `json:"linkShareMetadata,omitempty"`
1706
1707 MarkedViewedByMeDate string `json:"markedViewedByMeDate,omitempty"`
1708
1709
1710
1711 Md5Checksum string `json:"md5Checksum,omitempty"`
1712
1713
1714
1715 MimeType string `json:"mimeType,omitempty"`
1716
1717
1718
1719 ModifiedByMeDate string `json:"modifiedByMeDate,omitempty"`
1720
1721
1722
1723 ModifiedDate string `json:"modifiedDate,omitempty"`
1724
1725
1726
1727 OpenWithLinks map[string]string `json:"openWithLinks,omitempty"`
1728
1729
1730
1731 OriginalFilename string `json:"originalFilename,omitempty"`
1732
1733
1734 OwnedByMe bool `json:"ownedByMe,omitempty"`
1735
1736
1737 OwnerNames []string `json:"ownerNames,omitempty"`
1738
1739
1740
1741 Owners []*User `json:"owners,omitempty"`
1742
1743
1744
1745
1746
1747
1748 Parents []*ParentReference `json:"parents,omitempty"`
1749
1750
1751 PermissionIds []string `json:"permissionIds,omitempty"`
1752
1753
1754 Permissions []*Permission `json:"permissions,omitempty"`
1755
1756 Properties []*Property `json:"properties,omitempty"`
1757
1758 QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"`
1759
1760 ResourceKey string `json:"resourceKey,omitempty"`
1761
1762 SelfLink string `json:"selfLink,omitempty"`
1763
1764
1765
1766 Sha1Checksum string `json:"sha1Checksum,omitempty"`
1767
1768
1769
1770 Sha256Checksum string `json:"sha256Checksum,omitempty"`
1771
1772 Shareable bool `json:"shareable,omitempty"`
1773
1774
1775 Shared bool `json:"shared,omitempty"`
1776
1777
1778 SharedWithMeDate string `json:"sharedWithMeDate,omitempty"`
1779
1780
1781 SharingUser *User `json:"sharingUser,omitempty"`
1782
1783
1784 ShortcutDetails *FileShortcutDetails `json:"shortcutDetails,omitempty"`
1785
1786
1787 Spaces []string `json:"spaces,omitempty"`
1788
1789 TeamDriveId string `json:"teamDriveId,omitempty"`
1790
1791
1792 Thumbnail *FileThumbnail `json:"thumbnail,omitempty"`
1793
1794
1795
1796
1797
1798 ThumbnailLink string `json:"thumbnailLink,omitempty"`
1799
1800
1801 ThumbnailVersion int64 `json:"thumbnailVersion,omitempty,string"`
1802
1803
1804
1805 Title string `json:"title,omitempty"`
1806
1807
1808 TrashedDate string `json:"trashedDate,omitempty"`
1809
1810
1811 TrashingUser *User `json:"trashingUser,omitempty"`
1812
1813
1814 UserPermission *Permission `json:"userPermission,omitempty"`
1815
1816
1817
1818 Version int64 `json:"version,omitempty,string"`
1819
1820
1821 VideoMediaMetadata *FileVideoMediaMetadata `json:"videoMediaMetadata,omitempty"`
1822
1823
1824
1825 WebContentLink string `json:"webContentLink,omitempty"`
1826
1827
1828
1829 WebViewLink string `json:"webViewLink,omitempty"`
1830
1831
1832 WritersCanShare bool `json:"writersCanShare,omitempty"`
1833
1834
1835 googleapi.ServerResponse `json:"-"`
1836
1837
1838
1839
1840
1841 ForceSendFields []string `json:"-"`
1842
1843
1844
1845
1846 NullFields []string `json:"-"`
1847 }
1848
1849 func (s *File) MarshalJSON() ([]byte, error) {
1850 type NoMethod File
1851 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1852 }
1853
1854
1855
1856
1857 type FileCapabilities struct {
1858
1859
1860 CanAcceptOwnership bool `json:"canAcceptOwnership,omitempty"`
1861
1862
1863 CanAddChildren bool `json:"canAddChildren,omitempty"`
1864
1865
1866
1867
1868 CanAddFolderFromAnotherDrive bool `json:"canAddFolderFromAnotherDrive,omitempty"`
1869
1870
1871
1872 CanAddMyDriveParent bool `json:"canAddMyDriveParent,omitempty"`
1873
1874
1875 CanChangeCopyRequiresWriterPermission bool `json:"canChangeCopyRequiresWriterPermission,omitempty"`
1876
1877 CanChangeRestrictedDownload bool `json:"canChangeRestrictedDownload,omitempty"`
1878
1879
1880 CanChangeSecurityUpdateEnabled bool `json:"canChangeSecurityUpdateEnabled,omitempty"`
1881
1882 CanComment bool `json:"canComment,omitempty"`
1883
1884
1885
1886 CanCopy bool `json:"canCopy,omitempty"`
1887
1888 CanDelete bool `json:"canDelete,omitempty"`
1889
1890
1891
1892 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"`
1893
1894 CanDownload bool `json:"canDownload,omitempty"`
1895
1896
1897
1898 CanEdit bool `json:"canEdit,omitempty"`
1899
1900
1901 CanListChildren bool `json:"canListChildren,omitempty"`
1902
1903
1904 CanModifyContent bool `json:"canModifyContent,omitempty"`
1905
1906
1907
1908 CanModifyContentRestriction bool `json:"canModifyContentRestriction,omitempty"`
1909
1910
1911 CanModifyEditorContentRestriction bool `json:"canModifyEditorContentRestriction,omitempty"`
1912
1913
1914 CanModifyLabels bool `json:"canModifyLabels,omitempty"`
1915
1916
1917 CanModifyOwnerContentRestriction bool `json:"canModifyOwnerContentRestriction,omitempty"`
1918
1919
1920
1921 CanMoveChildrenOutOfDrive bool `json:"canMoveChildrenOutOfDrive,omitempty"`
1922
1923
1924 CanMoveChildrenOutOfTeamDrive bool `json:"canMoveChildrenOutOfTeamDrive,omitempty"`
1925
1926
1927
1928
1929 CanMoveChildrenWithinDrive bool `json:"canMoveChildrenWithinDrive,omitempty"`
1930
1931
1932 CanMoveChildrenWithinTeamDrive bool `json:"canMoveChildrenWithinTeamDrive,omitempty"`
1933
1934
1935 CanMoveItemIntoTeamDrive bool `json:"canMoveItemIntoTeamDrive,omitempty"`
1936
1937
1938
1939
1940 CanMoveItemOutOfDrive bool `json:"canMoveItemOutOfDrive,omitempty"`
1941
1942
1943 CanMoveItemOutOfTeamDrive bool `json:"canMoveItemOutOfTeamDrive,omitempty"`
1944
1945
1946
1947
1948 CanMoveItemWithinDrive bool `json:"canMoveItemWithinDrive,omitempty"`
1949
1950
1951 CanMoveItemWithinTeamDrive bool `json:"canMoveItemWithinTeamDrive,omitempty"`
1952
1953
1954 CanMoveTeamDriveItem bool `json:"canMoveTeamDriveItem,omitempty"`
1955
1956
1957 CanReadDrive bool `json:"canReadDrive,omitempty"`
1958
1959
1960 CanReadLabels bool `json:"canReadLabels,omitempty"`
1961
1962
1963
1964
1965 CanReadRevisions bool `json:"canReadRevisions,omitempty"`
1966
1967 CanReadTeamDrive bool `json:"canReadTeamDrive,omitempty"`
1968
1969
1970
1971
1972 CanRemoveChildren bool `json:"canRemoveChildren,omitempty"`
1973
1974
1975 CanRemoveContentRestriction bool `json:"canRemoveContentRestriction,omitempty"`
1976
1977
1978
1979 CanRemoveMyDriveParent bool `json:"canRemoveMyDriveParent,omitempty"`
1980
1981 CanRename bool `json:"canRename,omitempty"`
1982
1983
1984 CanShare bool `json:"canShare,omitempty"`
1985
1986 CanTrash bool `json:"canTrash,omitempty"`
1987
1988
1989
1990 CanTrashChildren bool `json:"canTrashChildren,omitempty"`
1991
1992
1993 CanUntrash bool `json:"canUntrash,omitempty"`
1994
1995
1996
1997
1998
1999 ForceSendFields []string `json:"-"`
2000
2001
2002
2003
2004 NullFields []string `json:"-"`
2005 }
2006
2007 func (s *FileCapabilities) MarshalJSON() ([]byte, error) {
2008 type NoMethod FileCapabilities
2009 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2010 }
2011
2012
2013
2014
2015 type FileImageMediaMetadata struct {
2016
2017 Aperture float64 `json:"aperture,omitempty"`
2018
2019 CameraMake string `json:"cameraMake,omitempty"`
2020
2021 CameraModel string `json:"cameraModel,omitempty"`
2022
2023 ColorSpace string `json:"colorSpace,omitempty"`
2024
2025
2026 Date string `json:"date,omitempty"`
2027
2028 ExposureBias float64 `json:"exposureBias,omitempty"`
2029
2030 ExposureMode string `json:"exposureMode,omitempty"`
2031
2032 ExposureTime float64 `json:"exposureTime,omitempty"`
2033
2034 FlashUsed bool `json:"flashUsed,omitempty"`
2035
2036
2037 FocalLength float64 `json:"focalLength,omitempty"`
2038
2039 Height int64 `json:"height,omitempty"`
2040
2041 IsoSpeed int64 `json:"isoSpeed,omitempty"`
2042
2043 Lens string `json:"lens,omitempty"`
2044
2045 Location *FileImageMediaMetadataLocation `json:"location,omitempty"`
2046
2047
2048 MaxApertureValue float64 `json:"maxApertureValue,omitempty"`
2049
2050 MeteringMode string `json:"meteringMode,omitempty"`
2051
2052
2053 Rotation int64 `json:"rotation,omitempty"`
2054
2055 Sensor string `json:"sensor,omitempty"`
2056
2057
2058 SubjectDistance int64 `json:"subjectDistance,omitempty"`
2059
2060 WhiteBalance string `json:"whiteBalance,omitempty"`
2061
2062 Width int64 `json:"width,omitempty"`
2063
2064
2065
2066
2067
2068 ForceSendFields []string `json:"-"`
2069
2070
2071
2072
2073 NullFields []string `json:"-"`
2074 }
2075
2076 func (s *FileImageMediaMetadata) MarshalJSON() ([]byte, error) {
2077 type NoMethod FileImageMediaMetadata
2078 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2079 }
2080
2081 func (s *FileImageMediaMetadata) UnmarshalJSON(data []byte) error {
2082 type NoMethod FileImageMediaMetadata
2083 var s1 struct {
2084 Aperture gensupport.JSONFloat64 `json:"aperture"`
2085 ExposureBias gensupport.JSONFloat64 `json:"exposureBias"`
2086 ExposureTime gensupport.JSONFloat64 `json:"exposureTime"`
2087 FocalLength gensupport.JSONFloat64 `json:"focalLength"`
2088 MaxApertureValue gensupport.JSONFloat64 `json:"maxApertureValue"`
2089 *NoMethod
2090 }
2091 s1.NoMethod = (*NoMethod)(s)
2092 if err := json.Unmarshal(data, &s1); err != nil {
2093 return err
2094 }
2095 s.Aperture = float64(s1.Aperture)
2096 s.ExposureBias = float64(s1.ExposureBias)
2097 s.ExposureTime = float64(s1.ExposureTime)
2098 s.FocalLength = float64(s1.FocalLength)
2099 s.MaxApertureValue = float64(s1.MaxApertureValue)
2100 return nil
2101 }
2102
2103
2104
2105 type FileImageMediaMetadataLocation struct {
2106
2107 Altitude float64 `json:"altitude,omitempty"`
2108
2109 Latitude float64 `json:"latitude,omitempty"`
2110
2111 Longitude float64 `json:"longitude,omitempty"`
2112
2113
2114
2115
2116
2117 ForceSendFields []string `json:"-"`
2118
2119
2120
2121
2122 NullFields []string `json:"-"`
2123 }
2124
2125 func (s *FileImageMediaMetadataLocation) MarshalJSON() ([]byte, error) {
2126 type NoMethod FileImageMediaMetadataLocation
2127 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2128 }
2129
2130 func (s *FileImageMediaMetadataLocation) UnmarshalJSON(data []byte) error {
2131 type NoMethod FileImageMediaMetadataLocation
2132 var s1 struct {
2133 Altitude gensupport.JSONFloat64 `json:"altitude"`
2134 Latitude gensupport.JSONFloat64 `json:"latitude"`
2135 Longitude gensupport.JSONFloat64 `json:"longitude"`
2136 *NoMethod
2137 }
2138 s1.NoMethod = (*NoMethod)(s)
2139 if err := json.Unmarshal(data, &s1); err != nil {
2140 return err
2141 }
2142 s.Altitude = float64(s1.Altitude)
2143 s.Latitude = float64(s1.Latitude)
2144 s.Longitude = float64(s1.Longitude)
2145 return nil
2146 }
2147
2148
2149
2150 type FileIndexableText struct {
2151
2152 Text string `json:"text,omitempty"`
2153
2154
2155
2156
2157
2158 ForceSendFields []string `json:"-"`
2159
2160
2161
2162
2163 NullFields []string `json:"-"`
2164 }
2165
2166 func (s *FileIndexableText) MarshalJSON() ([]byte, error) {
2167 type NoMethod FileIndexableText
2168 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2169 }
2170
2171
2172 type FileLabelInfo struct {
2173
2174
2175 Labels []*Label `json:"labels,omitempty"`
2176
2177
2178
2179
2180
2181 ForceSendFields []string `json:"-"`
2182
2183
2184
2185
2186 NullFields []string `json:"-"`
2187 }
2188
2189 func (s *FileLabelInfo) MarshalJSON() ([]byte, error) {
2190 type NoMethod FileLabelInfo
2191 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2192 }
2193
2194
2195 type FileLabels struct {
2196
2197 Hidden bool `json:"hidden,omitempty"`
2198
2199 Modified bool `json:"modified,omitempty"`
2200
2201
2202 Restricted bool `json:"restricted,omitempty"`
2203
2204 Starred bool `json:"starred,omitempty"`
2205
2206
2207
2208 Trashed bool `json:"trashed,omitempty"`
2209
2210 Viewed bool `json:"viewed,omitempty"`
2211
2212
2213
2214
2215
2216 ForceSendFields []string `json:"-"`
2217
2218
2219
2220
2221 NullFields []string `json:"-"`
2222 }
2223
2224 func (s *FileLabels) MarshalJSON() ([]byte, error) {
2225 type NoMethod FileLabels
2226 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2227 }
2228
2229
2230
2231 type FileLinkShareMetadata struct {
2232
2233
2234 SecurityUpdateEligible bool `json:"securityUpdateEligible,omitempty"`
2235
2236
2237 SecurityUpdateEnabled bool `json:"securityUpdateEnabled,omitempty"`
2238
2239
2240
2241
2242
2243 ForceSendFields []string `json:"-"`
2244
2245
2246
2247
2248 NullFields []string `json:"-"`
2249 }
2250
2251 func (s *FileLinkShareMetadata) MarshalJSON() ([]byte, error) {
2252 type NoMethod FileLinkShareMetadata
2253 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2254 }
2255
2256
2257
2258
2259 type FileShortcutDetails struct {
2260
2261 TargetId string `json:"targetId,omitempty"`
2262
2263
2264
2265 TargetMimeType string `json:"targetMimeType,omitempty"`
2266
2267 TargetResourceKey string `json:"targetResourceKey,omitempty"`
2268
2269
2270
2271
2272
2273 ForceSendFields []string `json:"-"`
2274
2275
2276
2277
2278 NullFields []string `json:"-"`
2279 }
2280
2281 func (s *FileShortcutDetails) MarshalJSON() ([]byte, error) {
2282 type NoMethod FileShortcutDetails
2283 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2284 }
2285
2286
2287
2288 type FileThumbnail struct {
2289
2290
2291 Image string `json:"image,omitempty"`
2292
2293 MimeType string `json:"mimeType,omitempty"`
2294
2295
2296
2297
2298
2299 ForceSendFields []string `json:"-"`
2300
2301
2302
2303
2304 NullFields []string `json:"-"`
2305 }
2306
2307 func (s *FileThumbnail) MarshalJSON() ([]byte, error) {
2308 type NoMethod FileThumbnail
2309 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2310 }
2311
2312
2313
2314 type FileVideoMediaMetadata struct {
2315
2316 DurationMillis int64 `json:"durationMillis,omitempty,string"`
2317
2318 Height int64 `json:"height,omitempty"`
2319
2320 Width int64 `json:"width,omitempty"`
2321
2322
2323
2324
2325
2326 ForceSendFields []string `json:"-"`
2327
2328
2329
2330
2331 NullFields []string `json:"-"`
2332 }
2333
2334 func (s *FileVideoMediaMetadata) MarshalJSON() ([]byte, error) {
2335 type NoMethod FileVideoMediaMetadata
2336 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2337 }
2338
2339
2340 type FileList struct {
2341
2342 Etag string `json:"etag,omitempty"`
2343
2344
2345
2346
2347
2348
2349 IncompleteSearch bool `json:"incompleteSearch,omitempty"`
2350
2351
2352 Items []*File `json:"items,omitempty"`
2353
2354 Kind string `json:"kind,omitempty"`
2355
2356 NextLink string `json:"nextLink,omitempty"`
2357
2358
2359
2360
2361 NextPageToken string `json:"nextPageToken,omitempty"`
2362
2363 SelfLink string `json:"selfLink,omitempty"`
2364
2365
2366 googleapi.ServerResponse `json:"-"`
2367
2368
2369
2370
2371
2372 ForceSendFields []string `json:"-"`
2373
2374
2375
2376
2377 NullFields []string `json:"-"`
2378 }
2379
2380 func (s *FileList) MarshalJSON() ([]byte, error) {
2381 type NoMethod FileList
2382 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2383 }
2384
2385
2386
2387 type GeneratedIds struct {
2388
2389 Ids []string `json:"ids,omitempty"`
2390
2391 Kind string `json:"kind,omitempty"`
2392
2393 Space string `json:"space,omitempty"`
2394
2395
2396 googleapi.ServerResponse `json:"-"`
2397
2398
2399
2400
2401
2402 ForceSendFields []string `json:"-"`
2403
2404
2405
2406
2407 NullFields []string `json:"-"`
2408 }
2409
2410 func (s *GeneratedIds) MarshalJSON() ([]byte, error) {
2411 type NoMethod GeneratedIds
2412 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2413 }
2414
2415
2416 type Label struct {
2417
2418 Fields map[string]LabelField `json:"fields,omitempty"`
2419
2420 Id string `json:"id,omitempty"`
2421
2422 Kind string `json:"kind,omitempty"`
2423
2424 RevisionId string `json:"revisionId,omitempty"`
2425
2426
2427
2428
2429
2430 ForceSendFields []string `json:"-"`
2431
2432
2433
2434
2435 NullFields []string `json:"-"`
2436 }
2437
2438 func (s *Label) MarshalJSON() ([]byte, error) {
2439 type NoMethod Label
2440 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2441 }
2442
2443
2444 type LabelField struct {
2445
2446
2447 DateString []string `json:"dateString,omitempty"`
2448
2449 Id string `json:"id,omitempty"`
2450
2451 Integer googleapi.Int64s `json:"integer,omitempty"`
2452
2453 Kind string `json:"kind,omitempty"`
2454
2455 Selection []string `json:"selection,omitempty"`
2456
2457 Text []string `json:"text,omitempty"`
2458
2459 User []*User `json:"user,omitempty"`
2460
2461
2462
2463 ValueType string `json:"valueType,omitempty"`
2464
2465
2466
2467
2468
2469 ForceSendFields []string `json:"-"`
2470
2471
2472
2473
2474 NullFields []string `json:"-"`
2475 }
2476
2477 func (s *LabelField) MarshalJSON() ([]byte, error) {
2478 type NoMethod LabelField
2479 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2480 }
2481
2482
2483 type LabelFieldModification struct {
2484
2485 FieldId string `json:"fieldId,omitempty"`
2486
2487 Kind string `json:"kind,omitempty"`
2488
2489
2490 SetDateValues []string `json:"setDateValues,omitempty"`
2491
2492
2493 SetIntegerValues googleapi.Int64s `json:"setIntegerValues,omitempty"`
2494
2495 SetSelectionValues []string `json:"setSelectionValues,omitempty"`
2496
2497 SetTextValues []string `json:"setTextValues,omitempty"`
2498
2499
2500 SetUserValues []string `json:"setUserValues,omitempty"`
2501
2502 UnsetValues bool `json:"unsetValues,omitempty"`
2503
2504
2505
2506
2507
2508 ForceSendFields []string `json:"-"`
2509
2510
2511
2512
2513 NullFields []string `json:"-"`
2514 }
2515
2516 func (s *LabelFieldModification) MarshalJSON() ([]byte, error) {
2517 type NoMethod LabelFieldModification
2518 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2519 }
2520
2521
2522 type LabelList struct {
2523
2524 Items []*Label `json:"items,omitempty"`
2525
2526 Kind string `json:"kind,omitempty"`
2527
2528
2529
2530
2531 NextPageToken string `json:"nextPageToken,omitempty"`
2532
2533
2534 googleapi.ServerResponse `json:"-"`
2535
2536
2537
2538
2539
2540 ForceSendFields []string `json:"-"`
2541
2542
2543
2544
2545 NullFields []string `json:"-"`
2546 }
2547
2548 func (s *LabelList) MarshalJSON() ([]byte, error) {
2549 type NoMethod LabelList
2550 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2551 }
2552
2553
2554
2555
2556 type LabelModification struct {
2557
2558 FieldModifications []*LabelFieldModification `json:"fieldModifications,omitempty"`
2559
2560 Kind string `json:"kind,omitempty"`
2561
2562 LabelId string `json:"labelId,omitempty"`
2563
2564 RemoveLabel bool `json:"removeLabel,omitempty"`
2565
2566
2567
2568
2569
2570 ForceSendFields []string `json:"-"`
2571
2572
2573
2574
2575 NullFields []string `json:"-"`
2576 }
2577
2578 func (s *LabelModification) MarshalJSON() ([]byte, error) {
2579 type NoMethod LabelModification
2580 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2581 }
2582
2583
2584
2585
2586 type ModifyLabelsRequest struct {
2587
2588 Kind string `json:"kind,omitempty"`
2589
2590
2591 LabelModifications []*LabelModification `json:"labelModifications,omitempty"`
2592
2593
2594
2595
2596
2597 ForceSendFields []string `json:"-"`
2598
2599
2600
2601
2602 NullFields []string `json:"-"`
2603 }
2604
2605 func (s *ModifyLabelsRequest) MarshalJSON() ([]byte, error) {
2606 type NoMethod ModifyLabelsRequest
2607 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2608 }
2609
2610
2611
2612 type ModifyLabelsResponse struct {
2613
2614 Kind string `json:"kind,omitempty"`
2615
2616
2617 ModifiedLabels []*Label `json:"modifiedLabels,omitempty"`
2618
2619
2620 googleapi.ServerResponse `json:"-"`
2621
2622
2623
2624
2625
2626 ForceSendFields []string `json:"-"`
2627
2628
2629
2630
2631 NullFields []string `json:"-"`
2632 }
2633
2634 func (s *ModifyLabelsResponse) MarshalJSON() ([]byte, error) {
2635 type NoMethod ModifyLabelsResponse
2636 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2637 }
2638
2639
2640 type ParentList struct {
2641
2642 Etag string `json:"etag,omitempty"`
2643
2644 Items []*ParentReference `json:"items,omitempty"`
2645
2646 Kind string `json:"kind,omitempty"`
2647
2648 SelfLink string `json:"selfLink,omitempty"`
2649
2650
2651 googleapi.ServerResponse `json:"-"`
2652
2653
2654
2655
2656
2657 ForceSendFields []string `json:"-"`
2658
2659
2660
2661
2662 NullFields []string `json:"-"`
2663 }
2664
2665 func (s *ParentList) MarshalJSON() ([]byte, error) {
2666 type NoMethod ParentList
2667 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2668 }
2669
2670
2671
2672
2673 type ParentReference struct {
2674
2675 Id string `json:"id,omitempty"`
2676
2677 IsRoot bool `json:"isRoot,omitempty"`
2678
2679 Kind string `json:"kind,omitempty"`
2680
2681 ParentLink string `json:"parentLink,omitempty"`
2682
2683 SelfLink string `json:"selfLink,omitempty"`
2684
2685
2686 googleapi.ServerResponse `json:"-"`
2687
2688
2689
2690
2691
2692 ForceSendFields []string `json:"-"`
2693
2694
2695
2696
2697 NullFields []string `json:"-"`
2698 }
2699
2700 func (s *ParentReference) MarshalJSON() ([]byte, error) {
2701 type NoMethod ParentReference
2702 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2703 }
2704
2705
2706
2707
2708
2709
2710 type Permission struct {
2711
2712
2713 AdditionalRoles []string `json:"additionalRoles,omitempty"`
2714
2715 AuthKey string `json:"authKey,omitempty"`
2716
2717
2718 Deleted bool `json:"deleted,omitempty"`
2719
2720
2721
2722 Domain string `json:"domain,omitempty"`
2723
2724
2725
2726 EmailAddress string `json:"emailAddress,omitempty"`
2727
2728 Etag string `json:"etag,omitempty"`
2729
2730
2731
2732
2733
2734 ExpirationDate string `json:"expirationDate,omitempty"`
2735
2736
2737
2738
2739
2740 Id string `json:"id,omitempty"`
2741
2742 Kind string `json:"kind,omitempty"`
2743
2744 Name string `json:"name,omitempty"`
2745
2746
2747
2748 PendingOwner bool `json:"pendingOwner,omitempty"`
2749
2750
2751
2752 PermissionDetails []*PermissionPermissionDetails `json:"permissionDetails,omitempty"`
2753
2754 PhotoLink string `json:"photoLink,omitempty"`
2755
2756
2757
2758 Role string `json:"role,omitempty"`
2759
2760 SelfLink string `json:"selfLink,omitempty"`
2761
2762
2763 TeamDrivePermissionDetails []*PermissionTeamDrivePermissionDetails `json:"teamDrivePermissionDetails,omitempty"`
2764
2765
2766 Type string `json:"type,omitempty"`
2767
2768
2769
2770
2771
2772 Value string `json:"value,omitempty"`
2773
2774
2775 View string `json:"view,omitempty"`
2776
2777 WithLink bool `json:"withLink,omitempty"`
2778
2779
2780 googleapi.ServerResponse `json:"-"`
2781
2782
2783
2784
2785
2786 ForceSendFields []string `json:"-"`
2787
2788
2789
2790
2791 NullFields []string `json:"-"`
2792 }
2793
2794 func (s *Permission) MarshalJSON() ([]byte, error) {
2795 type NoMethod Permission
2796 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2797 }
2798
2799 type PermissionPermissionDetails struct {
2800
2801
2802
2803 AdditionalRoles []string `json:"additionalRoles,omitempty"`
2804
2805
2806 Inherited bool `json:"inherited,omitempty"`
2807
2808
2809 InheritedFrom string `json:"inheritedFrom,omitempty"`
2810
2811
2812
2813 PermissionType string `json:"permissionType,omitempty"`
2814
2815
2816
2817 Role string `json:"role,omitempty"`
2818
2819
2820
2821
2822
2823 ForceSendFields []string `json:"-"`
2824
2825
2826
2827
2828 NullFields []string `json:"-"`
2829 }
2830
2831 func (s *PermissionPermissionDetails) MarshalJSON() ([]byte, error) {
2832 type NoMethod PermissionPermissionDetails
2833 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2834 }
2835
2836 type PermissionTeamDrivePermissionDetails struct {
2837
2838
2839 AdditionalRoles []string `json:"additionalRoles,omitempty"`
2840
2841
2842 Inherited bool `json:"inherited,omitempty"`
2843
2844
2845 InheritedFrom string `json:"inheritedFrom,omitempty"`
2846
2847 Role string `json:"role,omitempty"`
2848
2849
2850 TeamDrivePermissionType string `json:"teamDrivePermissionType,omitempty"`
2851
2852
2853
2854
2855
2856 ForceSendFields []string `json:"-"`
2857
2858
2859
2860
2861 NullFields []string `json:"-"`
2862 }
2863
2864 func (s *PermissionTeamDrivePermissionDetails) MarshalJSON() ([]byte, error) {
2865 type NoMethod PermissionTeamDrivePermissionDetails
2866 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2867 }
2868
2869
2870 type PermissionId struct {
2871
2872 Id string `json:"id,omitempty"`
2873
2874 Kind string `json:"kind,omitempty"`
2875
2876
2877 googleapi.ServerResponse `json:"-"`
2878
2879
2880
2881
2882
2883 ForceSendFields []string `json:"-"`
2884
2885
2886
2887
2888 NullFields []string `json:"-"`
2889 }
2890
2891 func (s *PermissionId) MarshalJSON() ([]byte, error) {
2892 type NoMethod PermissionId
2893 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2894 }
2895
2896
2897 type PermissionList struct {
2898
2899 Etag string `json:"etag,omitempty"`
2900
2901 Items []*Permission `json:"items,omitempty"`
2902
2903 Kind string `json:"kind,omitempty"`
2904
2905
2906
2907
2908 NextPageToken string `json:"nextPageToken,omitempty"`
2909
2910 SelfLink string `json:"selfLink,omitempty"`
2911
2912
2913 googleapi.ServerResponse `json:"-"`
2914
2915
2916
2917
2918
2919 ForceSendFields []string `json:"-"`
2920
2921
2922
2923
2924 NullFields []string `json:"-"`
2925 }
2926
2927 func (s *PermissionList) MarshalJSON() ([]byte, error) {
2928 type NoMethod PermissionList
2929 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2930 }
2931
2932
2933
2934
2935
2936
2937
2938
2939 type Property struct {
2940
2941 Etag string `json:"etag,omitempty"`
2942
2943 Key string `json:"key,omitempty"`
2944
2945 Kind string `json:"kind,omitempty"`
2946
2947 SelfLink string `json:"selfLink,omitempty"`
2948
2949 Value string `json:"value,omitempty"`
2950
2951
2952
2953
2954
2955 Visibility string `json:"visibility,omitempty"`
2956
2957
2958 googleapi.ServerResponse `json:"-"`
2959
2960
2961
2962
2963
2964 ForceSendFields []string `json:"-"`
2965
2966
2967
2968
2969 NullFields []string `json:"-"`
2970 }
2971
2972 func (s *Property) MarshalJSON() ([]byte, error) {
2973 type NoMethod Property
2974 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
2975 }
2976
2977
2978
2979 type PropertyList struct {
2980
2981 Etag string `json:"etag,omitempty"`
2982
2983 Items []*Property `json:"items,omitempty"`
2984
2985 Kind string `json:"kind,omitempty"`
2986
2987 SelfLink string `json:"selfLink,omitempty"`
2988
2989
2990 googleapi.ServerResponse `json:"-"`
2991
2992
2993
2994
2995
2996 ForceSendFields []string `json:"-"`
2997
2998
2999
3000
3001 NullFields []string `json:"-"`
3002 }
3003
3004 func (s *PropertyList) MarshalJSON() ([]byte, error) {
3005 type NoMethod PropertyList
3006 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3007 }
3008
3009
3010
3011
3012 type Revision struct {
3013
3014
3015 DownloadUrl string `json:"downloadUrl,omitempty"`
3016
3017 Etag string `json:"etag,omitempty"`
3018
3019
3020 ExportLinks map[string]string `json:"exportLinks,omitempty"`
3021
3022
3023 FileSize int64 `json:"fileSize,omitempty,string"`
3024
3025 Id string `json:"id,omitempty"`
3026
3027 Kind string `json:"kind,omitempty"`
3028
3029 LastModifyingUser *User `json:"lastModifyingUser,omitempty"`
3030
3031
3032 LastModifyingUserName string `json:"lastModifyingUserName,omitempty"`
3033
3034
3035 Md5Checksum string `json:"md5Checksum,omitempty"`
3036
3037 MimeType string `json:"mimeType,omitempty"`
3038
3039
3040 ModifiedDate string `json:"modifiedDate,omitempty"`
3041
3042
3043 OriginalFilename string `json:"originalFilename,omitempty"`
3044
3045
3046
3047
3048
3049
3050
3051 Pinned bool `json:"pinned,omitempty"`
3052
3053
3054 PublishAuto bool `json:"publishAuto,omitempty"`
3055
3056
3057 Published bool `json:"published,omitempty"`
3058
3059
3060 PublishedLink string `json:"publishedLink,omitempty"`
3061
3062
3063
3064 PublishedOutsideDomain bool `json:"publishedOutsideDomain,omitempty"`
3065
3066 SelfLink string `json:"selfLink,omitempty"`
3067
3068
3069 googleapi.ServerResponse `json:"-"`
3070
3071
3072
3073
3074
3075 ForceSendFields []string `json:"-"`
3076
3077
3078
3079
3080 NullFields []string `json:"-"`
3081 }
3082
3083 func (s *Revision) MarshalJSON() ([]byte, error) {
3084 type NoMethod Revision
3085 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3086 }
3087
3088
3089 type RevisionList struct {
3090
3091 Etag string `json:"etag,omitempty"`
3092
3093
3094 Items []*Revision `json:"items,omitempty"`
3095
3096 Kind string `json:"kind,omitempty"`
3097
3098
3099
3100
3101 NextPageToken string `json:"nextPageToken,omitempty"`
3102
3103 SelfLink string `json:"selfLink,omitempty"`
3104
3105
3106 googleapi.ServerResponse `json:"-"`
3107
3108
3109
3110
3111
3112 ForceSendFields []string `json:"-"`
3113
3114
3115
3116
3117 NullFields []string `json:"-"`
3118 }
3119
3120 func (s *RevisionList) MarshalJSON() ([]byte, error) {
3121 type NoMethod RevisionList
3122 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3123 }
3124
3125 type StartPageToken struct {
3126
3127
3128 Kind string `json:"kind,omitempty"`
3129
3130 StartPageToken string `json:"startPageToken,omitempty"`
3131
3132
3133 googleapi.ServerResponse `json:"-"`
3134
3135
3136
3137
3138
3139 ForceSendFields []string `json:"-"`
3140
3141
3142
3143
3144 NullFields []string `json:"-"`
3145 }
3146
3147 func (s *StartPageToken) MarshalJSON() ([]byte, error) {
3148 type NoMethod StartPageToken
3149 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3150 }
3151
3152
3153 type TeamDrive struct {
3154
3155
3156
3157
3158
3159 BackgroundImageFile *TeamDriveBackgroundImageFile `json:"backgroundImageFile,omitempty"`
3160
3161
3162 BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
3163
3164 Capabilities *TeamDriveCapabilities `json:"capabilities,omitempty"`
3165
3166
3167 ColorRgb string `json:"colorRgb,omitempty"`
3168
3169
3170 CreatedDate string `json:"createdDate,omitempty"`
3171
3172
3173 Id string `json:"id,omitempty"`
3174
3175 Kind string `json:"kind,omitempty"`
3176
3177 Name string `json:"name,omitempty"`
3178
3179
3180
3181 OrgUnitId string `json:"orgUnitId,omitempty"`
3182
3183
3184 Restrictions *TeamDriveRestrictions `json:"restrictions,omitempty"`
3185
3186
3187
3188
3189
3190
3191 ThemeId string `json:"themeId,omitempty"`
3192
3193
3194 googleapi.ServerResponse `json:"-"`
3195
3196
3197
3198
3199
3200 ForceSendFields []string `json:"-"`
3201
3202
3203
3204
3205 NullFields []string `json:"-"`
3206 }
3207
3208 func (s *TeamDrive) MarshalJSON() ([]byte, error) {
3209 type NoMethod TeamDrive
3210 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3211 }
3212
3213
3214
3215
3216
3217
3218 type TeamDriveBackgroundImageFile struct {
3219
3220 Id string `json:"id,omitempty"`
3221
3222
3223
3224
3225
3226 Width float64 `json:"width,omitempty"`
3227
3228
3229
3230
3231
3232 XCoordinate float64 `json:"xCoordinate,omitempty"`
3233
3234
3235
3236
3237
3238 YCoordinate float64 `json:"yCoordinate,omitempty"`
3239
3240
3241
3242
3243
3244 ForceSendFields []string `json:"-"`
3245
3246
3247
3248
3249 NullFields []string `json:"-"`
3250 }
3251
3252 func (s *TeamDriveBackgroundImageFile) MarshalJSON() ([]byte, error) {
3253 type NoMethod TeamDriveBackgroundImageFile
3254 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3255 }
3256
3257 func (s *TeamDriveBackgroundImageFile) UnmarshalJSON(data []byte) error {
3258 type NoMethod TeamDriveBackgroundImageFile
3259 var s1 struct {
3260 Width gensupport.JSONFloat64 `json:"width"`
3261 XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"`
3262 YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"`
3263 *NoMethod
3264 }
3265 s1.NoMethod = (*NoMethod)(s)
3266 if err := json.Unmarshal(data, &s1); err != nil {
3267 return err
3268 }
3269 s.Width = float64(s1.Width)
3270 s.XCoordinate = float64(s1.XCoordinate)
3271 s.YCoordinate = float64(s1.YCoordinate)
3272 return nil
3273 }
3274
3275
3276 type TeamDriveCapabilities struct {
3277
3278
3279 CanAddChildren bool `json:"canAddChildren,omitempty"`
3280
3281
3282
3283 CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"`
3284
3285
3286 CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"`
3287
3288
3289
3290 CanChangeSharingFoldersRequiresOrganizerPermissionRestriction bool `json:"canChangeSharingFoldersRequiresOrganizerPermissionRestriction,omitempty"`
3291
3292
3293 CanChangeTeamDriveBackground bool `json:"canChangeTeamDriveBackground,omitempty"`
3294
3295
3296 CanChangeTeamMembersOnlyRestriction bool `json:"canChangeTeamMembersOnlyRestriction,omitempty"`
3297
3298
3299 CanComment bool `json:"canComment,omitempty"`
3300
3301 CanCopy bool `json:"canCopy,omitempty"`
3302
3303
3304 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"`
3305
3306
3307
3308 CanDeleteTeamDrive bool `json:"canDeleteTeamDrive,omitempty"`
3309
3310 CanDownload bool `json:"canDownload,omitempty"`
3311
3312 CanEdit bool `json:"canEdit,omitempty"`
3313
3314
3315 CanListChildren bool `json:"canListChildren,omitempty"`
3316
3317
3318 CanManageMembers bool `json:"canManageMembers,omitempty"`
3319
3320
3321 CanReadRevisions bool `json:"canReadRevisions,omitempty"`
3322
3323
3324 CanRemoveChildren bool `json:"canRemoveChildren,omitempty"`
3325
3326
3327 CanRename bool `json:"canRename,omitempty"`
3328
3329 CanRenameTeamDrive bool `json:"canRenameTeamDrive,omitempty"`
3330
3331
3332 CanResetTeamDriveRestrictions bool `json:"canResetTeamDriveRestrictions,omitempty"`
3333
3334
3335 CanShare bool `json:"canShare,omitempty"`
3336
3337
3338 CanTrashChildren bool `json:"canTrashChildren,omitempty"`
3339
3340
3341
3342
3343
3344 ForceSendFields []string `json:"-"`
3345
3346
3347
3348
3349 NullFields []string `json:"-"`
3350 }
3351
3352 func (s *TeamDriveCapabilities) MarshalJSON() ([]byte, error) {
3353 type NoMethod TeamDriveCapabilities
3354 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3355 }
3356
3357
3358
3359 type TeamDriveRestrictions struct {
3360
3361
3362 AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"`
3363
3364
3365
3366
3367 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"`
3368
3369
3370
3371
3372 DomainUsersOnly bool `json:"domainUsersOnly,omitempty"`
3373
3374
3375
3376 SharingFoldersRequiresOrganizerPermission bool `json:"sharingFoldersRequiresOrganizerPermission,omitempty"`
3377
3378
3379 TeamMembersOnly bool `json:"teamMembersOnly,omitempty"`
3380
3381
3382
3383
3384
3385 ForceSendFields []string `json:"-"`
3386
3387
3388
3389
3390 NullFields []string `json:"-"`
3391 }
3392
3393 func (s *TeamDriveRestrictions) MarshalJSON() ([]byte, error) {
3394 type NoMethod TeamDriveRestrictions
3395 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3396 }
3397
3398
3399 type TeamDriveList struct {
3400
3401 Items []*TeamDrive `json:"items,omitempty"`
3402
3403 Kind string `json:"kind,omitempty"`
3404
3405 NextPageToken string `json:"nextPageToken,omitempty"`
3406
3407
3408 googleapi.ServerResponse `json:"-"`
3409
3410
3411
3412
3413
3414 ForceSendFields []string `json:"-"`
3415
3416
3417
3418
3419 NullFields []string `json:"-"`
3420 }
3421
3422 func (s *TeamDriveList) MarshalJSON() ([]byte, error) {
3423 type NoMethod TeamDriveList
3424 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3425 }
3426
3427
3428 type User struct {
3429
3430 DisplayName string `json:"displayName,omitempty"`
3431
3432 EmailAddress string `json:"emailAddress,omitempty"`
3433
3434
3435 IsAuthenticatedUser bool `json:"isAuthenticatedUser,omitempty"`
3436
3437 Kind string `json:"kind,omitempty"`
3438
3439
3440 PermissionId string `json:"permissionId,omitempty"`
3441
3442 Picture *UserPicture `json:"picture,omitempty"`
3443
3444
3445
3446
3447
3448 ForceSendFields []string `json:"-"`
3449
3450
3451
3452
3453 NullFields []string `json:"-"`
3454 }
3455
3456 func (s *User) MarshalJSON() ([]byte, error) {
3457 type NoMethod User
3458 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3459 }
3460
3461
3462 type UserPicture struct {
3463
3464 Url string `json:"url,omitempty"`
3465
3466
3467
3468
3469
3470 ForceSendFields []string `json:"-"`
3471
3472
3473
3474
3475 NullFields []string `json:"-"`
3476 }
3477
3478 func (s *UserPicture) MarshalJSON() ([]byte, error) {
3479 type NoMethod UserPicture
3480 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
3481 }
3482
3483 type AboutGetCall struct {
3484 s *Service
3485 urlParams_ gensupport.URLParams
3486 ifNoneMatch_ string
3487 ctx_ context.Context
3488 header_ http.Header
3489 }
3490
3491
3492
3493 func (r *AboutService) Get() *AboutGetCall {
3494 c := &AboutGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3495 return c
3496 }
3497
3498
3499
3500
3501
3502 func (c *AboutGetCall) IncludeSubscribed(includeSubscribed bool) *AboutGetCall {
3503 c.urlParams_.Set("includeSubscribed", fmt.Sprint(includeSubscribed))
3504 return c
3505 }
3506
3507
3508
3509 func (c *AboutGetCall) MaxChangeIdCount(maxChangeIdCount int64) *AboutGetCall {
3510 c.urlParams_.Set("maxChangeIdCount", fmt.Sprint(maxChangeIdCount))
3511 return c
3512 }
3513
3514
3515
3516 func (c *AboutGetCall) StartChangeId(startChangeId int64) *AboutGetCall {
3517 c.urlParams_.Set("startChangeId", fmt.Sprint(startChangeId))
3518 return c
3519 }
3520
3521
3522
3523
3524 func (c *AboutGetCall) Fields(s ...googleapi.Field) *AboutGetCall {
3525 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3526 return c
3527 }
3528
3529
3530
3531
3532 func (c *AboutGetCall) IfNoneMatch(entityTag string) *AboutGetCall {
3533 c.ifNoneMatch_ = entityTag
3534 return c
3535 }
3536
3537
3538 func (c *AboutGetCall) Context(ctx context.Context) *AboutGetCall {
3539 c.ctx_ = ctx
3540 return c
3541 }
3542
3543
3544
3545 func (c *AboutGetCall) Header() http.Header {
3546 if c.header_ == nil {
3547 c.header_ = make(http.Header)
3548 }
3549 return c.header_
3550 }
3551
3552 func (c *AboutGetCall) doRequest(alt string) (*http.Response, error) {
3553 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3554 if c.ifNoneMatch_ != "" {
3555 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3556 }
3557 var body io.Reader = nil
3558 c.urlParams_.Set("alt", alt)
3559 c.urlParams_.Set("prettyPrint", "false")
3560 urls := googleapi.ResolveRelative(c.s.BasePath, "about")
3561 urls += "?" + c.urlParams_.Encode()
3562 req, err := http.NewRequest("GET", urls, body)
3563 if err != nil {
3564 return nil, err
3565 }
3566 req.Header = reqHeaders
3567 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3568 }
3569
3570
3571
3572
3573
3574
3575 func (c *AboutGetCall) Do(opts ...googleapi.CallOption) (*About, error) {
3576 gensupport.SetOptions(c.urlParams_, opts...)
3577 res, err := c.doRequest("json")
3578 if res != nil && res.StatusCode == http.StatusNotModified {
3579 if res.Body != nil {
3580 res.Body.Close()
3581 }
3582 return nil, gensupport.WrapError(&googleapi.Error{
3583 Code: res.StatusCode,
3584 Header: res.Header,
3585 })
3586 }
3587 if err != nil {
3588 return nil, err
3589 }
3590 defer googleapi.CloseBody(res)
3591 if err := googleapi.CheckResponse(res); err != nil {
3592 return nil, gensupport.WrapError(err)
3593 }
3594 ret := &About{
3595 ServerResponse: googleapi.ServerResponse{
3596 Header: res.Header,
3597 HTTPStatusCode: res.StatusCode,
3598 },
3599 }
3600 target := &ret
3601 if err := gensupport.DecodeResponse(target, res); err != nil {
3602 return nil, err
3603 }
3604 return ret, nil
3605 }
3606
3607 type AppsGetCall struct {
3608 s *Service
3609 appId string
3610 urlParams_ gensupport.URLParams
3611 ifNoneMatch_ string
3612 ctx_ context.Context
3613 header_ http.Header
3614 }
3615
3616
3617
3618
3619 func (r *AppsService) Get(appId string) *AppsGetCall {
3620 c := &AppsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3621 c.appId = appId
3622 return c
3623 }
3624
3625
3626
3627
3628 func (c *AppsGetCall) Fields(s ...googleapi.Field) *AppsGetCall {
3629 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3630 return c
3631 }
3632
3633
3634
3635
3636 func (c *AppsGetCall) IfNoneMatch(entityTag string) *AppsGetCall {
3637 c.ifNoneMatch_ = entityTag
3638 return c
3639 }
3640
3641
3642 func (c *AppsGetCall) Context(ctx context.Context) *AppsGetCall {
3643 c.ctx_ = ctx
3644 return c
3645 }
3646
3647
3648
3649 func (c *AppsGetCall) Header() http.Header {
3650 if c.header_ == nil {
3651 c.header_ = make(http.Header)
3652 }
3653 return c.header_
3654 }
3655
3656 func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) {
3657 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3658 if c.ifNoneMatch_ != "" {
3659 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3660 }
3661 var body io.Reader = nil
3662 c.urlParams_.Set("alt", alt)
3663 c.urlParams_.Set("prettyPrint", "false")
3664 urls := googleapi.ResolveRelative(c.s.BasePath, "apps/{appId}")
3665 urls += "?" + c.urlParams_.Encode()
3666 req, err := http.NewRequest("GET", urls, body)
3667 if err != nil {
3668 return nil, err
3669 }
3670 req.Header = reqHeaders
3671 googleapi.Expand(req.URL, map[string]string{
3672 "appId": c.appId,
3673 })
3674 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3675 }
3676
3677
3678
3679
3680
3681
3682 func (c *AppsGetCall) Do(opts ...googleapi.CallOption) (*App, error) {
3683 gensupport.SetOptions(c.urlParams_, opts...)
3684 res, err := c.doRequest("json")
3685 if res != nil && res.StatusCode == http.StatusNotModified {
3686 if res.Body != nil {
3687 res.Body.Close()
3688 }
3689 return nil, gensupport.WrapError(&googleapi.Error{
3690 Code: res.StatusCode,
3691 Header: res.Header,
3692 })
3693 }
3694 if err != nil {
3695 return nil, err
3696 }
3697 defer googleapi.CloseBody(res)
3698 if err := googleapi.CheckResponse(res); err != nil {
3699 return nil, gensupport.WrapError(err)
3700 }
3701 ret := &App{
3702 ServerResponse: googleapi.ServerResponse{
3703 Header: res.Header,
3704 HTTPStatusCode: res.StatusCode,
3705 },
3706 }
3707 target := &ret
3708 if err := gensupport.DecodeResponse(target, res); err != nil {
3709 return nil, err
3710 }
3711 return ret, nil
3712 }
3713
3714 type AppsListCall struct {
3715 s *Service
3716 urlParams_ gensupport.URLParams
3717 ifNoneMatch_ string
3718 ctx_ context.Context
3719 header_ http.Header
3720 }
3721
3722
3723 func (r *AppsService) List() *AppsListCall {
3724 c := &AppsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3725 return c
3726 }
3727
3728
3729
3730
3731
3732
3733 func (c *AppsListCall) AppFilterExtensions(appFilterExtensions string) *AppsListCall {
3734 c.urlParams_.Set("appFilterExtensions", appFilterExtensions)
3735 return c
3736 }
3737
3738
3739
3740
3741
3742
3743 func (c *AppsListCall) AppFilterMimeTypes(appFilterMimeTypes string) *AppsListCall {
3744 c.urlParams_.Set("appFilterMimeTypes", appFilterMimeTypes)
3745 return c
3746 }
3747
3748
3749
3750
3751 func (c *AppsListCall) LanguageCode(languageCode string) *AppsListCall {
3752 c.urlParams_.Set("languageCode", languageCode)
3753 return c
3754 }
3755
3756
3757
3758
3759 func (c *AppsListCall) Fields(s ...googleapi.Field) *AppsListCall {
3760 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3761 return c
3762 }
3763
3764
3765
3766
3767 func (c *AppsListCall) IfNoneMatch(entityTag string) *AppsListCall {
3768 c.ifNoneMatch_ = entityTag
3769 return c
3770 }
3771
3772
3773 func (c *AppsListCall) Context(ctx context.Context) *AppsListCall {
3774 c.ctx_ = ctx
3775 return c
3776 }
3777
3778
3779
3780 func (c *AppsListCall) Header() http.Header {
3781 if c.header_ == nil {
3782 c.header_ = make(http.Header)
3783 }
3784 return c.header_
3785 }
3786
3787 func (c *AppsListCall) doRequest(alt string) (*http.Response, error) {
3788 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3789 if c.ifNoneMatch_ != "" {
3790 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3791 }
3792 var body io.Reader = nil
3793 c.urlParams_.Set("alt", alt)
3794 c.urlParams_.Set("prettyPrint", "false")
3795 urls := googleapi.ResolveRelative(c.s.BasePath, "apps")
3796 urls += "?" + c.urlParams_.Encode()
3797 req, err := http.NewRequest("GET", urls, body)
3798 if err != nil {
3799 return nil, err
3800 }
3801 req.Header = reqHeaders
3802 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3803 }
3804
3805
3806
3807
3808
3809
3810 func (c *AppsListCall) Do(opts ...googleapi.CallOption) (*AppList, error) {
3811 gensupport.SetOptions(c.urlParams_, opts...)
3812 res, err := c.doRequest("json")
3813 if res != nil && res.StatusCode == http.StatusNotModified {
3814 if res.Body != nil {
3815 res.Body.Close()
3816 }
3817 return nil, gensupport.WrapError(&googleapi.Error{
3818 Code: res.StatusCode,
3819 Header: res.Header,
3820 })
3821 }
3822 if err != nil {
3823 return nil, err
3824 }
3825 defer googleapi.CloseBody(res)
3826 if err := googleapi.CheckResponse(res); err != nil {
3827 return nil, gensupport.WrapError(err)
3828 }
3829 ret := &AppList{
3830 ServerResponse: googleapi.ServerResponse{
3831 Header: res.Header,
3832 HTTPStatusCode: res.StatusCode,
3833 },
3834 }
3835 target := &ret
3836 if err := gensupport.DecodeResponse(target, res); err != nil {
3837 return nil, err
3838 }
3839 return ret, nil
3840 }
3841
3842 type ChangesGetCall struct {
3843 s *Service
3844 changeId string
3845 urlParams_ gensupport.URLParams
3846 ifNoneMatch_ string
3847 ctx_ context.Context
3848 header_ http.Header
3849 }
3850
3851
3852
3853
3854
3855 func (r *ChangesService) Get(changeId string) *ChangesGetCall {
3856 c := &ChangesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3857 c.changeId = changeId
3858 return c
3859 }
3860
3861
3862
3863 func (c *ChangesGetCall) DriveId(driveId string) *ChangesGetCall {
3864 c.urlParams_.Set("driveId", driveId)
3865 return c
3866 }
3867
3868
3869
3870 func (c *ChangesGetCall) SupportsAllDrives(supportsAllDrives bool) *ChangesGetCall {
3871 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
3872 return c
3873 }
3874
3875
3876
3877 func (c *ChangesGetCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesGetCall {
3878 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
3879 return c
3880 }
3881
3882
3883
3884 func (c *ChangesGetCall) TeamDriveId(teamDriveId string) *ChangesGetCall {
3885 c.urlParams_.Set("teamDriveId", teamDriveId)
3886 return c
3887 }
3888
3889
3890
3891
3892 func (c *ChangesGetCall) Fields(s ...googleapi.Field) *ChangesGetCall {
3893 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3894 return c
3895 }
3896
3897
3898
3899
3900 func (c *ChangesGetCall) IfNoneMatch(entityTag string) *ChangesGetCall {
3901 c.ifNoneMatch_ = entityTag
3902 return c
3903 }
3904
3905
3906 func (c *ChangesGetCall) Context(ctx context.Context) *ChangesGetCall {
3907 c.ctx_ = ctx
3908 return c
3909 }
3910
3911
3912
3913 func (c *ChangesGetCall) Header() http.Header {
3914 if c.header_ == nil {
3915 c.header_ = make(http.Header)
3916 }
3917 return c.header_
3918 }
3919
3920 func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) {
3921 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3922 if c.ifNoneMatch_ != "" {
3923 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3924 }
3925 var body io.Reader = nil
3926 c.urlParams_.Set("alt", alt)
3927 c.urlParams_.Set("prettyPrint", "false")
3928 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/{changeId}")
3929 urls += "?" + c.urlParams_.Encode()
3930 req, err := http.NewRequest("GET", urls, body)
3931 if err != nil {
3932 return nil, err
3933 }
3934 req.Header = reqHeaders
3935 googleapi.Expand(req.URL, map[string]string{
3936 "changeId": c.changeId,
3937 })
3938 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3939 }
3940
3941
3942
3943
3944
3945
3946 func (c *ChangesGetCall) Do(opts ...googleapi.CallOption) (*Change, error) {
3947 gensupport.SetOptions(c.urlParams_, opts...)
3948 res, err := c.doRequest("json")
3949 if res != nil && res.StatusCode == http.StatusNotModified {
3950 if res.Body != nil {
3951 res.Body.Close()
3952 }
3953 return nil, gensupport.WrapError(&googleapi.Error{
3954 Code: res.StatusCode,
3955 Header: res.Header,
3956 })
3957 }
3958 if err != nil {
3959 return nil, err
3960 }
3961 defer googleapi.CloseBody(res)
3962 if err := googleapi.CheckResponse(res); err != nil {
3963 return nil, gensupport.WrapError(err)
3964 }
3965 ret := &Change{
3966 ServerResponse: googleapi.ServerResponse{
3967 Header: res.Header,
3968 HTTPStatusCode: res.StatusCode,
3969 },
3970 }
3971 target := &ret
3972 if err := gensupport.DecodeResponse(target, res); err != nil {
3973 return nil, err
3974 }
3975 return ret, nil
3976 }
3977
3978 type ChangesGetStartPageTokenCall struct {
3979 s *Service
3980 urlParams_ gensupport.URLParams
3981 ifNoneMatch_ string
3982 ctx_ context.Context
3983 header_ http.Header
3984 }
3985
3986
3987 func (r *ChangesService) GetStartPageToken() *ChangesGetStartPageTokenCall {
3988 c := &ChangesGetStartPageTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3989 return c
3990 }
3991
3992
3993
3994
3995 func (c *ChangesGetStartPageTokenCall) DriveId(driveId string) *ChangesGetStartPageTokenCall {
3996 c.urlParams_.Set("driveId", driveId)
3997 return c
3998 }
3999
4000
4001
4002 func (c *ChangesGetStartPageTokenCall) SupportsAllDrives(supportsAllDrives bool) *ChangesGetStartPageTokenCall {
4003 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
4004 return c
4005 }
4006
4007
4008
4009 func (c *ChangesGetStartPageTokenCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesGetStartPageTokenCall {
4010 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
4011 return c
4012 }
4013
4014
4015
4016 func (c *ChangesGetStartPageTokenCall) TeamDriveId(teamDriveId string) *ChangesGetStartPageTokenCall {
4017 c.urlParams_.Set("teamDriveId", teamDriveId)
4018 return c
4019 }
4020
4021
4022
4023
4024 func (c *ChangesGetStartPageTokenCall) Fields(s ...googleapi.Field) *ChangesGetStartPageTokenCall {
4025 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4026 return c
4027 }
4028
4029
4030
4031
4032 func (c *ChangesGetStartPageTokenCall) IfNoneMatch(entityTag string) *ChangesGetStartPageTokenCall {
4033 c.ifNoneMatch_ = entityTag
4034 return c
4035 }
4036
4037
4038 func (c *ChangesGetStartPageTokenCall) Context(ctx context.Context) *ChangesGetStartPageTokenCall {
4039 c.ctx_ = ctx
4040 return c
4041 }
4042
4043
4044
4045 func (c *ChangesGetStartPageTokenCall) Header() http.Header {
4046 if c.header_ == nil {
4047 c.header_ = make(http.Header)
4048 }
4049 return c.header_
4050 }
4051
4052 func (c *ChangesGetStartPageTokenCall) doRequest(alt string) (*http.Response, error) {
4053 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4054 if c.ifNoneMatch_ != "" {
4055 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4056 }
4057 var body io.Reader = nil
4058 c.urlParams_.Set("alt", alt)
4059 c.urlParams_.Set("prettyPrint", "false")
4060 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/startPageToken")
4061 urls += "?" + c.urlParams_.Encode()
4062 req, err := http.NewRequest("GET", urls, body)
4063 if err != nil {
4064 return nil, err
4065 }
4066 req.Header = reqHeaders
4067 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4068 }
4069
4070
4071
4072
4073
4074
4075 func (c *ChangesGetStartPageTokenCall) Do(opts ...googleapi.CallOption) (*StartPageToken, error) {
4076 gensupport.SetOptions(c.urlParams_, opts...)
4077 res, err := c.doRequest("json")
4078 if res != nil && res.StatusCode == http.StatusNotModified {
4079 if res.Body != nil {
4080 res.Body.Close()
4081 }
4082 return nil, gensupport.WrapError(&googleapi.Error{
4083 Code: res.StatusCode,
4084 Header: res.Header,
4085 })
4086 }
4087 if err != nil {
4088 return nil, err
4089 }
4090 defer googleapi.CloseBody(res)
4091 if err := googleapi.CheckResponse(res); err != nil {
4092 return nil, gensupport.WrapError(err)
4093 }
4094 ret := &StartPageToken{
4095 ServerResponse: googleapi.ServerResponse{
4096 Header: res.Header,
4097 HTTPStatusCode: res.StatusCode,
4098 },
4099 }
4100 target := &ret
4101 if err := gensupport.DecodeResponse(target, res); err != nil {
4102 return nil, err
4103 }
4104 return ret, nil
4105 }
4106
4107 type ChangesListCall struct {
4108 s *Service
4109 urlParams_ gensupport.URLParams
4110 ifNoneMatch_ string
4111 ctx_ context.Context
4112 header_ http.Header
4113 }
4114
4115
4116 func (r *ChangesService) List() *ChangesListCall {
4117 c := &ChangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4118 return c
4119 }
4120
4121
4122
4123
4124 func (c *ChangesListCall) DriveId(driveId string) *ChangesListCall {
4125 c.urlParams_.Set("driveId", driveId)
4126 return c
4127 }
4128
4129
4130
4131
4132
4133
4134 func (c *ChangesListCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesListCall {
4135 c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals))
4136 return c
4137 }
4138
4139
4140
4141
4142 func (c *ChangesListCall) IncludeDeleted(includeDeleted bool) *ChangesListCall {
4143 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
4144 return c
4145 }
4146
4147
4148
4149
4150 func (c *ChangesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesListCall {
4151 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives))
4152 return c
4153 }
4154
4155
4156
4157 func (c *ChangesListCall) IncludeLabels(includeLabels string) *ChangesListCall {
4158 c.urlParams_.Set("includeLabels", includeLabels)
4159 return c
4160 }
4161
4162
4163
4164
4165 func (c *ChangesListCall) IncludePermissionsForView(includePermissionsForView string) *ChangesListCall {
4166 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
4167 return c
4168 }
4169
4170
4171
4172
4173
4174
4175 func (c *ChangesListCall) IncludeSubscribed(includeSubscribed bool) *ChangesListCall {
4176 c.urlParams_.Set("includeSubscribed", fmt.Sprint(includeSubscribed))
4177 return c
4178 }
4179
4180
4181
4182 func (c *ChangesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesListCall {
4183 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems))
4184 return c
4185 }
4186
4187
4188
4189 func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall {
4190 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4191 return c
4192 }
4193
4194
4195
4196
4197
4198 func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall {
4199 c.urlParams_.Set("pageToken", pageToken)
4200 return c
4201 }
4202
4203
4204
4205 func (c *ChangesListCall) Spaces(spaces string) *ChangesListCall {
4206 c.urlParams_.Set("spaces", spaces)
4207 return c
4208 }
4209
4210
4211
4212 func (c *ChangesListCall) StartChangeId(startChangeId int64) *ChangesListCall {
4213 c.urlParams_.Set("startChangeId", fmt.Sprint(startChangeId))
4214 return c
4215 }
4216
4217
4218
4219 func (c *ChangesListCall) SupportsAllDrives(supportsAllDrives bool) *ChangesListCall {
4220 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
4221 return c
4222 }
4223
4224
4225
4226 func (c *ChangesListCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesListCall {
4227 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
4228 return c
4229 }
4230
4231
4232
4233 func (c *ChangesListCall) TeamDriveId(teamDriveId string) *ChangesListCall {
4234 c.urlParams_.Set("teamDriveId", teamDriveId)
4235 return c
4236 }
4237
4238
4239
4240
4241 func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall {
4242 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4243 return c
4244 }
4245
4246
4247
4248
4249 func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall {
4250 c.ifNoneMatch_ = entityTag
4251 return c
4252 }
4253
4254
4255 func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall {
4256 c.ctx_ = ctx
4257 return c
4258 }
4259
4260
4261
4262 func (c *ChangesListCall) Header() http.Header {
4263 if c.header_ == nil {
4264 c.header_ = make(http.Header)
4265 }
4266 return c.header_
4267 }
4268
4269 func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) {
4270 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4271 if c.ifNoneMatch_ != "" {
4272 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4273 }
4274 var body io.Reader = nil
4275 c.urlParams_.Set("alt", alt)
4276 c.urlParams_.Set("prettyPrint", "false")
4277 urls := googleapi.ResolveRelative(c.s.BasePath, "changes")
4278 urls += "?" + c.urlParams_.Encode()
4279 req, err := http.NewRequest("GET", urls, body)
4280 if err != nil {
4281 return nil, err
4282 }
4283 req.Header = reqHeaders
4284 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4285 }
4286
4287
4288
4289
4290
4291
4292 func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangeList, error) {
4293 gensupport.SetOptions(c.urlParams_, opts...)
4294 res, err := c.doRequest("json")
4295 if res != nil && res.StatusCode == http.StatusNotModified {
4296 if res.Body != nil {
4297 res.Body.Close()
4298 }
4299 return nil, gensupport.WrapError(&googleapi.Error{
4300 Code: res.StatusCode,
4301 Header: res.Header,
4302 })
4303 }
4304 if err != nil {
4305 return nil, err
4306 }
4307 defer googleapi.CloseBody(res)
4308 if err := googleapi.CheckResponse(res); err != nil {
4309 return nil, gensupport.WrapError(err)
4310 }
4311 ret := &ChangeList{
4312 ServerResponse: googleapi.ServerResponse{
4313 Header: res.Header,
4314 HTTPStatusCode: res.StatusCode,
4315 },
4316 }
4317 target := &ret
4318 if err := gensupport.DecodeResponse(target, res); err != nil {
4319 return nil, err
4320 }
4321 return ret, nil
4322 }
4323
4324
4325
4326
4327 func (c *ChangesListCall) Pages(ctx context.Context, f func(*ChangeList) error) error {
4328 c.ctx_ = ctx
4329 defer c.PageToken(c.urlParams_.Get("pageToken"))
4330 for {
4331 x, err := c.Do()
4332 if err != nil {
4333 return err
4334 }
4335 if err := f(x); err != nil {
4336 return err
4337 }
4338 if x.NextPageToken == "" {
4339 return nil
4340 }
4341 c.PageToken(x.NextPageToken)
4342 }
4343 }
4344
4345 type ChangesWatchCall struct {
4346 s *Service
4347 channel *Channel
4348 urlParams_ gensupport.URLParams
4349 ctx_ context.Context
4350 header_ http.Header
4351 }
4352
4353
4354 func (r *ChangesService) Watch(channel *Channel) *ChangesWatchCall {
4355 c := &ChangesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4356 c.channel = channel
4357 return c
4358 }
4359
4360
4361
4362
4363 func (c *ChangesWatchCall) DriveId(driveId string) *ChangesWatchCall {
4364 c.urlParams_.Set("driveId", driveId)
4365 return c
4366 }
4367
4368
4369
4370
4371
4372
4373 func (c *ChangesWatchCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesWatchCall {
4374 c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals))
4375 return c
4376 }
4377
4378
4379
4380
4381 func (c *ChangesWatchCall) IncludeDeleted(includeDeleted bool) *ChangesWatchCall {
4382 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
4383 return c
4384 }
4385
4386
4387
4388
4389 func (c *ChangesWatchCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesWatchCall {
4390 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives))
4391 return c
4392 }
4393
4394
4395
4396 func (c *ChangesWatchCall) IncludeLabels(includeLabels string) *ChangesWatchCall {
4397 c.urlParams_.Set("includeLabels", includeLabels)
4398 return c
4399 }
4400
4401
4402
4403
4404 func (c *ChangesWatchCall) IncludePermissionsForView(includePermissionsForView string) *ChangesWatchCall {
4405 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
4406 return c
4407 }
4408
4409
4410
4411
4412
4413
4414 func (c *ChangesWatchCall) IncludeSubscribed(includeSubscribed bool) *ChangesWatchCall {
4415 c.urlParams_.Set("includeSubscribed", fmt.Sprint(includeSubscribed))
4416 return c
4417 }
4418
4419
4420
4421 func (c *ChangesWatchCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesWatchCall {
4422 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems))
4423 return c
4424 }
4425
4426
4427
4428 func (c *ChangesWatchCall) MaxResults(maxResults int64) *ChangesWatchCall {
4429 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4430 return c
4431 }
4432
4433
4434
4435
4436
4437 func (c *ChangesWatchCall) PageToken(pageToken string) *ChangesWatchCall {
4438 c.urlParams_.Set("pageToken", pageToken)
4439 return c
4440 }
4441
4442
4443
4444 func (c *ChangesWatchCall) Spaces(spaces string) *ChangesWatchCall {
4445 c.urlParams_.Set("spaces", spaces)
4446 return c
4447 }
4448
4449
4450
4451 func (c *ChangesWatchCall) StartChangeId(startChangeId int64) *ChangesWatchCall {
4452 c.urlParams_.Set("startChangeId", fmt.Sprint(startChangeId))
4453 return c
4454 }
4455
4456
4457
4458 func (c *ChangesWatchCall) SupportsAllDrives(supportsAllDrives bool) *ChangesWatchCall {
4459 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
4460 return c
4461 }
4462
4463
4464
4465 func (c *ChangesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesWatchCall {
4466 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
4467 return c
4468 }
4469
4470
4471
4472 func (c *ChangesWatchCall) TeamDriveId(teamDriveId string) *ChangesWatchCall {
4473 c.urlParams_.Set("teamDriveId", teamDriveId)
4474 return c
4475 }
4476
4477
4478
4479
4480 func (c *ChangesWatchCall) Fields(s ...googleapi.Field) *ChangesWatchCall {
4481 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4482 return c
4483 }
4484
4485
4486 func (c *ChangesWatchCall) Context(ctx context.Context) *ChangesWatchCall {
4487 c.ctx_ = ctx
4488 return c
4489 }
4490
4491
4492
4493 func (c *ChangesWatchCall) Header() http.Header {
4494 if c.header_ == nil {
4495 c.header_ = make(http.Header)
4496 }
4497 return c.header_
4498 }
4499
4500 func (c *ChangesWatchCall) doRequest(alt string) (*http.Response, error) {
4501 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4502 var body io.Reader = nil
4503 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
4504 if err != nil {
4505 return nil, err
4506 }
4507 c.urlParams_.Set("alt", alt)
4508 c.urlParams_.Set("prettyPrint", "false")
4509 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/watch")
4510 urls += "?" + c.urlParams_.Encode()
4511 req, err := http.NewRequest("POST", urls, body)
4512 if err != nil {
4513 return nil, err
4514 }
4515 req.Header = reqHeaders
4516 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4517 }
4518
4519
4520
4521
4522
4523
4524 func (c *ChangesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
4525 gensupport.SetOptions(c.urlParams_, opts...)
4526 res, err := c.doRequest("json")
4527 if res != nil && res.StatusCode == http.StatusNotModified {
4528 if res.Body != nil {
4529 res.Body.Close()
4530 }
4531 return nil, gensupport.WrapError(&googleapi.Error{
4532 Code: res.StatusCode,
4533 Header: res.Header,
4534 })
4535 }
4536 if err != nil {
4537 return nil, err
4538 }
4539 defer googleapi.CloseBody(res)
4540 if err := googleapi.CheckResponse(res); err != nil {
4541 return nil, gensupport.WrapError(err)
4542 }
4543 ret := &Channel{
4544 ServerResponse: googleapi.ServerResponse{
4545 Header: res.Header,
4546 HTTPStatusCode: res.StatusCode,
4547 },
4548 }
4549 target := &ret
4550 if err := gensupport.DecodeResponse(target, res); err != nil {
4551 return nil, err
4552 }
4553 return ret, nil
4554 }
4555
4556 type ChannelsStopCall struct {
4557 s *Service
4558 channel *Channel
4559 urlParams_ gensupport.URLParams
4560 ctx_ context.Context
4561 header_ http.Header
4562 }
4563
4564
4565 func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
4566 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4567 c.channel = channel
4568 return c
4569 }
4570
4571
4572
4573
4574 func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
4575 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4576 return c
4577 }
4578
4579
4580 func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
4581 c.ctx_ = ctx
4582 return c
4583 }
4584
4585
4586
4587 func (c *ChannelsStopCall) Header() http.Header {
4588 if c.header_ == nil {
4589 c.header_ = make(http.Header)
4590 }
4591 return c.header_
4592 }
4593
4594 func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
4595 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4596 var body io.Reader = nil
4597 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
4598 if err != nil {
4599 return nil, err
4600 }
4601 c.urlParams_.Set("alt", alt)
4602 c.urlParams_.Set("prettyPrint", "false")
4603 urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
4604 urls += "?" + c.urlParams_.Encode()
4605 req, err := http.NewRequest("POST", urls, body)
4606 if err != nil {
4607 return nil, err
4608 }
4609 req.Header = reqHeaders
4610 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4611 }
4612
4613
4614 func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
4615 gensupport.SetOptions(c.urlParams_, opts...)
4616 res, err := c.doRequest("json")
4617 if err != nil {
4618 return err
4619 }
4620 defer googleapi.CloseBody(res)
4621 if err := googleapi.CheckResponse(res); err != nil {
4622 return gensupport.WrapError(err)
4623 }
4624 return nil
4625 }
4626
4627 type ChildrenDeleteCall struct {
4628 s *Service
4629 folderId string
4630 childId string
4631 urlParams_ gensupport.URLParams
4632 ctx_ context.Context
4633 header_ http.Header
4634 }
4635
4636
4637
4638
4639
4640 func (r *ChildrenService) Delete(folderId string, childId string) *ChildrenDeleteCall {
4641 c := &ChildrenDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4642 c.folderId = folderId
4643 c.childId = childId
4644 return c
4645 }
4646
4647
4648
4649
4650 func (c *ChildrenDeleteCall) EnforceSingleParent(enforceSingleParent bool) *ChildrenDeleteCall {
4651 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
4652 return c
4653 }
4654
4655
4656
4657
4658 func (c *ChildrenDeleteCall) Fields(s ...googleapi.Field) *ChildrenDeleteCall {
4659 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4660 return c
4661 }
4662
4663
4664 func (c *ChildrenDeleteCall) Context(ctx context.Context) *ChildrenDeleteCall {
4665 c.ctx_ = ctx
4666 return c
4667 }
4668
4669
4670
4671 func (c *ChildrenDeleteCall) Header() http.Header {
4672 if c.header_ == nil {
4673 c.header_ = make(http.Header)
4674 }
4675 return c.header_
4676 }
4677
4678 func (c *ChildrenDeleteCall) doRequest(alt string) (*http.Response, error) {
4679 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4680 var body io.Reader = nil
4681 c.urlParams_.Set("alt", alt)
4682 c.urlParams_.Set("prettyPrint", "false")
4683 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children/{childId}")
4684 urls += "?" + c.urlParams_.Encode()
4685 req, err := http.NewRequest("DELETE", urls, body)
4686 if err != nil {
4687 return nil, err
4688 }
4689 req.Header = reqHeaders
4690 googleapi.Expand(req.URL, map[string]string{
4691 "folderId": c.folderId,
4692 "childId": c.childId,
4693 })
4694 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4695 }
4696
4697
4698 func (c *ChildrenDeleteCall) Do(opts ...googleapi.CallOption) error {
4699 gensupport.SetOptions(c.urlParams_, opts...)
4700 res, err := c.doRequest("json")
4701 if err != nil {
4702 return err
4703 }
4704 defer googleapi.CloseBody(res)
4705 if err := googleapi.CheckResponse(res); err != nil {
4706 return gensupport.WrapError(err)
4707 }
4708 return nil
4709 }
4710
4711 type ChildrenGetCall struct {
4712 s *Service
4713 folderId string
4714 childId string
4715 urlParams_ gensupport.URLParams
4716 ifNoneMatch_ string
4717 ctx_ context.Context
4718 header_ http.Header
4719 }
4720
4721
4722
4723
4724
4725 func (r *ChildrenService) Get(folderId string, childId string) *ChildrenGetCall {
4726 c := &ChildrenGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4727 c.folderId = folderId
4728 c.childId = childId
4729 return c
4730 }
4731
4732
4733
4734
4735 func (c *ChildrenGetCall) Fields(s ...googleapi.Field) *ChildrenGetCall {
4736 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4737 return c
4738 }
4739
4740
4741
4742
4743 func (c *ChildrenGetCall) IfNoneMatch(entityTag string) *ChildrenGetCall {
4744 c.ifNoneMatch_ = entityTag
4745 return c
4746 }
4747
4748
4749 func (c *ChildrenGetCall) Context(ctx context.Context) *ChildrenGetCall {
4750 c.ctx_ = ctx
4751 return c
4752 }
4753
4754
4755
4756 func (c *ChildrenGetCall) Header() http.Header {
4757 if c.header_ == nil {
4758 c.header_ = make(http.Header)
4759 }
4760 return c.header_
4761 }
4762
4763 func (c *ChildrenGetCall) doRequest(alt string) (*http.Response, error) {
4764 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4765 if c.ifNoneMatch_ != "" {
4766 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4767 }
4768 var body io.Reader = nil
4769 c.urlParams_.Set("alt", alt)
4770 c.urlParams_.Set("prettyPrint", "false")
4771 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children/{childId}")
4772 urls += "?" + c.urlParams_.Encode()
4773 req, err := http.NewRequest("GET", urls, body)
4774 if err != nil {
4775 return nil, err
4776 }
4777 req.Header = reqHeaders
4778 googleapi.Expand(req.URL, map[string]string{
4779 "folderId": c.folderId,
4780 "childId": c.childId,
4781 })
4782 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4783 }
4784
4785
4786
4787
4788
4789
4790 func (c *ChildrenGetCall) Do(opts ...googleapi.CallOption) (*ChildReference, error) {
4791 gensupport.SetOptions(c.urlParams_, opts...)
4792 res, err := c.doRequest("json")
4793 if res != nil && res.StatusCode == http.StatusNotModified {
4794 if res.Body != nil {
4795 res.Body.Close()
4796 }
4797 return nil, gensupport.WrapError(&googleapi.Error{
4798 Code: res.StatusCode,
4799 Header: res.Header,
4800 })
4801 }
4802 if err != nil {
4803 return nil, err
4804 }
4805 defer googleapi.CloseBody(res)
4806 if err := googleapi.CheckResponse(res); err != nil {
4807 return nil, gensupport.WrapError(err)
4808 }
4809 ret := &ChildReference{
4810 ServerResponse: googleapi.ServerResponse{
4811 Header: res.Header,
4812 HTTPStatusCode: res.StatusCode,
4813 },
4814 }
4815 target := &ret
4816 if err := gensupport.DecodeResponse(target, res); err != nil {
4817 return nil, err
4818 }
4819 return ret, nil
4820 }
4821
4822 type ChildrenInsertCall struct {
4823 s *Service
4824 folderId string
4825 childreference *ChildReference
4826 urlParams_ gensupport.URLParams
4827 ctx_ context.Context
4828 header_ http.Header
4829 }
4830
4831
4832
4833
4834 func (r *ChildrenService) Insert(folderId string, childreference *ChildReference) *ChildrenInsertCall {
4835 c := &ChildrenInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4836 c.folderId = folderId
4837 c.childreference = childreference
4838 return c
4839 }
4840
4841
4842
4843
4844 func (c *ChildrenInsertCall) EnforceSingleParent(enforceSingleParent bool) *ChildrenInsertCall {
4845 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
4846 return c
4847 }
4848
4849
4850
4851 func (c *ChildrenInsertCall) SupportsAllDrives(supportsAllDrives bool) *ChildrenInsertCall {
4852 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
4853 return c
4854 }
4855
4856
4857
4858 func (c *ChildrenInsertCall) SupportsTeamDrives(supportsTeamDrives bool) *ChildrenInsertCall {
4859 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
4860 return c
4861 }
4862
4863
4864
4865
4866 func (c *ChildrenInsertCall) Fields(s ...googleapi.Field) *ChildrenInsertCall {
4867 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4868 return c
4869 }
4870
4871
4872 func (c *ChildrenInsertCall) Context(ctx context.Context) *ChildrenInsertCall {
4873 c.ctx_ = ctx
4874 return c
4875 }
4876
4877
4878
4879 func (c *ChildrenInsertCall) Header() http.Header {
4880 if c.header_ == nil {
4881 c.header_ = make(http.Header)
4882 }
4883 return c.header_
4884 }
4885
4886 func (c *ChildrenInsertCall) doRequest(alt string) (*http.Response, error) {
4887 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4888 var body io.Reader = nil
4889 body, err := googleapi.WithoutDataWrapper.JSONReader(c.childreference)
4890 if err != nil {
4891 return nil, err
4892 }
4893 c.urlParams_.Set("alt", alt)
4894 c.urlParams_.Set("prettyPrint", "false")
4895 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children")
4896 urls += "?" + c.urlParams_.Encode()
4897 req, err := http.NewRequest("POST", urls, body)
4898 if err != nil {
4899 return nil, err
4900 }
4901 req.Header = reqHeaders
4902 googleapi.Expand(req.URL, map[string]string{
4903 "folderId": c.folderId,
4904 })
4905 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4906 }
4907
4908
4909
4910
4911
4912
4913 func (c *ChildrenInsertCall) Do(opts ...googleapi.CallOption) (*ChildReference, error) {
4914 gensupport.SetOptions(c.urlParams_, opts...)
4915 res, err := c.doRequest("json")
4916 if res != nil && res.StatusCode == http.StatusNotModified {
4917 if res.Body != nil {
4918 res.Body.Close()
4919 }
4920 return nil, gensupport.WrapError(&googleapi.Error{
4921 Code: res.StatusCode,
4922 Header: res.Header,
4923 })
4924 }
4925 if err != nil {
4926 return nil, err
4927 }
4928 defer googleapi.CloseBody(res)
4929 if err := googleapi.CheckResponse(res); err != nil {
4930 return nil, gensupport.WrapError(err)
4931 }
4932 ret := &ChildReference{
4933 ServerResponse: googleapi.ServerResponse{
4934 Header: res.Header,
4935 HTTPStatusCode: res.StatusCode,
4936 },
4937 }
4938 target := &ret
4939 if err := gensupport.DecodeResponse(target, res); err != nil {
4940 return nil, err
4941 }
4942 return ret, nil
4943 }
4944
4945 type ChildrenListCall struct {
4946 s *Service
4947 folderId string
4948 urlParams_ gensupport.URLParams
4949 ifNoneMatch_ string
4950 ctx_ context.Context
4951 header_ http.Header
4952 }
4953
4954
4955
4956
4957 func (r *ChildrenService) List(folderId string) *ChildrenListCall {
4958 c := &ChildrenListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4959 c.folderId = folderId
4960 return c
4961 }
4962
4963
4964
4965 func (c *ChildrenListCall) MaxResults(maxResults int64) *ChildrenListCall {
4966 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4967 return c
4968 }
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978 func (c *ChildrenListCall) OrderBy(orderBy string) *ChildrenListCall {
4979 c.urlParams_.Set("orderBy", orderBy)
4980 return c
4981 }
4982
4983
4984 func (c *ChildrenListCall) PageToken(pageToken string) *ChildrenListCall {
4985 c.urlParams_.Set("pageToken", pageToken)
4986 return c
4987 }
4988
4989
4990 func (c *ChildrenListCall) Q(q string) *ChildrenListCall {
4991 c.urlParams_.Set("q", q)
4992 return c
4993 }
4994
4995
4996
4997
4998 func (c *ChildrenListCall) Fields(s ...googleapi.Field) *ChildrenListCall {
4999 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5000 return c
5001 }
5002
5003
5004
5005
5006 func (c *ChildrenListCall) IfNoneMatch(entityTag string) *ChildrenListCall {
5007 c.ifNoneMatch_ = entityTag
5008 return c
5009 }
5010
5011
5012 func (c *ChildrenListCall) Context(ctx context.Context) *ChildrenListCall {
5013 c.ctx_ = ctx
5014 return c
5015 }
5016
5017
5018
5019 func (c *ChildrenListCall) Header() http.Header {
5020 if c.header_ == nil {
5021 c.header_ = make(http.Header)
5022 }
5023 return c.header_
5024 }
5025
5026 func (c *ChildrenListCall) doRequest(alt string) (*http.Response, error) {
5027 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5028 if c.ifNoneMatch_ != "" {
5029 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5030 }
5031 var body io.Reader = nil
5032 c.urlParams_.Set("alt", alt)
5033 c.urlParams_.Set("prettyPrint", "false")
5034 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children")
5035 urls += "?" + c.urlParams_.Encode()
5036 req, err := http.NewRequest("GET", urls, body)
5037 if err != nil {
5038 return nil, err
5039 }
5040 req.Header = reqHeaders
5041 googleapi.Expand(req.URL, map[string]string{
5042 "folderId": c.folderId,
5043 })
5044 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5045 }
5046
5047
5048
5049
5050
5051
5052 func (c *ChildrenListCall) Do(opts ...googleapi.CallOption) (*ChildList, error) {
5053 gensupport.SetOptions(c.urlParams_, opts...)
5054 res, err := c.doRequest("json")
5055 if res != nil && res.StatusCode == http.StatusNotModified {
5056 if res.Body != nil {
5057 res.Body.Close()
5058 }
5059 return nil, gensupport.WrapError(&googleapi.Error{
5060 Code: res.StatusCode,
5061 Header: res.Header,
5062 })
5063 }
5064 if err != nil {
5065 return nil, err
5066 }
5067 defer googleapi.CloseBody(res)
5068 if err := googleapi.CheckResponse(res); err != nil {
5069 return nil, gensupport.WrapError(err)
5070 }
5071 ret := &ChildList{
5072 ServerResponse: googleapi.ServerResponse{
5073 Header: res.Header,
5074 HTTPStatusCode: res.StatusCode,
5075 },
5076 }
5077 target := &ret
5078 if err := gensupport.DecodeResponse(target, res); err != nil {
5079 return nil, err
5080 }
5081 return ret, nil
5082 }
5083
5084
5085
5086
5087 func (c *ChildrenListCall) Pages(ctx context.Context, f func(*ChildList) error) error {
5088 c.ctx_ = ctx
5089 defer c.PageToken(c.urlParams_.Get("pageToken"))
5090 for {
5091 x, err := c.Do()
5092 if err != nil {
5093 return err
5094 }
5095 if err := f(x); err != nil {
5096 return err
5097 }
5098 if x.NextPageToken == "" {
5099 return nil
5100 }
5101 c.PageToken(x.NextPageToken)
5102 }
5103 }
5104
5105 type CommentsDeleteCall struct {
5106 s *Service
5107 fileId string
5108 commentId string
5109 urlParams_ gensupport.URLParams
5110 ctx_ context.Context
5111 header_ http.Header
5112 }
5113
5114
5115
5116
5117
5118 func (r *CommentsService) Delete(fileId string, commentId string) *CommentsDeleteCall {
5119 c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5120 c.fileId = fileId
5121 c.commentId = commentId
5122 return c
5123 }
5124
5125
5126
5127
5128 func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall {
5129 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5130 return c
5131 }
5132
5133
5134 func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall {
5135 c.ctx_ = ctx
5136 return c
5137 }
5138
5139
5140
5141 func (c *CommentsDeleteCall) Header() http.Header {
5142 if c.header_ == nil {
5143 c.header_ = make(http.Header)
5144 }
5145 return c.header_
5146 }
5147
5148 func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) {
5149 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5150 var body io.Reader = nil
5151 c.urlParams_.Set("alt", alt)
5152 c.urlParams_.Set("prettyPrint", "false")
5153 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}")
5154 urls += "?" + c.urlParams_.Encode()
5155 req, err := http.NewRequest("DELETE", urls, body)
5156 if err != nil {
5157 return nil, err
5158 }
5159 req.Header = reqHeaders
5160 googleapi.Expand(req.URL, map[string]string{
5161 "fileId": c.fileId,
5162 "commentId": c.commentId,
5163 })
5164 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5165 }
5166
5167
5168 func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error {
5169 gensupport.SetOptions(c.urlParams_, opts...)
5170 res, err := c.doRequest("json")
5171 if err != nil {
5172 return err
5173 }
5174 defer googleapi.CloseBody(res)
5175 if err := googleapi.CheckResponse(res); err != nil {
5176 return gensupport.WrapError(err)
5177 }
5178 return nil
5179 }
5180
5181 type CommentsGetCall struct {
5182 s *Service
5183 fileId string
5184 commentId string
5185 urlParams_ gensupport.URLParams
5186 ifNoneMatch_ string
5187 ctx_ context.Context
5188 header_ http.Header
5189 }
5190
5191
5192
5193
5194
5195 func (r *CommentsService) Get(fileId string, commentId string) *CommentsGetCall {
5196 c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5197 c.fileId = fileId
5198 c.commentId = commentId
5199 return c
5200 }
5201
5202
5203
5204
5205 func (c *CommentsGetCall) IncludeDeleted(includeDeleted bool) *CommentsGetCall {
5206 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
5207 return c
5208 }
5209
5210
5211
5212
5213 func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall {
5214 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5215 return c
5216 }
5217
5218
5219
5220
5221 func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall {
5222 c.ifNoneMatch_ = entityTag
5223 return c
5224 }
5225
5226
5227 func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall {
5228 c.ctx_ = ctx
5229 return c
5230 }
5231
5232
5233
5234 func (c *CommentsGetCall) Header() http.Header {
5235 if c.header_ == nil {
5236 c.header_ = make(http.Header)
5237 }
5238 return c.header_
5239 }
5240
5241 func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) {
5242 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5243 if c.ifNoneMatch_ != "" {
5244 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5245 }
5246 var body io.Reader = nil
5247 c.urlParams_.Set("alt", alt)
5248 c.urlParams_.Set("prettyPrint", "false")
5249 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}")
5250 urls += "?" + c.urlParams_.Encode()
5251 req, err := http.NewRequest("GET", urls, body)
5252 if err != nil {
5253 return nil, err
5254 }
5255 req.Header = reqHeaders
5256 googleapi.Expand(req.URL, map[string]string{
5257 "fileId": c.fileId,
5258 "commentId": c.commentId,
5259 })
5260 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5261 }
5262
5263
5264
5265
5266
5267
5268 func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
5269 gensupport.SetOptions(c.urlParams_, opts...)
5270 res, err := c.doRequest("json")
5271 if res != nil && res.StatusCode == http.StatusNotModified {
5272 if res.Body != nil {
5273 res.Body.Close()
5274 }
5275 return nil, gensupport.WrapError(&googleapi.Error{
5276 Code: res.StatusCode,
5277 Header: res.Header,
5278 })
5279 }
5280 if err != nil {
5281 return nil, err
5282 }
5283 defer googleapi.CloseBody(res)
5284 if err := googleapi.CheckResponse(res); err != nil {
5285 return nil, gensupport.WrapError(err)
5286 }
5287 ret := &Comment{
5288 ServerResponse: googleapi.ServerResponse{
5289 Header: res.Header,
5290 HTTPStatusCode: res.StatusCode,
5291 },
5292 }
5293 target := &ret
5294 if err := gensupport.DecodeResponse(target, res); err != nil {
5295 return nil, err
5296 }
5297 return ret, nil
5298 }
5299
5300 type CommentsInsertCall struct {
5301 s *Service
5302 fileId string
5303 comment *Comment
5304 urlParams_ gensupport.URLParams
5305 ctx_ context.Context
5306 header_ http.Header
5307 }
5308
5309
5310
5311
5312 func (r *CommentsService) Insert(fileId string, comment *Comment) *CommentsInsertCall {
5313 c := &CommentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5314 c.fileId = fileId
5315 c.comment = comment
5316 return c
5317 }
5318
5319
5320
5321
5322 func (c *CommentsInsertCall) Fields(s ...googleapi.Field) *CommentsInsertCall {
5323 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5324 return c
5325 }
5326
5327
5328 func (c *CommentsInsertCall) Context(ctx context.Context) *CommentsInsertCall {
5329 c.ctx_ = ctx
5330 return c
5331 }
5332
5333
5334
5335 func (c *CommentsInsertCall) Header() http.Header {
5336 if c.header_ == nil {
5337 c.header_ = make(http.Header)
5338 }
5339 return c.header_
5340 }
5341
5342 func (c *CommentsInsertCall) doRequest(alt string) (*http.Response, error) {
5343 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5344 var body io.Reader = nil
5345 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
5346 if err != nil {
5347 return nil, err
5348 }
5349 c.urlParams_.Set("alt", alt)
5350 c.urlParams_.Set("prettyPrint", "false")
5351 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments")
5352 urls += "?" + c.urlParams_.Encode()
5353 req, err := http.NewRequest("POST", urls, body)
5354 if err != nil {
5355 return nil, err
5356 }
5357 req.Header = reqHeaders
5358 googleapi.Expand(req.URL, map[string]string{
5359 "fileId": c.fileId,
5360 })
5361 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5362 }
5363
5364
5365
5366
5367
5368
5369 func (c *CommentsInsertCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
5370 gensupport.SetOptions(c.urlParams_, opts...)
5371 res, err := c.doRequest("json")
5372 if res != nil && res.StatusCode == http.StatusNotModified {
5373 if res.Body != nil {
5374 res.Body.Close()
5375 }
5376 return nil, gensupport.WrapError(&googleapi.Error{
5377 Code: res.StatusCode,
5378 Header: res.Header,
5379 })
5380 }
5381 if err != nil {
5382 return nil, err
5383 }
5384 defer googleapi.CloseBody(res)
5385 if err := googleapi.CheckResponse(res); err != nil {
5386 return nil, gensupport.WrapError(err)
5387 }
5388 ret := &Comment{
5389 ServerResponse: googleapi.ServerResponse{
5390 Header: res.Header,
5391 HTTPStatusCode: res.StatusCode,
5392 },
5393 }
5394 target := &ret
5395 if err := gensupport.DecodeResponse(target, res); err != nil {
5396 return nil, err
5397 }
5398 return ret, nil
5399 }
5400
5401 type CommentsListCall struct {
5402 s *Service
5403 fileId string
5404 urlParams_ gensupport.URLParams
5405 ifNoneMatch_ string
5406 ctx_ context.Context
5407 header_ http.Header
5408 }
5409
5410
5411
5412
5413 func (r *CommentsService) List(fileId string) *CommentsListCall {
5414 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5415 c.fileId = fileId
5416 return c
5417 }
5418
5419
5420
5421
5422 func (c *CommentsListCall) IncludeDeleted(includeDeleted bool) *CommentsListCall {
5423 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
5424 return c
5425 }
5426
5427
5428
5429 func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
5430 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
5431 return c
5432 }
5433
5434
5435
5436
5437 func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
5438 c.urlParams_.Set("pageToken", pageToken)
5439 return c
5440 }
5441
5442
5443
5444
5445 func (c *CommentsListCall) UpdatedMin(updatedMin string) *CommentsListCall {
5446 c.urlParams_.Set("updatedMin", updatedMin)
5447 return c
5448 }
5449
5450
5451
5452
5453 func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
5454 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5455 return c
5456 }
5457
5458
5459
5460
5461 func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall {
5462 c.ifNoneMatch_ = entityTag
5463 return c
5464 }
5465
5466
5467 func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall {
5468 c.ctx_ = ctx
5469 return c
5470 }
5471
5472
5473
5474 func (c *CommentsListCall) Header() http.Header {
5475 if c.header_ == nil {
5476 c.header_ = make(http.Header)
5477 }
5478 return c.header_
5479 }
5480
5481 func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) {
5482 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5483 if c.ifNoneMatch_ != "" {
5484 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5485 }
5486 var body io.Reader = nil
5487 c.urlParams_.Set("alt", alt)
5488 c.urlParams_.Set("prettyPrint", "false")
5489 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments")
5490 urls += "?" + c.urlParams_.Encode()
5491 req, err := http.NewRequest("GET", urls, body)
5492 if err != nil {
5493 return nil, err
5494 }
5495 req.Header = reqHeaders
5496 googleapi.Expand(req.URL, map[string]string{
5497 "fileId": c.fileId,
5498 })
5499 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5500 }
5501
5502
5503
5504
5505
5506
5507 func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) {
5508 gensupport.SetOptions(c.urlParams_, opts...)
5509 res, err := c.doRequest("json")
5510 if res != nil && res.StatusCode == http.StatusNotModified {
5511 if res.Body != nil {
5512 res.Body.Close()
5513 }
5514 return nil, gensupport.WrapError(&googleapi.Error{
5515 Code: res.StatusCode,
5516 Header: res.Header,
5517 })
5518 }
5519 if err != nil {
5520 return nil, err
5521 }
5522 defer googleapi.CloseBody(res)
5523 if err := googleapi.CheckResponse(res); err != nil {
5524 return nil, gensupport.WrapError(err)
5525 }
5526 ret := &CommentList{
5527 ServerResponse: googleapi.ServerResponse{
5528 Header: res.Header,
5529 HTTPStatusCode: res.StatusCode,
5530 },
5531 }
5532 target := &ret
5533 if err := gensupport.DecodeResponse(target, res); err != nil {
5534 return nil, err
5535 }
5536 return ret, nil
5537 }
5538
5539
5540
5541
5542 func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error {
5543 c.ctx_ = ctx
5544 defer c.PageToken(c.urlParams_.Get("pageToken"))
5545 for {
5546 x, err := c.Do()
5547 if err != nil {
5548 return err
5549 }
5550 if err := f(x); err != nil {
5551 return err
5552 }
5553 if x.NextPageToken == "" {
5554 return nil
5555 }
5556 c.PageToken(x.NextPageToken)
5557 }
5558 }
5559
5560 type CommentsPatchCall struct {
5561 s *Service
5562 fileId string
5563 commentId string
5564 comment *Comment
5565 urlParams_ gensupport.URLParams
5566 ctx_ context.Context
5567 header_ http.Header
5568 }
5569
5570
5571
5572
5573
5574 func (r *CommentsService) Patch(fileId string, commentId string, comment *Comment) *CommentsPatchCall {
5575 c := &CommentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5576 c.fileId = fileId
5577 c.commentId = commentId
5578 c.comment = comment
5579 return c
5580 }
5581
5582
5583
5584
5585 func (c *CommentsPatchCall) Fields(s ...googleapi.Field) *CommentsPatchCall {
5586 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5587 return c
5588 }
5589
5590
5591 func (c *CommentsPatchCall) Context(ctx context.Context) *CommentsPatchCall {
5592 c.ctx_ = ctx
5593 return c
5594 }
5595
5596
5597
5598 func (c *CommentsPatchCall) Header() http.Header {
5599 if c.header_ == nil {
5600 c.header_ = make(http.Header)
5601 }
5602 return c.header_
5603 }
5604
5605 func (c *CommentsPatchCall) doRequest(alt string) (*http.Response, error) {
5606 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5607 var body io.Reader = nil
5608 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
5609 if err != nil {
5610 return nil, err
5611 }
5612 c.urlParams_.Set("alt", alt)
5613 c.urlParams_.Set("prettyPrint", "false")
5614 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}")
5615 urls += "?" + c.urlParams_.Encode()
5616 req, err := http.NewRequest("PATCH", urls, body)
5617 if err != nil {
5618 return nil, err
5619 }
5620 req.Header = reqHeaders
5621 googleapi.Expand(req.URL, map[string]string{
5622 "fileId": c.fileId,
5623 "commentId": c.commentId,
5624 })
5625 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5626 }
5627
5628
5629
5630
5631
5632
5633 func (c *CommentsPatchCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
5634 gensupport.SetOptions(c.urlParams_, opts...)
5635 res, err := c.doRequest("json")
5636 if res != nil && res.StatusCode == http.StatusNotModified {
5637 if res.Body != nil {
5638 res.Body.Close()
5639 }
5640 return nil, gensupport.WrapError(&googleapi.Error{
5641 Code: res.StatusCode,
5642 Header: res.Header,
5643 })
5644 }
5645 if err != nil {
5646 return nil, err
5647 }
5648 defer googleapi.CloseBody(res)
5649 if err := googleapi.CheckResponse(res); err != nil {
5650 return nil, gensupport.WrapError(err)
5651 }
5652 ret := &Comment{
5653 ServerResponse: googleapi.ServerResponse{
5654 Header: res.Header,
5655 HTTPStatusCode: res.StatusCode,
5656 },
5657 }
5658 target := &ret
5659 if err := gensupport.DecodeResponse(target, res); err != nil {
5660 return nil, err
5661 }
5662 return ret, nil
5663 }
5664
5665 type CommentsUpdateCall struct {
5666 s *Service
5667 fileId string
5668 commentId string
5669 comment *Comment
5670 urlParams_ gensupport.URLParams
5671 ctx_ context.Context
5672 header_ http.Header
5673 }
5674
5675
5676
5677
5678
5679 func (r *CommentsService) Update(fileId string, commentId string, comment *Comment) *CommentsUpdateCall {
5680 c := &CommentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5681 c.fileId = fileId
5682 c.commentId = commentId
5683 c.comment = comment
5684 return c
5685 }
5686
5687
5688
5689
5690 func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall {
5691 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5692 return c
5693 }
5694
5695
5696 func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall {
5697 c.ctx_ = ctx
5698 return c
5699 }
5700
5701
5702
5703 func (c *CommentsUpdateCall) Header() http.Header {
5704 if c.header_ == nil {
5705 c.header_ = make(http.Header)
5706 }
5707 return c.header_
5708 }
5709
5710 func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) {
5711 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5712 var body io.Reader = nil
5713 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
5714 if err != nil {
5715 return nil, err
5716 }
5717 c.urlParams_.Set("alt", alt)
5718 c.urlParams_.Set("prettyPrint", "false")
5719 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}")
5720 urls += "?" + c.urlParams_.Encode()
5721 req, err := http.NewRequest("PUT", urls, body)
5722 if err != nil {
5723 return nil, err
5724 }
5725 req.Header = reqHeaders
5726 googleapi.Expand(req.URL, map[string]string{
5727 "fileId": c.fileId,
5728 "commentId": c.commentId,
5729 })
5730 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5731 }
5732
5733
5734
5735
5736
5737
5738 func (c *CommentsUpdateCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
5739 gensupport.SetOptions(c.urlParams_, opts...)
5740 res, err := c.doRequest("json")
5741 if res != nil && res.StatusCode == http.StatusNotModified {
5742 if res.Body != nil {
5743 res.Body.Close()
5744 }
5745 return nil, gensupport.WrapError(&googleapi.Error{
5746 Code: res.StatusCode,
5747 Header: res.Header,
5748 })
5749 }
5750 if err != nil {
5751 return nil, err
5752 }
5753 defer googleapi.CloseBody(res)
5754 if err := googleapi.CheckResponse(res); err != nil {
5755 return nil, gensupport.WrapError(err)
5756 }
5757 ret := &Comment{
5758 ServerResponse: googleapi.ServerResponse{
5759 Header: res.Header,
5760 HTTPStatusCode: res.StatusCode,
5761 },
5762 }
5763 target := &ret
5764 if err := gensupport.DecodeResponse(target, res); err != nil {
5765 return nil, err
5766 }
5767 return ret, nil
5768 }
5769
5770 type DrivesDeleteCall struct {
5771 s *Service
5772 driveId string
5773 urlParams_ gensupport.URLParams
5774 ctx_ context.Context
5775 header_ http.Header
5776 }
5777
5778
5779
5780
5781
5782 func (r *DrivesService) Delete(driveId string) *DrivesDeleteCall {
5783 c := &DrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5784 c.driveId = driveId
5785 return c
5786 }
5787
5788
5789
5790
5791 func (c *DrivesDeleteCall) AllowItemDeletion(allowItemDeletion bool) *DrivesDeleteCall {
5792 c.urlParams_.Set("allowItemDeletion", fmt.Sprint(allowItemDeletion))
5793 return c
5794 }
5795
5796
5797
5798
5799
5800 func (c *DrivesDeleteCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesDeleteCall {
5801 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
5802 return c
5803 }
5804
5805
5806
5807
5808 func (c *DrivesDeleteCall) Fields(s ...googleapi.Field) *DrivesDeleteCall {
5809 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5810 return c
5811 }
5812
5813
5814 func (c *DrivesDeleteCall) Context(ctx context.Context) *DrivesDeleteCall {
5815 c.ctx_ = ctx
5816 return c
5817 }
5818
5819
5820
5821 func (c *DrivesDeleteCall) Header() http.Header {
5822 if c.header_ == nil {
5823 c.header_ = make(http.Header)
5824 }
5825 return c.header_
5826 }
5827
5828 func (c *DrivesDeleteCall) doRequest(alt string) (*http.Response, error) {
5829 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5830 var body io.Reader = nil
5831 c.urlParams_.Set("alt", alt)
5832 c.urlParams_.Set("prettyPrint", "false")
5833 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}")
5834 urls += "?" + c.urlParams_.Encode()
5835 req, err := http.NewRequest("DELETE", urls, body)
5836 if err != nil {
5837 return nil, err
5838 }
5839 req.Header = reqHeaders
5840 googleapi.Expand(req.URL, map[string]string{
5841 "driveId": c.driveId,
5842 })
5843 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5844 }
5845
5846
5847 func (c *DrivesDeleteCall) Do(opts ...googleapi.CallOption) error {
5848 gensupport.SetOptions(c.urlParams_, opts...)
5849 res, err := c.doRequest("json")
5850 if err != nil {
5851 return err
5852 }
5853 defer googleapi.CloseBody(res)
5854 if err := googleapi.CheckResponse(res); err != nil {
5855 return gensupport.WrapError(err)
5856 }
5857 return nil
5858 }
5859
5860 type DrivesGetCall struct {
5861 s *Service
5862 driveId string
5863 urlParams_ gensupport.URLParams
5864 ifNoneMatch_ string
5865 ctx_ context.Context
5866 header_ http.Header
5867 }
5868
5869
5870
5871
5872 func (r *DrivesService) Get(driveId string) *DrivesGetCall {
5873 c := &DrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5874 c.driveId = driveId
5875 return c
5876 }
5877
5878
5879
5880
5881
5882 func (c *DrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesGetCall {
5883 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
5884 return c
5885 }
5886
5887
5888
5889
5890 func (c *DrivesGetCall) Fields(s ...googleapi.Field) *DrivesGetCall {
5891 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5892 return c
5893 }
5894
5895
5896
5897
5898 func (c *DrivesGetCall) IfNoneMatch(entityTag string) *DrivesGetCall {
5899 c.ifNoneMatch_ = entityTag
5900 return c
5901 }
5902
5903
5904 func (c *DrivesGetCall) Context(ctx context.Context) *DrivesGetCall {
5905 c.ctx_ = ctx
5906 return c
5907 }
5908
5909
5910
5911 func (c *DrivesGetCall) Header() http.Header {
5912 if c.header_ == nil {
5913 c.header_ = make(http.Header)
5914 }
5915 return c.header_
5916 }
5917
5918 func (c *DrivesGetCall) doRequest(alt string) (*http.Response, error) {
5919 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5920 if c.ifNoneMatch_ != "" {
5921 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5922 }
5923 var body io.Reader = nil
5924 c.urlParams_.Set("alt", alt)
5925 c.urlParams_.Set("prettyPrint", "false")
5926 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}")
5927 urls += "?" + c.urlParams_.Encode()
5928 req, err := http.NewRequest("GET", urls, body)
5929 if err != nil {
5930 return nil, err
5931 }
5932 req.Header = reqHeaders
5933 googleapi.Expand(req.URL, map[string]string{
5934 "driveId": c.driveId,
5935 })
5936 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5937 }
5938
5939
5940
5941
5942
5943
5944 func (c *DrivesGetCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
5945 gensupport.SetOptions(c.urlParams_, opts...)
5946 res, err := c.doRequest("json")
5947 if res != nil && res.StatusCode == http.StatusNotModified {
5948 if res.Body != nil {
5949 res.Body.Close()
5950 }
5951 return nil, gensupport.WrapError(&googleapi.Error{
5952 Code: res.StatusCode,
5953 Header: res.Header,
5954 })
5955 }
5956 if err != nil {
5957 return nil, err
5958 }
5959 defer googleapi.CloseBody(res)
5960 if err := googleapi.CheckResponse(res); err != nil {
5961 return nil, gensupport.WrapError(err)
5962 }
5963 ret := &Drive{
5964 ServerResponse: googleapi.ServerResponse{
5965 Header: res.Header,
5966 HTTPStatusCode: res.StatusCode,
5967 },
5968 }
5969 target := &ret
5970 if err := gensupport.DecodeResponse(target, res); err != nil {
5971 return nil, err
5972 }
5973 return ret, nil
5974 }
5975
5976 type DrivesHideCall struct {
5977 s *Service
5978 driveId string
5979 urlParams_ gensupport.URLParams
5980 ctx_ context.Context
5981 header_ http.Header
5982 }
5983
5984
5985
5986
5987 func (r *DrivesService) Hide(driveId string) *DrivesHideCall {
5988 c := &DrivesHideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5989 c.driveId = driveId
5990 return c
5991 }
5992
5993
5994
5995
5996 func (c *DrivesHideCall) Fields(s ...googleapi.Field) *DrivesHideCall {
5997 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5998 return c
5999 }
6000
6001
6002 func (c *DrivesHideCall) Context(ctx context.Context) *DrivesHideCall {
6003 c.ctx_ = ctx
6004 return c
6005 }
6006
6007
6008
6009 func (c *DrivesHideCall) Header() http.Header {
6010 if c.header_ == nil {
6011 c.header_ = make(http.Header)
6012 }
6013 return c.header_
6014 }
6015
6016 func (c *DrivesHideCall) doRequest(alt string) (*http.Response, error) {
6017 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6018 var body io.Reader = nil
6019 c.urlParams_.Set("alt", alt)
6020 c.urlParams_.Set("prettyPrint", "false")
6021 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/hide")
6022 urls += "?" + c.urlParams_.Encode()
6023 req, err := http.NewRequest("POST", urls, body)
6024 if err != nil {
6025 return nil, err
6026 }
6027 req.Header = reqHeaders
6028 googleapi.Expand(req.URL, map[string]string{
6029 "driveId": c.driveId,
6030 })
6031 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6032 }
6033
6034
6035
6036
6037
6038
6039 func (c *DrivesHideCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
6040 gensupport.SetOptions(c.urlParams_, opts...)
6041 res, err := c.doRequest("json")
6042 if res != nil && res.StatusCode == http.StatusNotModified {
6043 if res.Body != nil {
6044 res.Body.Close()
6045 }
6046 return nil, gensupport.WrapError(&googleapi.Error{
6047 Code: res.StatusCode,
6048 Header: res.Header,
6049 })
6050 }
6051 if err != nil {
6052 return nil, err
6053 }
6054 defer googleapi.CloseBody(res)
6055 if err := googleapi.CheckResponse(res); err != nil {
6056 return nil, gensupport.WrapError(err)
6057 }
6058 ret := &Drive{
6059 ServerResponse: googleapi.ServerResponse{
6060 Header: res.Header,
6061 HTTPStatusCode: res.StatusCode,
6062 },
6063 }
6064 target := &ret
6065 if err := gensupport.DecodeResponse(target, res); err != nil {
6066 return nil, err
6067 }
6068 return ret, nil
6069 }
6070
6071 type DrivesInsertCall struct {
6072 s *Service
6073 drive *Drive
6074 urlParams_ gensupport.URLParams
6075 ctx_ context.Context
6076 header_ http.Header
6077 }
6078
6079
6080
6081
6082
6083
6084
6085
6086 func (r *DrivesService) Insert(requestId string, drive *Drive) *DrivesInsertCall {
6087 c := &DrivesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6088 c.urlParams_.Set("requestId", requestId)
6089 c.drive = drive
6090 return c
6091 }
6092
6093
6094
6095
6096 func (c *DrivesInsertCall) Fields(s ...googleapi.Field) *DrivesInsertCall {
6097 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6098 return c
6099 }
6100
6101
6102 func (c *DrivesInsertCall) Context(ctx context.Context) *DrivesInsertCall {
6103 c.ctx_ = ctx
6104 return c
6105 }
6106
6107
6108
6109 func (c *DrivesInsertCall) Header() http.Header {
6110 if c.header_ == nil {
6111 c.header_ = make(http.Header)
6112 }
6113 return c.header_
6114 }
6115
6116 func (c *DrivesInsertCall) doRequest(alt string) (*http.Response, error) {
6117 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6118 var body io.Reader = nil
6119 body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive)
6120 if err != nil {
6121 return nil, err
6122 }
6123 c.urlParams_.Set("alt", alt)
6124 c.urlParams_.Set("prettyPrint", "false")
6125 urls := googleapi.ResolveRelative(c.s.BasePath, "drives")
6126 urls += "?" + c.urlParams_.Encode()
6127 req, err := http.NewRequest("POST", urls, body)
6128 if err != nil {
6129 return nil, err
6130 }
6131 req.Header = reqHeaders
6132 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6133 }
6134
6135
6136
6137
6138
6139
6140 func (c *DrivesInsertCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
6141 gensupport.SetOptions(c.urlParams_, opts...)
6142 res, err := c.doRequest("json")
6143 if res != nil && res.StatusCode == http.StatusNotModified {
6144 if res.Body != nil {
6145 res.Body.Close()
6146 }
6147 return nil, gensupport.WrapError(&googleapi.Error{
6148 Code: res.StatusCode,
6149 Header: res.Header,
6150 })
6151 }
6152 if err != nil {
6153 return nil, err
6154 }
6155 defer googleapi.CloseBody(res)
6156 if err := googleapi.CheckResponse(res); err != nil {
6157 return nil, gensupport.WrapError(err)
6158 }
6159 ret := &Drive{
6160 ServerResponse: googleapi.ServerResponse{
6161 Header: res.Header,
6162 HTTPStatusCode: res.StatusCode,
6163 },
6164 }
6165 target := &ret
6166 if err := gensupport.DecodeResponse(target, res); err != nil {
6167 return nil, err
6168 }
6169 return ret, nil
6170 }
6171
6172 type DrivesListCall struct {
6173 s *Service
6174 urlParams_ gensupport.URLParams
6175 ifNoneMatch_ string
6176 ctx_ context.Context
6177 header_ http.Header
6178 }
6179
6180
6181
6182
6183
6184 func (r *DrivesService) List() *DrivesListCall {
6185 c := &DrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6186 return c
6187 }
6188
6189
6190
6191 func (c *DrivesListCall) MaxResults(maxResults int64) *DrivesListCall {
6192 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
6193 return c
6194 }
6195
6196
6197
6198 func (c *DrivesListCall) PageToken(pageToken string) *DrivesListCall {
6199 c.urlParams_.Set("pageToken", pageToken)
6200 return c
6201 }
6202
6203
6204 func (c *DrivesListCall) Q(q string) *DrivesListCall {
6205 c.urlParams_.Set("q", q)
6206 return c
6207 }
6208
6209
6210
6211
6212
6213 func (c *DrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesListCall {
6214 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
6215 return c
6216 }
6217
6218
6219
6220
6221 func (c *DrivesListCall) Fields(s ...googleapi.Field) *DrivesListCall {
6222 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6223 return c
6224 }
6225
6226
6227
6228
6229 func (c *DrivesListCall) IfNoneMatch(entityTag string) *DrivesListCall {
6230 c.ifNoneMatch_ = entityTag
6231 return c
6232 }
6233
6234
6235 func (c *DrivesListCall) Context(ctx context.Context) *DrivesListCall {
6236 c.ctx_ = ctx
6237 return c
6238 }
6239
6240
6241
6242 func (c *DrivesListCall) Header() http.Header {
6243 if c.header_ == nil {
6244 c.header_ = make(http.Header)
6245 }
6246 return c.header_
6247 }
6248
6249 func (c *DrivesListCall) doRequest(alt string) (*http.Response, error) {
6250 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6251 if c.ifNoneMatch_ != "" {
6252 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6253 }
6254 var body io.Reader = nil
6255 c.urlParams_.Set("alt", alt)
6256 c.urlParams_.Set("prettyPrint", "false")
6257 urls := googleapi.ResolveRelative(c.s.BasePath, "drives")
6258 urls += "?" + c.urlParams_.Encode()
6259 req, err := http.NewRequest("GET", urls, body)
6260 if err != nil {
6261 return nil, err
6262 }
6263 req.Header = reqHeaders
6264 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6265 }
6266
6267
6268
6269
6270
6271
6272 func (c *DrivesListCall) Do(opts ...googleapi.CallOption) (*DriveList, error) {
6273 gensupport.SetOptions(c.urlParams_, opts...)
6274 res, err := c.doRequest("json")
6275 if res != nil && res.StatusCode == http.StatusNotModified {
6276 if res.Body != nil {
6277 res.Body.Close()
6278 }
6279 return nil, gensupport.WrapError(&googleapi.Error{
6280 Code: res.StatusCode,
6281 Header: res.Header,
6282 })
6283 }
6284 if err != nil {
6285 return nil, err
6286 }
6287 defer googleapi.CloseBody(res)
6288 if err := googleapi.CheckResponse(res); err != nil {
6289 return nil, gensupport.WrapError(err)
6290 }
6291 ret := &DriveList{
6292 ServerResponse: googleapi.ServerResponse{
6293 Header: res.Header,
6294 HTTPStatusCode: res.StatusCode,
6295 },
6296 }
6297 target := &ret
6298 if err := gensupport.DecodeResponse(target, res); err != nil {
6299 return nil, err
6300 }
6301 return ret, nil
6302 }
6303
6304
6305
6306
6307 func (c *DrivesListCall) Pages(ctx context.Context, f func(*DriveList) error) error {
6308 c.ctx_ = ctx
6309 defer c.PageToken(c.urlParams_.Get("pageToken"))
6310 for {
6311 x, err := c.Do()
6312 if err != nil {
6313 return err
6314 }
6315 if err := f(x); err != nil {
6316 return err
6317 }
6318 if x.NextPageToken == "" {
6319 return nil
6320 }
6321 c.PageToken(x.NextPageToken)
6322 }
6323 }
6324
6325 type DrivesUnhideCall struct {
6326 s *Service
6327 driveId string
6328 urlParams_ gensupport.URLParams
6329 ctx_ context.Context
6330 header_ http.Header
6331 }
6332
6333
6334
6335
6336 func (r *DrivesService) Unhide(driveId string) *DrivesUnhideCall {
6337 c := &DrivesUnhideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6338 c.driveId = driveId
6339 return c
6340 }
6341
6342
6343
6344
6345 func (c *DrivesUnhideCall) Fields(s ...googleapi.Field) *DrivesUnhideCall {
6346 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6347 return c
6348 }
6349
6350
6351 func (c *DrivesUnhideCall) Context(ctx context.Context) *DrivesUnhideCall {
6352 c.ctx_ = ctx
6353 return c
6354 }
6355
6356
6357
6358 func (c *DrivesUnhideCall) Header() http.Header {
6359 if c.header_ == nil {
6360 c.header_ = make(http.Header)
6361 }
6362 return c.header_
6363 }
6364
6365 func (c *DrivesUnhideCall) doRequest(alt string) (*http.Response, error) {
6366 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6367 var body io.Reader = nil
6368 c.urlParams_.Set("alt", alt)
6369 c.urlParams_.Set("prettyPrint", "false")
6370 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/unhide")
6371 urls += "?" + c.urlParams_.Encode()
6372 req, err := http.NewRequest("POST", urls, body)
6373 if err != nil {
6374 return nil, err
6375 }
6376 req.Header = reqHeaders
6377 googleapi.Expand(req.URL, map[string]string{
6378 "driveId": c.driveId,
6379 })
6380 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6381 }
6382
6383
6384
6385
6386
6387
6388 func (c *DrivesUnhideCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
6389 gensupport.SetOptions(c.urlParams_, opts...)
6390 res, err := c.doRequest("json")
6391 if res != nil && res.StatusCode == http.StatusNotModified {
6392 if res.Body != nil {
6393 res.Body.Close()
6394 }
6395 return nil, gensupport.WrapError(&googleapi.Error{
6396 Code: res.StatusCode,
6397 Header: res.Header,
6398 })
6399 }
6400 if err != nil {
6401 return nil, err
6402 }
6403 defer googleapi.CloseBody(res)
6404 if err := googleapi.CheckResponse(res); err != nil {
6405 return nil, gensupport.WrapError(err)
6406 }
6407 ret := &Drive{
6408 ServerResponse: googleapi.ServerResponse{
6409 Header: res.Header,
6410 HTTPStatusCode: res.StatusCode,
6411 },
6412 }
6413 target := &ret
6414 if err := gensupport.DecodeResponse(target, res); err != nil {
6415 return nil, err
6416 }
6417 return ret, nil
6418 }
6419
6420 type DrivesUpdateCall struct {
6421 s *Service
6422 driveId string
6423 drive *Drive
6424 urlParams_ gensupport.URLParams
6425 ctx_ context.Context
6426 header_ http.Header
6427 }
6428
6429
6430
6431
6432 func (r *DrivesService) Update(driveId string, drive *Drive) *DrivesUpdateCall {
6433 c := &DrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6434 c.driveId = driveId
6435 c.drive = drive
6436 return c
6437 }
6438
6439
6440
6441
6442
6443 func (c *DrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesUpdateCall {
6444 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
6445 return c
6446 }
6447
6448
6449
6450
6451 func (c *DrivesUpdateCall) Fields(s ...googleapi.Field) *DrivesUpdateCall {
6452 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6453 return c
6454 }
6455
6456
6457 func (c *DrivesUpdateCall) Context(ctx context.Context) *DrivesUpdateCall {
6458 c.ctx_ = ctx
6459 return c
6460 }
6461
6462
6463
6464 func (c *DrivesUpdateCall) Header() http.Header {
6465 if c.header_ == nil {
6466 c.header_ = make(http.Header)
6467 }
6468 return c.header_
6469 }
6470
6471 func (c *DrivesUpdateCall) doRequest(alt string) (*http.Response, error) {
6472 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6473 var body io.Reader = nil
6474 body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive)
6475 if err != nil {
6476 return nil, err
6477 }
6478 c.urlParams_.Set("alt", alt)
6479 c.urlParams_.Set("prettyPrint", "false")
6480 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}")
6481 urls += "?" + c.urlParams_.Encode()
6482 req, err := http.NewRequest("PUT", urls, body)
6483 if err != nil {
6484 return nil, err
6485 }
6486 req.Header = reqHeaders
6487 googleapi.Expand(req.URL, map[string]string{
6488 "driveId": c.driveId,
6489 })
6490 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6491 }
6492
6493
6494
6495
6496
6497
6498 func (c *DrivesUpdateCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
6499 gensupport.SetOptions(c.urlParams_, opts...)
6500 res, err := c.doRequest("json")
6501 if res != nil && res.StatusCode == http.StatusNotModified {
6502 if res.Body != nil {
6503 res.Body.Close()
6504 }
6505 return nil, gensupport.WrapError(&googleapi.Error{
6506 Code: res.StatusCode,
6507 Header: res.Header,
6508 })
6509 }
6510 if err != nil {
6511 return nil, err
6512 }
6513 defer googleapi.CloseBody(res)
6514 if err := googleapi.CheckResponse(res); err != nil {
6515 return nil, gensupport.WrapError(err)
6516 }
6517 ret := &Drive{
6518 ServerResponse: googleapi.ServerResponse{
6519 Header: res.Header,
6520 HTTPStatusCode: res.StatusCode,
6521 },
6522 }
6523 target := &ret
6524 if err := gensupport.DecodeResponse(target, res); err != nil {
6525 return nil, err
6526 }
6527 return ret, nil
6528 }
6529
6530 type FilesCopyCall struct {
6531 s *Service
6532 fileId string
6533 file *File
6534 urlParams_ gensupport.URLParams
6535 ctx_ context.Context
6536 header_ http.Header
6537 }
6538
6539
6540
6541
6542 func (r *FilesService) Copy(fileId string, file *File) *FilesCopyCall {
6543 c := &FilesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6544 c.fileId = fileId
6545 c.file = file
6546 return c
6547 }
6548
6549
6550
6551 func (c *FilesCopyCall) Convert(convert bool) *FilesCopyCall {
6552 c.urlParams_.Set("convert", fmt.Sprint(convert))
6553 return c
6554 }
6555
6556
6557
6558
6559 func (c *FilesCopyCall) EnforceSingleParent(enforceSingleParent bool) *FilesCopyCall {
6560 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
6561 return c
6562 }
6563
6564
6565
6566 func (c *FilesCopyCall) IncludeLabels(includeLabels string) *FilesCopyCall {
6567 c.urlParams_.Set("includeLabels", includeLabels)
6568 return c
6569 }
6570
6571
6572
6573
6574 func (c *FilesCopyCall) IncludePermissionsForView(includePermissionsForView string) *FilesCopyCall {
6575 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
6576 return c
6577 }
6578
6579
6580
6581 func (c *FilesCopyCall) Ocr(ocr bool) *FilesCopyCall {
6582 c.urlParams_.Set("ocr", fmt.Sprint(ocr))
6583 return c
6584 }
6585
6586
6587
6588 func (c *FilesCopyCall) OcrLanguage(ocrLanguage string) *FilesCopyCall {
6589 c.urlParams_.Set("ocrLanguage", ocrLanguage)
6590 return c
6591 }
6592
6593
6594
6595 func (c *FilesCopyCall) Pinned(pinned bool) *FilesCopyCall {
6596 c.urlParams_.Set("pinned", fmt.Sprint(pinned))
6597 return c
6598 }
6599
6600
6601
6602 func (c *FilesCopyCall) SupportsAllDrives(supportsAllDrives bool) *FilesCopyCall {
6603 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
6604 return c
6605 }
6606
6607
6608
6609 func (c *FilesCopyCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesCopyCall {
6610 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
6611 return c
6612 }
6613
6614
6615
6616 func (c *FilesCopyCall) TimedTextLanguage(timedTextLanguage string) *FilesCopyCall {
6617 c.urlParams_.Set("timedTextLanguage", timedTextLanguage)
6618 return c
6619 }
6620
6621
6622
6623 func (c *FilesCopyCall) TimedTextTrackName(timedTextTrackName string) *FilesCopyCall {
6624 c.urlParams_.Set("timedTextTrackName", timedTextTrackName)
6625 return c
6626 }
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639 func (c *FilesCopyCall) Visibility(visibility string) *FilesCopyCall {
6640 c.urlParams_.Set("visibility", visibility)
6641 return c
6642 }
6643
6644
6645
6646
6647 func (c *FilesCopyCall) Fields(s ...googleapi.Field) *FilesCopyCall {
6648 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6649 return c
6650 }
6651
6652
6653 func (c *FilesCopyCall) Context(ctx context.Context) *FilesCopyCall {
6654 c.ctx_ = ctx
6655 return c
6656 }
6657
6658
6659
6660 func (c *FilesCopyCall) Header() http.Header {
6661 if c.header_ == nil {
6662 c.header_ = make(http.Header)
6663 }
6664 return c.header_
6665 }
6666
6667 func (c *FilesCopyCall) doRequest(alt string) (*http.Response, error) {
6668 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6669 var body io.Reader = nil
6670 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file)
6671 if err != nil {
6672 return nil, err
6673 }
6674 c.urlParams_.Set("alt", alt)
6675 c.urlParams_.Set("prettyPrint", "false")
6676 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/copy")
6677 urls += "?" + c.urlParams_.Encode()
6678 req, err := http.NewRequest("POST", urls, body)
6679 if err != nil {
6680 return nil, err
6681 }
6682 req.Header = reqHeaders
6683 googleapi.Expand(req.URL, map[string]string{
6684 "fileId": c.fileId,
6685 })
6686 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6687 }
6688
6689
6690
6691
6692
6693
6694 func (c *FilesCopyCall) Do(opts ...googleapi.CallOption) (*File, error) {
6695 gensupport.SetOptions(c.urlParams_, opts...)
6696 res, err := c.doRequest("json")
6697 if res != nil && res.StatusCode == http.StatusNotModified {
6698 if res.Body != nil {
6699 res.Body.Close()
6700 }
6701 return nil, gensupport.WrapError(&googleapi.Error{
6702 Code: res.StatusCode,
6703 Header: res.Header,
6704 })
6705 }
6706 if err != nil {
6707 return nil, err
6708 }
6709 defer googleapi.CloseBody(res)
6710 if err := googleapi.CheckResponse(res); err != nil {
6711 return nil, gensupport.WrapError(err)
6712 }
6713 ret := &File{
6714 ServerResponse: googleapi.ServerResponse{
6715 Header: res.Header,
6716 HTTPStatusCode: res.StatusCode,
6717 },
6718 }
6719 target := &ret
6720 if err := gensupport.DecodeResponse(target, res); err != nil {
6721 return nil, err
6722 }
6723 return ret, nil
6724 }
6725
6726 type FilesDeleteCall struct {
6727 s *Service
6728 fileId string
6729 urlParams_ gensupport.URLParams
6730 ctx_ context.Context
6731 header_ http.Header
6732 }
6733
6734
6735
6736
6737
6738
6739
6740 func (r *FilesService) Delete(fileId string) *FilesDeleteCall {
6741 c := &FilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6742 c.fileId = fileId
6743 return c
6744 }
6745
6746
6747
6748
6749
6750 func (c *FilesDeleteCall) EnforceSingleParent(enforceSingleParent bool) *FilesDeleteCall {
6751 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
6752 return c
6753 }
6754
6755
6756
6757 func (c *FilesDeleteCall) SupportsAllDrives(supportsAllDrives bool) *FilesDeleteCall {
6758 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
6759 return c
6760 }
6761
6762
6763
6764 func (c *FilesDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesDeleteCall {
6765 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
6766 return c
6767 }
6768
6769
6770
6771
6772 func (c *FilesDeleteCall) Fields(s ...googleapi.Field) *FilesDeleteCall {
6773 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6774 return c
6775 }
6776
6777
6778 func (c *FilesDeleteCall) Context(ctx context.Context) *FilesDeleteCall {
6779 c.ctx_ = ctx
6780 return c
6781 }
6782
6783
6784
6785 func (c *FilesDeleteCall) Header() http.Header {
6786 if c.header_ == nil {
6787 c.header_ = make(http.Header)
6788 }
6789 return c.header_
6790 }
6791
6792 func (c *FilesDeleteCall) doRequest(alt string) (*http.Response, error) {
6793 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6794 var body io.Reader = nil
6795 c.urlParams_.Set("alt", alt)
6796 c.urlParams_.Set("prettyPrint", "false")
6797 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}")
6798 urls += "?" + c.urlParams_.Encode()
6799 req, err := http.NewRequest("DELETE", urls, body)
6800 if err != nil {
6801 return nil, err
6802 }
6803 req.Header = reqHeaders
6804 googleapi.Expand(req.URL, map[string]string{
6805 "fileId": c.fileId,
6806 })
6807 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6808 }
6809
6810
6811 func (c *FilesDeleteCall) Do(opts ...googleapi.CallOption) error {
6812 gensupport.SetOptions(c.urlParams_, opts...)
6813 res, err := c.doRequest("json")
6814 if err != nil {
6815 return err
6816 }
6817 defer googleapi.CloseBody(res)
6818 if err := googleapi.CheckResponse(res); err != nil {
6819 return gensupport.WrapError(err)
6820 }
6821 return nil
6822 }
6823
6824 type FilesEmptyTrashCall struct {
6825 s *Service
6826 urlParams_ gensupport.URLParams
6827 ctx_ context.Context
6828 header_ http.Header
6829 }
6830
6831
6832 func (r *FilesService) EmptyTrash() *FilesEmptyTrashCall {
6833 c := &FilesEmptyTrashCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6834 return c
6835 }
6836
6837
6838
6839 func (c *FilesEmptyTrashCall) DriveId(driveId string) *FilesEmptyTrashCall {
6840 c.urlParams_.Set("driveId", driveId)
6841 return c
6842 }
6843
6844
6845
6846
6847
6848 func (c *FilesEmptyTrashCall) EnforceSingleParent(enforceSingleParent bool) *FilesEmptyTrashCall {
6849 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
6850 return c
6851 }
6852
6853
6854
6855
6856 func (c *FilesEmptyTrashCall) Fields(s ...googleapi.Field) *FilesEmptyTrashCall {
6857 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6858 return c
6859 }
6860
6861
6862 func (c *FilesEmptyTrashCall) Context(ctx context.Context) *FilesEmptyTrashCall {
6863 c.ctx_ = ctx
6864 return c
6865 }
6866
6867
6868
6869 func (c *FilesEmptyTrashCall) Header() http.Header {
6870 if c.header_ == nil {
6871 c.header_ = make(http.Header)
6872 }
6873 return c.header_
6874 }
6875
6876 func (c *FilesEmptyTrashCall) doRequest(alt string) (*http.Response, error) {
6877 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6878 var body io.Reader = nil
6879 c.urlParams_.Set("alt", alt)
6880 c.urlParams_.Set("prettyPrint", "false")
6881 urls := googleapi.ResolveRelative(c.s.BasePath, "files/trash")
6882 urls += "?" + c.urlParams_.Encode()
6883 req, err := http.NewRequest("DELETE", urls, body)
6884 if err != nil {
6885 return nil, err
6886 }
6887 req.Header = reqHeaders
6888 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6889 }
6890
6891
6892 func (c *FilesEmptyTrashCall) Do(opts ...googleapi.CallOption) error {
6893 gensupport.SetOptions(c.urlParams_, opts...)
6894 res, err := c.doRequest("json")
6895 if err != nil {
6896 return err
6897 }
6898 defer googleapi.CloseBody(res)
6899 if err := googleapi.CheckResponse(res); err != nil {
6900 return gensupport.WrapError(err)
6901 }
6902 return nil
6903 }
6904
6905 type FilesExportCall struct {
6906 s *Service
6907 fileId string
6908 urlParams_ gensupport.URLParams
6909 ifNoneMatch_ string
6910 ctx_ context.Context
6911 header_ http.Header
6912 }
6913
6914
6915
6916
6917
6918
6919
6920 func (r *FilesService) Export(fileId string, mimeType string) *FilesExportCall {
6921 c := &FilesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6922 c.fileId = fileId
6923 c.urlParams_.Set("mimeType", mimeType)
6924 return c
6925 }
6926
6927
6928
6929
6930 func (c *FilesExportCall) Fields(s ...googleapi.Field) *FilesExportCall {
6931 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6932 return c
6933 }
6934
6935
6936
6937
6938 func (c *FilesExportCall) IfNoneMatch(entityTag string) *FilesExportCall {
6939 c.ifNoneMatch_ = entityTag
6940 return c
6941 }
6942
6943
6944 func (c *FilesExportCall) Context(ctx context.Context) *FilesExportCall {
6945 c.ctx_ = ctx
6946 return c
6947 }
6948
6949
6950
6951 func (c *FilesExportCall) Header() http.Header {
6952 if c.header_ == nil {
6953 c.header_ = make(http.Header)
6954 }
6955 return c.header_
6956 }
6957
6958 func (c *FilesExportCall) doRequest(alt string) (*http.Response, error) {
6959 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6960 if c.ifNoneMatch_ != "" {
6961 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6962 }
6963 var body io.Reader = nil
6964 c.urlParams_.Set("alt", alt)
6965 c.urlParams_.Set("prettyPrint", "false")
6966 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/export")
6967 urls += "?" + c.urlParams_.Encode()
6968 req, err := http.NewRequest("GET", urls, body)
6969 if err != nil {
6970 return nil, err
6971 }
6972 req.Header = reqHeaders
6973 googleapi.Expand(req.URL, map[string]string{
6974 "fileId": c.fileId,
6975 })
6976 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6977 }
6978
6979
6980
6981
6982 func (c *FilesExportCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
6983 gensupport.SetOptions(c.urlParams_, opts...)
6984 res, err := c.doRequest("media")
6985 if err != nil {
6986 return nil, err
6987 }
6988 if err := googleapi.CheckResponse(res); err != nil {
6989 res.Body.Close()
6990 return nil, gensupport.WrapError(err)
6991 }
6992 return res, nil
6993 }
6994
6995
6996 func (c *FilesExportCall) Do(opts ...googleapi.CallOption) error {
6997 gensupport.SetOptions(c.urlParams_, opts...)
6998 res, err := c.doRequest("json")
6999 if err != nil {
7000 return err
7001 }
7002 defer googleapi.CloseBody(res)
7003 if err := googleapi.CheckResponse(res); err != nil {
7004 return gensupport.WrapError(err)
7005 }
7006 return nil
7007 }
7008
7009 type FilesGenerateIdsCall struct {
7010 s *Service
7011 urlParams_ gensupport.URLParams
7012 ifNoneMatch_ string
7013 ctx_ context.Context
7014 header_ http.Header
7015 }
7016
7017
7018
7019 func (r *FilesService) GenerateIds() *FilesGenerateIdsCall {
7020 c := &FilesGenerateIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7021 return c
7022 }
7023
7024
7025
7026 func (c *FilesGenerateIdsCall) MaxResults(maxResults int64) *FilesGenerateIdsCall {
7027 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
7028 return c
7029 }
7030
7031
7032
7033
7034 func (c *FilesGenerateIdsCall) Space(space string) *FilesGenerateIdsCall {
7035 c.urlParams_.Set("space", space)
7036 return c
7037 }
7038
7039
7040
7041
7042 func (c *FilesGenerateIdsCall) Type(type_ string) *FilesGenerateIdsCall {
7043 c.urlParams_.Set("type", type_)
7044 return c
7045 }
7046
7047
7048
7049
7050 func (c *FilesGenerateIdsCall) Fields(s ...googleapi.Field) *FilesGenerateIdsCall {
7051 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7052 return c
7053 }
7054
7055
7056
7057
7058 func (c *FilesGenerateIdsCall) IfNoneMatch(entityTag string) *FilesGenerateIdsCall {
7059 c.ifNoneMatch_ = entityTag
7060 return c
7061 }
7062
7063
7064 func (c *FilesGenerateIdsCall) Context(ctx context.Context) *FilesGenerateIdsCall {
7065 c.ctx_ = ctx
7066 return c
7067 }
7068
7069
7070
7071 func (c *FilesGenerateIdsCall) Header() http.Header {
7072 if c.header_ == nil {
7073 c.header_ = make(http.Header)
7074 }
7075 return c.header_
7076 }
7077
7078 func (c *FilesGenerateIdsCall) doRequest(alt string) (*http.Response, error) {
7079 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7080 if c.ifNoneMatch_ != "" {
7081 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7082 }
7083 var body io.Reader = nil
7084 c.urlParams_.Set("alt", alt)
7085 c.urlParams_.Set("prettyPrint", "false")
7086 urls := googleapi.ResolveRelative(c.s.BasePath, "files/generateIds")
7087 urls += "?" + c.urlParams_.Encode()
7088 req, err := http.NewRequest("GET", urls, body)
7089 if err != nil {
7090 return nil, err
7091 }
7092 req.Header = reqHeaders
7093 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7094 }
7095
7096
7097
7098
7099
7100
7101 func (c *FilesGenerateIdsCall) Do(opts ...googleapi.CallOption) (*GeneratedIds, error) {
7102 gensupport.SetOptions(c.urlParams_, opts...)
7103 res, err := c.doRequest("json")
7104 if res != nil && res.StatusCode == http.StatusNotModified {
7105 if res.Body != nil {
7106 res.Body.Close()
7107 }
7108 return nil, gensupport.WrapError(&googleapi.Error{
7109 Code: res.StatusCode,
7110 Header: res.Header,
7111 })
7112 }
7113 if err != nil {
7114 return nil, err
7115 }
7116 defer googleapi.CloseBody(res)
7117 if err := googleapi.CheckResponse(res); err != nil {
7118 return nil, gensupport.WrapError(err)
7119 }
7120 ret := &GeneratedIds{
7121 ServerResponse: googleapi.ServerResponse{
7122 Header: res.Header,
7123 HTTPStatusCode: res.StatusCode,
7124 },
7125 }
7126 target := &ret
7127 if err := gensupport.DecodeResponse(target, res); err != nil {
7128 return nil, err
7129 }
7130 return ret, nil
7131 }
7132
7133 type FilesGetCall struct {
7134 s *Service
7135 fileId string
7136 urlParams_ gensupport.URLParams
7137 ifNoneMatch_ string
7138 ctx_ context.Context
7139 header_ http.Header
7140 }
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151 func (r *FilesService) Get(fileId string) *FilesGetCall {
7152 c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7153 c.fileId = fileId
7154 return c
7155 }
7156
7157
7158
7159
7160 func (c *FilesGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesGetCall {
7161 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse))
7162 return c
7163 }
7164
7165
7166
7167 func (c *FilesGetCall) IncludeLabels(includeLabels string) *FilesGetCall {
7168 c.urlParams_.Set("includeLabels", includeLabels)
7169 return c
7170 }
7171
7172
7173
7174
7175 func (c *FilesGetCall) IncludePermissionsForView(includePermissionsForView string) *FilesGetCall {
7176 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
7177 return c
7178 }
7179
7180
7181
7182
7183
7184
7185
7186
7187 func (c *FilesGetCall) Projection(projection string) *FilesGetCall {
7188 c.urlParams_.Set("projection", projection)
7189 return c
7190 }
7191
7192
7193
7194 func (c *FilesGetCall) RevisionId(revisionId string) *FilesGetCall {
7195 c.urlParams_.Set("revisionId", revisionId)
7196 return c
7197 }
7198
7199
7200
7201 func (c *FilesGetCall) SupportsAllDrives(supportsAllDrives bool) *FilesGetCall {
7202 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
7203 return c
7204 }
7205
7206
7207
7208 func (c *FilesGetCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesGetCall {
7209 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
7210 return c
7211 }
7212
7213
7214
7215
7216 func (c *FilesGetCall) UpdateViewedDate(updateViewedDate bool) *FilesGetCall {
7217 c.urlParams_.Set("updateViewedDate", fmt.Sprint(updateViewedDate))
7218 return c
7219 }
7220
7221
7222
7223
7224 func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
7225 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7226 return c
7227 }
7228
7229
7230
7231
7232 func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
7233 c.ifNoneMatch_ = entityTag
7234 return c
7235 }
7236
7237
7238 func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
7239 c.ctx_ = ctx
7240 return c
7241 }
7242
7243
7244
7245 func (c *FilesGetCall) Header() http.Header {
7246 if c.header_ == nil {
7247 c.header_ = make(http.Header)
7248 }
7249 return c.header_
7250 }
7251
7252 func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
7253 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7254 if c.ifNoneMatch_ != "" {
7255 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7256 }
7257 var body io.Reader = nil
7258 c.urlParams_.Set("alt", alt)
7259 c.urlParams_.Set("prettyPrint", "false")
7260 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}")
7261 urls += "?" + c.urlParams_.Encode()
7262 req, err := http.NewRequest("GET", urls, body)
7263 if err != nil {
7264 return nil, err
7265 }
7266 req.Header = reqHeaders
7267 googleapi.Expand(req.URL, map[string]string{
7268 "fileId": c.fileId,
7269 })
7270 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7271 }
7272
7273
7274
7275
7276 func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
7277 gensupport.SetOptions(c.urlParams_, opts...)
7278 res, err := c.doRequest("media")
7279 if err != nil {
7280 return nil, err
7281 }
7282 if err := googleapi.CheckResponse(res); err != nil {
7283 res.Body.Close()
7284 return nil, gensupport.WrapError(err)
7285 }
7286 return res, nil
7287 }
7288
7289
7290
7291
7292
7293
7294 func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
7295 gensupport.SetOptions(c.urlParams_, opts...)
7296 res, err := c.doRequest("json")
7297 if res != nil && res.StatusCode == http.StatusNotModified {
7298 if res.Body != nil {
7299 res.Body.Close()
7300 }
7301 return nil, gensupport.WrapError(&googleapi.Error{
7302 Code: res.StatusCode,
7303 Header: res.Header,
7304 })
7305 }
7306 if err != nil {
7307 return nil, err
7308 }
7309 defer googleapi.CloseBody(res)
7310 if err := googleapi.CheckResponse(res); err != nil {
7311 return nil, gensupport.WrapError(err)
7312 }
7313 ret := &File{
7314 ServerResponse: googleapi.ServerResponse{
7315 Header: res.Header,
7316 HTTPStatusCode: res.StatusCode,
7317 },
7318 }
7319 target := &ret
7320 if err := gensupport.DecodeResponse(target, res); err != nil {
7321 return nil, err
7322 }
7323 return ret, nil
7324 }
7325
7326 type FilesInsertCall struct {
7327 s *Service
7328 file *File
7329 urlParams_ gensupport.URLParams
7330 mediaInfo_ *gensupport.MediaInfo
7331 ctx_ context.Context
7332 header_ http.Header
7333 }
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353 func (r *FilesService) Insert(file *File) *FilesInsertCall {
7354 c := &FilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7355 c.file = file
7356 return c
7357 }
7358
7359
7360
7361 func (c *FilesInsertCall) Convert(convert bool) *FilesInsertCall {
7362 c.urlParams_.Set("convert", fmt.Sprint(convert))
7363 return c
7364 }
7365
7366
7367
7368 func (c *FilesInsertCall) EnforceSingleParent(enforceSingleParent bool) *FilesInsertCall {
7369 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
7370 return c
7371 }
7372
7373
7374
7375 func (c *FilesInsertCall) IncludeLabels(includeLabels string) *FilesInsertCall {
7376 c.urlParams_.Set("includeLabels", includeLabels)
7377 return c
7378 }
7379
7380
7381
7382
7383 func (c *FilesInsertCall) IncludePermissionsForView(includePermissionsForView string) *FilesInsertCall {
7384 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
7385 return c
7386 }
7387
7388
7389
7390 func (c *FilesInsertCall) Ocr(ocr bool) *FilesInsertCall {
7391 c.urlParams_.Set("ocr", fmt.Sprint(ocr))
7392 return c
7393 }
7394
7395
7396
7397 func (c *FilesInsertCall) OcrLanguage(ocrLanguage string) *FilesInsertCall {
7398 c.urlParams_.Set("ocrLanguage", ocrLanguage)
7399 return c
7400 }
7401
7402
7403
7404
7405 func (c *FilesInsertCall) Pinned(pinned bool) *FilesInsertCall {
7406 c.urlParams_.Set("pinned", fmt.Sprint(pinned))
7407 return c
7408 }
7409
7410
7411
7412 func (c *FilesInsertCall) SupportsAllDrives(supportsAllDrives bool) *FilesInsertCall {
7413 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
7414 return c
7415 }
7416
7417
7418
7419 func (c *FilesInsertCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesInsertCall {
7420 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
7421 return c
7422 }
7423
7424
7425
7426 func (c *FilesInsertCall) TimedTextLanguage(timedTextLanguage string) *FilesInsertCall {
7427 c.urlParams_.Set("timedTextLanguage", timedTextLanguage)
7428 return c
7429 }
7430
7431
7432
7433 func (c *FilesInsertCall) TimedTextTrackName(timedTextTrackName string) *FilesInsertCall {
7434 c.urlParams_.Set("timedTextTrackName", timedTextTrackName)
7435 return c
7436 }
7437
7438
7439
7440 func (c *FilesInsertCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesInsertCall {
7441 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText))
7442 return c
7443 }
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455 func (c *FilesInsertCall) Visibility(visibility string) *FilesInsertCall {
7456 c.urlParams_.Set("visibility", visibility)
7457 return c
7458 }
7459
7460
7461
7462
7463
7464
7465
7466
7467 func (c *FilesInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesInsertCall {
7468 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
7469 return c
7470 }
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481 func (c *FilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesInsertCall {
7482 c.ctx_ = ctx
7483 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
7484 return c
7485 }
7486
7487
7488
7489
7490
7491 func (c *FilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesInsertCall {
7492 c.mediaInfo_.SetProgressUpdater(pu)
7493 return c
7494 }
7495
7496
7497
7498
7499 func (c *FilesInsertCall) Fields(s ...googleapi.Field) *FilesInsertCall {
7500 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7501 return c
7502 }
7503
7504
7505
7506
7507 func (c *FilesInsertCall) Context(ctx context.Context) *FilesInsertCall {
7508 c.ctx_ = ctx
7509 return c
7510 }
7511
7512
7513
7514 func (c *FilesInsertCall) Header() http.Header {
7515 if c.header_ == nil {
7516 c.header_ = make(http.Header)
7517 }
7518 return c.header_
7519 }
7520
7521 func (c *FilesInsertCall) doRequest(alt string) (*http.Response, error) {
7522 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7523 var body io.Reader = nil
7524 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file)
7525 if err != nil {
7526 return nil, err
7527 }
7528 c.urlParams_.Set("alt", alt)
7529 c.urlParams_.Set("prettyPrint", "false")
7530 urls := googleapi.ResolveRelative(c.s.BasePath, "files")
7531 if c.mediaInfo_ != nil {
7532 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v2/files")
7533 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
7534 }
7535 if body == nil {
7536 body = new(bytes.Buffer)
7537 reqHeaders.Set("Content-Type", "application/json")
7538 }
7539 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
7540 defer cleanup()
7541 urls += "?" + c.urlParams_.Encode()
7542 req, err := http.NewRequest("POST", urls, body)
7543 if err != nil {
7544 return nil, err
7545 }
7546 req.Header = reqHeaders
7547 req.GetBody = getBody
7548 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7549 }
7550
7551
7552
7553
7554
7555
7556 func (c *FilesInsertCall) Do(opts ...googleapi.CallOption) (*File, error) {
7557 gensupport.SetOptions(c.urlParams_, opts...)
7558 res, err := c.doRequest("json")
7559 if res != nil && res.StatusCode == http.StatusNotModified {
7560 if res.Body != nil {
7561 res.Body.Close()
7562 }
7563 return nil, gensupport.WrapError(&googleapi.Error{
7564 Code: res.StatusCode,
7565 Header: res.Header,
7566 })
7567 }
7568 if err != nil {
7569 return nil, err
7570 }
7571 defer googleapi.CloseBody(res)
7572 if err := googleapi.CheckResponse(res); err != nil {
7573 return nil, gensupport.WrapError(err)
7574 }
7575 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
7576 if rx != nil {
7577 rx.Client = c.s.client
7578 rx.UserAgent = c.s.userAgent()
7579 ctx := c.ctx_
7580 if ctx == nil {
7581 ctx = context.TODO()
7582 }
7583 res, err = rx.Upload(ctx)
7584 if err != nil {
7585 return nil, err
7586 }
7587 defer res.Body.Close()
7588 if err := googleapi.CheckResponse(res); err != nil {
7589 return nil, gensupport.WrapError(err)
7590 }
7591 }
7592 ret := &File{
7593 ServerResponse: googleapi.ServerResponse{
7594 Header: res.Header,
7595 HTTPStatusCode: res.StatusCode,
7596 },
7597 }
7598 target := &ret
7599 if err := gensupport.DecodeResponse(target, res); err != nil {
7600 return nil, err
7601 }
7602 return ret, nil
7603 }
7604
7605 type FilesListCall struct {
7606 s *Service
7607 urlParams_ gensupport.URLParams
7608 ifNoneMatch_ string
7609 ctx_ context.Context
7610 header_ http.Header
7611 }
7612
7613
7614
7615
7616
7617
7618
7619 func (r *FilesService) List() *FilesListCall {
7620 c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7621 return c
7622 }
7623
7624
7625
7626
7627
7628 func (c *FilesListCall) Corpora(corpora string) *FilesListCall {
7629 c.urlParams_.Set("corpora", corpora)
7630 return c
7631 }
7632
7633
7634
7635
7636
7637
7638
7639
7640 func (c *FilesListCall) Corpus(corpus string) *FilesListCall {
7641 c.urlParams_.Set("corpus", corpus)
7642 return c
7643 }
7644
7645
7646
7647 func (c *FilesListCall) DriveId(driveId string) *FilesListCall {
7648 c.urlParams_.Set("driveId", driveId)
7649 return c
7650 }
7651
7652
7653
7654
7655 func (c *FilesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *FilesListCall {
7656 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives))
7657 return c
7658 }
7659
7660
7661
7662 func (c *FilesListCall) IncludeLabels(includeLabels string) *FilesListCall {
7663 c.urlParams_.Set("includeLabels", includeLabels)
7664 return c
7665 }
7666
7667
7668
7669
7670 func (c *FilesListCall) IncludePermissionsForView(includePermissionsForView string) *FilesListCall {
7671 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
7672 return c
7673 }
7674
7675
7676
7677 func (c *FilesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *FilesListCall {
7678 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems))
7679 return c
7680 }
7681
7682
7683
7684
7685 func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall {
7686 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
7687 return c
7688 }
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698 func (c *FilesListCall) OrderBy(orderBy string) *FilesListCall {
7699 c.urlParams_.Set("orderBy", orderBy)
7700 return c
7701 }
7702
7703
7704 func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
7705 c.urlParams_.Set("pageToken", pageToken)
7706 return c
7707 }
7708
7709
7710
7711
7712
7713
7714
7715
7716 func (c *FilesListCall) Projection(projection string) *FilesListCall {
7717 c.urlParams_.Set("projection", projection)
7718 return c
7719 }
7720
7721
7722 func (c *FilesListCall) Q(q string) *FilesListCall {
7723 c.urlParams_.Set("q", q)
7724 return c
7725 }
7726
7727
7728
7729 func (c *FilesListCall) Spaces(spaces string) *FilesListCall {
7730 c.urlParams_.Set("spaces", spaces)
7731 return c
7732 }
7733
7734
7735
7736 func (c *FilesListCall) SupportsAllDrives(supportsAllDrives bool) *FilesListCall {
7737 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
7738 return c
7739 }
7740
7741
7742
7743 func (c *FilesListCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesListCall {
7744 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
7745 return c
7746 }
7747
7748
7749
7750 func (c *FilesListCall) TeamDriveId(teamDriveId string) *FilesListCall {
7751 c.urlParams_.Set("teamDriveId", teamDriveId)
7752 return c
7753 }
7754
7755
7756
7757
7758 func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
7759 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7760 return c
7761 }
7762
7763
7764
7765
7766 func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
7767 c.ifNoneMatch_ = entityTag
7768 return c
7769 }
7770
7771
7772 func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
7773 c.ctx_ = ctx
7774 return c
7775 }
7776
7777
7778
7779 func (c *FilesListCall) Header() http.Header {
7780 if c.header_ == nil {
7781 c.header_ = make(http.Header)
7782 }
7783 return c.header_
7784 }
7785
7786 func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
7787 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7788 if c.ifNoneMatch_ != "" {
7789 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7790 }
7791 var body io.Reader = nil
7792 c.urlParams_.Set("alt", alt)
7793 c.urlParams_.Set("prettyPrint", "false")
7794 urls := googleapi.ResolveRelative(c.s.BasePath, "files")
7795 urls += "?" + c.urlParams_.Encode()
7796 req, err := http.NewRequest("GET", urls, body)
7797 if err != nil {
7798 return nil, err
7799 }
7800 req.Header = reqHeaders
7801 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7802 }
7803
7804
7805
7806
7807
7808
7809 func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
7810 gensupport.SetOptions(c.urlParams_, opts...)
7811 res, err := c.doRequest("json")
7812 if res != nil && res.StatusCode == http.StatusNotModified {
7813 if res.Body != nil {
7814 res.Body.Close()
7815 }
7816 return nil, gensupport.WrapError(&googleapi.Error{
7817 Code: res.StatusCode,
7818 Header: res.Header,
7819 })
7820 }
7821 if err != nil {
7822 return nil, err
7823 }
7824 defer googleapi.CloseBody(res)
7825 if err := googleapi.CheckResponse(res); err != nil {
7826 return nil, gensupport.WrapError(err)
7827 }
7828 ret := &FileList{
7829 ServerResponse: googleapi.ServerResponse{
7830 Header: res.Header,
7831 HTTPStatusCode: res.StatusCode,
7832 },
7833 }
7834 target := &ret
7835 if err := gensupport.DecodeResponse(target, res); err != nil {
7836 return nil, err
7837 }
7838 return ret, nil
7839 }
7840
7841
7842
7843
7844 func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
7845 c.ctx_ = ctx
7846 defer c.PageToken(c.urlParams_.Get("pageToken"))
7847 for {
7848 x, err := c.Do()
7849 if err != nil {
7850 return err
7851 }
7852 if err := f(x); err != nil {
7853 return err
7854 }
7855 if x.NextPageToken == "" {
7856 return nil
7857 }
7858 c.PageToken(x.NextPageToken)
7859 }
7860 }
7861
7862 type FilesListLabelsCall struct {
7863 s *Service
7864 fileId string
7865 urlParams_ gensupport.URLParams
7866 ifNoneMatch_ string
7867 ctx_ context.Context
7868 header_ http.Header
7869 }
7870
7871
7872
7873
7874 func (r *FilesService) ListLabels(fileId string) *FilesListLabelsCall {
7875 c := &FilesListLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7876 c.fileId = fileId
7877 return c
7878 }
7879
7880
7881
7882 func (c *FilesListLabelsCall) MaxResults(maxResults int64) *FilesListLabelsCall {
7883 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
7884 return c
7885 }
7886
7887
7888
7889
7890 func (c *FilesListLabelsCall) PageToken(pageToken string) *FilesListLabelsCall {
7891 c.urlParams_.Set("pageToken", pageToken)
7892 return c
7893 }
7894
7895
7896
7897
7898 func (c *FilesListLabelsCall) Fields(s ...googleapi.Field) *FilesListLabelsCall {
7899 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7900 return c
7901 }
7902
7903
7904
7905
7906 func (c *FilesListLabelsCall) IfNoneMatch(entityTag string) *FilesListLabelsCall {
7907 c.ifNoneMatch_ = entityTag
7908 return c
7909 }
7910
7911
7912 func (c *FilesListLabelsCall) Context(ctx context.Context) *FilesListLabelsCall {
7913 c.ctx_ = ctx
7914 return c
7915 }
7916
7917
7918
7919 func (c *FilesListLabelsCall) Header() http.Header {
7920 if c.header_ == nil {
7921 c.header_ = make(http.Header)
7922 }
7923 return c.header_
7924 }
7925
7926 func (c *FilesListLabelsCall) doRequest(alt string) (*http.Response, error) {
7927 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7928 if c.ifNoneMatch_ != "" {
7929 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7930 }
7931 var body io.Reader = nil
7932 c.urlParams_.Set("alt", alt)
7933 c.urlParams_.Set("prettyPrint", "false")
7934 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/listLabels")
7935 urls += "?" + c.urlParams_.Encode()
7936 req, err := http.NewRequest("GET", urls, body)
7937 if err != nil {
7938 return nil, err
7939 }
7940 req.Header = reqHeaders
7941 googleapi.Expand(req.URL, map[string]string{
7942 "fileId": c.fileId,
7943 })
7944 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7945 }
7946
7947
7948
7949
7950
7951
7952 func (c *FilesListLabelsCall) Do(opts ...googleapi.CallOption) (*LabelList, error) {
7953 gensupport.SetOptions(c.urlParams_, opts...)
7954 res, err := c.doRequest("json")
7955 if res != nil && res.StatusCode == http.StatusNotModified {
7956 if res.Body != nil {
7957 res.Body.Close()
7958 }
7959 return nil, gensupport.WrapError(&googleapi.Error{
7960 Code: res.StatusCode,
7961 Header: res.Header,
7962 })
7963 }
7964 if err != nil {
7965 return nil, err
7966 }
7967 defer googleapi.CloseBody(res)
7968 if err := googleapi.CheckResponse(res); err != nil {
7969 return nil, gensupport.WrapError(err)
7970 }
7971 ret := &LabelList{
7972 ServerResponse: googleapi.ServerResponse{
7973 Header: res.Header,
7974 HTTPStatusCode: res.StatusCode,
7975 },
7976 }
7977 target := &ret
7978 if err := gensupport.DecodeResponse(target, res); err != nil {
7979 return nil, err
7980 }
7981 return ret, nil
7982 }
7983
7984
7985
7986
7987 func (c *FilesListLabelsCall) Pages(ctx context.Context, f func(*LabelList) error) error {
7988 c.ctx_ = ctx
7989 defer c.PageToken(c.urlParams_.Get("pageToken"))
7990 for {
7991 x, err := c.Do()
7992 if err != nil {
7993 return err
7994 }
7995 if err := f(x); err != nil {
7996 return err
7997 }
7998 if x.NextPageToken == "" {
7999 return nil
8000 }
8001 c.PageToken(x.NextPageToken)
8002 }
8003 }
8004
8005 type FilesModifyLabelsCall struct {
8006 s *Service
8007 fileId string
8008 modifylabelsrequest *ModifyLabelsRequest
8009 urlParams_ gensupport.URLParams
8010 ctx_ context.Context
8011 header_ http.Header
8012 }
8013
8014
8015
8016
8017
8018 func (r *FilesService) ModifyLabels(fileId string, modifylabelsrequest *ModifyLabelsRequest) *FilesModifyLabelsCall {
8019 c := &FilesModifyLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8020 c.fileId = fileId
8021 c.modifylabelsrequest = modifylabelsrequest
8022 return c
8023 }
8024
8025
8026
8027
8028 func (c *FilesModifyLabelsCall) Fields(s ...googleapi.Field) *FilesModifyLabelsCall {
8029 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8030 return c
8031 }
8032
8033
8034 func (c *FilesModifyLabelsCall) Context(ctx context.Context) *FilesModifyLabelsCall {
8035 c.ctx_ = ctx
8036 return c
8037 }
8038
8039
8040
8041 func (c *FilesModifyLabelsCall) Header() http.Header {
8042 if c.header_ == nil {
8043 c.header_ = make(http.Header)
8044 }
8045 return c.header_
8046 }
8047
8048 func (c *FilesModifyLabelsCall) doRequest(alt string) (*http.Response, error) {
8049 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8050 var body io.Reader = nil
8051 body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifylabelsrequest)
8052 if err != nil {
8053 return nil, err
8054 }
8055 c.urlParams_.Set("alt", alt)
8056 c.urlParams_.Set("prettyPrint", "false")
8057 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/modifyLabels")
8058 urls += "?" + c.urlParams_.Encode()
8059 req, err := http.NewRequest("POST", urls, body)
8060 if err != nil {
8061 return nil, err
8062 }
8063 req.Header = reqHeaders
8064 googleapi.Expand(req.URL, map[string]string{
8065 "fileId": c.fileId,
8066 })
8067 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8068 }
8069
8070
8071
8072
8073
8074
8075
8076 func (c *FilesModifyLabelsCall) Do(opts ...googleapi.CallOption) (*ModifyLabelsResponse, error) {
8077 gensupport.SetOptions(c.urlParams_, opts...)
8078 res, err := c.doRequest("json")
8079 if res != nil && res.StatusCode == http.StatusNotModified {
8080 if res.Body != nil {
8081 res.Body.Close()
8082 }
8083 return nil, gensupport.WrapError(&googleapi.Error{
8084 Code: res.StatusCode,
8085 Header: res.Header,
8086 })
8087 }
8088 if err != nil {
8089 return nil, err
8090 }
8091 defer googleapi.CloseBody(res)
8092 if err := googleapi.CheckResponse(res); err != nil {
8093 return nil, gensupport.WrapError(err)
8094 }
8095 ret := &ModifyLabelsResponse{
8096 ServerResponse: googleapi.ServerResponse{
8097 Header: res.Header,
8098 HTTPStatusCode: res.StatusCode,
8099 },
8100 }
8101 target := &ret
8102 if err := gensupport.DecodeResponse(target, res); err != nil {
8103 return nil, err
8104 }
8105 return ret, nil
8106 }
8107
8108 type FilesPatchCall struct {
8109 s *Service
8110 fileId string
8111 file *File
8112 urlParams_ gensupport.URLParams
8113 ctx_ context.Context
8114 header_ http.Header
8115 }
8116
8117
8118
8119
8120
8121
8122
8123 func (r *FilesService) Patch(fileId string, file *File) *FilesPatchCall {
8124 c := &FilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8125 c.fileId = fileId
8126 c.file = file
8127 return c
8128 }
8129
8130
8131
8132 func (c *FilesPatchCall) AddParents(addParents string) *FilesPatchCall {
8133 c.urlParams_.Set("addParents", addParents)
8134 return c
8135 }
8136
8137
8138
8139 func (c *FilesPatchCall) Convert(convert bool) *FilesPatchCall {
8140 c.urlParams_.Set("convert", fmt.Sprint(convert))
8141 return c
8142 }
8143
8144
8145
8146
8147 func (c *FilesPatchCall) EnforceSingleParent(enforceSingleParent bool) *FilesPatchCall {
8148 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
8149 return c
8150 }
8151
8152
8153
8154 func (c *FilesPatchCall) IncludeLabels(includeLabels string) *FilesPatchCall {
8155 c.urlParams_.Set("includeLabels", includeLabels)
8156 return c
8157 }
8158
8159
8160
8161
8162 func (c *FilesPatchCall) IncludePermissionsForView(includePermissionsForView string) *FilesPatchCall {
8163 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
8164 return c
8165 }
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190 func (c *FilesPatchCall) ModifiedDateBehavior(modifiedDateBehavior string) *FilesPatchCall {
8191 c.urlParams_.Set("modifiedDateBehavior", modifiedDateBehavior)
8192 return c
8193 }
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204 func (c *FilesPatchCall) NewRevision(newRevision bool) *FilesPatchCall {
8205 c.urlParams_.Set("newRevision", fmt.Sprint(newRevision))
8206 return c
8207 }
8208
8209
8210
8211 func (c *FilesPatchCall) Ocr(ocr bool) *FilesPatchCall {
8212 c.urlParams_.Set("ocr", fmt.Sprint(ocr))
8213 return c
8214 }
8215
8216
8217
8218 func (c *FilesPatchCall) OcrLanguage(ocrLanguage string) *FilesPatchCall {
8219 c.urlParams_.Set("ocrLanguage", ocrLanguage)
8220 return c
8221 }
8222
8223
8224
8225
8226 func (c *FilesPatchCall) Pinned(pinned bool) *FilesPatchCall {
8227 c.urlParams_.Set("pinned", fmt.Sprint(pinned))
8228 return c
8229 }
8230
8231
8232
8233 func (c *FilesPatchCall) RemoveParents(removeParents string) *FilesPatchCall {
8234 c.urlParams_.Set("removeParents", removeParents)
8235 return c
8236 }
8237
8238
8239
8240
8241
8242
8243 func (c *FilesPatchCall) SetModifiedDate(setModifiedDate bool) *FilesPatchCall {
8244 c.urlParams_.Set("setModifiedDate", fmt.Sprint(setModifiedDate))
8245 return c
8246 }
8247
8248
8249
8250 func (c *FilesPatchCall) SupportsAllDrives(supportsAllDrives bool) *FilesPatchCall {
8251 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
8252 return c
8253 }
8254
8255
8256
8257 func (c *FilesPatchCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesPatchCall {
8258 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
8259 return c
8260 }
8261
8262
8263
8264 func (c *FilesPatchCall) TimedTextLanguage(timedTextLanguage string) *FilesPatchCall {
8265 c.urlParams_.Set("timedTextLanguage", timedTextLanguage)
8266 return c
8267 }
8268
8269
8270
8271 func (c *FilesPatchCall) TimedTextTrackName(timedTextTrackName string) *FilesPatchCall {
8272 c.urlParams_.Set("timedTextTrackName", timedTextTrackName)
8273 return c
8274 }
8275
8276
8277
8278 func (c *FilesPatchCall) UpdateViewedDate(updateViewedDate bool) *FilesPatchCall {
8279 c.urlParams_.Set("updateViewedDate", fmt.Sprint(updateViewedDate))
8280 return c
8281 }
8282
8283
8284
8285 func (c *FilesPatchCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesPatchCall {
8286 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText))
8287 return c
8288 }
8289
8290
8291
8292
8293 func (c *FilesPatchCall) Fields(s ...googleapi.Field) *FilesPatchCall {
8294 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8295 return c
8296 }
8297
8298
8299 func (c *FilesPatchCall) Context(ctx context.Context) *FilesPatchCall {
8300 c.ctx_ = ctx
8301 return c
8302 }
8303
8304
8305
8306 func (c *FilesPatchCall) Header() http.Header {
8307 if c.header_ == nil {
8308 c.header_ = make(http.Header)
8309 }
8310 return c.header_
8311 }
8312
8313 func (c *FilesPatchCall) doRequest(alt string) (*http.Response, error) {
8314 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8315 var body io.Reader = nil
8316 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file)
8317 if err != nil {
8318 return nil, err
8319 }
8320 c.urlParams_.Set("alt", alt)
8321 c.urlParams_.Set("prettyPrint", "false")
8322 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}")
8323 urls += "?" + c.urlParams_.Encode()
8324 req, err := http.NewRequest("PATCH", urls, body)
8325 if err != nil {
8326 return nil, err
8327 }
8328 req.Header = reqHeaders
8329 googleapi.Expand(req.URL, map[string]string{
8330 "fileId": c.fileId,
8331 })
8332 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8333 }
8334
8335
8336
8337
8338
8339
8340 func (c *FilesPatchCall) Do(opts ...googleapi.CallOption) (*File, error) {
8341 gensupport.SetOptions(c.urlParams_, opts...)
8342 res, err := c.doRequest("json")
8343 if res != nil && res.StatusCode == http.StatusNotModified {
8344 if res.Body != nil {
8345 res.Body.Close()
8346 }
8347 return nil, gensupport.WrapError(&googleapi.Error{
8348 Code: res.StatusCode,
8349 Header: res.Header,
8350 })
8351 }
8352 if err != nil {
8353 return nil, err
8354 }
8355 defer googleapi.CloseBody(res)
8356 if err := googleapi.CheckResponse(res); err != nil {
8357 return nil, gensupport.WrapError(err)
8358 }
8359 ret := &File{
8360 ServerResponse: googleapi.ServerResponse{
8361 Header: res.Header,
8362 HTTPStatusCode: res.StatusCode,
8363 },
8364 }
8365 target := &ret
8366 if err := gensupport.DecodeResponse(target, res); err != nil {
8367 return nil, err
8368 }
8369 return ret, nil
8370 }
8371
8372 type FilesTouchCall struct {
8373 s *Service
8374 fileId string
8375 urlParams_ gensupport.URLParams
8376 ctx_ context.Context
8377 header_ http.Header
8378 }
8379
8380
8381
8382
8383 func (r *FilesService) Touch(fileId string) *FilesTouchCall {
8384 c := &FilesTouchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8385 c.fileId = fileId
8386 return c
8387 }
8388
8389
8390
8391 func (c *FilesTouchCall) IncludeLabels(includeLabels string) *FilesTouchCall {
8392 c.urlParams_.Set("includeLabels", includeLabels)
8393 return c
8394 }
8395
8396
8397
8398
8399 func (c *FilesTouchCall) IncludePermissionsForView(includePermissionsForView string) *FilesTouchCall {
8400 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
8401 return c
8402 }
8403
8404
8405
8406 func (c *FilesTouchCall) SupportsAllDrives(supportsAllDrives bool) *FilesTouchCall {
8407 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
8408 return c
8409 }
8410
8411
8412
8413 func (c *FilesTouchCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesTouchCall {
8414 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
8415 return c
8416 }
8417
8418
8419
8420
8421 func (c *FilesTouchCall) Fields(s ...googleapi.Field) *FilesTouchCall {
8422 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8423 return c
8424 }
8425
8426
8427 func (c *FilesTouchCall) Context(ctx context.Context) *FilesTouchCall {
8428 c.ctx_ = ctx
8429 return c
8430 }
8431
8432
8433
8434 func (c *FilesTouchCall) Header() http.Header {
8435 if c.header_ == nil {
8436 c.header_ = make(http.Header)
8437 }
8438 return c.header_
8439 }
8440
8441 func (c *FilesTouchCall) doRequest(alt string) (*http.Response, error) {
8442 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8443 var body io.Reader = nil
8444 c.urlParams_.Set("alt", alt)
8445 c.urlParams_.Set("prettyPrint", "false")
8446 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/touch")
8447 urls += "?" + c.urlParams_.Encode()
8448 req, err := http.NewRequest("POST", urls, body)
8449 if err != nil {
8450 return nil, err
8451 }
8452 req.Header = reqHeaders
8453 googleapi.Expand(req.URL, map[string]string{
8454 "fileId": c.fileId,
8455 })
8456 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8457 }
8458
8459
8460
8461
8462
8463
8464 func (c *FilesTouchCall) Do(opts ...googleapi.CallOption) (*File, error) {
8465 gensupport.SetOptions(c.urlParams_, opts...)
8466 res, err := c.doRequest("json")
8467 if res != nil && res.StatusCode == http.StatusNotModified {
8468 if res.Body != nil {
8469 res.Body.Close()
8470 }
8471 return nil, gensupport.WrapError(&googleapi.Error{
8472 Code: res.StatusCode,
8473 Header: res.Header,
8474 })
8475 }
8476 if err != nil {
8477 return nil, err
8478 }
8479 defer googleapi.CloseBody(res)
8480 if err := googleapi.CheckResponse(res); err != nil {
8481 return nil, gensupport.WrapError(err)
8482 }
8483 ret := &File{
8484 ServerResponse: googleapi.ServerResponse{
8485 Header: res.Header,
8486 HTTPStatusCode: res.StatusCode,
8487 },
8488 }
8489 target := &ret
8490 if err := gensupport.DecodeResponse(target, res); err != nil {
8491 return nil, err
8492 }
8493 return ret, nil
8494 }
8495
8496 type FilesTrashCall struct {
8497 s *Service
8498 fileId string
8499 urlParams_ gensupport.URLParams
8500 ctx_ context.Context
8501 header_ http.Header
8502 }
8503
8504
8505
8506
8507
8508
8509 func (r *FilesService) Trash(fileId string) *FilesTrashCall {
8510 c := &FilesTrashCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8511 c.fileId = fileId
8512 return c
8513 }
8514
8515
8516
8517 func (c *FilesTrashCall) IncludeLabels(includeLabels string) *FilesTrashCall {
8518 c.urlParams_.Set("includeLabels", includeLabels)
8519 return c
8520 }
8521
8522
8523
8524
8525 func (c *FilesTrashCall) IncludePermissionsForView(includePermissionsForView string) *FilesTrashCall {
8526 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
8527 return c
8528 }
8529
8530
8531
8532 func (c *FilesTrashCall) SupportsAllDrives(supportsAllDrives bool) *FilesTrashCall {
8533 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
8534 return c
8535 }
8536
8537
8538
8539 func (c *FilesTrashCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesTrashCall {
8540 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
8541 return c
8542 }
8543
8544
8545
8546
8547 func (c *FilesTrashCall) Fields(s ...googleapi.Field) *FilesTrashCall {
8548 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8549 return c
8550 }
8551
8552
8553 func (c *FilesTrashCall) Context(ctx context.Context) *FilesTrashCall {
8554 c.ctx_ = ctx
8555 return c
8556 }
8557
8558
8559
8560 func (c *FilesTrashCall) Header() http.Header {
8561 if c.header_ == nil {
8562 c.header_ = make(http.Header)
8563 }
8564 return c.header_
8565 }
8566
8567 func (c *FilesTrashCall) doRequest(alt string) (*http.Response, error) {
8568 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8569 var body io.Reader = nil
8570 c.urlParams_.Set("alt", alt)
8571 c.urlParams_.Set("prettyPrint", "false")
8572 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/trash")
8573 urls += "?" + c.urlParams_.Encode()
8574 req, err := http.NewRequest("POST", urls, body)
8575 if err != nil {
8576 return nil, err
8577 }
8578 req.Header = reqHeaders
8579 googleapi.Expand(req.URL, map[string]string{
8580 "fileId": c.fileId,
8581 })
8582 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8583 }
8584
8585
8586
8587
8588
8589
8590 func (c *FilesTrashCall) Do(opts ...googleapi.CallOption) (*File, error) {
8591 gensupport.SetOptions(c.urlParams_, opts...)
8592 res, err := c.doRequest("json")
8593 if res != nil && res.StatusCode == http.StatusNotModified {
8594 if res.Body != nil {
8595 res.Body.Close()
8596 }
8597 return nil, gensupport.WrapError(&googleapi.Error{
8598 Code: res.StatusCode,
8599 Header: res.Header,
8600 })
8601 }
8602 if err != nil {
8603 return nil, err
8604 }
8605 defer googleapi.CloseBody(res)
8606 if err := googleapi.CheckResponse(res); err != nil {
8607 return nil, gensupport.WrapError(err)
8608 }
8609 ret := &File{
8610 ServerResponse: googleapi.ServerResponse{
8611 Header: res.Header,
8612 HTTPStatusCode: res.StatusCode,
8613 },
8614 }
8615 target := &ret
8616 if err := gensupport.DecodeResponse(target, res); err != nil {
8617 return nil, err
8618 }
8619 return ret, nil
8620 }
8621
8622 type FilesUntrashCall struct {
8623 s *Service
8624 fileId string
8625 urlParams_ gensupport.URLParams
8626 ctx_ context.Context
8627 header_ http.Header
8628 }
8629
8630
8631
8632
8633
8634
8635 func (r *FilesService) Untrash(fileId string) *FilesUntrashCall {
8636 c := &FilesUntrashCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8637 c.fileId = fileId
8638 return c
8639 }
8640
8641
8642
8643 func (c *FilesUntrashCall) IncludeLabels(includeLabels string) *FilesUntrashCall {
8644 c.urlParams_.Set("includeLabels", includeLabels)
8645 return c
8646 }
8647
8648
8649
8650
8651 func (c *FilesUntrashCall) IncludePermissionsForView(includePermissionsForView string) *FilesUntrashCall {
8652 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
8653 return c
8654 }
8655
8656
8657
8658 func (c *FilesUntrashCall) SupportsAllDrives(supportsAllDrives bool) *FilesUntrashCall {
8659 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
8660 return c
8661 }
8662
8663
8664
8665 func (c *FilesUntrashCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesUntrashCall {
8666 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
8667 return c
8668 }
8669
8670
8671
8672
8673 func (c *FilesUntrashCall) Fields(s ...googleapi.Field) *FilesUntrashCall {
8674 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8675 return c
8676 }
8677
8678
8679 func (c *FilesUntrashCall) Context(ctx context.Context) *FilesUntrashCall {
8680 c.ctx_ = ctx
8681 return c
8682 }
8683
8684
8685
8686 func (c *FilesUntrashCall) Header() http.Header {
8687 if c.header_ == nil {
8688 c.header_ = make(http.Header)
8689 }
8690 return c.header_
8691 }
8692
8693 func (c *FilesUntrashCall) doRequest(alt string) (*http.Response, error) {
8694 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8695 var body io.Reader = nil
8696 c.urlParams_.Set("alt", alt)
8697 c.urlParams_.Set("prettyPrint", "false")
8698 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/untrash")
8699 urls += "?" + c.urlParams_.Encode()
8700 req, err := http.NewRequest("POST", urls, body)
8701 if err != nil {
8702 return nil, err
8703 }
8704 req.Header = reqHeaders
8705 googleapi.Expand(req.URL, map[string]string{
8706 "fileId": c.fileId,
8707 })
8708 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8709 }
8710
8711
8712
8713
8714
8715
8716 func (c *FilesUntrashCall) Do(opts ...googleapi.CallOption) (*File, error) {
8717 gensupport.SetOptions(c.urlParams_, opts...)
8718 res, err := c.doRequest("json")
8719 if res != nil && res.StatusCode == http.StatusNotModified {
8720 if res.Body != nil {
8721 res.Body.Close()
8722 }
8723 return nil, gensupport.WrapError(&googleapi.Error{
8724 Code: res.StatusCode,
8725 Header: res.Header,
8726 })
8727 }
8728 if err != nil {
8729 return nil, err
8730 }
8731 defer googleapi.CloseBody(res)
8732 if err := googleapi.CheckResponse(res); err != nil {
8733 return nil, gensupport.WrapError(err)
8734 }
8735 ret := &File{
8736 ServerResponse: googleapi.ServerResponse{
8737 Header: res.Header,
8738 HTTPStatusCode: res.StatusCode,
8739 },
8740 }
8741 target := &ret
8742 if err := gensupport.DecodeResponse(target, res); err != nil {
8743 return nil, err
8744 }
8745 return ret, nil
8746 }
8747
8748 type FilesUpdateCall struct {
8749 s *Service
8750 fileId string
8751 file *File
8752 urlParams_ gensupport.URLParams
8753 mediaInfo_ *gensupport.MediaInfo
8754 ctx_ context.Context
8755 header_ http.Header
8756 }
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770 func (r *FilesService) Update(fileId string, file *File) *FilesUpdateCall {
8771 c := &FilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8772 c.fileId = fileId
8773 c.file = file
8774 return c
8775 }
8776
8777
8778
8779 func (c *FilesUpdateCall) AddParents(addParents string) *FilesUpdateCall {
8780 c.urlParams_.Set("addParents", addParents)
8781 return c
8782 }
8783
8784
8785
8786 func (c *FilesUpdateCall) Convert(convert bool) *FilesUpdateCall {
8787 c.urlParams_.Set("convert", fmt.Sprint(convert))
8788 return c
8789 }
8790
8791
8792
8793
8794 func (c *FilesUpdateCall) EnforceSingleParent(enforceSingleParent bool) *FilesUpdateCall {
8795 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
8796 return c
8797 }
8798
8799
8800
8801 func (c *FilesUpdateCall) IncludeLabels(includeLabels string) *FilesUpdateCall {
8802 c.urlParams_.Set("includeLabels", includeLabels)
8803 return c
8804 }
8805
8806
8807
8808
8809 func (c *FilesUpdateCall) IncludePermissionsForView(includePermissionsForView string) *FilesUpdateCall {
8810 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
8811 return c
8812 }
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837 func (c *FilesUpdateCall) ModifiedDateBehavior(modifiedDateBehavior string) *FilesUpdateCall {
8838 c.urlParams_.Set("modifiedDateBehavior", modifiedDateBehavior)
8839 return c
8840 }
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850 func (c *FilesUpdateCall) NewRevision(newRevision bool) *FilesUpdateCall {
8851 c.urlParams_.Set("newRevision", fmt.Sprint(newRevision))
8852 return c
8853 }
8854
8855
8856
8857 func (c *FilesUpdateCall) Ocr(ocr bool) *FilesUpdateCall {
8858 c.urlParams_.Set("ocr", fmt.Sprint(ocr))
8859 return c
8860 }
8861
8862
8863
8864 func (c *FilesUpdateCall) OcrLanguage(ocrLanguage string) *FilesUpdateCall {
8865 c.urlParams_.Set("ocrLanguage", ocrLanguage)
8866 return c
8867 }
8868
8869
8870
8871 func (c *FilesUpdateCall) Pinned(pinned bool) *FilesUpdateCall {
8872 c.urlParams_.Set("pinned", fmt.Sprint(pinned))
8873 return c
8874 }
8875
8876
8877
8878 func (c *FilesUpdateCall) RemoveParents(removeParents string) *FilesUpdateCall {
8879 c.urlParams_.Set("removeParents", removeParents)
8880 return c
8881 }
8882
8883
8884
8885
8886
8887
8888 func (c *FilesUpdateCall) SetModifiedDate(setModifiedDate bool) *FilesUpdateCall {
8889 c.urlParams_.Set("setModifiedDate", fmt.Sprint(setModifiedDate))
8890 return c
8891 }
8892
8893
8894
8895 func (c *FilesUpdateCall) SupportsAllDrives(supportsAllDrives bool) *FilesUpdateCall {
8896 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
8897 return c
8898 }
8899
8900
8901
8902 func (c *FilesUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesUpdateCall {
8903 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
8904 return c
8905 }
8906
8907
8908
8909 func (c *FilesUpdateCall) TimedTextLanguage(timedTextLanguage string) *FilesUpdateCall {
8910 c.urlParams_.Set("timedTextLanguage", timedTextLanguage)
8911 return c
8912 }
8913
8914
8915
8916 func (c *FilesUpdateCall) TimedTextTrackName(timedTextTrackName string) *FilesUpdateCall {
8917 c.urlParams_.Set("timedTextTrackName", timedTextTrackName)
8918 return c
8919 }
8920
8921
8922
8923 func (c *FilesUpdateCall) UpdateViewedDate(updateViewedDate bool) *FilesUpdateCall {
8924 c.urlParams_.Set("updateViewedDate", fmt.Sprint(updateViewedDate))
8925 return c
8926 }
8927
8928
8929
8930 func (c *FilesUpdateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesUpdateCall {
8931 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText))
8932 return c
8933 }
8934
8935
8936
8937
8938
8939
8940
8941
8942 func (c *FilesUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesUpdateCall {
8943 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
8944 return c
8945 }
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956 func (c *FilesUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesUpdateCall {
8957 c.ctx_ = ctx
8958 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
8959 return c
8960 }
8961
8962
8963
8964
8965
8966 func (c *FilesUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesUpdateCall {
8967 c.mediaInfo_.SetProgressUpdater(pu)
8968 return c
8969 }
8970
8971
8972
8973
8974 func (c *FilesUpdateCall) Fields(s ...googleapi.Field) *FilesUpdateCall {
8975 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8976 return c
8977 }
8978
8979
8980
8981
8982 func (c *FilesUpdateCall) Context(ctx context.Context) *FilesUpdateCall {
8983 c.ctx_ = ctx
8984 return c
8985 }
8986
8987
8988
8989 func (c *FilesUpdateCall) Header() http.Header {
8990 if c.header_ == nil {
8991 c.header_ = make(http.Header)
8992 }
8993 return c.header_
8994 }
8995
8996 func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) {
8997 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8998 var body io.Reader = nil
8999 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file)
9000 if err != nil {
9001 return nil, err
9002 }
9003 c.urlParams_.Set("alt", alt)
9004 c.urlParams_.Set("prettyPrint", "false")
9005 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}")
9006 if c.mediaInfo_ != nil {
9007 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v2/files/{fileId}")
9008 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
9009 }
9010 if body == nil {
9011 body = new(bytes.Buffer)
9012 reqHeaders.Set("Content-Type", "application/json")
9013 }
9014 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
9015 defer cleanup()
9016 urls += "?" + c.urlParams_.Encode()
9017 req, err := http.NewRequest("PUT", urls, body)
9018 if err != nil {
9019 return nil, err
9020 }
9021 req.Header = reqHeaders
9022 req.GetBody = getBody
9023 googleapi.Expand(req.URL, map[string]string{
9024 "fileId": c.fileId,
9025 })
9026 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9027 }
9028
9029
9030
9031
9032
9033
9034 func (c *FilesUpdateCall) Do(opts ...googleapi.CallOption) (*File, error) {
9035 gensupport.SetOptions(c.urlParams_, opts...)
9036 res, err := c.doRequest("json")
9037 if res != nil && res.StatusCode == http.StatusNotModified {
9038 if res.Body != nil {
9039 res.Body.Close()
9040 }
9041 return nil, gensupport.WrapError(&googleapi.Error{
9042 Code: res.StatusCode,
9043 Header: res.Header,
9044 })
9045 }
9046 if err != nil {
9047 return nil, err
9048 }
9049 defer googleapi.CloseBody(res)
9050 if err := googleapi.CheckResponse(res); err != nil {
9051 return nil, gensupport.WrapError(err)
9052 }
9053 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
9054 if rx != nil {
9055 rx.Client = c.s.client
9056 rx.UserAgent = c.s.userAgent()
9057 ctx := c.ctx_
9058 if ctx == nil {
9059 ctx = context.TODO()
9060 }
9061 res, err = rx.Upload(ctx)
9062 if err != nil {
9063 return nil, err
9064 }
9065 defer res.Body.Close()
9066 if err := googleapi.CheckResponse(res); err != nil {
9067 return nil, gensupport.WrapError(err)
9068 }
9069 }
9070 ret := &File{
9071 ServerResponse: googleapi.ServerResponse{
9072 Header: res.Header,
9073 HTTPStatusCode: res.StatusCode,
9074 },
9075 }
9076 target := &ret
9077 if err := gensupport.DecodeResponse(target, res); err != nil {
9078 return nil, err
9079 }
9080 return ret, nil
9081 }
9082
9083 type FilesWatchCall struct {
9084 s *Service
9085 fileId string
9086 channel *Channel
9087 urlParams_ gensupport.URLParams
9088 ctx_ context.Context
9089 header_ http.Header
9090 }
9091
9092
9093
9094
9095 func (r *FilesService) Watch(fileId string, channel *Channel) *FilesWatchCall {
9096 c := &FilesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9097 c.fileId = fileId
9098 c.channel = channel
9099 return c
9100 }
9101
9102
9103
9104
9105 func (c *FilesWatchCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesWatchCall {
9106 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse))
9107 return c
9108 }
9109
9110
9111
9112 func (c *FilesWatchCall) IncludeLabels(includeLabels string) *FilesWatchCall {
9113 c.urlParams_.Set("includeLabels", includeLabels)
9114 return c
9115 }
9116
9117
9118
9119
9120 func (c *FilesWatchCall) IncludePermissionsForView(includePermissionsForView string) *FilesWatchCall {
9121 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
9122 return c
9123 }
9124
9125
9126
9127
9128
9129
9130
9131
9132 func (c *FilesWatchCall) Projection(projection string) *FilesWatchCall {
9133 c.urlParams_.Set("projection", projection)
9134 return c
9135 }
9136
9137
9138
9139 func (c *FilesWatchCall) RevisionId(revisionId string) *FilesWatchCall {
9140 c.urlParams_.Set("revisionId", revisionId)
9141 return c
9142 }
9143
9144
9145
9146 func (c *FilesWatchCall) SupportsAllDrives(supportsAllDrives bool) *FilesWatchCall {
9147 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
9148 return c
9149 }
9150
9151
9152
9153 func (c *FilesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesWatchCall {
9154 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
9155 return c
9156 }
9157
9158
9159
9160
9161 func (c *FilesWatchCall) UpdateViewedDate(updateViewedDate bool) *FilesWatchCall {
9162 c.urlParams_.Set("updateViewedDate", fmt.Sprint(updateViewedDate))
9163 return c
9164 }
9165
9166
9167
9168
9169 func (c *FilesWatchCall) Fields(s ...googleapi.Field) *FilesWatchCall {
9170 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9171 return c
9172 }
9173
9174
9175 func (c *FilesWatchCall) Context(ctx context.Context) *FilesWatchCall {
9176 c.ctx_ = ctx
9177 return c
9178 }
9179
9180
9181
9182 func (c *FilesWatchCall) Header() http.Header {
9183 if c.header_ == nil {
9184 c.header_ = make(http.Header)
9185 }
9186 return c.header_
9187 }
9188
9189 func (c *FilesWatchCall) doRequest(alt string) (*http.Response, error) {
9190 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9191 var body io.Reader = nil
9192 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
9193 if err != nil {
9194 return nil, err
9195 }
9196 c.urlParams_.Set("alt", alt)
9197 c.urlParams_.Set("prettyPrint", "false")
9198 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/watch")
9199 urls += "?" + c.urlParams_.Encode()
9200 req, err := http.NewRequest("POST", urls, body)
9201 if err != nil {
9202 return nil, err
9203 }
9204 req.Header = reqHeaders
9205 googleapi.Expand(req.URL, map[string]string{
9206 "fileId": c.fileId,
9207 })
9208 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9209 }
9210
9211
9212
9213
9214
9215
9216 func (c *FilesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
9217 gensupport.SetOptions(c.urlParams_, opts...)
9218 res, err := c.doRequest("json")
9219 if res != nil && res.StatusCode == http.StatusNotModified {
9220 if res.Body != nil {
9221 res.Body.Close()
9222 }
9223 return nil, gensupport.WrapError(&googleapi.Error{
9224 Code: res.StatusCode,
9225 Header: res.Header,
9226 })
9227 }
9228 if err != nil {
9229 return nil, err
9230 }
9231 defer googleapi.CloseBody(res)
9232 if err := googleapi.CheckResponse(res); err != nil {
9233 return nil, gensupport.WrapError(err)
9234 }
9235 ret := &Channel{
9236 ServerResponse: googleapi.ServerResponse{
9237 Header: res.Header,
9238 HTTPStatusCode: res.StatusCode,
9239 },
9240 }
9241 target := &ret
9242 if err := gensupport.DecodeResponse(target, res); err != nil {
9243 return nil, err
9244 }
9245 return ret, nil
9246 }
9247
9248 type ParentsDeleteCall struct {
9249 s *Service
9250 fileId string
9251 parentId string
9252 urlParams_ gensupport.URLParams
9253 ctx_ context.Context
9254 header_ http.Header
9255 }
9256
9257
9258
9259
9260
9261 func (r *ParentsService) Delete(fileId string, parentId string) *ParentsDeleteCall {
9262 c := &ParentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9263 c.fileId = fileId
9264 c.parentId = parentId
9265 return c
9266 }
9267
9268
9269
9270
9271 func (c *ParentsDeleteCall) EnforceSingleParent(enforceSingleParent bool) *ParentsDeleteCall {
9272 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
9273 return c
9274 }
9275
9276
9277
9278
9279 func (c *ParentsDeleteCall) Fields(s ...googleapi.Field) *ParentsDeleteCall {
9280 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9281 return c
9282 }
9283
9284
9285 func (c *ParentsDeleteCall) Context(ctx context.Context) *ParentsDeleteCall {
9286 c.ctx_ = ctx
9287 return c
9288 }
9289
9290
9291
9292 func (c *ParentsDeleteCall) Header() http.Header {
9293 if c.header_ == nil {
9294 c.header_ = make(http.Header)
9295 }
9296 return c.header_
9297 }
9298
9299 func (c *ParentsDeleteCall) doRequest(alt string) (*http.Response, error) {
9300 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9301 var body io.Reader = nil
9302 c.urlParams_.Set("alt", alt)
9303 c.urlParams_.Set("prettyPrint", "false")
9304 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents/{parentId}")
9305 urls += "?" + c.urlParams_.Encode()
9306 req, err := http.NewRequest("DELETE", urls, body)
9307 if err != nil {
9308 return nil, err
9309 }
9310 req.Header = reqHeaders
9311 googleapi.Expand(req.URL, map[string]string{
9312 "fileId": c.fileId,
9313 "parentId": c.parentId,
9314 })
9315 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9316 }
9317
9318
9319 func (c *ParentsDeleteCall) Do(opts ...googleapi.CallOption) error {
9320 gensupport.SetOptions(c.urlParams_, opts...)
9321 res, err := c.doRequest("json")
9322 if err != nil {
9323 return err
9324 }
9325 defer googleapi.CloseBody(res)
9326 if err := googleapi.CheckResponse(res); err != nil {
9327 return gensupport.WrapError(err)
9328 }
9329 return nil
9330 }
9331
9332 type ParentsGetCall struct {
9333 s *Service
9334 fileId string
9335 parentId string
9336 urlParams_ gensupport.URLParams
9337 ifNoneMatch_ string
9338 ctx_ context.Context
9339 header_ http.Header
9340 }
9341
9342
9343
9344
9345
9346 func (r *ParentsService) Get(fileId string, parentId string) *ParentsGetCall {
9347 c := &ParentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9348 c.fileId = fileId
9349 c.parentId = parentId
9350 return c
9351 }
9352
9353
9354
9355
9356 func (c *ParentsGetCall) Fields(s ...googleapi.Field) *ParentsGetCall {
9357 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9358 return c
9359 }
9360
9361
9362
9363
9364 func (c *ParentsGetCall) IfNoneMatch(entityTag string) *ParentsGetCall {
9365 c.ifNoneMatch_ = entityTag
9366 return c
9367 }
9368
9369
9370 func (c *ParentsGetCall) Context(ctx context.Context) *ParentsGetCall {
9371 c.ctx_ = ctx
9372 return c
9373 }
9374
9375
9376
9377 func (c *ParentsGetCall) Header() http.Header {
9378 if c.header_ == nil {
9379 c.header_ = make(http.Header)
9380 }
9381 return c.header_
9382 }
9383
9384 func (c *ParentsGetCall) doRequest(alt string) (*http.Response, error) {
9385 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9386 if c.ifNoneMatch_ != "" {
9387 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9388 }
9389 var body io.Reader = nil
9390 c.urlParams_.Set("alt", alt)
9391 c.urlParams_.Set("prettyPrint", "false")
9392 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents/{parentId}")
9393 urls += "?" + c.urlParams_.Encode()
9394 req, err := http.NewRequest("GET", urls, body)
9395 if err != nil {
9396 return nil, err
9397 }
9398 req.Header = reqHeaders
9399 googleapi.Expand(req.URL, map[string]string{
9400 "fileId": c.fileId,
9401 "parentId": c.parentId,
9402 })
9403 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9404 }
9405
9406
9407
9408
9409
9410
9411
9412 func (c *ParentsGetCall) Do(opts ...googleapi.CallOption) (*ParentReference, error) {
9413 gensupport.SetOptions(c.urlParams_, opts...)
9414 res, err := c.doRequest("json")
9415 if res != nil && res.StatusCode == http.StatusNotModified {
9416 if res.Body != nil {
9417 res.Body.Close()
9418 }
9419 return nil, gensupport.WrapError(&googleapi.Error{
9420 Code: res.StatusCode,
9421 Header: res.Header,
9422 })
9423 }
9424 if err != nil {
9425 return nil, err
9426 }
9427 defer googleapi.CloseBody(res)
9428 if err := googleapi.CheckResponse(res); err != nil {
9429 return nil, gensupport.WrapError(err)
9430 }
9431 ret := &ParentReference{
9432 ServerResponse: googleapi.ServerResponse{
9433 Header: res.Header,
9434 HTTPStatusCode: res.StatusCode,
9435 },
9436 }
9437 target := &ret
9438 if err := gensupport.DecodeResponse(target, res); err != nil {
9439 return nil, err
9440 }
9441 return ret, nil
9442 }
9443
9444 type ParentsInsertCall struct {
9445 s *Service
9446 fileId string
9447 parentreference *ParentReference
9448 urlParams_ gensupport.URLParams
9449 ctx_ context.Context
9450 header_ http.Header
9451 }
9452
9453
9454
9455
9456 func (r *ParentsService) Insert(fileId string, parentreference *ParentReference) *ParentsInsertCall {
9457 c := &ParentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9458 c.fileId = fileId
9459 c.parentreference = parentreference
9460 return c
9461 }
9462
9463
9464
9465
9466 func (c *ParentsInsertCall) EnforceSingleParent(enforceSingleParent bool) *ParentsInsertCall {
9467 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
9468 return c
9469 }
9470
9471
9472
9473 func (c *ParentsInsertCall) SupportsAllDrives(supportsAllDrives bool) *ParentsInsertCall {
9474 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
9475 return c
9476 }
9477
9478
9479
9480 func (c *ParentsInsertCall) SupportsTeamDrives(supportsTeamDrives bool) *ParentsInsertCall {
9481 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
9482 return c
9483 }
9484
9485
9486
9487
9488 func (c *ParentsInsertCall) Fields(s ...googleapi.Field) *ParentsInsertCall {
9489 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9490 return c
9491 }
9492
9493
9494 func (c *ParentsInsertCall) Context(ctx context.Context) *ParentsInsertCall {
9495 c.ctx_ = ctx
9496 return c
9497 }
9498
9499
9500
9501 func (c *ParentsInsertCall) Header() http.Header {
9502 if c.header_ == nil {
9503 c.header_ = make(http.Header)
9504 }
9505 return c.header_
9506 }
9507
9508 func (c *ParentsInsertCall) doRequest(alt string) (*http.Response, error) {
9509 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9510 var body io.Reader = nil
9511 body, err := googleapi.WithoutDataWrapper.JSONReader(c.parentreference)
9512 if err != nil {
9513 return nil, err
9514 }
9515 c.urlParams_.Set("alt", alt)
9516 c.urlParams_.Set("prettyPrint", "false")
9517 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents")
9518 urls += "?" + c.urlParams_.Encode()
9519 req, err := http.NewRequest("POST", urls, body)
9520 if err != nil {
9521 return nil, err
9522 }
9523 req.Header = reqHeaders
9524 googleapi.Expand(req.URL, map[string]string{
9525 "fileId": c.fileId,
9526 })
9527 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9528 }
9529
9530
9531
9532
9533
9534
9535
9536 func (c *ParentsInsertCall) Do(opts ...googleapi.CallOption) (*ParentReference, error) {
9537 gensupport.SetOptions(c.urlParams_, opts...)
9538 res, err := c.doRequest("json")
9539 if res != nil && res.StatusCode == http.StatusNotModified {
9540 if res.Body != nil {
9541 res.Body.Close()
9542 }
9543 return nil, gensupport.WrapError(&googleapi.Error{
9544 Code: res.StatusCode,
9545 Header: res.Header,
9546 })
9547 }
9548 if err != nil {
9549 return nil, err
9550 }
9551 defer googleapi.CloseBody(res)
9552 if err := googleapi.CheckResponse(res); err != nil {
9553 return nil, gensupport.WrapError(err)
9554 }
9555 ret := &ParentReference{
9556 ServerResponse: googleapi.ServerResponse{
9557 Header: res.Header,
9558 HTTPStatusCode: res.StatusCode,
9559 },
9560 }
9561 target := &ret
9562 if err := gensupport.DecodeResponse(target, res); err != nil {
9563 return nil, err
9564 }
9565 return ret, nil
9566 }
9567
9568 type ParentsListCall struct {
9569 s *Service
9570 fileId string
9571 urlParams_ gensupport.URLParams
9572 ifNoneMatch_ string
9573 ctx_ context.Context
9574 header_ http.Header
9575 }
9576
9577
9578
9579
9580 func (r *ParentsService) List(fileId string) *ParentsListCall {
9581 c := &ParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9582 c.fileId = fileId
9583 return c
9584 }
9585
9586
9587
9588
9589 func (c *ParentsListCall) Fields(s ...googleapi.Field) *ParentsListCall {
9590 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9591 return c
9592 }
9593
9594
9595
9596
9597 func (c *ParentsListCall) IfNoneMatch(entityTag string) *ParentsListCall {
9598 c.ifNoneMatch_ = entityTag
9599 return c
9600 }
9601
9602
9603 func (c *ParentsListCall) Context(ctx context.Context) *ParentsListCall {
9604 c.ctx_ = ctx
9605 return c
9606 }
9607
9608
9609
9610 func (c *ParentsListCall) Header() http.Header {
9611 if c.header_ == nil {
9612 c.header_ = make(http.Header)
9613 }
9614 return c.header_
9615 }
9616
9617 func (c *ParentsListCall) doRequest(alt string) (*http.Response, error) {
9618 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9619 if c.ifNoneMatch_ != "" {
9620 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9621 }
9622 var body io.Reader = nil
9623 c.urlParams_.Set("alt", alt)
9624 c.urlParams_.Set("prettyPrint", "false")
9625 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents")
9626 urls += "?" + c.urlParams_.Encode()
9627 req, err := http.NewRequest("GET", urls, body)
9628 if err != nil {
9629 return nil, err
9630 }
9631 req.Header = reqHeaders
9632 googleapi.Expand(req.URL, map[string]string{
9633 "fileId": c.fileId,
9634 })
9635 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9636 }
9637
9638
9639
9640
9641
9642
9643 func (c *ParentsListCall) Do(opts ...googleapi.CallOption) (*ParentList, error) {
9644 gensupport.SetOptions(c.urlParams_, opts...)
9645 res, err := c.doRequest("json")
9646 if res != nil && res.StatusCode == http.StatusNotModified {
9647 if res.Body != nil {
9648 res.Body.Close()
9649 }
9650 return nil, gensupport.WrapError(&googleapi.Error{
9651 Code: res.StatusCode,
9652 Header: res.Header,
9653 })
9654 }
9655 if err != nil {
9656 return nil, err
9657 }
9658 defer googleapi.CloseBody(res)
9659 if err := googleapi.CheckResponse(res); err != nil {
9660 return nil, gensupport.WrapError(err)
9661 }
9662 ret := &ParentList{
9663 ServerResponse: googleapi.ServerResponse{
9664 Header: res.Header,
9665 HTTPStatusCode: res.StatusCode,
9666 },
9667 }
9668 target := &ret
9669 if err := gensupport.DecodeResponse(target, res); err != nil {
9670 return nil, err
9671 }
9672 return ret, nil
9673 }
9674
9675 type PermissionsDeleteCall struct {
9676 s *Service
9677 fileId string
9678 permissionId string
9679 urlParams_ gensupport.URLParams
9680 ctx_ context.Context
9681 header_ http.Header
9682 }
9683
9684
9685
9686
9687
9688
9689
9690 func (r *PermissionsService) Delete(fileId string, permissionId string) *PermissionsDeleteCall {
9691 c := &PermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9692 c.fileId = fileId
9693 c.permissionId = permissionId
9694 return c
9695 }
9696
9697
9698
9699 func (c *PermissionsDeleteCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsDeleteCall {
9700 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
9701 return c
9702 }
9703
9704
9705
9706 func (c *PermissionsDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsDeleteCall {
9707 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
9708 return c
9709 }
9710
9711
9712
9713
9714
9715
9716 func (c *PermissionsDeleteCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsDeleteCall {
9717 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
9718 return c
9719 }
9720
9721
9722
9723
9724 func (c *PermissionsDeleteCall) Fields(s ...googleapi.Field) *PermissionsDeleteCall {
9725 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9726 return c
9727 }
9728
9729
9730 func (c *PermissionsDeleteCall) Context(ctx context.Context) *PermissionsDeleteCall {
9731 c.ctx_ = ctx
9732 return c
9733 }
9734
9735
9736
9737 func (c *PermissionsDeleteCall) Header() http.Header {
9738 if c.header_ == nil {
9739 c.header_ = make(http.Header)
9740 }
9741 return c.header_
9742 }
9743
9744 func (c *PermissionsDeleteCall) doRequest(alt string) (*http.Response, error) {
9745 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9746 var body io.Reader = nil
9747 c.urlParams_.Set("alt", alt)
9748 c.urlParams_.Set("prettyPrint", "false")
9749 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}")
9750 urls += "?" + c.urlParams_.Encode()
9751 req, err := http.NewRequest("DELETE", urls, body)
9752 if err != nil {
9753 return nil, err
9754 }
9755 req.Header = reqHeaders
9756 googleapi.Expand(req.URL, map[string]string{
9757 "fileId": c.fileId,
9758 "permissionId": c.permissionId,
9759 })
9760 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9761 }
9762
9763
9764 func (c *PermissionsDeleteCall) Do(opts ...googleapi.CallOption) error {
9765 gensupport.SetOptions(c.urlParams_, opts...)
9766 res, err := c.doRequest("json")
9767 if err != nil {
9768 return err
9769 }
9770 defer googleapi.CloseBody(res)
9771 if err := googleapi.CheckResponse(res); err != nil {
9772 return gensupport.WrapError(err)
9773 }
9774 return nil
9775 }
9776
9777 type PermissionsGetCall struct {
9778 s *Service
9779 fileId string
9780 permissionId string
9781 urlParams_ gensupport.URLParams
9782 ifNoneMatch_ string
9783 ctx_ context.Context
9784 header_ http.Header
9785 }
9786
9787
9788
9789
9790
9791 func (r *PermissionsService) Get(fileId string, permissionId string) *PermissionsGetCall {
9792 c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9793 c.fileId = fileId
9794 c.permissionId = permissionId
9795 return c
9796 }
9797
9798
9799
9800 func (c *PermissionsGetCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsGetCall {
9801 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
9802 return c
9803 }
9804
9805
9806
9807 func (c *PermissionsGetCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsGetCall {
9808 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
9809 return c
9810 }
9811
9812
9813
9814
9815
9816
9817 func (c *PermissionsGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsGetCall {
9818 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
9819 return c
9820 }
9821
9822
9823
9824
9825 func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall {
9826 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9827 return c
9828 }
9829
9830
9831
9832
9833 func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall {
9834 c.ifNoneMatch_ = entityTag
9835 return c
9836 }
9837
9838
9839 func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall {
9840 c.ctx_ = ctx
9841 return c
9842 }
9843
9844
9845
9846 func (c *PermissionsGetCall) Header() http.Header {
9847 if c.header_ == nil {
9848 c.header_ = make(http.Header)
9849 }
9850 return c.header_
9851 }
9852
9853 func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) {
9854 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9855 if c.ifNoneMatch_ != "" {
9856 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9857 }
9858 var body io.Reader = nil
9859 c.urlParams_.Set("alt", alt)
9860 c.urlParams_.Set("prettyPrint", "false")
9861 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}")
9862 urls += "?" + c.urlParams_.Encode()
9863 req, err := http.NewRequest("GET", urls, body)
9864 if err != nil {
9865 return nil, err
9866 }
9867 req.Header = reqHeaders
9868 googleapi.Expand(req.URL, map[string]string{
9869 "fileId": c.fileId,
9870 "permissionId": c.permissionId,
9871 })
9872 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9873 }
9874
9875
9876
9877
9878
9879
9880 func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
9881 gensupport.SetOptions(c.urlParams_, opts...)
9882 res, err := c.doRequest("json")
9883 if res != nil && res.StatusCode == http.StatusNotModified {
9884 if res.Body != nil {
9885 res.Body.Close()
9886 }
9887 return nil, gensupport.WrapError(&googleapi.Error{
9888 Code: res.StatusCode,
9889 Header: res.Header,
9890 })
9891 }
9892 if err != nil {
9893 return nil, err
9894 }
9895 defer googleapi.CloseBody(res)
9896 if err := googleapi.CheckResponse(res); err != nil {
9897 return nil, gensupport.WrapError(err)
9898 }
9899 ret := &Permission{
9900 ServerResponse: googleapi.ServerResponse{
9901 Header: res.Header,
9902 HTTPStatusCode: res.StatusCode,
9903 },
9904 }
9905 target := &ret
9906 if err := gensupport.DecodeResponse(target, res); err != nil {
9907 return nil, err
9908 }
9909 return ret, nil
9910 }
9911
9912 type PermissionsGetIdForEmailCall struct {
9913 s *Service
9914 email string
9915 urlParams_ gensupport.URLParams
9916 ifNoneMatch_ string
9917 ctx_ context.Context
9918 header_ http.Header
9919 }
9920
9921
9922
9923
9924 func (r *PermissionsService) GetIdForEmail(email string) *PermissionsGetIdForEmailCall {
9925 c := &PermissionsGetIdForEmailCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9926 c.email = email
9927 return c
9928 }
9929
9930
9931
9932
9933 func (c *PermissionsGetIdForEmailCall) Fields(s ...googleapi.Field) *PermissionsGetIdForEmailCall {
9934 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9935 return c
9936 }
9937
9938
9939
9940
9941 func (c *PermissionsGetIdForEmailCall) IfNoneMatch(entityTag string) *PermissionsGetIdForEmailCall {
9942 c.ifNoneMatch_ = entityTag
9943 return c
9944 }
9945
9946
9947 func (c *PermissionsGetIdForEmailCall) Context(ctx context.Context) *PermissionsGetIdForEmailCall {
9948 c.ctx_ = ctx
9949 return c
9950 }
9951
9952
9953
9954 func (c *PermissionsGetIdForEmailCall) Header() http.Header {
9955 if c.header_ == nil {
9956 c.header_ = make(http.Header)
9957 }
9958 return c.header_
9959 }
9960
9961 func (c *PermissionsGetIdForEmailCall) doRequest(alt string) (*http.Response, error) {
9962 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9963 if c.ifNoneMatch_ != "" {
9964 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9965 }
9966 var body io.Reader = nil
9967 c.urlParams_.Set("alt", alt)
9968 c.urlParams_.Set("prettyPrint", "false")
9969 urls := googleapi.ResolveRelative(c.s.BasePath, "permissionIds/{email}")
9970 urls += "?" + c.urlParams_.Encode()
9971 req, err := http.NewRequest("GET", urls, body)
9972 if err != nil {
9973 return nil, err
9974 }
9975 req.Header = reqHeaders
9976 googleapi.Expand(req.URL, map[string]string{
9977 "email": c.email,
9978 })
9979 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9980 }
9981
9982
9983
9984
9985
9986
9987 func (c *PermissionsGetIdForEmailCall) Do(opts ...googleapi.CallOption) (*PermissionId, error) {
9988 gensupport.SetOptions(c.urlParams_, opts...)
9989 res, err := c.doRequest("json")
9990 if res != nil && res.StatusCode == http.StatusNotModified {
9991 if res.Body != nil {
9992 res.Body.Close()
9993 }
9994 return nil, gensupport.WrapError(&googleapi.Error{
9995 Code: res.StatusCode,
9996 Header: res.Header,
9997 })
9998 }
9999 if err != nil {
10000 return nil, err
10001 }
10002 defer googleapi.CloseBody(res)
10003 if err := googleapi.CheckResponse(res); err != nil {
10004 return nil, gensupport.WrapError(err)
10005 }
10006 ret := &PermissionId{
10007 ServerResponse: googleapi.ServerResponse{
10008 Header: res.Header,
10009 HTTPStatusCode: res.StatusCode,
10010 },
10011 }
10012 target := &ret
10013 if err := gensupport.DecodeResponse(target, res); err != nil {
10014 return nil, err
10015 }
10016 return ret, nil
10017 }
10018
10019 type PermissionsInsertCall struct {
10020 s *Service
10021 fileId string
10022 permission *Permission
10023 urlParams_ gensupport.URLParams
10024 ctx_ context.Context
10025 header_ http.Header
10026 }
10027
10028
10029
10030
10031
10032
10033 func (r *PermissionsService) Insert(fileId string, permission *Permission) *PermissionsInsertCall {
10034 c := &PermissionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10035 c.fileId = fileId
10036 c.permission = permission
10037 return c
10038 }
10039
10040
10041
10042 func (c *PermissionsInsertCall) EmailMessage(emailMessage string) *PermissionsInsertCall {
10043 c.urlParams_.Set("emailMessage", emailMessage)
10044 return c
10045 }
10046
10047
10048
10049 func (c *PermissionsInsertCall) EnforceSingleParent(enforceSingleParent bool) *PermissionsInsertCall {
10050 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
10051 return c
10052 }
10053
10054
10055
10056
10057
10058
10059 func (c *PermissionsInsertCall) MoveToNewOwnersRoot(moveToNewOwnersRoot bool) *PermissionsInsertCall {
10060 c.urlParams_.Set("moveToNewOwnersRoot", fmt.Sprint(moveToNewOwnersRoot))
10061 return c
10062 }
10063
10064
10065
10066
10067 func (c *PermissionsInsertCall) SendNotificationEmails(sendNotificationEmails bool) *PermissionsInsertCall {
10068 c.urlParams_.Set("sendNotificationEmails", fmt.Sprint(sendNotificationEmails))
10069 return c
10070 }
10071
10072
10073
10074 func (c *PermissionsInsertCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsInsertCall {
10075 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
10076 return c
10077 }
10078
10079
10080
10081 func (c *PermissionsInsertCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsInsertCall {
10082 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
10083 return c
10084 }
10085
10086
10087
10088
10089
10090
10091 func (c *PermissionsInsertCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsInsertCall {
10092 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
10093 return c
10094 }
10095
10096
10097
10098
10099 func (c *PermissionsInsertCall) Fields(s ...googleapi.Field) *PermissionsInsertCall {
10100 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10101 return c
10102 }
10103
10104
10105 func (c *PermissionsInsertCall) Context(ctx context.Context) *PermissionsInsertCall {
10106 c.ctx_ = ctx
10107 return c
10108 }
10109
10110
10111
10112 func (c *PermissionsInsertCall) Header() http.Header {
10113 if c.header_ == nil {
10114 c.header_ = make(http.Header)
10115 }
10116 return c.header_
10117 }
10118
10119 func (c *PermissionsInsertCall) doRequest(alt string) (*http.Response, error) {
10120 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10121 var body io.Reader = nil
10122 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission)
10123 if err != nil {
10124 return nil, err
10125 }
10126 c.urlParams_.Set("alt", alt)
10127 c.urlParams_.Set("prettyPrint", "false")
10128 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions")
10129 urls += "?" + c.urlParams_.Encode()
10130 req, err := http.NewRequest("POST", urls, body)
10131 if err != nil {
10132 return nil, err
10133 }
10134 req.Header = reqHeaders
10135 googleapi.Expand(req.URL, map[string]string{
10136 "fileId": c.fileId,
10137 })
10138 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10139 }
10140
10141
10142
10143
10144
10145
10146 func (c *PermissionsInsertCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
10147 gensupport.SetOptions(c.urlParams_, opts...)
10148 res, err := c.doRequest("json")
10149 if res != nil && res.StatusCode == http.StatusNotModified {
10150 if res.Body != nil {
10151 res.Body.Close()
10152 }
10153 return nil, gensupport.WrapError(&googleapi.Error{
10154 Code: res.StatusCode,
10155 Header: res.Header,
10156 })
10157 }
10158 if err != nil {
10159 return nil, err
10160 }
10161 defer googleapi.CloseBody(res)
10162 if err := googleapi.CheckResponse(res); err != nil {
10163 return nil, gensupport.WrapError(err)
10164 }
10165 ret := &Permission{
10166 ServerResponse: googleapi.ServerResponse{
10167 Header: res.Header,
10168 HTTPStatusCode: res.StatusCode,
10169 },
10170 }
10171 target := &ret
10172 if err := gensupport.DecodeResponse(target, res); err != nil {
10173 return nil, err
10174 }
10175 return ret, nil
10176 }
10177
10178 type PermissionsListCall struct {
10179 s *Service
10180 fileId string
10181 urlParams_ gensupport.URLParams
10182 ifNoneMatch_ string
10183 ctx_ context.Context
10184 header_ http.Header
10185 }
10186
10187
10188
10189
10190 func (r *PermissionsService) List(fileId string) *PermissionsListCall {
10191 c := &PermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10192 c.fileId = fileId
10193 return c
10194 }
10195
10196
10197
10198
10199 func (c *PermissionsListCall) IncludePermissionsForView(includePermissionsForView string) *PermissionsListCall {
10200 c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
10201 return c
10202 }
10203
10204
10205
10206
10207
10208 func (c *PermissionsListCall) MaxResults(maxResults int64) *PermissionsListCall {
10209 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
10210 return c
10211 }
10212
10213
10214
10215
10216 func (c *PermissionsListCall) PageToken(pageToken string) *PermissionsListCall {
10217 c.urlParams_.Set("pageToken", pageToken)
10218 return c
10219 }
10220
10221
10222
10223 func (c *PermissionsListCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsListCall {
10224 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
10225 return c
10226 }
10227
10228
10229
10230 func (c *PermissionsListCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsListCall {
10231 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
10232 return c
10233 }
10234
10235
10236
10237
10238
10239
10240 func (c *PermissionsListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsListCall {
10241 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
10242 return c
10243 }
10244
10245
10246
10247
10248 func (c *PermissionsListCall) Fields(s ...googleapi.Field) *PermissionsListCall {
10249 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10250 return c
10251 }
10252
10253
10254
10255
10256 func (c *PermissionsListCall) IfNoneMatch(entityTag string) *PermissionsListCall {
10257 c.ifNoneMatch_ = entityTag
10258 return c
10259 }
10260
10261
10262 func (c *PermissionsListCall) Context(ctx context.Context) *PermissionsListCall {
10263 c.ctx_ = ctx
10264 return c
10265 }
10266
10267
10268
10269 func (c *PermissionsListCall) Header() http.Header {
10270 if c.header_ == nil {
10271 c.header_ = make(http.Header)
10272 }
10273 return c.header_
10274 }
10275
10276 func (c *PermissionsListCall) doRequest(alt string) (*http.Response, error) {
10277 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10278 if c.ifNoneMatch_ != "" {
10279 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10280 }
10281 var body io.Reader = nil
10282 c.urlParams_.Set("alt", alt)
10283 c.urlParams_.Set("prettyPrint", "false")
10284 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions")
10285 urls += "?" + c.urlParams_.Encode()
10286 req, err := http.NewRequest("GET", urls, body)
10287 if err != nil {
10288 return nil, err
10289 }
10290 req.Header = reqHeaders
10291 googleapi.Expand(req.URL, map[string]string{
10292 "fileId": c.fileId,
10293 })
10294 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10295 }
10296
10297
10298
10299
10300
10301
10302 func (c *PermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionList, error) {
10303 gensupport.SetOptions(c.urlParams_, opts...)
10304 res, err := c.doRequest("json")
10305 if res != nil && res.StatusCode == http.StatusNotModified {
10306 if res.Body != nil {
10307 res.Body.Close()
10308 }
10309 return nil, gensupport.WrapError(&googleapi.Error{
10310 Code: res.StatusCode,
10311 Header: res.Header,
10312 })
10313 }
10314 if err != nil {
10315 return nil, err
10316 }
10317 defer googleapi.CloseBody(res)
10318 if err := googleapi.CheckResponse(res); err != nil {
10319 return nil, gensupport.WrapError(err)
10320 }
10321 ret := &PermissionList{
10322 ServerResponse: googleapi.ServerResponse{
10323 Header: res.Header,
10324 HTTPStatusCode: res.StatusCode,
10325 },
10326 }
10327 target := &ret
10328 if err := gensupport.DecodeResponse(target, res); err != nil {
10329 return nil, err
10330 }
10331 return ret, nil
10332 }
10333
10334
10335
10336
10337 func (c *PermissionsListCall) Pages(ctx context.Context, f func(*PermissionList) error) error {
10338 c.ctx_ = ctx
10339 defer c.PageToken(c.urlParams_.Get("pageToken"))
10340 for {
10341 x, err := c.Do()
10342 if err != nil {
10343 return err
10344 }
10345 if err := f(x); err != nil {
10346 return err
10347 }
10348 if x.NextPageToken == "" {
10349 return nil
10350 }
10351 c.PageToken(x.NextPageToken)
10352 }
10353 }
10354
10355 type PermissionsPatchCall struct {
10356 s *Service
10357 fileId string
10358 permissionId string
10359 permission *Permission
10360 urlParams_ gensupport.URLParams
10361 ctx_ context.Context
10362 header_ http.Header
10363 }
10364
10365
10366
10367
10368
10369
10370
10371 func (r *PermissionsService) Patch(fileId string, permissionId string, permission *Permission) *PermissionsPatchCall {
10372 c := &PermissionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10373 c.fileId = fileId
10374 c.permissionId = permissionId
10375 c.permission = permission
10376 return c
10377 }
10378
10379
10380
10381 func (c *PermissionsPatchCall) RemoveExpiration(removeExpiration bool) *PermissionsPatchCall {
10382 c.urlParams_.Set("removeExpiration", fmt.Sprint(removeExpiration))
10383 return c
10384 }
10385
10386
10387
10388 func (c *PermissionsPatchCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsPatchCall {
10389 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
10390 return c
10391 }
10392
10393
10394
10395 func (c *PermissionsPatchCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsPatchCall {
10396 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
10397 return c
10398 }
10399
10400
10401
10402
10403 func (c *PermissionsPatchCall) TransferOwnership(transferOwnership bool) *PermissionsPatchCall {
10404 c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership))
10405 return c
10406 }
10407
10408
10409
10410
10411
10412
10413 func (c *PermissionsPatchCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsPatchCall {
10414 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
10415 return c
10416 }
10417
10418
10419
10420
10421 func (c *PermissionsPatchCall) Fields(s ...googleapi.Field) *PermissionsPatchCall {
10422 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10423 return c
10424 }
10425
10426
10427 func (c *PermissionsPatchCall) Context(ctx context.Context) *PermissionsPatchCall {
10428 c.ctx_ = ctx
10429 return c
10430 }
10431
10432
10433
10434 func (c *PermissionsPatchCall) Header() http.Header {
10435 if c.header_ == nil {
10436 c.header_ = make(http.Header)
10437 }
10438 return c.header_
10439 }
10440
10441 func (c *PermissionsPatchCall) doRequest(alt string) (*http.Response, error) {
10442 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10443 var body io.Reader = nil
10444 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission)
10445 if err != nil {
10446 return nil, err
10447 }
10448 c.urlParams_.Set("alt", alt)
10449 c.urlParams_.Set("prettyPrint", "false")
10450 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}")
10451 urls += "?" + c.urlParams_.Encode()
10452 req, err := http.NewRequest("PATCH", urls, body)
10453 if err != nil {
10454 return nil, err
10455 }
10456 req.Header = reqHeaders
10457 googleapi.Expand(req.URL, map[string]string{
10458 "fileId": c.fileId,
10459 "permissionId": c.permissionId,
10460 })
10461 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10462 }
10463
10464
10465
10466
10467
10468
10469 func (c *PermissionsPatchCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
10470 gensupport.SetOptions(c.urlParams_, opts...)
10471 res, err := c.doRequest("json")
10472 if res != nil && res.StatusCode == http.StatusNotModified {
10473 if res.Body != nil {
10474 res.Body.Close()
10475 }
10476 return nil, gensupport.WrapError(&googleapi.Error{
10477 Code: res.StatusCode,
10478 Header: res.Header,
10479 })
10480 }
10481 if err != nil {
10482 return nil, err
10483 }
10484 defer googleapi.CloseBody(res)
10485 if err := googleapi.CheckResponse(res); err != nil {
10486 return nil, gensupport.WrapError(err)
10487 }
10488 ret := &Permission{
10489 ServerResponse: googleapi.ServerResponse{
10490 Header: res.Header,
10491 HTTPStatusCode: res.StatusCode,
10492 },
10493 }
10494 target := &ret
10495 if err := gensupport.DecodeResponse(target, res); err != nil {
10496 return nil, err
10497 }
10498 return ret, nil
10499 }
10500
10501 type PermissionsUpdateCall struct {
10502 s *Service
10503 fileId string
10504 permissionId string
10505 permission *Permission
10506 urlParams_ gensupport.URLParams
10507 ctx_ context.Context
10508 header_ http.Header
10509 }
10510
10511
10512
10513
10514
10515
10516 func (r *PermissionsService) Update(fileId string, permissionId string, permission *Permission) *PermissionsUpdateCall {
10517 c := &PermissionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10518 c.fileId = fileId
10519 c.permissionId = permissionId
10520 c.permission = permission
10521 return c
10522 }
10523
10524
10525
10526 func (c *PermissionsUpdateCall) RemoveExpiration(removeExpiration bool) *PermissionsUpdateCall {
10527 c.urlParams_.Set("removeExpiration", fmt.Sprint(removeExpiration))
10528 return c
10529 }
10530
10531
10532
10533 func (c *PermissionsUpdateCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsUpdateCall {
10534 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
10535 return c
10536 }
10537
10538
10539
10540 func (c *PermissionsUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsUpdateCall {
10541 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
10542 return c
10543 }
10544
10545
10546
10547
10548 func (c *PermissionsUpdateCall) TransferOwnership(transferOwnership bool) *PermissionsUpdateCall {
10549 c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership))
10550 return c
10551 }
10552
10553
10554
10555
10556
10557
10558 func (c *PermissionsUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsUpdateCall {
10559 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
10560 return c
10561 }
10562
10563
10564
10565
10566 func (c *PermissionsUpdateCall) Fields(s ...googleapi.Field) *PermissionsUpdateCall {
10567 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10568 return c
10569 }
10570
10571
10572 func (c *PermissionsUpdateCall) Context(ctx context.Context) *PermissionsUpdateCall {
10573 c.ctx_ = ctx
10574 return c
10575 }
10576
10577
10578
10579 func (c *PermissionsUpdateCall) Header() http.Header {
10580 if c.header_ == nil {
10581 c.header_ = make(http.Header)
10582 }
10583 return c.header_
10584 }
10585
10586 func (c *PermissionsUpdateCall) doRequest(alt string) (*http.Response, error) {
10587 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10588 var body io.Reader = nil
10589 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission)
10590 if err != nil {
10591 return nil, err
10592 }
10593 c.urlParams_.Set("alt", alt)
10594 c.urlParams_.Set("prettyPrint", "false")
10595 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}")
10596 urls += "?" + c.urlParams_.Encode()
10597 req, err := http.NewRequest("PUT", urls, body)
10598 if err != nil {
10599 return nil, err
10600 }
10601 req.Header = reqHeaders
10602 googleapi.Expand(req.URL, map[string]string{
10603 "fileId": c.fileId,
10604 "permissionId": c.permissionId,
10605 })
10606 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10607 }
10608
10609
10610
10611
10612
10613
10614 func (c *PermissionsUpdateCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
10615 gensupport.SetOptions(c.urlParams_, opts...)
10616 res, err := c.doRequest("json")
10617 if res != nil && res.StatusCode == http.StatusNotModified {
10618 if res.Body != nil {
10619 res.Body.Close()
10620 }
10621 return nil, gensupport.WrapError(&googleapi.Error{
10622 Code: res.StatusCode,
10623 Header: res.Header,
10624 })
10625 }
10626 if err != nil {
10627 return nil, err
10628 }
10629 defer googleapi.CloseBody(res)
10630 if err := googleapi.CheckResponse(res); err != nil {
10631 return nil, gensupport.WrapError(err)
10632 }
10633 ret := &Permission{
10634 ServerResponse: googleapi.ServerResponse{
10635 Header: res.Header,
10636 HTTPStatusCode: res.StatusCode,
10637 },
10638 }
10639 target := &ret
10640 if err := gensupport.DecodeResponse(target, res); err != nil {
10641 return nil, err
10642 }
10643 return ret, nil
10644 }
10645
10646 type PropertiesDeleteCall struct {
10647 s *Service
10648 fileId string
10649 propertyKey string
10650 urlParams_ gensupport.URLParams
10651 ctx_ context.Context
10652 header_ http.Header
10653 }
10654
10655
10656
10657
10658
10659 func (r *PropertiesService) Delete(fileId string, propertyKey string) *PropertiesDeleteCall {
10660 c := &PropertiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10661 c.fileId = fileId
10662 c.propertyKey = propertyKey
10663 return c
10664 }
10665
10666
10667
10668 func (c *PropertiesDeleteCall) Visibility(visibility string) *PropertiesDeleteCall {
10669 c.urlParams_.Set("visibility", visibility)
10670 return c
10671 }
10672
10673
10674
10675
10676 func (c *PropertiesDeleteCall) Fields(s ...googleapi.Field) *PropertiesDeleteCall {
10677 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10678 return c
10679 }
10680
10681
10682 func (c *PropertiesDeleteCall) Context(ctx context.Context) *PropertiesDeleteCall {
10683 c.ctx_ = ctx
10684 return c
10685 }
10686
10687
10688
10689 func (c *PropertiesDeleteCall) Header() http.Header {
10690 if c.header_ == nil {
10691 c.header_ = make(http.Header)
10692 }
10693 return c.header_
10694 }
10695
10696 func (c *PropertiesDeleteCall) doRequest(alt string) (*http.Response, error) {
10697 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10698 var body io.Reader = nil
10699 c.urlParams_.Set("alt", alt)
10700 c.urlParams_.Set("prettyPrint", "false")
10701 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}")
10702 urls += "?" + c.urlParams_.Encode()
10703 req, err := http.NewRequest("DELETE", urls, body)
10704 if err != nil {
10705 return nil, err
10706 }
10707 req.Header = reqHeaders
10708 googleapi.Expand(req.URL, map[string]string{
10709 "fileId": c.fileId,
10710 "propertyKey": c.propertyKey,
10711 })
10712 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10713 }
10714
10715
10716 func (c *PropertiesDeleteCall) Do(opts ...googleapi.CallOption) error {
10717 gensupport.SetOptions(c.urlParams_, opts...)
10718 res, err := c.doRequest("json")
10719 if err != nil {
10720 return err
10721 }
10722 defer googleapi.CloseBody(res)
10723 if err := googleapi.CheckResponse(res); err != nil {
10724 return gensupport.WrapError(err)
10725 }
10726 return nil
10727 }
10728
10729 type PropertiesGetCall struct {
10730 s *Service
10731 fileId string
10732 propertyKey string
10733 urlParams_ gensupport.URLParams
10734 ifNoneMatch_ string
10735 ctx_ context.Context
10736 header_ http.Header
10737 }
10738
10739
10740
10741
10742
10743 func (r *PropertiesService) Get(fileId string, propertyKey string) *PropertiesGetCall {
10744 c := &PropertiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10745 c.fileId = fileId
10746 c.propertyKey = propertyKey
10747 return c
10748 }
10749
10750
10751
10752 func (c *PropertiesGetCall) Visibility(visibility string) *PropertiesGetCall {
10753 c.urlParams_.Set("visibility", visibility)
10754 return c
10755 }
10756
10757
10758
10759
10760 func (c *PropertiesGetCall) Fields(s ...googleapi.Field) *PropertiesGetCall {
10761 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10762 return c
10763 }
10764
10765
10766
10767
10768 func (c *PropertiesGetCall) IfNoneMatch(entityTag string) *PropertiesGetCall {
10769 c.ifNoneMatch_ = entityTag
10770 return c
10771 }
10772
10773
10774 func (c *PropertiesGetCall) Context(ctx context.Context) *PropertiesGetCall {
10775 c.ctx_ = ctx
10776 return c
10777 }
10778
10779
10780
10781 func (c *PropertiesGetCall) Header() http.Header {
10782 if c.header_ == nil {
10783 c.header_ = make(http.Header)
10784 }
10785 return c.header_
10786 }
10787
10788 func (c *PropertiesGetCall) doRequest(alt string) (*http.Response, error) {
10789 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10790 if c.ifNoneMatch_ != "" {
10791 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10792 }
10793 var body io.Reader = nil
10794 c.urlParams_.Set("alt", alt)
10795 c.urlParams_.Set("prettyPrint", "false")
10796 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}")
10797 urls += "?" + c.urlParams_.Encode()
10798 req, err := http.NewRequest("GET", urls, body)
10799 if err != nil {
10800 return nil, err
10801 }
10802 req.Header = reqHeaders
10803 googleapi.Expand(req.URL, map[string]string{
10804 "fileId": c.fileId,
10805 "propertyKey": c.propertyKey,
10806 })
10807 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10808 }
10809
10810
10811
10812
10813
10814
10815 func (c *PropertiesGetCall) Do(opts ...googleapi.CallOption) (*Property, error) {
10816 gensupport.SetOptions(c.urlParams_, opts...)
10817 res, err := c.doRequest("json")
10818 if res != nil && res.StatusCode == http.StatusNotModified {
10819 if res.Body != nil {
10820 res.Body.Close()
10821 }
10822 return nil, gensupport.WrapError(&googleapi.Error{
10823 Code: res.StatusCode,
10824 Header: res.Header,
10825 })
10826 }
10827 if err != nil {
10828 return nil, err
10829 }
10830 defer googleapi.CloseBody(res)
10831 if err := googleapi.CheckResponse(res); err != nil {
10832 return nil, gensupport.WrapError(err)
10833 }
10834 ret := &Property{
10835 ServerResponse: googleapi.ServerResponse{
10836 Header: res.Header,
10837 HTTPStatusCode: res.StatusCode,
10838 },
10839 }
10840 target := &ret
10841 if err := gensupport.DecodeResponse(target, res); err != nil {
10842 return nil, err
10843 }
10844 return ret, nil
10845 }
10846
10847 type PropertiesInsertCall struct {
10848 s *Service
10849 fileId string
10850 property *Property
10851 urlParams_ gensupport.URLParams
10852 ctx_ context.Context
10853 header_ http.Header
10854 }
10855
10856
10857
10858
10859 func (r *PropertiesService) Insert(fileId string, property *Property) *PropertiesInsertCall {
10860 c := &PropertiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10861 c.fileId = fileId
10862 c.property = property
10863 return c
10864 }
10865
10866
10867
10868
10869 func (c *PropertiesInsertCall) Fields(s ...googleapi.Field) *PropertiesInsertCall {
10870 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10871 return c
10872 }
10873
10874
10875 func (c *PropertiesInsertCall) Context(ctx context.Context) *PropertiesInsertCall {
10876 c.ctx_ = ctx
10877 return c
10878 }
10879
10880
10881
10882 func (c *PropertiesInsertCall) Header() http.Header {
10883 if c.header_ == nil {
10884 c.header_ = make(http.Header)
10885 }
10886 return c.header_
10887 }
10888
10889 func (c *PropertiesInsertCall) doRequest(alt string) (*http.Response, error) {
10890 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10891 var body io.Reader = nil
10892 body, err := googleapi.WithoutDataWrapper.JSONReader(c.property)
10893 if err != nil {
10894 return nil, err
10895 }
10896 c.urlParams_.Set("alt", alt)
10897 c.urlParams_.Set("prettyPrint", "false")
10898 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties")
10899 urls += "?" + c.urlParams_.Encode()
10900 req, err := http.NewRequest("POST", urls, body)
10901 if err != nil {
10902 return nil, err
10903 }
10904 req.Header = reqHeaders
10905 googleapi.Expand(req.URL, map[string]string{
10906 "fileId": c.fileId,
10907 })
10908 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10909 }
10910
10911
10912
10913
10914
10915
10916 func (c *PropertiesInsertCall) Do(opts ...googleapi.CallOption) (*Property, error) {
10917 gensupport.SetOptions(c.urlParams_, opts...)
10918 res, err := c.doRequest("json")
10919 if res != nil && res.StatusCode == http.StatusNotModified {
10920 if res.Body != nil {
10921 res.Body.Close()
10922 }
10923 return nil, gensupport.WrapError(&googleapi.Error{
10924 Code: res.StatusCode,
10925 Header: res.Header,
10926 })
10927 }
10928 if err != nil {
10929 return nil, err
10930 }
10931 defer googleapi.CloseBody(res)
10932 if err := googleapi.CheckResponse(res); err != nil {
10933 return nil, gensupport.WrapError(err)
10934 }
10935 ret := &Property{
10936 ServerResponse: googleapi.ServerResponse{
10937 Header: res.Header,
10938 HTTPStatusCode: res.StatusCode,
10939 },
10940 }
10941 target := &ret
10942 if err := gensupport.DecodeResponse(target, res); err != nil {
10943 return nil, err
10944 }
10945 return ret, nil
10946 }
10947
10948 type PropertiesListCall struct {
10949 s *Service
10950 fileId string
10951 urlParams_ gensupport.URLParams
10952 ifNoneMatch_ string
10953 ctx_ context.Context
10954 header_ http.Header
10955 }
10956
10957
10958
10959
10960 func (r *PropertiesService) List(fileId string) *PropertiesListCall {
10961 c := &PropertiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10962 c.fileId = fileId
10963 return c
10964 }
10965
10966
10967
10968
10969 func (c *PropertiesListCall) Fields(s ...googleapi.Field) *PropertiesListCall {
10970 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10971 return c
10972 }
10973
10974
10975
10976
10977 func (c *PropertiesListCall) IfNoneMatch(entityTag string) *PropertiesListCall {
10978 c.ifNoneMatch_ = entityTag
10979 return c
10980 }
10981
10982
10983 func (c *PropertiesListCall) Context(ctx context.Context) *PropertiesListCall {
10984 c.ctx_ = ctx
10985 return c
10986 }
10987
10988
10989
10990 func (c *PropertiesListCall) Header() http.Header {
10991 if c.header_ == nil {
10992 c.header_ = make(http.Header)
10993 }
10994 return c.header_
10995 }
10996
10997 func (c *PropertiesListCall) doRequest(alt string) (*http.Response, error) {
10998 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10999 if c.ifNoneMatch_ != "" {
11000 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11001 }
11002 var body io.Reader = nil
11003 c.urlParams_.Set("alt", alt)
11004 c.urlParams_.Set("prettyPrint", "false")
11005 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties")
11006 urls += "?" + c.urlParams_.Encode()
11007 req, err := http.NewRequest("GET", urls, body)
11008 if err != nil {
11009 return nil, err
11010 }
11011 req.Header = reqHeaders
11012 googleapi.Expand(req.URL, map[string]string{
11013 "fileId": c.fileId,
11014 })
11015 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11016 }
11017
11018
11019
11020
11021
11022
11023 func (c *PropertiesListCall) Do(opts ...googleapi.CallOption) (*PropertyList, error) {
11024 gensupport.SetOptions(c.urlParams_, opts...)
11025 res, err := c.doRequest("json")
11026 if res != nil && res.StatusCode == http.StatusNotModified {
11027 if res.Body != nil {
11028 res.Body.Close()
11029 }
11030 return nil, gensupport.WrapError(&googleapi.Error{
11031 Code: res.StatusCode,
11032 Header: res.Header,
11033 })
11034 }
11035 if err != nil {
11036 return nil, err
11037 }
11038 defer googleapi.CloseBody(res)
11039 if err := googleapi.CheckResponse(res); err != nil {
11040 return nil, gensupport.WrapError(err)
11041 }
11042 ret := &PropertyList{
11043 ServerResponse: googleapi.ServerResponse{
11044 Header: res.Header,
11045 HTTPStatusCode: res.StatusCode,
11046 },
11047 }
11048 target := &ret
11049 if err := gensupport.DecodeResponse(target, res); err != nil {
11050 return nil, err
11051 }
11052 return ret, nil
11053 }
11054
11055 type PropertiesPatchCall struct {
11056 s *Service
11057 fileId string
11058 propertyKey string
11059 property *Property
11060 urlParams_ gensupport.URLParams
11061 ctx_ context.Context
11062 header_ http.Header
11063 }
11064
11065
11066
11067
11068
11069 func (r *PropertiesService) Patch(fileId string, propertyKey string, property *Property) *PropertiesPatchCall {
11070 c := &PropertiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11071 c.fileId = fileId
11072 c.propertyKey = propertyKey
11073 c.property = property
11074 return c
11075 }
11076
11077
11078
11079 func (c *PropertiesPatchCall) Visibility(visibility string) *PropertiesPatchCall {
11080 c.urlParams_.Set("visibility", visibility)
11081 return c
11082 }
11083
11084
11085
11086
11087 func (c *PropertiesPatchCall) Fields(s ...googleapi.Field) *PropertiesPatchCall {
11088 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11089 return c
11090 }
11091
11092
11093 func (c *PropertiesPatchCall) Context(ctx context.Context) *PropertiesPatchCall {
11094 c.ctx_ = ctx
11095 return c
11096 }
11097
11098
11099
11100 func (c *PropertiesPatchCall) Header() http.Header {
11101 if c.header_ == nil {
11102 c.header_ = make(http.Header)
11103 }
11104 return c.header_
11105 }
11106
11107 func (c *PropertiesPatchCall) doRequest(alt string) (*http.Response, error) {
11108 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11109 var body io.Reader = nil
11110 body, err := googleapi.WithoutDataWrapper.JSONReader(c.property)
11111 if err != nil {
11112 return nil, err
11113 }
11114 c.urlParams_.Set("alt", alt)
11115 c.urlParams_.Set("prettyPrint", "false")
11116 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}")
11117 urls += "?" + c.urlParams_.Encode()
11118 req, err := http.NewRequest("PATCH", urls, body)
11119 if err != nil {
11120 return nil, err
11121 }
11122 req.Header = reqHeaders
11123 googleapi.Expand(req.URL, map[string]string{
11124 "fileId": c.fileId,
11125 "propertyKey": c.propertyKey,
11126 })
11127 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11128 }
11129
11130
11131
11132
11133
11134
11135 func (c *PropertiesPatchCall) Do(opts ...googleapi.CallOption) (*Property, error) {
11136 gensupport.SetOptions(c.urlParams_, opts...)
11137 res, err := c.doRequest("json")
11138 if res != nil && res.StatusCode == http.StatusNotModified {
11139 if res.Body != nil {
11140 res.Body.Close()
11141 }
11142 return nil, gensupport.WrapError(&googleapi.Error{
11143 Code: res.StatusCode,
11144 Header: res.Header,
11145 })
11146 }
11147 if err != nil {
11148 return nil, err
11149 }
11150 defer googleapi.CloseBody(res)
11151 if err := googleapi.CheckResponse(res); err != nil {
11152 return nil, gensupport.WrapError(err)
11153 }
11154 ret := &Property{
11155 ServerResponse: googleapi.ServerResponse{
11156 Header: res.Header,
11157 HTTPStatusCode: res.StatusCode,
11158 },
11159 }
11160 target := &ret
11161 if err := gensupport.DecodeResponse(target, res); err != nil {
11162 return nil, err
11163 }
11164 return ret, nil
11165 }
11166
11167 type PropertiesUpdateCall struct {
11168 s *Service
11169 fileId string
11170 propertyKey string
11171 property *Property
11172 urlParams_ gensupport.URLParams
11173 ctx_ context.Context
11174 header_ http.Header
11175 }
11176
11177
11178
11179
11180
11181 func (r *PropertiesService) Update(fileId string, propertyKey string, property *Property) *PropertiesUpdateCall {
11182 c := &PropertiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11183 c.fileId = fileId
11184 c.propertyKey = propertyKey
11185 c.property = property
11186 return c
11187 }
11188
11189
11190
11191 func (c *PropertiesUpdateCall) Visibility(visibility string) *PropertiesUpdateCall {
11192 c.urlParams_.Set("visibility", visibility)
11193 return c
11194 }
11195
11196
11197
11198
11199 func (c *PropertiesUpdateCall) Fields(s ...googleapi.Field) *PropertiesUpdateCall {
11200 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11201 return c
11202 }
11203
11204
11205 func (c *PropertiesUpdateCall) Context(ctx context.Context) *PropertiesUpdateCall {
11206 c.ctx_ = ctx
11207 return c
11208 }
11209
11210
11211
11212 func (c *PropertiesUpdateCall) Header() http.Header {
11213 if c.header_ == nil {
11214 c.header_ = make(http.Header)
11215 }
11216 return c.header_
11217 }
11218
11219 func (c *PropertiesUpdateCall) doRequest(alt string) (*http.Response, error) {
11220 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11221 var body io.Reader = nil
11222 body, err := googleapi.WithoutDataWrapper.JSONReader(c.property)
11223 if err != nil {
11224 return nil, err
11225 }
11226 c.urlParams_.Set("alt", alt)
11227 c.urlParams_.Set("prettyPrint", "false")
11228 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}")
11229 urls += "?" + c.urlParams_.Encode()
11230 req, err := http.NewRequest("PUT", urls, body)
11231 if err != nil {
11232 return nil, err
11233 }
11234 req.Header = reqHeaders
11235 googleapi.Expand(req.URL, map[string]string{
11236 "fileId": c.fileId,
11237 "propertyKey": c.propertyKey,
11238 })
11239 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11240 }
11241
11242
11243
11244
11245
11246
11247 func (c *PropertiesUpdateCall) Do(opts ...googleapi.CallOption) (*Property, error) {
11248 gensupport.SetOptions(c.urlParams_, opts...)
11249 res, err := c.doRequest("json")
11250 if res != nil && res.StatusCode == http.StatusNotModified {
11251 if res.Body != nil {
11252 res.Body.Close()
11253 }
11254 return nil, gensupport.WrapError(&googleapi.Error{
11255 Code: res.StatusCode,
11256 Header: res.Header,
11257 })
11258 }
11259 if err != nil {
11260 return nil, err
11261 }
11262 defer googleapi.CloseBody(res)
11263 if err := googleapi.CheckResponse(res); err != nil {
11264 return nil, gensupport.WrapError(err)
11265 }
11266 ret := &Property{
11267 ServerResponse: googleapi.ServerResponse{
11268 Header: res.Header,
11269 HTTPStatusCode: res.StatusCode,
11270 },
11271 }
11272 target := &ret
11273 if err := gensupport.DecodeResponse(target, res); err != nil {
11274 return nil, err
11275 }
11276 return ret, nil
11277 }
11278
11279 type RepliesDeleteCall struct {
11280 s *Service
11281 fileId string
11282 commentId string
11283 replyId string
11284 urlParams_ gensupport.URLParams
11285 ctx_ context.Context
11286 header_ http.Header
11287 }
11288
11289
11290
11291
11292
11293
11294 func (r *RepliesService) Delete(fileId string, commentId string, replyId string) *RepliesDeleteCall {
11295 c := &RepliesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11296 c.fileId = fileId
11297 c.commentId = commentId
11298 c.replyId = replyId
11299 return c
11300 }
11301
11302
11303
11304
11305 func (c *RepliesDeleteCall) Fields(s ...googleapi.Field) *RepliesDeleteCall {
11306 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11307 return c
11308 }
11309
11310
11311 func (c *RepliesDeleteCall) Context(ctx context.Context) *RepliesDeleteCall {
11312 c.ctx_ = ctx
11313 return c
11314 }
11315
11316
11317
11318 func (c *RepliesDeleteCall) Header() http.Header {
11319 if c.header_ == nil {
11320 c.header_ = make(http.Header)
11321 }
11322 return c.header_
11323 }
11324
11325 func (c *RepliesDeleteCall) doRequest(alt string) (*http.Response, error) {
11326 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11327 var body io.Reader = nil
11328 c.urlParams_.Set("alt", alt)
11329 c.urlParams_.Set("prettyPrint", "false")
11330 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}")
11331 urls += "?" + c.urlParams_.Encode()
11332 req, err := http.NewRequest("DELETE", urls, body)
11333 if err != nil {
11334 return nil, err
11335 }
11336 req.Header = reqHeaders
11337 googleapi.Expand(req.URL, map[string]string{
11338 "fileId": c.fileId,
11339 "commentId": c.commentId,
11340 "replyId": c.replyId,
11341 })
11342 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11343 }
11344
11345
11346 func (c *RepliesDeleteCall) Do(opts ...googleapi.CallOption) error {
11347 gensupport.SetOptions(c.urlParams_, opts...)
11348 res, err := c.doRequest("json")
11349 if err != nil {
11350 return err
11351 }
11352 defer googleapi.CloseBody(res)
11353 if err := googleapi.CheckResponse(res); err != nil {
11354 return gensupport.WrapError(err)
11355 }
11356 return nil
11357 }
11358
11359 type RepliesGetCall struct {
11360 s *Service
11361 fileId string
11362 commentId string
11363 replyId string
11364 urlParams_ gensupport.URLParams
11365 ifNoneMatch_ string
11366 ctx_ context.Context
11367 header_ http.Header
11368 }
11369
11370
11371
11372
11373
11374
11375 func (r *RepliesService) Get(fileId string, commentId string, replyId string) *RepliesGetCall {
11376 c := &RepliesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11377 c.fileId = fileId
11378 c.commentId = commentId
11379 c.replyId = replyId
11380 return c
11381 }
11382
11383
11384
11385 func (c *RepliesGetCall) IncludeDeleted(includeDeleted bool) *RepliesGetCall {
11386 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
11387 return c
11388 }
11389
11390
11391
11392
11393 func (c *RepliesGetCall) Fields(s ...googleapi.Field) *RepliesGetCall {
11394 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11395 return c
11396 }
11397
11398
11399
11400
11401 func (c *RepliesGetCall) IfNoneMatch(entityTag string) *RepliesGetCall {
11402 c.ifNoneMatch_ = entityTag
11403 return c
11404 }
11405
11406
11407 func (c *RepliesGetCall) Context(ctx context.Context) *RepliesGetCall {
11408 c.ctx_ = ctx
11409 return c
11410 }
11411
11412
11413
11414 func (c *RepliesGetCall) Header() http.Header {
11415 if c.header_ == nil {
11416 c.header_ = make(http.Header)
11417 }
11418 return c.header_
11419 }
11420
11421 func (c *RepliesGetCall) doRequest(alt string) (*http.Response, error) {
11422 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11423 if c.ifNoneMatch_ != "" {
11424 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11425 }
11426 var body io.Reader = nil
11427 c.urlParams_.Set("alt", alt)
11428 c.urlParams_.Set("prettyPrint", "false")
11429 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}")
11430 urls += "?" + c.urlParams_.Encode()
11431 req, err := http.NewRequest("GET", urls, body)
11432 if err != nil {
11433 return nil, err
11434 }
11435 req.Header = reqHeaders
11436 googleapi.Expand(req.URL, map[string]string{
11437 "fileId": c.fileId,
11438 "commentId": c.commentId,
11439 "replyId": c.replyId,
11440 })
11441 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11442 }
11443
11444
11445
11446
11447
11448
11449 func (c *RepliesGetCall) Do(opts ...googleapi.CallOption) (*CommentReply, error) {
11450 gensupport.SetOptions(c.urlParams_, opts...)
11451 res, err := c.doRequest("json")
11452 if res != nil && res.StatusCode == http.StatusNotModified {
11453 if res.Body != nil {
11454 res.Body.Close()
11455 }
11456 return nil, gensupport.WrapError(&googleapi.Error{
11457 Code: res.StatusCode,
11458 Header: res.Header,
11459 })
11460 }
11461 if err != nil {
11462 return nil, err
11463 }
11464 defer googleapi.CloseBody(res)
11465 if err := googleapi.CheckResponse(res); err != nil {
11466 return nil, gensupport.WrapError(err)
11467 }
11468 ret := &CommentReply{
11469 ServerResponse: googleapi.ServerResponse{
11470 Header: res.Header,
11471 HTTPStatusCode: res.StatusCode,
11472 },
11473 }
11474 target := &ret
11475 if err := gensupport.DecodeResponse(target, res); err != nil {
11476 return nil, err
11477 }
11478 return ret, nil
11479 }
11480
11481 type RepliesInsertCall struct {
11482 s *Service
11483 fileId string
11484 commentId string
11485 commentreply *CommentReply
11486 urlParams_ gensupport.URLParams
11487 ctx_ context.Context
11488 header_ http.Header
11489 }
11490
11491
11492
11493
11494
11495 func (r *RepliesService) Insert(fileId string, commentId string, commentreply *CommentReply) *RepliesInsertCall {
11496 c := &RepliesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11497 c.fileId = fileId
11498 c.commentId = commentId
11499 c.commentreply = commentreply
11500 return c
11501 }
11502
11503
11504
11505
11506 func (c *RepliesInsertCall) Fields(s ...googleapi.Field) *RepliesInsertCall {
11507 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11508 return c
11509 }
11510
11511
11512 func (c *RepliesInsertCall) Context(ctx context.Context) *RepliesInsertCall {
11513 c.ctx_ = ctx
11514 return c
11515 }
11516
11517
11518
11519 func (c *RepliesInsertCall) Header() http.Header {
11520 if c.header_ == nil {
11521 c.header_ = make(http.Header)
11522 }
11523 return c.header_
11524 }
11525
11526 func (c *RepliesInsertCall) doRequest(alt string) (*http.Response, error) {
11527 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11528 var body io.Reader = nil
11529 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply)
11530 if err != nil {
11531 return nil, err
11532 }
11533 c.urlParams_.Set("alt", alt)
11534 c.urlParams_.Set("prettyPrint", "false")
11535 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies")
11536 urls += "?" + c.urlParams_.Encode()
11537 req, err := http.NewRequest("POST", urls, body)
11538 if err != nil {
11539 return nil, err
11540 }
11541 req.Header = reqHeaders
11542 googleapi.Expand(req.URL, map[string]string{
11543 "fileId": c.fileId,
11544 "commentId": c.commentId,
11545 })
11546 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11547 }
11548
11549
11550
11551
11552
11553
11554 func (c *RepliesInsertCall) Do(opts ...googleapi.CallOption) (*CommentReply, error) {
11555 gensupport.SetOptions(c.urlParams_, opts...)
11556 res, err := c.doRequest("json")
11557 if res != nil && res.StatusCode == http.StatusNotModified {
11558 if res.Body != nil {
11559 res.Body.Close()
11560 }
11561 return nil, gensupport.WrapError(&googleapi.Error{
11562 Code: res.StatusCode,
11563 Header: res.Header,
11564 })
11565 }
11566 if err != nil {
11567 return nil, err
11568 }
11569 defer googleapi.CloseBody(res)
11570 if err := googleapi.CheckResponse(res); err != nil {
11571 return nil, gensupport.WrapError(err)
11572 }
11573 ret := &CommentReply{
11574 ServerResponse: googleapi.ServerResponse{
11575 Header: res.Header,
11576 HTTPStatusCode: res.StatusCode,
11577 },
11578 }
11579 target := &ret
11580 if err := gensupport.DecodeResponse(target, res); err != nil {
11581 return nil, err
11582 }
11583 return ret, nil
11584 }
11585
11586 type RepliesListCall struct {
11587 s *Service
11588 fileId string
11589 commentId string
11590 urlParams_ gensupport.URLParams
11591 ifNoneMatch_ string
11592 ctx_ context.Context
11593 header_ http.Header
11594 }
11595
11596
11597
11598
11599
11600 func (r *RepliesService) List(fileId string, commentId string) *RepliesListCall {
11601 c := &RepliesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11602 c.fileId = fileId
11603 c.commentId = commentId
11604 return c
11605 }
11606
11607
11608
11609 func (c *RepliesListCall) IncludeDeleted(includeDeleted bool) *RepliesListCall {
11610 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
11611 return c
11612 }
11613
11614
11615
11616 func (c *RepliesListCall) MaxResults(maxResults int64) *RepliesListCall {
11617 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
11618 return c
11619 }
11620
11621
11622
11623
11624 func (c *RepliesListCall) PageToken(pageToken string) *RepliesListCall {
11625 c.urlParams_.Set("pageToken", pageToken)
11626 return c
11627 }
11628
11629
11630
11631
11632 func (c *RepliesListCall) Fields(s ...googleapi.Field) *RepliesListCall {
11633 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11634 return c
11635 }
11636
11637
11638
11639
11640 func (c *RepliesListCall) IfNoneMatch(entityTag string) *RepliesListCall {
11641 c.ifNoneMatch_ = entityTag
11642 return c
11643 }
11644
11645
11646 func (c *RepliesListCall) Context(ctx context.Context) *RepliesListCall {
11647 c.ctx_ = ctx
11648 return c
11649 }
11650
11651
11652
11653 func (c *RepliesListCall) Header() http.Header {
11654 if c.header_ == nil {
11655 c.header_ = make(http.Header)
11656 }
11657 return c.header_
11658 }
11659
11660 func (c *RepliesListCall) doRequest(alt string) (*http.Response, error) {
11661 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11662 if c.ifNoneMatch_ != "" {
11663 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11664 }
11665 var body io.Reader = nil
11666 c.urlParams_.Set("alt", alt)
11667 c.urlParams_.Set("prettyPrint", "false")
11668 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies")
11669 urls += "?" + c.urlParams_.Encode()
11670 req, err := http.NewRequest("GET", urls, body)
11671 if err != nil {
11672 return nil, err
11673 }
11674 req.Header = reqHeaders
11675 googleapi.Expand(req.URL, map[string]string{
11676 "fileId": c.fileId,
11677 "commentId": c.commentId,
11678 })
11679 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11680 }
11681
11682
11683
11684
11685
11686
11687
11688 func (c *RepliesListCall) Do(opts ...googleapi.CallOption) (*CommentReplyList, error) {
11689 gensupport.SetOptions(c.urlParams_, opts...)
11690 res, err := c.doRequest("json")
11691 if res != nil && res.StatusCode == http.StatusNotModified {
11692 if res.Body != nil {
11693 res.Body.Close()
11694 }
11695 return nil, gensupport.WrapError(&googleapi.Error{
11696 Code: res.StatusCode,
11697 Header: res.Header,
11698 })
11699 }
11700 if err != nil {
11701 return nil, err
11702 }
11703 defer googleapi.CloseBody(res)
11704 if err := googleapi.CheckResponse(res); err != nil {
11705 return nil, gensupport.WrapError(err)
11706 }
11707 ret := &CommentReplyList{
11708 ServerResponse: googleapi.ServerResponse{
11709 Header: res.Header,
11710 HTTPStatusCode: res.StatusCode,
11711 },
11712 }
11713 target := &ret
11714 if err := gensupport.DecodeResponse(target, res); err != nil {
11715 return nil, err
11716 }
11717 return ret, nil
11718 }
11719
11720
11721
11722
11723 func (c *RepliesListCall) Pages(ctx context.Context, f func(*CommentReplyList) error) error {
11724 c.ctx_ = ctx
11725 defer c.PageToken(c.urlParams_.Get("pageToken"))
11726 for {
11727 x, err := c.Do()
11728 if err != nil {
11729 return err
11730 }
11731 if err := f(x); err != nil {
11732 return err
11733 }
11734 if x.NextPageToken == "" {
11735 return nil
11736 }
11737 c.PageToken(x.NextPageToken)
11738 }
11739 }
11740
11741 type RepliesPatchCall struct {
11742 s *Service
11743 fileId string
11744 commentId string
11745 replyId string
11746 commentreply *CommentReply
11747 urlParams_ gensupport.URLParams
11748 ctx_ context.Context
11749 header_ http.Header
11750 }
11751
11752
11753
11754
11755
11756
11757 func (r *RepliesService) Patch(fileId string, commentId string, replyId string, commentreply *CommentReply) *RepliesPatchCall {
11758 c := &RepliesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11759 c.fileId = fileId
11760 c.commentId = commentId
11761 c.replyId = replyId
11762 c.commentreply = commentreply
11763 return c
11764 }
11765
11766
11767
11768
11769 func (c *RepliesPatchCall) Fields(s ...googleapi.Field) *RepliesPatchCall {
11770 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11771 return c
11772 }
11773
11774
11775 func (c *RepliesPatchCall) Context(ctx context.Context) *RepliesPatchCall {
11776 c.ctx_ = ctx
11777 return c
11778 }
11779
11780
11781
11782 func (c *RepliesPatchCall) Header() http.Header {
11783 if c.header_ == nil {
11784 c.header_ = make(http.Header)
11785 }
11786 return c.header_
11787 }
11788
11789 func (c *RepliesPatchCall) doRequest(alt string) (*http.Response, error) {
11790 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11791 var body io.Reader = nil
11792 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply)
11793 if err != nil {
11794 return nil, err
11795 }
11796 c.urlParams_.Set("alt", alt)
11797 c.urlParams_.Set("prettyPrint", "false")
11798 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}")
11799 urls += "?" + c.urlParams_.Encode()
11800 req, err := http.NewRequest("PATCH", urls, body)
11801 if err != nil {
11802 return nil, err
11803 }
11804 req.Header = reqHeaders
11805 googleapi.Expand(req.URL, map[string]string{
11806 "fileId": c.fileId,
11807 "commentId": c.commentId,
11808 "replyId": c.replyId,
11809 })
11810 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11811 }
11812
11813
11814
11815
11816
11817
11818 func (c *RepliesPatchCall) Do(opts ...googleapi.CallOption) (*CommentReply, error) {
11819 gensupport.SetOptions(c.urlParams_, opts...)
11820 res, err := c.doRequest("json")
11821 if res != nil && res.StatusCode == http.StatusNotModified {
11822 if res.Body != nil {
11823 res.Body.Close()
11824 }
11825 return nil, gensupport.WrapError(&googleapi.Error{
11826 Code: res.StatusCode,
11827 Header: res.Header,
11828 })
11829 }
11830 if err != nil {
11831 return nil, err
11832 }
11833 defer googleapi.CloseBody(res)
11834 if err := googleapi.CheckResponse(res); err != nil {
11835 return nil, gensupport.WrapError(err)
11836 }
11837 ret := &CommentReply{
11838 ServerResponse: googleapi.ServerResponse{
11839 Header: res.Header,
11840 HTTPStatusCode: res.StatusCode,
11841 },
11842 }
11843 target := &ret
11844 if err := gensupport.DecodeResponse(target, res); err != nil {
11845 return nil, err
11846 }
11847 return ret, nil
11848 }
11849
11850 type RepliesUpdateCall struct {
11851 s *Service
11852 fileId string
11853 commentId string
11854 replyId string
11855 commentreply *CommentReply
11856 urlParams_ gensupport.URLParams
11857 ctx_ context.Context
11858 header_ http.Header
11859 }
11860
11861
11862
11863
11864
11865
11866 func (r *RepliesService) Update(fileId string, commentId string, replyId string, commentreply *CommentReply) *RepliesUpdateCall {
11867 c := &RepliesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11868 c.fileId = fileId
11869 c.commentId = commentId
11870 c.replyId = replyId
11871 c.commentreply = commentreply
11872 return c
11873 }
11874
11875
11876
11877
11878 func (c *RepliesUpdateCall) Fields(s ...googleapi.Field) *RepliesUpdateCall {
11879 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11880 return c
11881 }
11882
11883
11884 func (c *RepliesUpdateCall) Context(ctx context.Context) *RepliesUpdateCall {
11885 c.ctx_ = ctx
11886 return c
11887 }
11888
11889
11890
11891 func (c *RepliesUpdateCall) Header() http.Header {
11892 if c.header_ == nil {
11893 c.header_ = make(http.Header)
11894 }
11895 return c.header_
11896 }
11897
11898 func (c *RepliesUpdateCall) doRequest(alt string) (*http.Response, error) {
11899 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11900 var body io.Reader = nil
11901 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply)
11902 if err != nil {
11903 return nil, err
11904 }
11905 c.urlParams_.Set("alt", alt)
11906 c.urlParams_.Set("prettyPrint", "false")
11907 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}")
11908 urls += "?" + c.urlParams_.Encode()
11909 req, err := http.NewRequest("PUT", urls, body)
11910 if err != nil {
11911 return nil, err
11912 }
11913 req.Header = reqHeaders
11914 googleapi.Expand(req.URL, map[string]string{
11915 "fileId": c.fileId,
11916 "commentId": c.commentId,
11917 "replyId": c.replyId,
11918 })
11919 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11920 }
11921
11922
11923
11924
11925
11926
11927 func (c *RepliesUpdateCall) Do(opts ...googleapi.CallOption) (*CommentReply, error) {
11928 gensupport.SetOptions(c.urlParams_, opts...)
11929 res, err := c.doRequest("json")
11930 if res != nil && res.StatusCode == http.StatusNotModified {
11931 if res.Body != nil {
11932 res.Body.Close()
11933 }
11934 return nil, gensupport.WrapError(&googleapi.Error{
11935 Code: res.StatusCode,
11936 Header: res.Header,
11937 })
11938 }
11939 if err != nil {
11940 return nil, err
11941 }
11942 defer googleapi.CloseBody(res)
11943 if err := googleapi.CheckResponse(res); err != nil {
11944 return nil, gensupport.WrapError(err)
11945 }
11946 ret := &CommentReply{
11947 ServerResponse: googleapi.ServerResponse{
11948 Header: res.Header,
11949 HTTPStatusCode: res.StatusCode,
11950 },
11951 }
11952 target := &ret
11953 if err := gensupport.DecodeResponse(target, res); err != nil {
11954 return nil, err
11955 }
11956 return ret, nil
11957 }
11958
11959 type RevisionsDeleteCall struct {
11960 s *Service
11961 fileId string
11962 revisionId string
11963 urlParams_ gensupport.URLParams
11964 ctx_ context.Context
11965 header_ http.Header
11966 }
11967
11968
11969
11970
11971
11972
11973
11974
11975 func (r *RevisionsService) Delete(fileId string, revisionId string) *RevisionsDeleteCall {
11976 c := &RevisionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11977 c.fileId = fileId
11978 c.revisionId = revisionId
11979 return c
11980 }
11981
11982
11983
11984
11985 func (c *RevisionsDeleteCall) Fields(s ...googleapi.Field) *RevisionsDeleteCall {
11986 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11987 return c
11988 }
11989
11990
11991 func (c *RevisionsDeleteCall) Context(ctx context.Context) *RevisionsDeleteCall {
11992 c.ctx_ = ctx
11993 return c
11994 }
11995
11996
11997
11998 func (c *RevisionsDeleteCall) Header() http.Header {
11999 if c.header_ == nil {
12000 c.header_ = make(http.Header)
12001 }
12002 return c.header_
12003 }
12004
12005 func (c *RevisionsDeleteCall) doRequest(alt string) (*http.Response, error) {
12006 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12007 var body io.Reader = nil
12008 c.urlParams_.Set("alt", alt)
12009 c.urlParams_.Set("prettyPrint", "false")
12010 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}")
12011 urls += "?" + c.urlParams_.Encode()
12012 req, err := http.NewRequest("DELETE", urls, body)
12013 if err != nil {
12014 return nil, err
12015 }
12016 req.Header = reqHeaders
12017 googleapi.Expand(req.URL, map[string]string{
12018 "fileId": c.fileId,
12019 "revisionId": c.revisionId,
12020 })
12021 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12022 }
12023
12024
12025 func (c *RevisionsDeleteCall) Do(opts ...googleapi.CallOption) error {
12026 gensupport.SetOptions(c.urlParams_, opts...)
12027 res, err := c.doRequest("json")
12028 if err != nil {
12029 return err
12030 }
12031 defer googleapi.CloseBody(res)
12032 if err := googleapi.CheckResponse(res); err != nil {
12033 return gensupport.WrapError(err)
12034 }
12035 return nil
12036 }
12037
12038 type RevisionsGetCall struct {
12039 s *Service
12040 fileId string
12041 revisionId string
12042 urlParams_ gensupport.URLParams
12043 ifNoneMatch_ string
12044 ctx_ context.Context
12045 header_ http.Header
12046 }
12047
12048
12049
12050
12051
12052 func (r *RevisionsService) Get(fileId string, revisionId string) *RevisionsGetCall {
12053 c := &RevisionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12054 c.fileId = fileId
12055 c.revisionId = revisionId
12056 return c
12057 }
12058
12059
12060
12061
12062 func (c *RevisionsGetCall) Fields(s ...googleapi.Field) *RevisionsGetCall {
12063 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12064 return c
12065 }
12066
12067
12068
12069
12070 func (c *RevisionsGetCall) IfNoneMatch(entityTag string) *RevisionsGetCall {
12071 c.ifNoneMatch_ = entityTag
12072 return c
12073 }
12074
12075
12076 func (c *RevisionsGetCall) Context(ctx context.Context) *RevisionsGetCall {
12077 c.ctx_ = ctx
12078 return c
12079 }
12080
12081
12082
12083 func (c *RevisionsGetCall) Header() http.Header {
12084 if c.header_ == nil {
12085 c.header_ = make(http.Header)
12086 }
12087 return c.header_
12088 }
12089
12090 func (c *RevisionsGetCall) doRequest(alt string) (*http.Response, error) {
12091 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12092 if c.ifNoneMatch_ != "" {
12093 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12094 }
12095 var body io.Reader = nil
12096 c.urlParams_.Set("alt", alt)
12097 c.urlParams_.Set("prettyPrint", "false")
12098 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}")
12099 urls += "?" + c.urlParams_.Encode()
12100 req, err := http.NewRequest("GET", urls, body)
12101 if err != nil {
12102 return nil, err
12103 }
12104 req.Header = reqHeaders
12105 googleapi.Expand(req.URL, map[string]string{
12106 "fileId": c.fileId,
12107 "revisionId": c.revisionId,
12108 })
12109 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12110 }
12111
12112
12113
12114
12115
12116
12117 func (c *RevisionsGetCall) Do(opts ...googleapi.CallOption) (*Revision, error) {
12118 gensupport.SetOptions(c.urlParams_, opts...)
12119 res, err := c.doRequest("json")
12120 if res != nil && res.StatusCode == http.StatusNotModified {
12121 if res.Body != nil {
12122 res.Body.Close()
12123 }
12124 return nil, gensupport.WrapError(&googleapi.Error{
12125 Code: res.StatusCode,
12126 Header: res.Header,
12127 })
12128 }
12129 if err != nil {
12130 return nil, err
12131 }
12132 defer googleapi.CloseBody(res)
12133 if err := googleapi.CheckResponse(res); err != nil {
12134 return nil, gensupport.WrapError(err)
12135 }
12136 ret := &Revision{
12137 ServerResponse: googleapi.ServerResponse{
12138 Header: res.Header,
12139 HTTPStatusCode: res.StatusCode,
12140 },
12141 }
12142 target := &ret
12143 if err := gensupport.DecodeResponse(target, res); err != nil {
12144 return nil, err
12145 }
12146 return ret, nil
12147 }
12148
12149 type RevisionsListCall struct {
12150 s *Service
12151 fileId string
12152 urlParams_ gensupport.URLParams
12153 ifNoneMatch_ string
12154 ctx_ context.Context
12155 header_ http.Header
12156 }
12157
12158
12159
12160
12161 func (r *RevisionsService) List(fileId string) *RevisionsListCall {
12162 c := &RevisionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12163 c.fileId = fileId
12164 return c
12165 }
12166
12167
12168
12169 func (c *RevisionsListCall) MaxResults(maxResults int64) *RevisionsListCall {
12170 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
12171 return c
12172 }
12173
12174
12175
12176
12177 func (c *RevisionsListCall) PageToken(pageToken string) *RevisionsListCall {
12178 c.urlParams_.Set("pageToken", pageToken)
12179 return c
12180 }
12181
12182
12183
12184
12185 func (c *RevisionsListCall) Fields(s ...googleapi.Field) *RevisionsListCall {
12186 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12187 return c
12188 }
12189
12190
12191
12192
12193 func (c *RevisionsListCall) IfNoneMatch(entityTag string) *RevisionsListCall {
12194 c.ifNoneMatch_ = entityTag
12195 return c
12196 }
12197
12198
12199 func (c *RevisionsListCall) Context(ctx context.Context) *RevisionsListCall {
12200 c.ctx_ = ctx
12201 return c
12202 }
12203
12204
12205
12206 func (c *RevisionsListCall) Header() http.Header {
12207 if c.header_ == nil {
12208 c.header_ = make(http.Header)
12209 }
12210 return c.header_
12211 }
12212
12213 func (c *RevisionsListCall) doRequest(alt string) (*http.Response, error) {
12214 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12215 if c.ifNoneMatch_ != "" {
12216 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12217 }
12218 var body io.Reader = nil
12219 c.urlParams_.Set("alt", alt)
12220 c.urlParams_.Set("prettyPrint", "false")
12221 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions")
12222 urls += "?" + c.urlParams_.Encode()
12223 req, err := http.NewRequest("GET", urls, body)
12224 if err != nil {
12225 return nil, err
12226 }
12227 req.Header = reqHeaders
12228 googleapi.Expand(req.URL, map[string]string{
12229 "fileId": c.fileId,
12230 })
12231 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12232 }
12233
12234
12235
12236
12237
12238
12239 func (c *RevisionsListCall) Do(opts ...googleapi.CallOption) (*RevisionList, error) {
12240 gensupport.SetOptions(c.urlParams_, opts...)
12241 res, err := c.doRequest("json")
12242 if res != nil && res.StatusCode == http.StatusNotModified {
12243 if res.Body != nil {
12244 res.Body.Close()
12245 }
12246 return nil, gensupport.WrapError(&googleapi.Error{
12247 Code: res.StatusCode,
12248 Header: res.Header,
12249 })
12250 }
12251 if err != nil {
12252 return nil, err
12253 }
12254 defer googleapi.CloseBody(res)
12255 if err := googleapi.CheckResponse(res); err != nil {
12256 return nil, gensupport.WrapError(err)
12257 }
12258 ret := &RevisionList{
12259 ServerResponse: googleapi.ServerResponse{
12260 Header: res.Header,
12261 HTTPStatusCode: res.StatusCode,
12262 },
12263 }
12264 target := &ret
12265 if err := gensupport.DecodeResponse(target, res); err != nil {
12266 return nil, err
12267 }
12268 return ret, nil
12269 }
12270
12271
12272
12273
12274 func (c *RevisionsListCall) Pages(ctx context.Context, f func(*RevisionList) error) error {
12275 c.ctx_ = ctx
12276 defer c.PageToken(c.urlParams_.Get("pageToken"))
12277 for {
12278 x, err := c.Do()
12279 if err != nil {
12280 return err
12281 }
12282 if err := f(x); err != nil {
12283 return err
12284 }
12285 if x.NextPageToken == "" {
12286 return nil
12287 }
12288 c.PageToken(x.NextPageToken)
12289 }
12290 }
12291
12292 type RevisionsPatchCall struct {
12293 s *Service
12294 fileId string
12295 revisionId string
12296 revision *Revision
12297 urlParams_ gensupport.URLParams
12298 ctx_ context.Context
12299 header_ http.Header
12300 }
12301
12302
12303
12304
12305
12306 func (r *RevisionsService) Patch(fileId string, revisionId string, revision *Revision) *RevisionsPatchCall {
12307 c := &RevisionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12308 c.fileId = fileId
12309 c.revisionId = revisionId
12310 c.revision = revision
12311 return c
12312 }
12313
12314
12315
12316
12317 func (c *RevisionsPatchCall) Fields(s ...googleapi.Field) *RevisionsPatchCall {
12318 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12319 return c
12320 }
12321
12322
12323 func (c *RevisionsPatchCall) Context(ctx context.Context) *RevisionsPatchCall {
12324 c.ctx_ = ctx
12325 return c
12326 }
12327
12328
12329
12330 func (c *RevisionsPatchCall) Header() http.Header {
12331 if c.header_ == nil {
12332 c.header_ = make(http.Header)
12333 }
12334 return c.header_
12335 }
12336
12337 func (c *RevisionsPatchCall) doRequest(alt string) (*http.Response, error) {
12338 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12339 var body io.Reader = nil
12340 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision)
12341 if err != nil {
12342 return nil, err
12343 }
12344 c.urlParams_.Set("alt", alt)
12345 c.urlParams_.Set("prettyPrint", "false")
12346 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}")
12347 urls += "?" + c.urlParams_.Encode()
12348 req, err := http.NewRequest("PATCH", urls, body)
12349 if err != nil {
12350 return nil, err
12351 }
12352 req.Header = reqHeaders
12353 googleapi.Expand(req.URL, map[string]string{
12354 "fileId": c.fileId,
12355 "revisionId": c.revisionId,
12356 })
12357 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12358 }
12359
12360
12361
12362
12363
12364
12365 func (c *RevisionsPatchCall) Do(opts ...googleapi.CallOption) (*Revision, error) {
12366 gensupport.SetOptions(c.urlParams_, opts...)
12367 res, err := c.doRequest("json")
12368 if res != nil && res.StatusCode == http.StatusNotModified {
12369 if res.Body != nil {
12370 res.Body.Close()
12371 }
12372 return nil, gensupport.WrapError(&googleapi.Error{
12373 Code: res.StatusCode,
12374 Header: res.Header,
12375 })
12376 }
12377 if err != nil {
12378 return nil, err
12379 }
12380 defer googleapi.CloseBody(res)
12381 if err := googleapi.CheckResponse(res); err != nil {
12382 return nil, gensupport.WrapError(err)
12383 }
12384 ret := &Revision{
12385 ServerResponse: googleapi.ServerResponse{
12386 Header: res.Header,
12387 HTTPStatusCode: res.StatusCode,
12388 },
12389 }
12390 target := &ret
12391 if err := gensupport.DecodeResponse(target, res); err != nil {
12392 return nil, err
12393 }
12394 return ret, nil
12395 }
12396
12397 type RevisionsUpdateCall struct {
12398 s *Service
12399 fileId string
12400 revisionId string
12401 revision *Revision
12402 urlParams_ gensupport.URLParams
12403 ctx_ context.Context
12404 header_ http.Header
12405 }
12406
12407
12408
12409
12410
12411 func (r *RevisionsService) Update(fileId string, revisionId string, revision *Revision) *RevisionsUpdateCall {
12412 c := &RevisionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12413 c.fileId = fileId
12414 c.revisionId = revisionId
12415 c.revision = revision
12416 return c
12417 }
12418
12419
12420
12421
12422 func (c *RevisionsUpdateCall) Fields(s ...googleapi.Field) *RevisionsUpdateCall {
12423 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12424 return c
12425 }
12426
12427
12428 func (c *RevisionsUpdateCall) Context(ctx context.Context) *RevisionsUpdateCall {
12429 c.ctx_ = ctx
12430 return c
12431 }
12432
12433
12434
12435 func (c *RevisionsUpdateCall) Header() http.Header {
12436 if c.header_ == nil {
12437 c.header_ = make(http.Header)
12438 }
12439 return c.header_
12440 }
12441
12442 func (c *RevisionsUpdateCall) doRequest(alt string) (*http.Response, error) {
12443 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12444 var body io.Reader = nil
12445 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision)
12446 if err != nil {
12447 return nil, err
12448 }
12449 c.urlParams_.Set("alt", alt)
12450 c.urlParams_.Set("prettyPrint", "false")
12451 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}")
12452 urls += "?" + c.urlParams_.Encode()
12453 req, err := http.NewRequest("PUT", urls, body)
12454 if err != nil {
12455 return nil, err
12456 }
12457 req.Header = reqHeaders
12458 googleapi.Expand(req.URL, map[string]string{
12459 "fileId": c.fileId,
12460 "revisionId": c.revisionId,
12461 })
12462 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12463 }
12464
12465
12466
12467
12468
12469
12470 func (c *RevisionsUpdateCall) Do(opts ...googleapi.CallOption) (*Revision, error) {
12471 gensupport.SetOptions(c.urlParams_, opts...)
12472 res, err := c.doRequest("json")
12473 if res != nil && res.StatusCode == http.StatusNotModified {
12474 if res.Body != nil {
12475 res.Body.Close()
12476 }
12477 return nil, gensupport.WrapError(&googleapi.Error{
12478 Code: res.StatusCode,
12479 Header: res.Header,
12480 })
12481 }
12482 if err != nil {
12483 return nil, err
12484 }
12485 defer googleapi.CloseBody(res)
12486 if err := googleapi.CheckResponse(res); err != nil {
12487 return nil, gensupport.WrapError(err)
12488 }
12489 ret := &Revision{
12490 ServerResponse: googleapi.ServerResponse{
12491 Header: res.Header,
12492 HTTPStatusCode: res.StatusCode,
12493 },
12494 }
12495 target := &ret
12496 if err := gensupport.DecodeResponse(target, res); err != nil {
12497 return nil, err
12498 }
12499 return ret, nil
12500 }
12501
12502 type TeamdrivesDeleteCall struct {
12503 s *Service
12504 teamDriveId string
12505 urlParams_ gensupport.URLParams
12506 ctx_ context.Context
12507 header_ http.Header
12508 }
12509
12510
12511
12512
12513 func (r *TeamdrivesService) Delete(teamDriveId string) *TeamdrivesDeleteCall {
12514 c := &TeamdrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12515 c.teamDriveId = teamDriveId
12516 return c
12517 }
12518
12519
12520
12521
12522 func (c *TeamdrivesDeleteCall) Fields(s ...googleapi.Field) *TeamdrivesDeleteCall {
12523 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12524 return c
12525 }
12526
12527
12528 func (c *TeamdrivesDeleteCall) Context(ctx context.Context) *TeamdrivesDeleteCall {
12529 c.ctx_ = ctx
12530 return c
12531 }
12532
12533
12534
12535 func (c *TeamdrivesDeleteCall) Header() http.Header {
12536 if c.header_ == nil {
12537 c.header_ = make(http.Header)
12538 }
12539 return c.header_
12540 }
12541
12542 func (c *TeamdrivesDeleteCall) doRequest(alt string) (*http.Response, error) {
12543 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12544 var body io.Reader = nil
12545 c.urlParams_.Set("alt", alt)
12546 c.urlParams_.Set("prettyPrint", "false")
12547 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}")
12548 urls += "?" + c.urlParams_.Encode()
12549 req, err := http.NewRequest("DELETE", urls, body)
12550 if err != nil {
12551 return nil, err
12552 }
12553 req.Header = reqHeaders
12554 googleapi.Expand(req.URL, map[string]string{
12555 "teamDriveId": c.teamDriveId,
12556 })
12557 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12558 }
12559
12560
12561 func (c *TeamdrivesDeleteCall) Do(opts ...googleapi.CallOption) error {
12562 gensupport.SetOptions(c.urlParams_, opts...)
12563 res, err := c.doRequest("json")
12564 if err != nil {
12565 return err
12566 }
12567 defer googleapi.CloseBody(res)
12568 if err := googleapi.CheckResponse(res); err != nil {
12569 return gensupport.WrapError(err)
12570 }
12571 return nil
12572 }
12573
12574 type TeamdrivesGetCall struct {
12575 s *Service
12576 teamDriveId string
12577 urlParams_ gensupport.URLParams
12578 ifNoneMatch_ string
12579 ctx_ context.Context
12580 header_ http.Header
12581 }
12582
12583
12584
12585
12586 func (r *TeamdrivesService) Get(teamDriveId string) *TeamdrivesGetCall {
12587 c := &TeamdrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12588 c.teamDriveId = teamDriveId
12589 return c
12590 }
12591
12592
12593
12594
12595
12596 func (c *TeamdrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesGetCall {
12597 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
12598 return c
12599 }
12600
12601
12602
12603
12604 func (c *TeamdrivesGetCall) Fields(s ...googleapi.Field) *TeamdrivesGetCall {
12605 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12606 return c
12607 }
12608
12609
12610
12611
12612 func (c *TeamdrivesGetCall) IfNoneMatch(entityTag string) *TeamdrivesGetCall {
12613 c.ifNoneMatch_ = entityTag
12614 return c
12615 }
12616
12617
12618 func (c *TeamdrivesGetCall) Context(ctx context.Context) *TeamdrivesGetCall {
12619 c.ctx_ = ctx
12620 return c
12621 }
12622
12623
12624
12625 func (c *TeamdrivesGetCall) Header() http.Header {
12626 if c.header_ == nil {
12627 c.header_ = make(http.Header)
12628 }
12629 return c.header_
12630 }
12631
12632 func (c *TeamdrivesGetCall) doRequest(alt string) (*http.Response, error) {
12633 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12634 if c.ifNoneMatch_ != "" {
12635 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12636 }
12637 var body io.Reader = nil
12638 c.urlParams_.Set("alt", alt)
12639 c.urlParams_.Set("prettyPrint", "false")
12640 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}")
12641 urls += "?" + c.urlParams_.Encode()
12642 req, err := http.NewRequest("GET", urls, body)
12643 if err != nil {
12644 return nil, err
12645 }
12646 req.Header = reqHeaders
12647 googleapi.Expand(req.URL, map[string]string{
12648 "teamDriveId": c.teamDriveId,
12649 })
12650 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12651 }
12652
12653
12654
12655
12656
12657
12658 func (c *TeamdrivesGetCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) {
12659 gensupport.SetOptions(c.urlParams_, opts...)
12660 res, err := c.doRequest("json")
12661 if res != nil && res.StatusCode == http.StatusNotModified {
12662 if res.Body != nil {
12663 res.Body.Close()
12664 }
12665 return nil, gensupport.WrapError(&googleapi.Error{
12666 Code: res.StatusCode,
12667 Header: res.Header,
12668 })
12669 }
12670 if err != nil {
12671 return nil, err
12672 }
12673 defer googleapi.CloseBody(res)
12674 if err := googleapi.CheckResponse(res); err != nil {
12675 return nil, gensupport.WrapError(err)
12676 }
12677 ret := &TeamDrive{
12678 ServerResponse: googleapi.ServerResponse{
12679 Header: res.Header,
12680 HTTPStatusCode: res.StatusCode,
12681 },
12682 }
12683 target := &ret
12684 if err := gensupport.DecodeResponse(target, res); err != nil {
12685 return nil, err
12686 }
12687 return ret, nil
12688 }
12689
12690 type TeamdrivesInsertCall struct {
12691 s *Service
12692 teamdrive *TeamDrive
12693 urlParams_ gensupport.URLParams
12694 ctx_ context.Context
12695 header_ http.Header
12696 }
12697
12698
12699
12700
12701
12702
12703
12704
12705 func (r *TeamdrivesService) Insert(requestId string, teamdrive *TeamDrive) *TeamdrivesInsertCall {
12706 c := &TeamdrivesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12707 c.urlParams_.Set("requestId", requestId)
12708 c.teamdrive = teamdrive
12709 return c
12710 }
12711
12712
12713
12714
12715 func (c *TeamdrivesInsertCall) Fields(s ...googleapi.Field) *TeamdrivesInsertCall {
12716 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12717 return c
12718 }
12719
12720
12721 func (c *TeamdrivesInsertCall) Context(ctx context.Context) *TeamdrivesInsertCall {
12722 c.ctx_ = ctx
12723 return c
12724 }
12725
12726
12727
12728 func (c *TeamdrivesInsertCall) Header() http.Header {
12729 if c.header_ == nil {
12730 c.header_ = make(http.Header)
12731 }
12732 return c.header_
12733 }
12734
12735 func (c *TeamdrivesInsertCall) doRequest(alt string) (*http.Response, error) {
12736 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12737 var body io.Reader = nil
12738 body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive)
12739 if err != nil {
12740 return nil, err
12741 }
12742 c.urlParams_.Set("alt", alt)
12743 c.urlParams_.Set("prettyPrint", "false")
12744 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives")
12745 urls += "?" + c.urlParams_.Encode()
12746 req, err := http.NewRequest("POST", urls, body)
12747 if err != nil {
12748 return nil, err
12749 }
12750 req.Header = reqHeaders
12751 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12752 }
12753
12754
12755
12756
12757
12758
12759 func (c *TeamdrivesInsertCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) {
12760 gensupport.SetOptions(c.urlParams_, opts...)
12761 res, err := c.doRequest("json")
12762 if res != nil && res.StatusCode == http.StatusNotModified {
12763 if res.Body != nil {
12764 res.Body.Close()
12765 }
12766 return nil, gensupport.WrapError(&googleapi.Error{
12767 Code: res.StatusCode,
12768 Header: res.Header,
12769 })
12770 }
12771 if err != nil {
12772 return nil, err
12773 }
12774 defer googleapi.CloseBody(res)
12775 if err := googleapi.CheckResponse(res); err != nil {
12776 return nil, gensupport.WrapError(err)
12777 }
12778 ret := &TeamDrive{
12779 ServerResponse: googleapi.ServerResponse{
12780 Header: res.Header,
12781 HTTPStatusCode: res.StatusCode,
12782 },
12783 }
12784 target := &ret
12785 if err := gensupport.DecodeResponse(target, res); err != nil {
12786 return nil, err
12787 }
12788 return ret, nil
12789 }
12790
12791 type TeamdrivesListCall struct {
12792 s *Service
12793 urlParams_ gensupport.URLParams
12794 ifNoneMatch_ string
12795 ctx_ context.Context
12796 header_ http.Header
12797 }
12798
12799
12800 func (r *TeamdrivesService) List() *TeamdrivesListCall {
12801 c := &TeamdrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12802 return c
12803 }
12804
12805
12806
12807 func (c *TeamdrivesListCall) MaxResults(maxResults int64) *TeamdrivesListCall {
12808 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
12809 return c
12810 }
12811
12812
12813
12814 func (c *TeamdrivesListCall) PageToken(pageToken string) *TeamdrivesListCall {
12815 c.urlParams_.Set("pageToken", pageToken)
12816 return c
12817 }
12818
12819
12820 func (c *TeamdrivesListCall) Q(q string) *TeamdrivesListCall {
12821 c.urlParams_.Set("q", q)
12822 return c
12823 }
12824
12825
12826
12827
12828
12829 func (c *TeamdrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesListCall {
12830 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
12831 return c
12832 }
12833
12834
12835
12836
12837 func (c *TeamdrivesListCall) Fields(s ...googleapi.Field) *TeamdrivesListCall {
12838 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12839 return c
12840 }
12841
12842
12843
12844
12845 func (c *TeamdrivesListCall) IfNoneMatch(entityTag string) *TeamdrivesListCall {
12846 c.ifNoneMatch_ = entityTag
12847 return c
12848 }
12849
12850
12851 func (c *TeamdrivesListCall) Context(ctx context.Context) *TeamdrivesListCall {
12852 c.ctx_ = ctx
12853 return c
12854 }
12855
12856
12857
12858 func (c *TeamdrivesListCall) Header() http.Header {
12859 if c.header_ == nil {
12860 c.header_ = make(http.Header)
12861 }
12862 return c.header_
12863 }
12864
12865 func (c *TeamdrivesListCall) doRequest(alt string) (*http.Response, error) {
12866 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12867 if c.ifNoneMatch_ != "" {
12868 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12869 }
12870 var body io.Reader = nil
12871 c.urlParams_.Set("alt", alt)
12872 c.urlParams_.Set("prettyPrint", "false")
12873 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives")
12874 urls += "?" + c.urlParams_.Encode()
12875 req, err := http.NewRequest("GET", urls, body)
12876 if err != nil {
12877 return nil, err
12878 }
12879 req.Header = reqHeaders
12880 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12881 }
12882
12883
12884
12885
12886
12887
12888 func (c *TeamdrivesListCall) Do(opts ...googleapi.CallOption) (*TeamDriveList, error) {
12889 gensupport.SetOptions(c.urlParams_, opts...)
12890 res, err := c.doRequest("json")
12891 if res != nil && res.StatusCode == http.StatusNotModified {
12892 if res.Body != nil {
12893 res.Body.Close()
12894 }
12895 return nil, gensupport.WrapError(&googleapi.Error{
12896 Code: res.StatusCode,
12897 Header: res.Header,
12898 })
12899 }
12900 if err != nil {
12901 return nil, err
12902 }
12903 defer googleapi.CloseBody(res)
12904 if err := googleapi.CheckResponse(res); err != nil {
12905 return nil, gensupport.WrapError(err)
12906 }
12907 ret := &TeamDriveList{
12908 ServerResponse: googleapi.ServerResponse{
12909 Header: res.Header,
12910 HTTPStatusCode: res.StatusCode,
12911 },
12912 }
12913 target := &ret
12914 if err := gensupport.DecodeResponse(target, res); err != nil {
12915 return nil, err
12916 }
12917 return ret, nil
12918 }
12919
12920
12921
12922
12923 func (c *TeamdrivesListCall) Pages(ctx context.Context, f func(*TeamDriveList) error) error {
12924 c.ctx_ = ctx
12925 defer c.PageToken(c.urlParams_.Get("pageToken"))
12926 for {
12927 x, err := c.Do()
12928 if err != nil {
12929 return err
12930 }
12931 if err := f(x); err != nil {
12932 return err
12933 }
12934 if x.NextPageToken == "" {
12935 return nil
12936 }
12937 c.PageToken(x.NextPageToken)
12938 }
12939 }
12940
12941 type TeamdrivesUpdateCall struct {
12942 s *Service
12943 teamDriveId string
12944 teamdrive *TeamDrive
12945 urlParams_ gensupport.URLParams
12946 ctx_ context.Context
12947 header_ http.Header
12948 }
12949
12950
12951
12952
12953 func (r *TeamdrivesService) Update(teamDriveId string, teamdrive *TeamDrive) *TeamdrivesUpdateCall {
12954 c := &TeamdrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12955 c.teamDriveId = teamDriveId
12956 c.teamdrive = teamdrive
12957 return c
12958 }
12959
12960
12961
12962
12963
12964 func (c *TeamdrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesUpdateCall {
12965 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
12966 return c
12967 }
12968
12969
12970
12971
12972 func (c *TeamdrivesUpdateCall) Fields(s ...googleapi.Field) *TeamdrivesUpdateCall {
12973 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12974 return c
12975 }
12976
12977
12978 func (c *TeamdrivesUpdateCall) Context(ctx context.Context) *TeamdrivesUpdateCall {
12979 c.ctx_ = ctx
12980 return c
12981 }
12982
12983
12984
12985 func (c *TeamdrivesUpdateCall) Header() http.Header {
12986 if c.header_ == nil {
12987 c.header_ = make(http.Header)
12988 }
12989 return c.header_
12990 }
12991
12992 func (c *TeamdrivesUpdateCall) doRequest(alt string) (*http.Response, error) {
12993 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12994 var body io.Reader = nil
12995 body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive)
12996 if err != nil {
12997 return nil, err
12998 }
12999 c.urlParams_.Set("alt", alt)
13000 c.urlParams_.Set("prettyPrint", "false")
13001 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}")
13002 urls += "?" + c.urlParams_.Encode()
13003 req, err := http.NewRequest("PUT", urls, body)
13004 if err != nil {
13005 return nil, err
13006 }
13007 req.Header = reqHeaders
13008 googleapi.Expand(req.URL, map[string]string{
13009 "teamDriveId": c.teamDriveId,
13010 })
13011 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13012 }
13013
13014
13015
13016
13017
13018
13019 func (c *TeamdrivesUpdateCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) {
13020 gensupport.SetOptions(c.urlParams_, opts...)
13021 res, err := c.doRequest("json")
13022 if res != nil && res.StatusCode == http.StatusNotModified {
13023 if res.Body != nil {
13024 res.Body.Close()
13025 }
13026 return nil, gensupport.WrapError(&googleapi.Error{
13027 Code: res.StatusCode,
13028 Header: res.Header,
13029 })
13030 }
13031 if err != nil {
13032 return nil, err
13033 }
13034 defer googleapi.CloseBody(res)
13035 if err := googleapi.CheckResponse(res); err != nil {
13036 return nil, gensupport.WrapError(err)
13037 }
13038 ret := &TeamDrive{
13039 ServerResponse: googleapi.ServerResponse{
13040 Header: res.Header,
13041 HTTPStatusCode: res.StatusCode,
13042 },
13043 }
13044 target := &ret
13045 if err := gensupport.DecodeResponse(target, res); err != nil {
13046 return nil, err
13047 }
13048 return ret, nil
13049 }
13050
View as plain text