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 package storage
45
46 import (
47 "bytes"
48 "context"
49 "encoding/json"
50 "errors"
51 "fmt"
52 "io"
53 "net/http"
54 "net/url"
55 "strconv"
56 "strings"
57
58 googleapi "google.golang.org/api/googleapi"
59 gensupport "google.golang.org/api/internal/gensupport"
60 option "google.golang.org/api/option"
61 internaloption "google.golang.org/api/option/internaloption"
62 htransport "google.golang.org/api/transport/http"
63 )
64
65
66
67 var _ = bytes.NewBuffer
68 var _ = strconv.Itoa
69 var _ = fmt.Sprintf
70 var _ = json.NewDecoder
71 var _ = io.Copy
72 var _ = url.Parse
73 var _ = gensupport.MarshalJSON
74 var _ = googleapi.Version
75 var _ = errors.New
76 var _ = strings.Replace
77 var _ = context.Canceled
78 var _ = internaloption.WithDefaultEndpoint
79
80 const apiId = "storage:v1beta2"
81 const apiName = "storage"
82 const apiVersion = "v1beta2"
83 const basePath = "https://storage.googleapis.com/storage/v1beta2/"
84
85
86 const (
87
88 DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
89
90
91 DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
92
93
94 DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
95 )
96
97
98 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
99 scopesOption := option.WithScopes(
100 "https://www.googleapis.com/auth/devstorage.full_control",
101 "https://www.googleapis.com/auth/devstorage.read_only",
102 "https://www.googleapis.com/auth/devstorage.read_write",
103 )
104
105 opts = append([]option.ClientOption{scopesOption}, opts...)
106 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
107 client, endpoint, err := htransport.NewClient(ctx, opts...)
108 if err != nil {
109 return nil, err
110 }
111 s, err := New(client)
112 if err != nil {
113 return nil, err
114 }
115 if endpoint != "" {
116 s.BasePath = endpoint
117 }
118 return s, nil
119 }
120
121
122
123
124
125
126 func New(client *http.Client) (*Service, error) {
127 if client == nil {
128 return nil, errors.New("client is nil")
129 }
130 s := &Service{client: client, BasePath: basePath}
131 s.BucketAccessControls = NewBucketAccessControlsService(s)
132 s.Buckets = NewBucketsService(s)
133 s.Channels = NewChannelsService(s)
134 s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
135 s.ObjectAccessControls = NewObjectAccessControlsService(s)
136 s.Objects = NewObjectsService(s)
137 return s, nil
138 }
139
140 type Service struct {
141 client *http.Client
142 BasePath string
143 UserAgent string
144
145 BucketAccessControls *BucketAccessControlsService
146
147 Buckets *BucketsService
148
149 Channels *ChannelsService
150
151 DefaultObjectAccessControls *DefaultObjectAccessControlsService
152
153 ObjectAccessControls *ObjectAccessControlsService
154
155 Objects *ObjectsService
156 }
157
158 func (s *Service) userAgent() string {
159 if s.UserAgent == "" {
160 return googleapi.UserAgent
161 }
162 return googleapi.UserAgent + " " + s.UserAgent
163 }
164
165 func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
166 rs := &BucketAccessControlsService{s: s}
167 return rs
168 }
169
170 type BucketAccessControlsService struct {
171 s *Service
172 }
173
174 func NewBucketsService(s *Service) *BucketsService {
175 rs := &BucketsService{s: s}
176 return rs
177 }
178
179 type BucketsService struct {
180 s *Service
181 }
182
183 func NewChannelsService(s *Service) *ChannelsService {
184 rs := &ChannelsService{s: s}
185 return rs
186 }
187
188 type ChannelsService struct {
189 s *Service
190 }
191
192 func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
193 rs := &DefaultObjectAccessControlsService{s: s}
194 return rs
195 }
196
197 type DefaultObjectAccessControlsService struct {
198 s *Service
199 }
200
201 func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
202 rs := &ObjectAccessControlsService{s: s}
203 return rs
204 }
205
206 type ObjectAccessControlsService struct {
207 s *Service
208 }
209
210 func NewObjectsService(s *Service) *ObjectsService {
211 rs := &ObjectsService{s: s}
212 return rs
213 }
214
215 type ObjectsService struct {
216 s *Service
217 }
218
219
220 type Bucket struct {
221
222 Acl []*BucketAccessControl `json:"acl,omitempty"`
223
224
225
226 Cors []*BucketCors `json:"cors,omitempty"`
227
228
229
230 DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
231
232
233 Etag string `json:"etag,omitempty"`
234
235
236 Id string `json:"id,omitempty"`
237
238
239
240 Kind string `json:"kind,omitempty"`
241
242
243
244 Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
245
246
247
248
249
250 Location string `json:"location,omitempty"`
251
252
253
254
255 Logging *BucketLogging `json:"logging,omitempty"`
256
257
258 Metageneration int64 `json:"metageneration,omitempty,string"`
259
260
261 Name string `json:"name,omitempty"`
262
263
264
265 Owner *BucketOwner `json:"owner,omitempty"`
266
267
268 SelfLink string `json:"selfLink,omitempty"`
269
270
271
272
273
274
275 StorageClass string `json:"storageClass,omitempty"`
276
277
278 TimeCreated string `json:"timeCreated,omitempty"`
279
280
281 Versioning *BucketVersioning `json:"versioning,omitempty"`
282
283
284 Website *BucketWebsite `json:"website,omitempty"`
285
286
287
288 googleapi.ServerResponse `json:"-"`
289
290
291
292
293
294
295
296 ForceSendFields []string `json:"-"`
297
298
299
300
301
302
303
304 NullFields []string `json:"-"`
305 }
306
307 func (s *Bucket) MarshalJSON() ([]byte, error) {
308 type NoMethod Bucket
309 raw := NoMethod(*s)
310 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
311 }
312
313 type BucketCors struct {
314
315
316 MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"`
317
318
319
320
321 Method []string `json:"method,omitempty"`
322
323
324
325
326 Origin []string `json:"origin,omitempty"`
327
328
329
330
331 ResponseHeader []string `json:"responseHeader,omitempty"`
332
333
334
335
336
337
338
339 ForceSendFields []string `json:"-"`
340
341
342
343
344
345
346
347 NullFields []string `json:"-"`
348 }
349
350 func (s *BucketCors) MarshalJSON() ([]byte, error) {
351 type NoMethod BucketCors
352 raw := NoMethod(*s)
353 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
354 }
355
356
357
358 type BucketLifecycle struct {
359
360
361 Rule []*BucketLifecycleRule `json:"rule,omitempty"`
362
363
364
365
366
367
368
369 ForceSendFields []string `json:"-"`
370
371
372
373
374
375
376
377 NullFields []string `json:"-"`
378 }
379
380 func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
381 type NoMethod BucketLifecycle
382 raw := NoMethod(*s)
383 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
384 }
385
386 type BucketLifecycleRule struct {
387
388 Action *BucketLifecycleRuleAction `json:"action,omitempty"`
389
390
391 Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
392
393
394
395
396
397
398
399 ForceSendFields []string `json:"-"`
400
401
402
403
404
405
406
407 NullFields []string `json:"-"`
408 }
409
410 func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
411 type NoMethod BucketLifecycleRule
412 raw := NoMethod(*s)
413 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
414 }
415
416
417 type BucketLifecycleRuleAction struct {
418
419 Type string `json:"type,omitempty"`
420
421
422
423
424
425
426
427 ForceSendFields []string `json:"-"`
428
429
430
431
432
433
434
435 NullFields []string `json:"-"`
436 }
437
438 func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
439 type NoMethod BucketLifecycleRuleAction
440 raw := NoMethod(*s)
441 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
442 }
443
444
445
446 type BucketLifecycleRuleCondition struct {
447
448
449 Age int64 `json:"age,omitempty"`
450
451
452
453
454 CreatedBefore string `json:"createdBefore,omitempty"`
455
456
457
458
459 IsLive *bool `json:"isLive,omitempty"`
460
461
462
463
464 NumNewerVersions int64 `json:"numNewerVersions,omitempty"`
465
466
467
468
469
470
471
472 ForceSendFields []string `json:"-"`
473
474
475
476
477
478
479
480 NullFields []string `json:"-"`
481 }
482
483 func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
484 type NoMethod BucketLifecycleRuleCondition
485 raw := NoMethod(*s)
486 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
487 }
488
489
490
491
492 type BucketLogging struct {
493
494
495 LogBucket string `json:"logBucket,omitempty"`
496
497
498 LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
499
500
501
502
503
504
505
506 ForceSendFields []string `json:"-"`
507
508
509
510
511
512
513
514 NullFields []string `json:"-"`
515 }
516
517 func (s *BucketLogging) MarshalJSON() ([]byte, error) {
518 type NoMethod BucketLogging
519 raw := NoMethod(*s)
520 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
521 }
522
523
524
525 type BucketOwner struct {
526
527 Entity string `json:"entity,omitempty"`
528
529
530 EntityId string `json:"entityId,omitempty"`
531
532
533
534
535
536
537
538 ForceSendFields []string `json:"-"`
539
540
541
542
543
544
545
546 NullFields []string `json:"-"`
547 }
548
549 func (s *BucketOwner) MarshalJSON() ([]byte, error) {
550 type NoMethod BucketOwner
551 raw := NoMethod(*s)
552 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
553 }
554
555
556 type BucketVersioning struct {
557
558
559 Enabled bool `json:"enabled,omitempty"`
560
561
562
563
564
565
566
567 ForceSendFields []string `json:"-"`
568
569
570
571
572
573
574
575 NullFields []string `json:"-"`
576 }
577
578 func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
579 type NoMethod BucketVersioning
580 raw := NoMethod(*s)
581 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
582 }
583
584
585 type BucketWebsite struct {
586
587
588 MainPageSuffix string `json:"mainPageSuffix,omitempty"`
589
590
591
592 NotFoundPage string `json:"notFoundPage,omitempty"`
593
594
595
596
597
598
599
600 ForceSendFields []string `json:"-"`
601
602
603
604
605
606
607
608
609 NullFields []string `json:"-"`
610 }
611
612 func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
613 type NoMethod BucketWebsite
614 raw := NoMethod(*s)
615 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
616 }
617
618
619 type BucketAccessControl struct {
620
621 Bucket string `json:"bucket,omitempty"`
622
623
624 Domain string `json:"domain,omitempty"`
625
626
627 Email string `json:"email,omitempty"`
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643 Entity string `json:"entity,omitempty"`
644
645
646 EntityId string `json:"entityId,omitempty"`
647
648
649 Etag string `json:"etag,omitempty"`
650
651
652 Id string `json:"id,omitempty"`
653
654
655
656 Kind string `json:"kind,omitempty"`
657
658
659
660 Role string `json:"role,omitempty"`
661
662
663 SelfLink string `json:"selfLink,omitempty"`
664
665
666
667 googleapi.ServerResponse `json:"-"`
668
669
670
671
672
673
674
675 ForceSendFields []string `json:"-"`
676
677
678
679
680
681
682
683 NullFields []string `json:"-"`
684 }
685
686 func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
687 type NoMethod BucketAccessControl
688 raw := NoMethod(*s)
689 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
690 }
691
692
693 type BucketAccessControls struct {
694
695 Items []*BucketAccessControl `json:"items,omitempty"`
696
697
698
699 Kind string `json:"kind,omitempty"`
700
701
702
703 googleapi.ServerResponse `json:"-"`
704
705
706
707
708
709
710
711 ForceSendFields []string `json:"-"`
712
713
714
715
716
717
718
719 NullFields []string `json:"-"`
720 }
721
722 func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
723 type NoMethod BucketAccessControls
724 raw := NoMethod(*s)
725 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
726 }
727
728
729 type Buckets struct {
730
731 Items []*Bucket `json:"items,omitempty"`
732
733
734
735 Kind string `json:"kind,omitempty"`
736
737
738
739
740 NextPageToken string `json:"nextPageToken,omitempty"`
741
742
743
744 googleapi.ServerResponse `json:"-"`
745
746
747
748
749
750
751
752 ForceSendFields []string `json:"-"`
753
754
755
756
757
758
759
760 NullFields []string `json:"-"`
761 }
762
763 func (s *Buckets) MarshalJSON() ([]byte, error) {
764 type NoMethod Buckets
765 raw := NoMethod(*s)
766 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
767 }
768
769
770 type Channel struct {
771
772
773 Address string `json:"address,omitempty"`
774
775
776
777 Expiration int64 `json:"expiration,omitempty,string"`
778
779
780 Id string `json:"id,omitempty"`
781
782
783
784 Kind string `json:"kind,omitempty"`
785
786
787
788 Params map[string]string `json:"params,omitempty"`
789
790
791
792 Payload bool `json:"payload,omitempty"`
793
794
795
796 ResourceId string `json:"resourceId,omitempty"`
797
798
799 ResourceUri string `json:"resourceUri,omitempty"`
800
801
802
803 Token string `json:"token,omitempty"`
804
805
806 Type string `json:"type,omitempty"`
807
808
809
810 googleapi.ServerResponse `json:"-"`
811
812
813
814
815
816
817
818 ForceSendFields []string `json:"-"`
819
820
821
822
823
824
825
826 NullFields []string `json:"-"`
827 }
828
829 func (s *Channel) MarshalJSON() ([]byte, error) {
830 type NoMethod Channel
831 raw := NoMethod(*s)
832 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
833 }
834
835
836 type ComposeRequest struct {
837
838 Destination *Object `json:"destination,omitempty"`
839
840
841 Kind string `json:"kind,omitempty"`
842
843
844
845 SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
846
847
848
849
850
851
852
853 ForceSendFields []string `json:"-"`
854
855
856
857
858
859
860
861 NullFields []string `json:"-"`
862 }
863
864 func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
865 type NoMethod ComposeRequest
866 raw := NoMethod(*s)
867 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
868 }
869
870 type ComposeRequestSourceObjects struct {
871
872 Generation int64 `json:"generation,omitempty,string"`
873
874
875
876 Name string `json:"name,omitempty"`
877
878
879
880 ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
881
882
883
884
885
886
887
888 ForceSendFields []string `json:"-"`
889
890
891
892
893
894
895
896 NullFields []string `json:"-"`
897 }
898
899 func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
900 type NoMethod ComposeRequestSourceObjects
901 raw := NoMethod(*s)
902 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
903 }
904
905
906
907 type ComposeRequestSourceObjectsObjectPreconditions struct {
908
909
910
911
912 IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"`
913
914
915
916
917
918
919
920 ForceSendFields []string `json:"-"`
921
922
923
924
925
926
927
928
929 NullFields []string `json:"-"`
930 }
931
932 func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
933 type NoMethod ComposeRequestSourceObjectsObjectPreconditions
934 raw := NoMethod(*s)
935 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
936 }
937
938
939 type Object struct {
940
941 Acl []*ObjectAccessControl `json:"acl,omitempty"`
942
943
944 Bucket string `json:"bucket,omitempty"`
945
946
947 CacheControl string `json:"cacheControl,omitempty"`
948
949
950
951
952 ComponentCount int64 `json:"componentCount,omitempty"`
953
954
955 ContentDisposition string `json:"contentDisposition,omitempty"`
956
957
958 ContentEncoding string `json:"contentEncoding,omitempty"`
959
960
961 ContentLanguage string `json:"contentLanguage,omitempty"`
962
963
964 ContentType string `json:"contentType,omitempty"`
965
966
967
968 Crc32c string `json:"crc32c,omitempty"`
969
970
971 Etag string `json:"etag,omitempty"`
972
973
974
975 Generation int64 `json:"generation,omitempty,string"`
976
977
978 Id string `json:"id,omitempty"`
979
980
981
982 Kind string `json:"kind,omitempty"`
983
984
985 Md5Hash string `json:"md5Hash,omitempty"`
986
987
988 MediaLink string `json:"mediaLink,omitempty"`
989
990
991 Metadata map[string]string `json:"metadata,omitempty"`
992
993
994
995
996 Metageneration int64 `json:"metageneration,omitempty,string"`
997
998
999
1000 Name string `json:"name,omitempty"`
1001
1002
1003
1004 Owner *ObjectOwner `json:"owner,omitempty"`
1005
1006
1007 SelfLink string `json:"selfLink,omitempty"`
1008
1009
1010 Size uint64 `json:"size,omitempty,string"`
1011
1012
1013 StorageClass string `json:"storageClass,omitempty"`
1014
1015
1016
1017 TimeDeleted string `json:"timeDeleted,omitempty"`
1018
1019
1020 Updated string `json:"updated,omitempty"`
1021
1022
1023
1024 googleapi.ServerResponse `json:"-"`
1025
1026
1027
1028
1029
1030
1031
1032 ForceSendFields []string `json:"-"`
1033
1034
1035
1036
1037
1038
1039
1040 NullFields []string `json:"-"`
1041 }
1042
1043 func (s *Object) MarshalJSON() ([]byte, error) {
1044 type NoMethod Object
1045 raw := NoMethod(*s)
1046 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1047 }
1048
1049
1050
1051 type ObjectOwner struct {
1052
1053 Entity string `json:"entity,omitempty"`
1054
1055
1056 EntityId string `json:"entityId,omitempty"`
1057
1058
1059
1060
1061
1062
1063
1064 ForceSendFields []string `json:"-"`
1065
1066
1067
1068
1069
1070
1071
1072 NullFields []string `json:"-"`
1073 }
1074
1075 func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
1076 type NoMethod ObjectOwner
1077 raw := NoMethod(*s)
1078 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1079 }
1080
1081
1082 type ObjectAccessControl struct {
1083
1084 Bucket string `json:"bucket,omitempty"`
1085
1086
1087 Domain string `json:"domain,omitempty"`
1088
1089
1090 Email string `json:"email,omitempty"`
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106 Entity string `json:"entity,omitempty"`
1107
1108
1109 EntityId string `json:"entityId,omitempty"`
1110
1111
1112 Etag string `json:"etag,omitempty"`
1113
1114
1115 Generation int64 `json:"generation,omitempty,string"`
1116
1117
1118 Id string `json:"id,omitempty"`
1119
1120
1121
1122 Kind string `json:"kind,omitempty"`
1123
1124
1125 Object string `json:"object,omitempty"`
1126
1127
1128 Role string `json:"role,omitempty"`
1129
1130
1131 SelfLink string `json:"selfLink,omitempty"`
1132
1133
1134
1135 googleapi.ServerResponse `json:"-"`
1136
1137
1138
1139
1140
1141
1142
1143 ForceSendFields []string `json:"-"`
1144
1145
1146
1147
1148
1149
1150
1151 NullFields []string `json:"-"`
1152 }
1153
1154 func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
1155 type NoMethod ObjectAccessControl
1156 raw := NoMethod(*s)
1157 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1158 }
1159
1160
1161 type ObjectAccessControls struct {
1162
1163 Items []interface{} `json:"items,omitempty"`
1164
1165
1166
1167 Kind string `json:"kind,omitempty"`
1168
1169
1170
1171 googleapi.ServerResponse `json:"-"`
1172
1173
1174
1175
1176
1177
1178
1179 ForceSendFields []string `json:"-"`
1180
1181
1182
1183
1184
1185
1186
1187 NullFields []string `json:"-"`
1188 }
1189
1190 func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
1191 type NoMethod ObjectAccessControls
1192 raw := NoMethod(*s)
1193 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1194 }
1195
1196
1197 type Objects struct {
1198
1199 Items []*Object `json:"items,omitempty"`
1200
1201
1202
1203 Kind string `json:"kind,omitempty"`
1204
1205
1206
1207
1208 NextPageToken string `json:"nextPageToken,omitempty"`
1209
1210
1211
1212 Prefixes []string `json:"prefixes,omitempty"`
1213
1214
1215
1216 googleapi.ServerResponse `json:"-"`
1217
1218
1219
1220
1221
1222
1223
1224 ForceSendFields []string `json:"-"`
1225
1226
1227
1228
1229
1230
1231
1232 NullFields []string `json:"-"`
1233 }
1234
1235 func (s *Objects) MarshalJSON() ([]byte, error) {
1236 type NoMethod Objects
1237 raw := NoMethod(*s)
1238 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1239 }
1240
1241
1242
1243 type BucketAccessControlsDeleteCall struct {
1244 s *Service
1245 bucket string
1246 entity string
1247 urlParams_ gensupport.URLParams
1248 ctx_ context.Context
1249 header_ http.Header
1250 }
1251
1252
1253
1254 func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
1255 c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1256 c.bucket = bucket
1257 c.entity = entity
1258 return c
1259 }
1260
1261
1262
1263
1264 func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
1265 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1266 return c
1267 }
1268
1269
1270
1271
1272 func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
1273 c.ctx_ = ctx
1274 return c
1275 }
1276
1277
1278
1279 func (c *BucketAccessControlsDeleteCall) Header() http.Header {
1280 if c.header_ == nil {
1281 c.header_ = make(http.Header)
1282 }
1283 return c.header_
1284 }
1285
1286 func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
1287 reqHeaders := make(http.Header)
1288 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
1289 for k, v := range c.header_ {
1290 reqHeaders[k] = v
1291 }
1292 reqHeaders.Set("User-Agent", c.s.userAgent())
1293 var body io.Reader = nil
1294 c.urlParams_.Set("alt", alt)
1295 c.urlParams_.Set("prettyPrint", "false")
1296 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
1297 urls += "?" + c.urlParams_.Encode()
1298 req, err := http.NewRequest("DELETE", urls, body)
1299 if err != nil {
1300 return nil, err
1301 }
1302 req.Header = reqHeaders
1303 googleapi.Expand(req.URL, map[string]string{
1304 "bucket": c.bucket,
1305 "entity": c.entity,
1306 })
1307 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1308 }
1309
1310
1311 func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
1312 gensupport.SetOptions(c.urlParams_, opts...)
1313 res, err := c.doRequest("json")
1314 if err != nil {
1315 return err
1316 }
1317 defer googleapi.CloseBody(res)
1318 if err := googleapi.CheckResponse(res); err != nil {
1319 return err
1320 }
1321 return nil
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350 }
1351
1352
1353
1354 type BucketAccessControlsGetCall struct {
1355 s *Service
1356 bucket string
1357 entity string
1358 urlParams_ gensupport.URLParams
1359 ifNoneMatch_ string
1360 ctx_ context.Context
1361 header_ http.Header
1362 }
1363
1364
1365
1366 func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
1367 c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1368 c.bucket = bucket
1369 c.entity = entity
1370 return c
1371 }
1372
1373
1374
1375
1376 func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
1377 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1378 return c
1379 }
1380
1381
1382
1383
1384
1385
1386 func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
1387 c.ifNoneMatch_ = entityTag
1388 return c
1389 }
1390
1391
1392
1393
1394 func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
1395 c.ctx_ = ctx
1396 return c
1397 }
1398
1399
1400
1401 func (c *BucketAccessControlsGetCall) Header() http.Header {
1402 if c.header_ == nil {
1403 c.header_ = make(http.Header)
1404 }
1405 return c.header_
1406 }
1407
1408 func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
1409 reqHeaders := make(http.Header)
1410 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
1411 for k, v := range c.header_ {
1412 reqHeaders[k] = v
1413 }
1414 reqHeaders.Set("User-Agent", c.s.userAgent())
1415 if c.ifNoneMatch_ != "" {
1416 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1417 }
1418 var body io.Reader = nil
1419 c.urlParams_.Set("alt", alt)
1420 c.urlParams_.Set("prettyPrint", "false")
1421 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
1422 urls += "?" + c.urlParams_.Encode()
1423 req, err := http.NewRequest("GET", urls, body)
1424 if err != nil {
1425 return nil, err
1426 }
1427 req.Header = reqHeaders
1428 googleapi.Expand(req.URL, map[string]string{
1429 "bucket": c.bucket,
1430 "entity": c.entity,
1431 })
1432 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1433 }
1434
1435
1436
1437
1438
1439
1440
1441
1442 func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
1443 gensupport.SetOptions(c.urlParams_, opts...)
1444 res, err := c.doRequest("json")
1445 if res != nil && res.StatusCode == http.StatusNotModified {
1446 if res.Body != nil {
1447 res.Body.Close()
1448 }
1449 return nil, &googleapi.Error{
1450 Code: res.StatusCode,
1451 Header: res.Header,
1452 }
1453 }
1454 if err != nil {
1455 return nil, err
1456 }
1457 defer googleapi.CloseBody(res)
1458 if err := googleapi.CheckResponse(res); err != nil {
1459 return nil, err
1460 }
1461 ret := &BucketAccessControl{
1462 ServerResponse: googleapi.ServerResponse{
1463 Header: res.Header,
1464 HTTPStatusCode: res.StatusCode,
1465 },
1466 }
1467 target := &ret
1468 if err := gensupport.DecodeResponse(target, res); err != nil {
1469 return nil, err
1470 }
1471 return ret, nil
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503 }
1504
1505
1506
1507 type BucketAccessControlsInsertCall struct {
1508 s *Service
1509 bucket string
1510 bucketaccesscontrol *BucketAccessControl
1511 urlParams_ gensupport.URLParams
1512 ctx_ context.Context
1513 header_ http.Header
1514 }
1515
1516
1517 func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
1518 c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1519 c.bucket = bucket
1520 c.bucketaccesscontrol = bucketaccesscontrol
1521 return c
1522 }
1523
1524
1525
1526
1527 func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
1528 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1529 return c
1530 }
1531
1532
1533
1534
1535 func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
1536 c.ctx_ = ctx
1537 return c
1538 }
1539
1540
1541
1542 func (c *BucketAccessControlsInsertCall) Header() http.Header {
1543 if c.header_ == nil {
1544 c.header_ = make(http.Header)
1545 }
1546 return c.header_
1547 }
1548
1549 func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
1550 reqHeaders := make(http.Header)
1551 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
1552 for k, v := range c.header_ {
1553 reqHeaders[k] = v
1554 }
1555 reqHeaders.Set("User-Agent", c.s.userAgent())
1556 var body io.Reader = nil
1557 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
1558 if err != nil {
1559 return nil, err
1560 }
1561 reqHeaders.Set("Content-Type", "application/json")
1562 c.urlParams_.Set("alt", alt)
1563 c.urlParams_.Set("prettyPrint", "false")
1564 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
1565 urls += "?" + c.urlParams_.Encode()
1566 req, err := http.NewRequest("POST", urls, body)
1567 if err != nil {
1568 return nil, err
1569 }
1570 req.Header = reqHeaders
1571 googleapi.Expand(req.URL, map[string]string{
1572 "bucket": c.bucket,
1573 })
1574 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1575 }
1576
1577
1578
1579
1580
1581
1582
1583
1584 func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
1585 gensupport.SetOptions(c.urlParams_, opts...)
1586 res, err := c.doRequest("json")
1587 if res != nil && res.StatusCode == http.StatusNotModified {
1588 if res.Body != nil {
1589 res.Body.Close()
1590 }
1591 return nil, &googleapi.Error{
1592 Code: res.StatusCode,
1593 Header: res.Header,
1594 }
1595 }
1596 if err != nil {
1597 return nil, err
1598 }
1599 defer googleapi.CloseBody(res)
1600 if err := googleapi.CheckResponse(res); err != nil {
1601 return nil, err
1602 }
1603 ret := &BucketAccessControl{
1604 ServerResponse: googleapi.ServerResponse{
1605 Header: res.Header,
1606 HTTPStatusCode: res.StatusCode,
1607 },
1608 }
1609 target := &ret
1610 if err := gensupport.DecodeResponse(target, res); err != nil {
1611 return nil, err
1612 }
1613 return ret, nil
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641 }
1642
1643
1644
1645 type BucketAccessControlsListCall struct {
1646 s *Service
1647 bucket string
1648 urlParams_ gensupport.URLParams
1649 ifNoneMatch_ string
1650 ctx_ context.Context
1651 header_ http.Header
1652 }
1653
1654
1655 func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
1656 c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1657 c.bucket = bucket
1658 return c
1659 }
1660
1661
1662
1663
1664 func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
1665 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1666 return c
1667 }
1668
1669
1670
1671
1672
1673
1674 func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
1675 c.ifNoneMatch_ = entityTag
1676 return c
1677 }
1678
1679
1680
1681
1682 func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
1683 c.ctx_ = ctx
1684 return c
1685 }
1686
1687
1688
1689 func (c *BucketAccessControlsListCall) Header() http.Header {
1690 if c.header_ == nil {
1691 c.header_ = make(http.Header)
1692 }
1693 return c.header_
1694 }
1695
1696 func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
1697 reqHeaders := make(http.Header)
1698 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
1699 for k, v := range c.header_ {
1700 reqHeaders[k] = v
1701 }
1702 reqHeaders.Set("User-Agent", c.s.userAgent())
1703 if c.ifNoneMatch_ != "" {
1704 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1705 }
1706 var body io.Reader = nil
1707 c.urlParams_.Set("alt", alt)
1708 c.urlParams_.Set("prettyPrint", "false")
1709 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
1710 urls += "?" + c.urlParams_.Encode()
1711 req, err := http.NewRequest("GET", urls, body)
1712 if err != nil {
1713 return nil, err
1714 }
1715 req.Header = reqHeaders
1716 googleapi.Expand(req.URL, map[string]string{
1717 "bucket": c.bucket,
1718 })
1719 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1720 }
1721
1722
1723
1724
1725
1726
1727
1728
1729 func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
1730 gensupport.SetOptions(c.urlParams_, opts...)
1731 res, err := c.doRequest("json")
1732 if res != nil && res.StatusCode == http.StatusNotModified {
1733 if res.Body != nil {
1734 res.Body.Close()
1735 }
1736 return nil, &googleapi.Error{
1737 Code: res.StatusCode,
1738 Header: res.Header,
1739 }
1740 }
1741 if err != nil {
1742 return nil, err
1743 }
1744 defer googleapi.CloseBody(res)
1745 if err := googleapi.CheckResponse(res); err != nil {
1746 return nil, err
1747 }
1748 ret := &BucketAccessControls{
1749 ServerResponse: googleapi.ServerResponse{
1750 Header: res.Header,
1751 HTTPStatusCode: res.StatusCode,
1752 },
1753 }
1754 target := &ret
1755 if err := gensupport.DecodeResponse(target, res); err != nil {
1756 return nil, err
1757 }
1758 return ret, nil
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783 }
1784
1785
1786
1787 type BucketAccessControlsPatchCall struct {
1788 s *Service
1789 bucket string
1790 entity string
1791 bucketaccesscontrol *BucketAccessControl
1792 urlParams_ gensupport.URLParams
1793 ctx_ context.Context
1794 header_ http.Header
1795 }
1796
1797
1798
1799 func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
1800 c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1801 c.bucket = bucket
1802 c.entity = entity
1803 c.bucketaccesscontrol = bucketaccesscontrol
1804 return c
1805 }
1806
1807
1808
1809
1810 func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
1811 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1812 return c
1813 }
1814
1815
1816
1817
1818 func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
1819 c.ctx_ = ctx
1820 return c
1821 }
1822
1823
1824
1825 func (c *BucketAccessControlsPatchCall) Header() http.Header {
1826 if c.header_ == nil {
1827 c.header_ = make(http.Header)
1828 }
1829 return c.header_
1830 }
1831
1832 func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
1833 reqHeaders := make(http.Header)
1834 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
1835 for k, v := range c.header_ {
1836 reqHeaders[k] = v
1837 }
1838 reqHeaders.Set("User-Agent", c.s.userAgent())
1839 var body io.Reader = nil
1840 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
1841 if err != nil {
1842 return nil, err
1843 }
1844 reqHeaders.Set("Content-Type", "application/json")
1845 c.urlParams_.Set("alt", alt)
1846 c.urlParams_.Set("prettyPrint", "false")
1847 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
1848 urls += "?" + c.urlParams_.Encode()
1849 req, err := http.NewRequest("PATCH", urls, body)
1850 if err != nil {
1851 return nil, err
1852 }
1853 req.Header = reqHeaders
1854 googleapi.Expand(req.URL, map[string]string{
1855 "bucket": c.bucket,
1856 "entity": c.entity,
1857 })
1858 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1859 }
1860
1861
1862
1863
1864
1865
1866
1867
1868 func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
1869 gensupport.SetOptions(c.urlParams_, opts...)
1870 res, err := c.doRequest("json")
1871 if res != nil && res.StatusCode == http.StatusNotModified {
1872 if res.Body != nil {
1873 res.Body.Close()
1874 }
1875 return nil, &googleapi.Error{
1876 Code: res.StatusCode,
1877 Header: res.Header,
1878 }
1879 }
1880 if err != nil {
1881 return nil, err
1882 }
1883 defer googleapi.CloseBody(res)
1884 if err := googleapi.CheckResponse(res); err != nil {
1885 return nil, err
1886 }
1887 ret := &BucketAccessControl{
1888 ServerResponse: googleapi.ServerResponse{
1889 Header: res.Header,
1890 HTTPStatusCode: res.StatusCode,
1891 },
1892 }
1893 target := &ret
1894 if err := gensupport.DecodeResponse(target, res); err != nil {
1895 return nil, err
1896 }
1897 return ret, nil
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932 }
1933
1934
1935
1936 type BucketAccessControlsUpdateCall struct {
1937 s *Service
1938 bucket string
1939 entity string
1940 bucketaccesscontrol *BucketAccessControl
1941 urlParams_ gensupport.URLParams
1942 ctx_ context.Context
1943 header_ http.Header
1944 }
1945
1946
1947 func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
1948 c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1949 c.bucket = bucket
1950 c.entity = entity
1951 c.bucketaccesscontrol = bucketaccesscontrol
1952 return c
1953 }
1954
1955
1956
1957
1958 func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
1959 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1960 return c
1961 }
1962
1963
1964
1965
1966 func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
1967 c.ctx_ = ctx
1968 return c
1969 }
1970
1971
1972
1973 func (c *BucketAccessControlsUpdateCall) Header() http.Header {
1974 if c.header_ == nil {
1975 c.header_ = make(http.Header)
1976 }
1977 return c.header_
1978 }
1979
1980 func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
1981 reqHeaders := make(http.Header)
1982 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
1983 for k, v := range c.header_ {
1984 reqHeaders[k] = v
1985 }
1986 reqHeaders.Set("User-Agent", c.s.userAgent())
1987 var body io.Reader = nil
1988 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
1989 if err != nil {
1990 return nil, err
1991 }
1992 reqHeaders.Set("Content-Type", "application/json")
1993 c.urlParams_.Set("alt", alt)
1994 c.urlParams_.Set("prettyPrint", "false")
1995 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
1996 urls += "?" + c.urlParams_.Encode()
1997 req, err := http.NewRequest("PUT", urls, body)
1998 if err != nil {
1999 return nil, err
2000 }
2001 req.Header = reqHeaders
2002 googleapi.Expand(req.URL, map[string]string{
2003 "bucket": c.bucket,
2004 "entity": c.entity,
2005 })
2006 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2007 }
2008
2009
2010
2011
2012
2013
2014
2015
2016 func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
2017 gensupport.SetOptions(c.urlParams_, opts...)
2018 res, err := c.doRequest("json")
2019 if res != nil && res.StatusCode == http.StatusNotModified {
2020 if res.Body != nil {
2021 res.Body.Close()
2022 }
2023 return nil, &googleapi.Error{
2024 Code: res.StatusCode,
2025 Header: res.Header,
2026 }
2027 }
2028 if err != nil {
2029 return nil, err
2030 }
2031 defer googleapi.CloseBody(res)
2032 if err := googleapi.CheckResponse(res); err != nil {
2033 return nil, err
2034 }
2035 ret := &BucketAccessControl{
2036 ServerResponse: googleapi.ServerResponse{
2037 Header: res.Header,
2038 HTTPStatusCode: res.StatusCode,
2039 },
2040 }
2041 target := &ret
2042 if err := gensupport.DecodeResponse(target, res); err != nil {
2043 return nil, err
2044 }
2045 return ret, nil
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080 }
2081
2082
2083
2084 type BucketsDeleteCall struct {
2085 s *Service
2086 bucket string
2087 urlParams_ gensupport.URLParams
2088 ctx_ context.Context
2089 header_ http.Header
2090 }
2091
2092
2093 func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
2094 c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2095 c.bucket = bucket
2096 return c
2097 }
2098
2099
2100
2101
2102
2103 func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsDeleteCall {
2104 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
2105 return c
2106 }
2107
2108
2109
2110
2111
2112 func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsDeleteCall {
2113 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
2114 return c
2115 }
2116
2117
2118
2119
2120 func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
2121 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2122 return c
2123 }
2124
2125
2126
2127
2128 func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
2129 c.ctx_ = ctx
2130 return c
2131 }
2132
2133
2134
2135 func (c *BucketsDeleteCall) Header() http.Header {
2136 if c.header_ == nil {
2137 c.header_ = make(http.Header)
2138 }
2139 return c.header_
2140 }
2141
2142 func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
2143 reqHeaders := make(http.Header)
2144 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
2145 for k, v := range c.header_ {
2146 reqHeaders[k] = v
2147 }
2148 reqHeaders.Set("User-Agent", c.s.userAgent())
2149 var body io.Reader = nil
2150 c.urlParams_.Set("alt", alt)
2151 c.urlParams_.Set("prettyPrint", "false")
2152 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
2153 urls += "?" + c.urlParams_.Encode()
2154 req, err := http.NewRequest("DELETE", urls, body)
2155 if err != nil {
2156 return nil, err
2157 }
2158 req.Header = reqHeaders
2159 googleapi.Expand(req.URL, map[string]string{
2160 "bucket": c.bucket,
2161 })
2162 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2163 }
2164
2165
2166 func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
2167 gensupport.SetOptions(c.urlParams_, opts...)
2168 res, err := c.doRequest("json")
2169 if err != nil {
2170 return err
2171 }
2172 defer googleapi.CloseBody(res)
2173 if err := googleapi.CheckResponse(res); err != nil {
2174 return err
2175 }
2176 return nil
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211 }
2212
2213
2214
2215 type BucketsGetCall struct {
2216 s *Service
2217 bucket string
2218 urlParams_ gensupport.URLParams
2219 ifNoneMatch_ string
2220 ctx_ context.Context
2221 header_ http.Header
2222 }
2223
2224
2225 func (r *BucketsService) Get(bucket string) *BucketsGetCall {
2226 c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2227 c.bucket = bucket
2228 return c
2229 }
2230
2231
2232
2233
2234
2235 func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsGetCall {
2236 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
2237 return c
2238 }
2239
2240
2241
2242
2243
2244 func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsGetCall {
2245 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
2246 return c
2247 }
2248
2249
2250
2251
2252
2253
2254
2255
2256 func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
2257 c.urlParams_.Set("projection", projection)
2258 return c
2259 }
2260
2261
2262
2263
2264 func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
2265 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2266 return c
2267 }
2268
2269
2270
2271
2272
2273
2274 func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
2275 c.ifNoneMatch_ = entityTag
2276 return c
2277 }
2278
2279
2280
2281
2282 func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
2283 c.ctx_ = ctx
2284 return c
2285 }
2286
2287
2288
2289 func (c *BucketsGetCall) Header() http.Header {
2290 if c.header_ == nil {
2291 c.header_ = make(http.Header)
2292 }
2293 return c.header_
2294 }
2295
2296 func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
2297 reqHeaders := make(http.Header)
2298 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
2299 for k, v := range c.header_ {
2300 reqHeaders[k] = v
2301 }
2302 reqHeaders.Set("User-Agent", c.s.userAgent())
2303 if c.ifNoneMatch_ != "" {
2304 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2305 }
2306 var body io.Reader = nil
2307 c.urlParams_.Set("alt", alt)
2308 c.urlParams_.Set("prettyPrint", "false")
2309 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
2310 urls += "?" + c.urlParams_.Encode()
2311 req, err := http.NewRequest("GET", urls, body)
2312 if err != nil {
2313 return nil, err
2314 }
2315 req.Header = reqHeaders
2316 googleapi.Expand(req.URL, map[string]string{
2317 "bucket": c.bucket,
2318 })
2319 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2320 }
2321
2322
2323
2324
2325
2326
2327
2328
2329 func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
2330 gensupport.SetOptions(c.urlParams_, opts...)
2331 res, err := c.doRequest("json")
2332 if res != nil && res.StatusCode == http.StatusNotModified {
2333 if res.Body != nil {
2334 res.Body.Close()
2335 }
2336 return nil, &googleapi.Error{
2337 Code: res.StatusCode,
2338 Header: res.Header,
2339 }
2340 }
2341 if err != nil {
2342 return nil, err
2343 }
2344 defer googleapi.CloseBody(res)
2345 if err := googleapi.CheckResponse(res); err != nil {
2346 return nil, err
2347 }
2348 ret := &Bucket{
2349 ServerResponse: googleapi.ServerResponse{
2350 Header: res.Header,
2351 HTTPStatusCode: res.StatusCode,
2352 },
2353 }
2354 target := &ret
2355 if err := gensupport.DecodeResponse(target, res); err != nil {
2356 return nil, err
2357 }
2358 return ret, nil
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410 }
2411
2412
2413
2414 type BucketsInsertCall struct {
2415 s *Service
2416 bucket *Bucket
2417 urlParams_ gensupport.URLParams
2418 ctx_ context.Context
2419 header_ http.Header
2420 }
2421
2422
2423 func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall {
2424 c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2425 c.urlParams_.Set("project", projectid)
2426 c.bucket = bucket
2427 return c
2428 }
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439 func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
2440 c.urlParams_.Set("projection", projection)
2441 return c
2442 }
2443
2444
2445
2446
2447 func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
2448 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2449 return c
2450 }
2451
2452
2453
2454
2455 func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
2456 c.ctx_ = ctx
2457 return c
2458 }
2459
2460
2461
2462 func (c *BucketsInsertCall) Header() http.Header {
2463 if c.header_ == nil {
2464 c.header_ = make(http.Header)
2465 }
2466 return c.header_
2467 }
2468
2469 func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
2470 reqHeaders := make(http.Header)
2471 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
2472 for k, v := range c.header_ {
2473 reqHeaders[k] = v
2474 }
2475 reqHeaders.Set("User-Agent", c.s.userAgent())
2476 var body io.Reader = nil
2477 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
2478 if err != nil {
2479 return nil, err
2480 }
2481 reqHeaders.Set("Content-Type", "application/json")
2482 c.urlParams_.Set("alt", alt)
2483 c.urlParams_.Set("prettyPrint", "false")
2484 urls := googleapi.ResolveRelative(c.s.BasePath, "b")
2485 urls += "?" + c.urlParams_.Encode()
2486 req, err := http.NewRequest("POST", urls, body)
2487 if err != nil {
2488 return nil, err
2489 }
2490 req.Header = reqHeaders
2491 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2492 }
2493
2494
2495
2496
2497
2498
2499
2500
2501 func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
2502 gensupport.SetOptions(c.urlParams_, opts...)
2503 res, err := c.doRequest("json")
2504 if res != nil && res.StatusCode == http.StatusNotModified {
2505 if res.Body != nil {
2506 res.Body.Close()
2507 }
2508 return nil, &googleapi.Error{
2509 Code: res.StatusCode,
2510 Header: res.Header,
2511 }
2512 }
2513 if err != nil {
2514 return nil, err
2515 }
2516 defer googleapi.CloseBody(res)
2517 if err := googleapi.CheckResponse(res); err != nil {
2518 return nil, err
2519 }
2520 ret := &Bucket{
2521 ServerResponse: googleapi.ServerResponse{
2522 Header: res.Header,
2523 HTTPStatusCode: res.StatusCode,
2524 },
2525 }
2526 target := &ret
2527 if err := gensupport.DecodeResponse(target, res); err != nil {
2528 return nil, err
2529 }
2530 return ret, nil
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572 }
2573
2574
2575
2576 type BucketsListCall struct {
2577 s *Service
2578 urlParams_ gensupport.URLParams
2579 ifNoneMatch_ string
2580 ctx_ context.Context
2581 header_ http.Header
2582 }
2583
2584
2585 func (r *BucketsService) List(projectid string) *BucketsListCall {
2586 c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2587 c.urlParams_.Set("project", projectid)
2588 return c
2589 }
2590
2591
2592
2593 func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
2594 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2595 return c
2596 }
2597
2598
2599
2600
2601 func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
2602 c.urlParams_.Set("pageToken", pageToken)
2603 return c
2604 }
2605
2606
2607
2608
2609
2610
2611
2612
2613 func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
2614 c.urlParams_.Set("projection", projection)
2615 return c
2616 }
2617
2618
2619
2620
2621 func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
2622 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2623 return c
2624 }
2625
2626
2627
2628
2629
2630
2631 func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
2632 c.ifNoneMatch_ = entityTag
2633 return c
2634 }
2635
2636
2637
2638
2639 func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
2640 c.ctx_ = ctx
2641 return c
2642 }
2643
2644
2645
2646 func (c *BucketsListCall) Header() http.Header {
2647 if c.header_ == nil {
2648 c.header_ = make(http.Header)
2649 }
2650 return c.header_
2651 }
2652
2653 func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
2654 reqHeaders := make(http.Header)
2655 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
2656 for k, v := range c.header_ {
2657 reqHeaders[k] = v
2658 }
2659 reqHeaders.Set("User-Agent", c.s.userAgent())
2660 if c.ifNoneMatch_ != "" {
2661 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2662 }
2663 var body io.Reader = nil
2664 c.urlParams_.Set("alt", alt)
2665 c.urlParams_.Set("prettyPrint", "false")
2666 urls := googleapi.ResolveRelative(c.s.BasePath, "b")
2667 urls += "?" + c.urlParams_.Encode()
2668 req, err := http.NewRequest("GET", urls, body)
2669 if err != nil {
2670 return nil, err
2671 }
2672 req.Header = reqHeaders
2673 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2674 }
2675
2676
2677
2678
2679
2680
2681
2682
2683 func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
2684 gensupport.SetOptions(c.urlParams_, opts...)
2685 res, err := c.doRequest("json")
2686 if res != nil && res.StatusCode == http.StatusNotModified {
2687 if res.Body != nil {
2688 res.Body.Close()
2689 }
2690 return nil, &googleapi.Error{
2691 Code: res.StatusCode,
2692 Header: res.Header,
2693 }
2694 }
2695 if err != nil {
2696 return nil, err
2697 }
2698 defer googleapi.CloseBody(res)
2699 if err := googleapi.CheckResponse(res); err != nil {
2700 return nil, err
2701 }
2702 ret := &Buckets{
2703 ServerResponse: googleapi.ServerResponse{
2704 Header: res.Header,
2705 HTTPStatusCode: res.StatusCode,
2706 },
2707 }
2708 target := &ret
2709 if err := gensupport.DecodeResponse(target, res); err != nil {
2710 return nil, err
2711 }
2712 return ret, nil
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764 }
2765
2766
2767
2768
2769 func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
2770 c.ctx_ = ctx
2771 defer c.PageToken(c.urlParams_.Get("pageToken"))
2772 for {
2773 x, err := c.Do()
2774 if err != nil {
2775 return err
2776 }
2777 if err := f(x); err != nil {
2778 return err
2779 }
2780 if x.NextPageToken == "" {
2781 return nil
2782 }
2783 c.PageToken(x.NextPageToken)
2784 }
2785 }
2786
2787
2788
2789 type BucketsPatchCall struct {
2790 s *Service
2791 bucket string
2792 bucket2 *Bucket
2793 urlParams_ gensupport.URLParams
2794 ctx_ context.Context
2795 header_ http.Header
2796 }
2797
2798
2799 func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
2800 c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2801 c.bucket = bucket
2802 c.bucket2 = bucket2
2803 return c
2804 }
2805
2806
2807
2808
2809
2810 func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsPatchCall {
2811 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
2812 return c
2813 }
2814
2815
2816
2817
2818
2819 func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsPatchCall {
2820 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
2821 return c
2822 }
2823
2824
2825
2826
2827
2828
2829
2830
2831 func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
2832 c.urlParams_.Set("projection", projection)
2833 return c
2834 }
2835
2836
2837
2838
2839 func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
2840 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2841 return c
2842 }
2843
2844
2845
2846
2847 func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
2848 c.ctx_ = ctx
2849 return c
2850 }
2851
2852
2853
2854 func (c *BucketsPatchCall) Header() http.Header {
2855 if c.header_ == nil {
2856 c.header_ = make(http.Header)
2857 }
2858 return c.header_
2859 }
2860
2861 func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
2862 reqHeaders := make(http.Header)
2863 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
2864 for k, v := range c.header_ {
2865 reqHeaders[k] = v
2866 }
2867 reqHeaders.Set("User-Agent", c.s.userAgent())
2868 var body io.Reader = nil
2869 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
2870 if err != nil {
2871 return nil, err
2872 }
2873 reqHeaders.Set("Content-Type", "application/json")
2874 c.urlParams_.Set("alt", alt)
2875 c.urlParams_.Set("prettyPrint", "false")
2876 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
2877 urls += "?" + c.urlParams_.Encode()
2878 req, err := http.NewRequest("PATCH", urls, body)
2879 if err != nil {
2880 return nil, err
2881 }
2882 req.Header = reqHeaders
2883 googleapi.Expand(req.URL, map[string]string{
2884 "bucket": c.bucket,
2885 })
2886 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2887 }
2888
2889
2890
2891
2892
2893
2894
2895
2896 func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
2897 gensupport.SetOptions(c.urlParams_, opts...)
2898 res, err := c.doRequest("json")
2899 if res != nil && res.StatusCode == http.StatusNotModified {
2900 if res.Body != nil {
2901 res.Body.Close()
2902 }
2903 return nil, &googleapi.Error{
2904 Code: res.StatusCode,
2905 Header: res.Header,
2906 }
2907 }
2908 if err != nil {
2909 return nil, err
2910 }
2911 defer googleapi.CloseBody(res)
2912 if err := googleapi.CheckResponse(res); err != nil {
2913 return nil, err
2914 }
2915 ret := &Bucket{
2916 ServerResponse: googleapi.ServerResponse{
2917 Header: res.Header,
2918 HTTPStatusCode: res.StatusCode,
2919 },
2920 }
2921 target := &ret
2922 if err := gensupport.DecodeResponse(target, res); err != nil {
2923 return nil, err
2924 }
2925 return ret, nil
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979 }
2980
2981
2982
2983 type BucketsUpdateCall struct {
2984 s *Service
2985 bucket string
2986 bucket2 *Bucket
2987 urlParams_ gensupport.URLParams
2988 ctx_ context.Context
2989 header_ http.Header
2990 }
2991
2992
2993 func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
2994 c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2995 c.bucket = bucket
2996 c.bucket2 = bucket2
2997 return c
2998 }
2999
3000
3001
3002
3003
3004 func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *BucketsUpdateCall {
3005 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3006 return c
3007 }
3008
3009
3010
3011
3012
3013 func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *BucketsUpdateCall {
3014 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
3015 return c
3016 }
3017
3018
3019
3020
3021
3022
3023
3024
3025 func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
3026 c.urlParams_.Set("projection", projection)
3027 return c
3028 }
3029
3030
3031
3032
3033 func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
3034 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3035 return c
3036 }
3037
3038
3039
3040
3041 func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
3042 c.ctx_ = ctx
3043 return c
3044 }
3045
3046
3047
3048 func (c *BucketsUpdateCall) Header() http.Header {
3049 if c.header_ == nil {
3050 c.header_ = make(http.Header)
3051 }
3052 return c.header_
3053 }
3054
3055 func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
3056 reqHeaders := make(http.Header)
3057 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
3058 for k, v := range c.header_ {
3059 reqHeaders[k] = v
3060 }
3061 reqHeaders.Set("User-Agent", c.s.userAgent())
3062 var body io.Reader = nil
3063 body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
3064 if err != nil {
3065 return nil, err
3066 }
3067 reqHeaders.Set("Content-Type", "application/json")
3068 c.urlParams_.Set("alt", alt)
3069 c.urlParams_.Set("prettyPrint", "false")
3070 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
3071 urls += "?" + c.urlParams_.Encode()
3072 req, err := http.NewRequest("PUT", urls, body)
3073 if err != nil {
3074 return nil, err
3075 }
3076 req.Header = reqHeaders
3077 googleapi.Expand(req.URL, map[string]string{
3078 "bucket": c.bucket,
3079 })
3080 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3081 }
3082
3083
3084
3085
3086
3087
3088
3089
3090 func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
3091 gensupport.SetOptions(c.urlParams_, opts...)
3092 res, err := c.doRequest("json")
3093 if res != nil && res.StatusCode == http.StatusNotModified {
3094 if res.Body != nil {
3095 res.Body.Close()
3096 }
3097 return nil, &googleapi.Error{
3098 Code: res.StatusCode,
3099 Header: res.Header,
3100 }
3101 }
3102 if err != nil {
3103 return nil, err
3104 }
3105 defer googleapi.CloseBody(res)
3106 if err := googleapi.CheckResponse(res); err != nil {
3107 return nil, err
3108 }
3109 ret := &Bucket{
3110 ServerResponse: googleapi.ServerResponse{
3111 Header: res.Header,
3112 HTTPStatusCode: res.StatusCode,
3113 },
3114 }
3115 target := &ret
3116 if err := gensupport.DecodeResponse(target, res); err != nil {
3117 return nil, err
3118 }
3119 return ret, nil
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173 }
3174
3175
3176
3177 type ChannelsStopCall struct {
3178 s *Service
3179 channel *Channel
3180 urlParams_ gensupport.URLParams
3181 ctx_ context.Context
3182 header_ http.Header
3183 }
3184
3185
3186 func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
3187 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3188 c.channel = channel
3189 return c
3190 }
3191
3192
3193
3194
3195 func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
3196 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3197 return c
3198 }
3199
3200
3201
3202
3203 func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
3204 c.ctx_ = ctx
3205 return c
3206 }
3207
3208
3209
3210 func (c *ChannelsStopCall) Header() http.Header {
3211 if c.header_ == nil {
3212 c.header_ = make(http.Header)
3213 }
3214 return c.header_
3215 }
3216
3217 func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
3218 reqHeaders := make(http.Header)
3219 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
3220 for k, v := range c.header_ {
3221 reqHeaders[k] = v
3222 }
3223 reqHeaders.Set("User-Agent", c.s.userAgent())
3224 var body io.Reader = nil
3225 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
3226 if err != nil {
3227 return nil, err
3228 }
3229 reqHeaders.Set("Content-Type", "application/json")
3230 c.urlParams_.Set("alt", alt)
3231 c.urlParams_.Set("prettyPrint", "false")
3232 urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
3233 urls += "?" + c.urlParams_.Encode()
3234 req, err := http.NewRequest("POST", urls, body)
3235 if err != nil {
3236 return nil, err
3237 }
3238 req.Header = reqHeaders
3239 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3240 }
3241
3242
3243 func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
3244 gensupport.SetOptions(c.urlParams_, opts...)
3245 res, err := c.doRequest("json")
3246 if err != nil {
3247 return err
3248 }
3249 defer googleapi.CloseBody(res)
3250 if err := googleapi.CheckResponse(res); err != nil {
3251 return err
3252 }
3253 return nil
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270 }
3271
3272
3273
3274 type DefaultObjectAccessControlsDeleteCall struct {
3275 s *Service
3276 bucket string
3277 entity string
3278 urlParams_ gensupport.URLParams
3279 ctx_ context.Context
3280 header_ http.Header
3281 }
3282
3283
3284
3285 func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall {
3286 c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3287 c.bucket = bucket
3288 c.entity = entity
3289 return c
3290 }
3291
3292
3293
3294
3295 func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall {
3296 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3297 return c
3298 }
3299
3300
3301
3302
3303 func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
3304 c.ctx_ = ctx
3305 return c
3306 }
3307
3308
3309
3310 func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
3311 if c.header_ == nil {
3312 c.header_ = make(http.Header)
3313 }
3314 return c.header_
3315 }
3316
3317 func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
3318 reqHeaders := make(http.Header)
3319 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
3320 for k, v := range c.header_ {
3321 reqHeaders[k] = v
3322 }
3323 reqHeaders.Set("User-Agent", c.s.userAgent())
3324 var body io.Reader = nil
3325 c.urlParams_.Set("alt", alt)
3326 c.urlParams_.Set("prettyPrint", "false")
3327 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
3328 urls += "?" + c.urlParams_.Encode()
3329 req, err := http.NewRequest("DELETE", urls, body)
3330 if err != nil {
3331 return nil, err
3332 }
3333 req.Header = reqHeaders
3334 googleapi.Expand(req.URL, map[string]string{
3335 "bucket": c.bucket,
3336 "entity": c.entity,
3337 })
3338 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3339 }
3340
3341
3342 func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
3343 gensupport.SetOptions(c.urlParams_, opts...)
3344 res, err := c.doRequest("json")
3345 if err != nil {
3346 return err
3347 }
3348 defer googleapi.CloseBody(res)
3349 if err := googleapi.CheckResponse(res); err != nil {
3350 return err
3351 }
3352 return nil
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381 }
3382
3383
3384
3385 type DefaultObjectAccessControlsGetCall struct {
3386 s *Service
3387 bucket string
3388 entity string
3389 urlParams_ gensupport.URLParams
3390 ifNoneMatch_ string
3391 ctx_ context.Context
3392 header_ http.Header
3393 }
3394
3395
3396
3397 func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall {
3398 c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3399 c.bucket = bucket
3400 c.entity = entity
3401 return c
3402 }
3403
3404
3405
3406
3407 func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall {
3408 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3409 return c
3410 }
3411
3412
3413
3414
3415
3416
3417 func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall {
3418 c.ifNoneMatch_ = entityTag
3419 return c
3420 }
3421
3422
3423
3424
3425 func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
3426 c.ctx_ = ctx
3427 return c
3428 }
3429
3430
3431
3432 func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
3433 if c.header_ == nil {
3434 c.header_ = make(http.Header)
3435 }
3436 return c.header_
3437 }
3438
3439 func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
3440 reqHeaders := make(http.Header)
3441 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
3442 for k, v := range c.header_ {
3443 reqHeaders[k] = v
3444 }
3445 reqHeaders.Set("User-Agent", c.s.userAgent())
3446 if c.ifNoneMatch_ != "" {
3447 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3448 }
3449 var body io.Reader = nil
3450 c.urlParams_.Set("alt", alt)
3451 c.urlParams_.Set("prettyPrint", "false")
3452 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
3453 urls += "?" + c.urlParams_.Encode()
3454 req, err := http.NewRequest("GET", urls, body)
3455 if err != nil {
3456 return nil, err
3457 }
3458 req.Header = reqHeaders
3459 googleapi.Expand(req.URL, map[string]string{
3460 "bucket": c.bucket,
3461 "entity": c.entity,
3462 })
3463 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3464 }
3465
3466
3467
3468
3469
3470
3471
3472
3473 func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
3474 gensupport.SetOptions(c.urlParams_, opts...)
3475 res, err := c.doRequest("json")
3476 if res != nil && res.StatusCode == http.StatusNotModified {
3477 if res.Body != nil {
3478 res.Body.Close()
3479 }
3480 return nil, &googleapi.Error{
3481 Code: res.StatusCode,
3482 Header: res.Header,
3483 }
3484 }
3485 if err != nil {
3486 return nil, err
3487 }
3488 defer googleapi.CloseBody(res)
3489 if err := googleapi.CheckResponse(res); err != nil {
3490 return nil, err
3491 }
3492 ret := &ObjectAccessControl{
3493 ServerResponse: googleapi.ServerResponse{
3494 Header: res.Header,
3495 HTTPStatusCode: res.StatusCode,
3496 },
3497 }
3498 target := &ret
3499 if err := gensupport.DecodeResponse(target, res); err != nil {
3500 return nil, err
3501 }
3502 return ret, nil
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534 }
3535
3536
3537
3538 type DefaultObjectAccessControlsInsertCall struct {
3539 s *Service
3540 bucket string
3541 objectaccesscontrol *ObjectAccessControl
3542 urlParams_ gensupport.URLParams
3543 ctx_ context.Context
3544 header_ http.Header
3545 }
3546
3547
3548
3549 func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
3550 c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3551 c.bucket = bucket
3552 c.objectaccesscontrol = objectaccesscontrol
3553 return c
3554 }
3555
3556
3557
3558
3559 func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall {
3560 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3561 return c
3562 }
3563
3564
3565
3566
3567 func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
3568 c.ctx_ = ctx
3569 return c
3570 }
3571
3572
3573
3574 func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
3575 if c.header_ == nil {
3576 c.header_ = make(http.Header)
3577 }
3578 return c.header_
3579 }
3580
3581 func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
3582 reqHeaders := make(http.Header)
3583 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
3584 for k, v := range c.header_ {
3585 reqHeaders[k] = v
3586 }
3587 reqHeaders.Set("User-Agent", c.s.userAgent())
3588 var body io.Reader = nil
3589 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
3590 if err != nil {
3591 return nil, err
3592 }
3593 reqHeaders.Set("Content-Type", "application/json")
3594 c.urlParams_.Set("alt", alt)
3595 c.urlParams_.Set("prettyPrint", "false")
3596 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
3597 urls += "?" + c.urlParams_.Encode()
3598 req, err := http.NewRequest("POST", urls, body)
3599 if err != nil {
3600 return nil, err
3601 }
3602 req.Header = reqHeaders
3603 googleapi.Expand(req.URL, map[string]string{
3604 "bucket": c.bucket,
3605 })
3606 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3607 }
3608
3609
3610
3611
3612
3613
3614
3615
3616 func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
3617 gensupport.SetOptions(c.urlParams_, opts...)
3618 res, err := c.doRequest("json")
3619 if res != nil && res.StatusCode == http.StatusNotModified {
3620 if res.Body != nil {
3621 res.Body.Close()
3622 }
3623 return nil, &googleapi.Error{
3624 Code: res.StatusCode,
3625 Header: res.Header,
3626 }
3627 }
3628 if err != nil {
3629 return nil, err
3630 }
3631 defer googleapi.CloseBody(res)
3632 if err := googleapi.CheckResponse(res); err != nil {
3633 return nil, err
3634 }
3635 ret := &ObjectAccessControl{
3636 ServerResponse: googleapi.ServerResponse{
3637 Header: res.Header,
3638 HTTPStatusCode: res.StatusCode,
3639 },
3640 }
3641 target := &ret
3642 if err := gensupport.DecodeResponse(target, res); err != nil {
3643 return nil, err
3644 }
3645 return ret, nil
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673 }
3674
3675
3676
3677 type DefaultObjectAccessControlsListCall struct {
3678 s *Service
3679 bucket string
3680 urlParams_ gensupport.URLParams
3681 ifNoneMatch_ string
3682 ctx_ context.Context
3683 header_ http.Header
3684 }
3685
3686
3687 func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall {
3688 c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3689 c.bucket = bucket
3690 return c
3691 }
3692
3693
3694
3695
3696 func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall {
3697 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
3698 return c
3699 }
3700
3701
3702
3703
3704
3705 func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
3706 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
3707 return c
3708 }
3709
3710
3711
3712
3713 func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall {
3714 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3715 return c
3716 }
3717
3718
3719
3720
3721
3722
3723 func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall {
3724 c.ifNoneMatch_ = entityTag
3725 return c
3726 }
3727
3728
3729
3730
3731 func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
3732 c.ctx_ = ctx
3733 return c
3734 }
3735
3736
3737
3738 func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
3739 if c.header_ == nil {
3740 c.header_ = make(http.Header)
3741 }
3742 return c.header_
3743 }
3744
3745 func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
3746 reqHeaders := make(http.Header)
3747 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
3748 for k, v := range c.header_ {
3749 reqHeaders[k] = v
3750 }
3751 reqHeaders.Set("User-Agent", c.s.userAgent())
3752 if c.ifNoneMatch_ != "" {
3753 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3754 }
3755 var body io.Reader = nil
3756 c.urlParams_.Set("alt", alt)
3757 c.urlParams_.Set("prettyPrint", "false")
3758 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
3759 urls += "?" + c.urlParams_.Encode()
3760 req, err := http.NewRequest("GET", urls, body)
3761 if err != nil {
3762 return nil, err
3763 }
3764 req.Header = reqHeaders
3765 googleapi.Expand(req.URL, map[string]string{
3766 "bucket": c.bucket,
3767 })
3768 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3769 }
3770
3771
3772
3773
3774
3775
3776
3777
3778 func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
3779 gensupport.SetOptions(c.urlParams_, opts...)
3780 res, err := c.doRequest("json")
3781 if res != nil && res.StatusCode == http.StatusNotModified {
3782 if res.Body != nil {
3783 res.Body.Close()
3784 }
3785 return nil, &googleapi.Error{
3786 Code: res.StatusCode,
3787 Header: res.Header,
3788 }
3789 }
3790 if err != nil {
3791 return nil, err
3792 }
3793 defer googleapi.CloseBody(res)
3794 if err := googleapi.CheckResponse(res); err != nil {
3795 return nil, err
3796 }
3797 ret := &ObjectAccessControls{
3798 ServerResponse: googleapi.ServerResponse{
3799 Header: res.Header,
3800 HTTPStatusCode: res.StatusCode,
3801 },
3802 }
3803 target := &ret
3804 if err := gensupport.DecodeResponse(target, res); err != nil {
3805 return nil, err
3806 }
3807 return ret, nil
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844 }
3845
3846
3847
3848 type DefaultObjectAccessControlsPatchCall struct {
3849 s *Service
3850 bucket string
3851 entity string
3852 objectaccesscontrol *ObjectAccessControl
3853 urlParams_ gensupport.URLParams
3854 ctx_ context.Context
3855 header_ http.Header
3856 }
3857
3858
3859
3860 func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall {
3861 c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3862 c.bucket = bucket
3863 c.entity = entity
3864 c.objectaccesscontrol = objectaccesscontrol
3865 return c
3866 }
3867
3868
3869
3870
3871 func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall {
3872 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3873 return c
3874 }
3875
3876
3877
3878
3879 func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
3880 c.ctx_ = ctx
3881 return c
3882 }
3883
3884
3885
3886 func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
3887 if c.header_ == nil {
3888 c.header_ = make(http.Header)
3889 }
3890 return c.header_
3891 }
3892
3893 func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
3894 reqHeaders := make(http.Header)
3895 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
3896 for k, v := range c.header_ {
3897 reqHeaders[k] = v
3898 }
3899 reqHeaders.Set("User-Agent", c.s.userAgent())
3900 var body io.Reader = nil
3901 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
3902 if err != nil {
3903 return nil, err
3904 }
3905 reqHeaders.Set("Content-Type", "application/json")
3906 c.urlParams_.Set("alt", alt)
3907 c.urlParams_.Set("prettyPrint", "false")
3908 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
3909 urls += "?" + c.urlParams_.Encode()
3910 req, err := http.NewRequest("PATCH", urls, body)
3911 if err != nil {
3912 return nil, err
3913 }
3914 req.Header = reqHeaders
3915 googleapi.Expand(req.URL, map[string]string{
3916 "bucket": c.bucket,
3917 "entity": c.entity,
3918 })
3919 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3920 }
3921
3922
3923
3924
3925
3926
3927
3928
3929 func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
3930 gensupport.SetOptions(c.urlParams_, opts...)
3931 res, err := c.doRequest("json")
3932 if res != nil && res.StatusCode == http.StatusNotModified {
3933 if res.Body != nil {
3934 res.Body.Close()
3935 }
3936 return nil, &googleapi.Error{
3937 Code: res.StatusCode,
3938 Header: res.Header,
3939 }
3940 }
3941 if err != nil {
3942 return nil, err
3943 }
3944 defer googleapi.CloseBody(res)
3945 if err := googleapi.CheckResponse(res); err != nil {
3946 return nil, err
3947 }
3948 ret := &ObjectAccessControl{
3949 ServerResponse: googleapi.ServerResponse{
3950 Header: res.Header,
3951 HTTPStatusCode: res.StatusCode,
3952 },
3953 }
3954 target := &ret
3955 if err := gensupport.DecodeResponse(target, res); err != nil {
3956 return nil, err
3957 }
3958 return ret, nil
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993 }
3994
3995
3996
3997 type DefaultObjectAccessControlsUpdateCall struct {
3998 s *Service
3999 bucket string
4000 entity string
4001 objectaccesscontrol *ObjectAccessControl
4002 urlParams_ gensupport.URLParams
4003 ctx_ context.Context
4004 header_ http.Header
4005 }
4006
4007
4008 func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall {
4009 c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4010 c.bucket = bucket
4011 c.entity = entity
4012 c.objectaccesscontrol = objectaccesscontrol
4013 return c
4014 }
4015
4016
4017
4018
4019 func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall {
4020 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4021 return c
4022 }
4023
4024
4025
4026
4027 func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
4028 c.ctx_ = ctx
4029 return c
4030 }
4031
4032
4033
4034 func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
4035 if c.header_ == nil {
4036 c.header_ = make(http.Header)
4037 }
4038 return c.header_
4039 }
4040
4041 func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
4042 reqHeaders := make(http.Header)
4043 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
4044 for k, v := range c.header_ {
4045 reqHeaders[k] = v
4046 }
4047 reqHeaders.Set("User-Agent", c.s.userAgent())
4048 var body io.Reader = nil
4049 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
4050 if err != nil {
4051 return nil, err
4052 }
4053 reqHeaders.Set("Content-Type", "application/json")
4054 c.urlParams_.Set("alt", alt)
4055 c.urlParams_.Set("prettyPrint", "false")
4056 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
4057 urls += "?" + c.urlParams_.Encode()
4058 req, err := http.NewRequest("PUT", urls, body)
4059 if err != nil {
4060 return nil, err
4061 }
4062 req.Header = reqHeaders
4063 googleapi.Expand(req.URL, map[string]string{
4064 "bucket": c.bucket,
4065 "entity": c.entity,
4066 })
4067 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4068 }
4069
4070
4071
4072
4073
4074
4075
4076
4077 func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
4078 gensupport.SetOptions(c.urlParams_, opts...)
4079 res, err := c.doRequest("json")
4080 if res != nil && res.StatusCode == http.StatusNotModified {
4081 if res.Body != nil {
4082 res.Body.Close()
4083 }
4084 return nil, &googleapi.Error{
4085 Code: res.StatusCode,
4086 Header: res.Header,
4087 }
4088 }
4089 if err != nil {
4090 return nil, err
4091 }
4092 defer googleapi.CloseBody(res)
4093 if err := googleapi.CheckResponse(res); err != nil {
4094 return nil, err
4095 }
4096 ret := &ObjectAccessControl{
4097 ServerResponse: googleapi.ServerResponse{
4098 Header: res.Header,
4099 HTTPStatusCode: res.StatusCode,
4100 },
4101 }
4102 target := &ret
4103 if err := gensupport.DecodeResponse(target, res); err != nil {
4104 return nil, err
4105 }
4106 return ret, nil
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141 }
4142
4143
4144
4145 type ObjectAccessControlsDeleteCall struct {
4146 s *Service
4147 bucket string
4148 object string
4149 entity string
4150 urlParams_ gensupport.URLParams
4151 ctx_ context.Context
4152 header_ http.Header
4153 }
4154
4155
4156
4157 func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
4158 c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4159 c.bucket = bucket
4160 c.object = object
4161 c.entity = entity
4162 return c
4163 }
4164
4165
4166
4167
4168 func (c *ObjectAccessControlsDeleteCall) Generation(generation uint64) *ObjectAccessControlsDeleteCall {
4169 c.urlParams_.Set("generation", fmt.Sprint(generation))
4170 return c
4171 }
4172
4173
4174
4175
4176 func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
4177 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4178 return c
4179 }
4180
4181
4182
4183
4184 func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
4185 c.ctx_ = ctx
4186 return c
4187 }
4188
4189
4190
4191 func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
4192 if c.header_ == nil {
4193 c.header_ = make(http.Header)
4194 }
4195 return c.header_
4196 }
4197
4198 func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
4199 reqHeaders := make(http.Header)
4200 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
4201 for k, v := range c.header_ {
4202 reqHeaders[k] = v
4203 }
4204 reqHeaders.Set("User-Agent", c.s.userAgent())
4205 var body io.Reader = nil
4206 c.urlParams_.Set("alt", alt)
4207 c.urlParams_.Set("prettyPrint", "false")
4208 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
4209 urls += "?" + c.urlParams_.Encode()
4210 req, err := http.NewRequest("DELETE", urls, body)
4211 if err != nil {
4212 return nil, err
4213 }
4214 req.Header = reqHeaders
4215 googleapi.Expand(req.URL, map[string]string{
4216 "bucket": c.bucket,
4217 "object": c.object,
4218 "entity": c.entity,
4219 })
4220 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4221 }
4222
4223
4224 func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
4225 gensupport.SetOptions(c.urlParams_, opts...)
4226 res, err := c.doRequest("json")
4227 if err != nil {
4228 return err
4229 }
4230 defer googleapi.CloseBody(res)
4231 if err := googleapi.CheckResponse(res); err != nil {
4232 return err
4233 }
4234 return nil
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276 }
4277
4278
4279
4280 type ObjectAccessControlsGetCall struct {
4281 s *Service
4282 bucket string
4283 object string
4284 entity string
4285 urlParams_ gensupport.URLParams
4286 ifNoneMatch_ string
4287 ctx_ context.Context
4288 header_ http.Header
4289 }
4290
4291
4292
4293 func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
4294 c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4295 c.bucket = bucket
4296 c.object = object
4297 c.entity = entity
4298 return c
4299 }
4300
4301
4302
4303
4304 func (c *ObjectAccessControlsGetCall) Generation(generation uint64) *ObjectAccessControlsGetCall {
4305 c.urlParams_.Set("generation", fmt.Sprint(generation))
4306 return c
4307 }
4308
4309
4310
4311
4312 func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
4313 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4314 return c
4315 }
4316
4317
4318
4319
4320
4321
4322 func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
4323 c.ifNoneMatch_ = entityTag
4324 return c
4325 }
4326
4327
4328
4329
4330 func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
4331 c.ctx_ = ctx
4332 return c
4333 }
4334
4335
4336
4337 func (c *ObjectAccessControlsGetCall) Header() http.Header {
4338 if c.header_ == nil {
4339 c.header_ = make(http.Header)
4340 }
4341 return c.header_
4342 }
4343
4344 func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
4345 reqHeaders := make(http.Header)
4346 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
4347 for k, v := range c.header_ {
4348 reqHeaders[k] = v
4349 }
4350 reqHeaders.Set("User-Agent", c.s.userAgent())
4351 if c.ifNoneMatch_ != "" {
4352 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4353 }
4354 var body io.Reader = nil
4355 c.urlParams_.Set("alt", alt)
4356 c.urlParams_.Set("prettyPrint", "false")
4357 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
4358 urls += "?" + c.urlParams_.Encode()
4359 req, err := http.NewRequest("GET", urls, body)
4360 if err != nil {
4361 return nil, err
4362 }
4363 req.Header = reqHeaders
4364 googleapi.Expand(req.URL, map[string]string{
4365 "bucket": c.bucket,
4366 "object": c.object,
4367 "entity": c.entity,
4368 })
4369 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4370 }
4371
4372
4373
4374
4375
4376
4377
4378
4379 func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
4380 gensupport.SetOptions(c.urlParams_, opts...)
4381 res, err := c.doRequest("json")
4382 if res != nil && res.StatusCode == http.StatusNotModified {
4383 if res.Body != nil {
4384 res.Body.Close()
4385 }
4386 return nil, &googleapi.Error{
4387 Code: res.StatusCode,
4388 Header: res.Header,
4389 }
4390 }
4391 if err != nil {
4392 return nil, err
4393 }
4394 defer googleapi.CloseBody(res)
4395 if err := googleapi.CheckResponse(res); err != nil {
4396 return nil, err
4397 }
4398 ret := &ObjectAccessControl{
4399 ServerResponse: googleapi.ServerResponse{
4400 Header: res.Header,
4401 HTTPStatusCode: res.StatusCode,
4402 },
4403 }
4404 target := &ret
4405 if err := gensupport.DecodeResponse(target, res); err != nil {
4406 return nil, err
4407 }
4408 return ret, nil
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453 }
4454
4455
4456
4457 type ObjectAccessControlsInsertCall struct {
4458 s *Service
4459 bucket string
4460 object string
4461 objectaccesscontrol *ObjectAccessControl
4462 urlParams_ gensupport.URLParams
4463 ctx_ context.Context
4464 header_ http.Header
4465 }
4466
4467
4468 func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
4469 c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4470 c.bucket = bucket
4471 c.object = object
4472 c.objectaccesscontrol = objectaccesscontrol
4473 return c
4474 }
4475
4476
4477
4478
4479 func (c *ObjectAccessControlsInsertCall) Generation(generation uint64) *ObjectAccessControlsInsertCall {
4480 c.urlParams_.Set("generation", fmt.Sprint(generation))
4481 return c
4482 }
4483
4484
4485
4486
4487 func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
4488 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4489 return c
4490 }
4491
4492
4493
4494
4495 func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
4496 c.ctx_ = ctx
4497 return c
4498 }
4499
4500
4501
4502 func (c *ObjectAccessControlsInsertCall) Header() http.Header {
4503 if c.header_ == nil {
4504 c.header_ = make(http.Header)
4505 }
4506 return c.header_
4507 }
4508
4509 func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
4510 reqHeaders := make(http.Header)
4511 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
4512 for k, v := range c.header_ {
4513 reqHeaders[k] = v
4514 }
4515 reqHeaders.Set("User-Agent", c.s.userAgent())
4516 var body io.Reader = nil
4517 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
4518 if err != nil {
4519 return nil, err
4520 }
4521 reqHeaders.Set("Content-Type", "application/json")
4522 c.urlParams_.Set("alt", alt)
4523 c.urlParams_.Set("prettyPrint", "false")
4524 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
4525 urls += "?" + c.urlParams_.Encode()
4526 req, err := http.NewRequest("POST", urls, body)
4527 if err != nil {
4528 return nil, err
4529 }
4530 req.Header = reqHeaders
4531 googleapi.Expand(req.URL, map[string]string{
4532 "bucket": c.bucket,
4533 "object": c.object,
4534 })
4535 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4536 }
4537
4538
4539
4540
4541
4542
4543
4544
4545 func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
4546 gensupport.SetOptions(c.urlParams_, opts...)
4547 res, err := c.doRequest("json")
4548 if res != nil && res.StatusCode == http.StatusNotModified {
4549 if res.Body != nil {
4550 res.Body.Close()
4551 }
4552 return nil, &googleapi.Error{
4553 Code: res.StatusCode,
4554 Header: res.Header,
4555 }
4556 }
4557 if err != nil {
4558 return nil, err
4559 }
4560 defer googleapi.CloseBody(res)
4561 if err := googleapi.CheckResponse(res); err != nil {
4562 return nil, err
4563 }
4564 ret := &ObjectAccessControl{
4565 ServerResponse: googleapi.ServerResponse{
4566 Header: res.Header,
4567 HTTPStatusCode: res.StatusCode,
4568 },
4569 }
4570 target := &ret
4571 if err := gensupport.DecodeResponse(target, res); err != nil {
4572 return nil, err
4573 }
4574 return ret, nil
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615 }
4616
4617
4618
4619 type ObjectAccessControlsListCall struct {
4620 s *Service
4621 bucket string
4622 object string
4623 urlParams_ gensupport.URLParams
4624 ifNoneMatch_ string
4625 ctx_ context.Context
4626 header_ http.Header
4627 }
4628
4629
4630 func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
4631 c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4632 c.bucket = bucket
4633 c.object = object
4634 return c
4635 }
4636
4637
4638
4639
4640 func (c *ObjectAccessControlsListCall) Generation(generation uint64) *ObjectAccessControlsListCall {
4641 c.urlParams_.Set("generation", fmt.Sprint(generation))
4642 return c
4643 }
4644
4645
4646
4647
4648 func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
4649 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4650 return c
4651 }
4652
4653
4654
4655
4656
4657
4658 func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
4659 c.ifNoneMatch_ = entityTag
4660 return c
4661 }
4662
4663
4664
4665
4666 func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
4667 c.ctx_ = ctx
4668 return c
4669 }
4670
4671
4672
4673 func (c *ObjectAccessControlsListCall) Header() http.Header {
4674 if c.header_ == nil {
4675 c.header_ = make(http.Header)
4676 }
4677 return c.header_
4678 }
4679
4680 func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
4681 reqHeaders := make(http.Header)
4682 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
4683 for k, v := range c.header_ {
4684 reqHeaders[k] = v
4685 }
4686 reqHeaders.Set("User-Agent", c.s.userAgent())
4687 if c.ifNoneMatch_ != "" {
4688 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4689 }
4690 var body io.Reader = nil
4691 c.urlParams_.Set("alt", alt)
4692 c.urlParams_.Set("prettyPrint", "false")
4693 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
4694 urls += "?" + c.urlParams_.Encode()
4695 req, err := http.NewRequest("GET", urls, body)
4696 if err != nil {
4697 return nil, err
4698 }
4699 req.Header = reqHeaders
4700 googleapi.Expand(req.URL, map[string]string{
4701 "bucket": c.bucket,
4702 "object": c.object,
4703 })
4704 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4705 }
4706
4707
4708
4709
4710
4711
4712
4713
4714 func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
4715 gensupport.SetOptions(c.urlParams_, opts...)
4716 res, err := c.doRequest("json")
4717 if res != nil && res.StatusCode == http.StatusNotModified {
4718 if res.Body != nil {
4719 res.Body.Close()
4720 }
4721 return nil, &googleapi.Error{
4722 Code: res.StatusCode,
4723 Header: res.Header,
4724 }
4725 }
4726 if err != nil {
4727 return nil, err
4728 }
4729 defer googleapi.CloseBody(res)
4730 if err := googleapi.CheckResponse(res); err != nil {
4731 return nil, err
4732 }
4733 ret := &ObjectAccessControls{
4734 ServerResponse: googleapi.ServerResponse{
4735 Header: res.Header,
4736 HTTPStatusCode: res.StatusCode,
4737 },
4738 }
4739 target := &ret
4740 if err := gensupport.DecodeResponse(target, res); err != nil {
4741 return nil, err
4742 }
4743 return ret, nil
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781 }
4782
4783
4784
4785 type ObjectAccessControlsPatchCall struct {
4786 s *Service
4787 bucket string
4788 object string
4789 entity string
4790 objectaccesscontrol *ObjectAccessControl
4791 urlParams_ gensupport.URLParams
4792 ctx_ context.Context
4793 header_ http.Header
4794 }
4795
4796
4797
4798 func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
4799 c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4800 c.bucket = bucket
4801 c.object = object
4802 c.entity = entity
4803 c.objectaccesscontrol = objectaccesscontrol
4804 return c
4805 }
4806
4807
4808
4809
4810 func (c *ObjectAccessControlsPatchCall) Generation(generation uint64) *ObjectAccessControlsPatchCall {
4811 c.urlParams_.Set("generation", fmt.Sprint(generation))
4812 return c
4813 }
4814
4815
4816
4817
4818 func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
4819 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4820 return c
4821 }
4822
4823
4824
4825
4826 func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
4827 c.ctx_ = ctx
4828 return c
4829 }
4830
4831
4832
4833 func (c *ObjectAccessControlsPatchCall) Header() http.Header {
4834 if c.header_ == nil {
4835 c.header_ = make(http.Header)
4836 }
4837 return c.header_
4838 }
4839
4840 func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
4841 reqHeaders := make(http.Header)
4842 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
4843 for k, v := range c.header_ {
4844 reqHeaders[k] = v
4845 }
4846 reqHeaders.Set("User-Agent", c.s.userAgent())
4847 var body io.Reader = nil
4848 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
4849 if err != nil {
4850 return nil, err
4851 }
4852 reqHeaders.Set("Content-Type", "application/json")
4853 c.urlParams_.Set("alt", alt)
4854 c.urlParams_.Set("prettyPrint", "false")
4855 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
4856 urls += "?" + c.urlParams_.Encode()
4857 req, err := http.NewRequest("PATCH", urls, body)
4858 if err != nil {
4859 return nil, err
4860 }
4861 req.Header = reqHeaders
4862 googleapi.Expand(req.URL, map[string]string{
4863 "bucket": c.bucket,
4864 "object": c.object,
4865 "entity": c.entity,
4866 })
4867 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4868 }
4869
4870
4871
4872
4873
4874
4875
4876
4877 func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
4878 gensupport.SetOptions(c.urlParams_, opts...)
4879 res, err := c.doRequest("json")
4880 if res != nil && res.StatusCode == http.StatusNotModified {
4881 if res.Body != nil {
4882 res.Body.Close()
4883 }
4884 return nil, &googleapi.Error{
4885 Code: res.StatusCode,
4886 Header: res.Header,
4887 }
4888 }
4889 if err != nil {
4890 return nil, err
4891 }
4892 defer googleapi.CloseBody(res)
4893 if err := googleapi.CheckResponse(res); err != nil {
4894 return nil, err
4895 }
4896 ret := &ObjectAccessControl{
4897 ServerResponse: googleapi.ServerResponse{
4898 Header: res.Header,
4899 HTTPStatusCode: res.StatusCode,
4900 },
4901 }
4902 target := &ret
4903 if err := gensupport.DecodeResponse(target, res); err != nil {
4904 return nil, err
4905 }
4906 return ret, nil
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954 }
4955
4956
4957
4958 type ObjectAccessControlsUpdateCall struct {
4959 s *Service
4960 bucket string
4961 object string
4962 entity string
4963 objectaccesscontrol *ObjectAccessControl
4964 urlParams_ gensupport.URLParams
4965 ctx_ context.Context
4966 header_ http.Header
4967 }
4968
4969
4970 func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
4971 c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4972 c.bucket = bucket
4973 c.object = object
4974 c.entity = entity
4975 c.objectaccesscontrol = objectaccesscontrol
4976 return c
4977 }
4978
4979
4980
4981
4982 func (c *ObjectAccessControlsUpdateCall) Generation(generation uint64) *ObjectAccessControlsUpdateCall {
4983 c.urlParams_.Set("generation", fmt.Sprint(generation))
4984 return c
4985 }
4986
4987
4988
4989
4990 func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
4991 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4992 return c
4993 }
4994
4995
4996
4997
4998 func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
4999 c.ctx_ = ctx
5000 return c
5001 }
5002
5003
5004
5005 func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
5006 if c.header_ == nil {
5007 c.header_ = make(http.Header)
5008 }
5009 return c.header_
5010 }
5011
5012 func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
5013 reqHeaders := make(http.Header)
5014 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
5015 for k, v := range c.header_ {
5016 reqHeaders[k] = v
5017 }
5018 reqHeaders.Set("User-Agent", c.s.userAgent())
5019 var body io.Reader = nil
5020 body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
5021 if err != nil {
5022 return nil, err
5023 }
5024 reqHeaders.Set("Content-Type", "application/json")
5025 c.urlParams_.Set("alt", alt)
5026 c.urlParams_.Set("prettyPrint", "false")
5027 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
5028 urls += "?" + c.urlParams_.Encode()
5029 req, err := http.NewRequest("PUT", urls, body)
5030 if err != nil {
5031 return nil, err
5032 }
5033 req.Header = reqHeaders
5034 googleapi.Expand(req.URL, map[string]string{
5035 "bucket": c.bucket,
5036 "object": c.object,
5037 "entity": c.entity,
5038 })
5039 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5040 }
5041
5042
5043
5044
5045
5046
5047
5048
5049 func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
5050 gensupport.SetOptions(c.urlParams_, opts...)
5051 res, err := c.doRequest("json")
5052 if res != nil && res.StatusCode == http.StatusNotModified {
5053 if res.Body != nil {
5054 res.Body.Close()
5055 }
5056 return nil, &googleapi.Error{
5057 Code: res.StatusCode,
5058 Header: res.Header,
5059 }
5060 }
5061 if err != nil {
5062 return nil, err
5063 }
5064 defer googleapi.CloseBody(res)
5065 if err := googleapi.CheckResponse(res); err != nil {
5066 return nil, err
5067 }
5068 ret := &ObjectAccessControl{
5069 ServerResponse: googleapi.ServerResponse{
5070 Header: res.Header,
5071 HTTPStatusCode: res.StatusCode,
5072 },
5073 }
5074 target := &ret
5075 if err := gensupport.DecodeResponse(target, res); err != nil {
5076 return nil, err
5077 }
5078 return ret, nil
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126 }
5127
5128
5129
5130 type ObjectsComposeCall struct {
5131 s *Service
5132 destinationBucket string
5133 destinationObject string
5134 composerequest *ComposeRequest
5135 urlParams_ gensupport.URLParams
5136 ctx_ context.Context
5137 header_ http.Header
5138 }
5139
5140
5141
5142 func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall {
5143 c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5144 c.destinationBucket = destinationBucket
5145 c.destinationObject = destinationObject
5146 c.composerequest = composerequest
5147 return c
5148 }
5149
5150
5151
5152
5153 func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsComposeCall {
5154 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
5155 return c
5156 }
5157
5158
5159
5160
5161 func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsComposeCall {
5162 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
5163 return c
5164 }
5165
5166
5167
5168
5169 func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall {
5170 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5171 return c
5172 }
5173
5174
5175
5176
5177 func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
5178 c.ctx_ = ctx
5179 return c
5180 }
5181
5182
5183
5184 func (c *ObjectsComposeCall) Header() http.Header {
5185 if c.header_ == nil {
5186 c.header_ = make(http.Header)
5187 }
5188 return c.header_
5189 }
5190
5191 func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
5192 reqHeaders := make(http.Header)
5193 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
5194 for k, v := range c.header_ {
5195 reqHeaders[k] = v
5196 }
5197 reqHeaders.Set("User-Agent", c.s.userAgent())
5198 var body io.Reader = nil
5199 body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
5200 if err != nil {
5201 return nil, err
5202 }
5203 reqHeaders.Set("Content-Type", "application/json")
5204 c.urlParams_.Set("alt", alt)
5205 c.urlParams_.Set("prettyPrint", "false")
5206 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose")
5207 urls += "?" + c.urlParams_.Encode()
5208 req, err := http.NewRequest("POST", urls, body)
5209 if err != nil {
5210 return nil, err
5211 }
5212 req.Header = reqHeaders
5213 googleapi.Expand(req.URL, map[string]string{
5214 "destinationBucket": c.destinationBucket,
5215 "destinationObject": c.destinationObject,
5216 })
5217 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5218 }
5219
5220
5221
5222
5223 func (c *ObjectsComposeCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
5224 gensupport.SetOptions(c.urlParams_, opts...)
5225 res, err := c.doRequest("media")
5226 if err != nil {
5227 return nil, err
5228 }
5229 if err := googleapi.CheckMediaResponse(res); err != nil {
5230 res.Body.Close()
5231 return nil, err
5232 }
5233 return res, nil
5234 }
5235
5236
5237
5238
5239
5240
5241
5242
5243 func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
5244 gensupport.SetOptions(c.urlParams_, opts...)
5245 res, err := c.doRequest("json")
5246 if res != nil && res.StatusCode == http.StatusNotModified {
5247 if res.Body != nil {
5248 res.Body.Close()
5249 }
5250 return nil, &googleapi.Error{
5251 Code: res.StatusCode,
5252 Header: res.Header,
5253 }
5254 }
5255 if err != nil {
5256 return nil, err
5257 }
5258 defer googleapi.CloseBody(res)
5259 if err := googleapi.CheckResponse(res); err != nil {
5260 return nil, err
5261 }
5262 ret := &Object{
5263 ServerResponse: googleapi.ServerResponse{
5264 Header: res.Header,
5265 HTTPStatusCode: res.StatusCode,
5266 },
5267 }
5268 target := &ret
5269 if err := gensupport.DecodeResponse(target, res); err != nil {
5270 return nil, err
5271 }
5272 return ret, nil
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321 }
5322
5323
5324
5325 type ObjectsCopyCall struct {
5326 s *Service
5327 sourceBucket string
5328 sourceObject string
5329 destinationBucket string
5330 destinationObject string
5331 object *Object
5332 urlParams_ gensupport.URLParams
5333 ctx_ context.Context
5334 header_ http.Header
5335 }
5336
5337
5338
5339 func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall {
5340 c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5341 c.sourceBucket = sourceBucket
5342 c.sourceObject = sourceObject
5343 c.destinationBucket = destinationBucket
5344 c.destinationObject = destinationObject
5345 c.object = object
5346 return c
5347 }
5348
5349
5350
5351
5352 func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsCopyCall {
5353 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
5354 return c
5355 }
5356
5357
5358
5359
5360
5361 func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsCopyCall {
5362 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
5363 return c
5364 }
5365
5366
5367
5368
5369
5370 func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsCopyCall {
5371 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
5372 return c
5373 }
5374
5375
5376
5377
5378
5379 func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsCopyCall {
5380 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
5381 return c
5382 }
5383
5384
5385
5386
5387 func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch uint64) *ObjectsCopyCall {
5388 c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
5389 return c
5390 }
5391
5392
5393
5394
5395
5396 func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch uint64) *ObjectsCopyCall {
5397 c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
5398 return c
5399 }
5400
5401
5402
5403
5404
5405 func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch uint64) *ObjectsCopyCall {
5406 c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
5407 return c
5408 }
5409
5410
5411
5412
5413
5414 func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch uint64) *ObjectsCopyCall {
5415 c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
5416 return c
5417 }
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427 func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall {
5428 c.urlParams_.Set("projection", projection)
5429 return c
5430 }
5431
5432
5433
5434
5435 func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration uint64) *ObjectsCopyCall {
5436 c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
5437 return c
5438 }
5439
5440
5441
5442
5443 func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall {
5444 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5445 return c
5446 }
5447
5448
5449
5450
5451 func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
5452 c.ctx_ = ctx
5453 return c
5454 }
5455
5456
5457
5458 func (c *ObjectsCopyCall) Header() http.Header {
5459 if c.header_ == nil {
5460 c.header_ = make(http.Header)
5461 }
5462 return c.header_
5463 }
5464
5465 func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
5466 reqHeaders := make(http.Header)
5467 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
5468 for k, v := range c.header_ {
5469 reqHeaders[k] = v
5470 }
5471 reqHeaders.Set("User-Agent", c.s.userAgent())
5472 var body io.Reader = nil
5473 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
5474 if err != nil {
5475 return nil, err
5476 }
5477 reqHeaders.Set("Content-Type", "application/json")
5478 c.urlParams_.Set("alt", alt)
5479 c.urlParams_.Set("prettyPrint", "false")
5480 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}")
5481 urls += "?" + c.urlParams_.Encode()
5482 req, err := http.NewRequest("POST", urls, body)
5483 if err != nil {
5484 return nil, err
5485 }
5486 req.Header = reqHeaders
5487 googleapi.Expand(req.URL, map[string]string{
5488 "sourceBucket": c.sourceBucket,
5489 "sourceObject": c.sourceObject,
5490 "destinationBucket": c.destinationBucket,
5491 "destinationObject": c.destinationObject,
5492 })
5493 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5494 }
5495
5496
5497
5498
5499 func (c *ObjectsCopyCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
5500 gensupport.SetOptions(c.urlParams_, opts...)
5501 res, err := c.doRequest("media")
5502 if err != nil {
5503 return nil, err
5504 }
5505 if err := googleapi.CheckMediaResponse(res); err != nil {
5506 res.Body.Close()
5507 return nil, err
5508 }
5509 return res, nil
5510 }
5511
5512
5513
5514
5515
5516
5517
5518
5519 func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
5520 gensupport.SetOptions(c.urlParams_, opts...)
5521 res, err := c.doRequest("json")
5522 if res != nil && res.StatusCode == http.StatusNotModified {
5523 if res.Body != nil {
5524 res.Body.Close()
5525 }
5526 return nil, &googleapi.Error{
5527 Code: res.StatusCode,
5528 Header: res.Header,
5529 }
5530 }
5531 if err != nil {
5532 return nil, err
5533 }
5534 defer googleapi.CloseBody(res)
5535 if err := googleapi.CheckResponse(res); err != nil {
5536 return nil, err
5537 }
5538 ret := &Object{
5539 ServerResponse: googleapi.ServerResponse{
5540 Header: res.Header,
5541 HTTPStatusCode: res.StatusCode,
5542 },
5543 }
5544 target := &ret
5545 if err := gensupport.DecodeResponse(target, res); err != nil {
5546 return nil, err
5547 }
5548 return ret, nil
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666 }
5667
5668
5669
5670 type ObjectsDeleteCall struct {
5671 s *Service
5672 bucket string
5673 object string
5674 urlParams_ gensupport.URLParams
5675 ctx_ context.Context
5676 header_ http.Header
5677 }
5678
5679
5680
5681
5682 func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
5683 c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5684 c.bucket = bucket
5685 c.object = object
5686 return c
5687 }
5688
5689
5690
5691
5692 func (c *ObjectsDeleteCall) Generation(generation uint64) *ObjectsDeleteCall {
5693 c.urlParams_.Set("generation", fmt.Sprint(generation))
5694 return c
5695 }
5696
5697
5698
5699
5700 func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsDeleteCall {
5701 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
5702 return c
5703 }
5704
5705
5706
5707
5708 func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsDeleteCall {
5709 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
5710 return c
5711 }
5712
5713
5714
5715
5716 func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsDeleteCall {
5717 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
5718 return c
5719 }
5720
5721
5722
5723
5724
5725 func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsDeleteCall {
5726 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
5727 return c
5728 }
5729
5730
5731
5732
5733 func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
5734 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5735 return c
5736 }
5737
5738
5739
5740
5741 func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
5742 c.ctx_ = ctx
5743 return c
5744 }
5745
5746
5747
5748 func (c *ObjectsDeleteCall) Header() http.Header {
5749 if c.header_ == nil {
5750 c.header_ = make(http.Header)
5751 }
5752 return c.header_
5753 }
5754
5755 func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
5756 reqHeaders := make(http.Header)
5757 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
5758 for k, v := range c.header_ {
5759 reqHeaders[k] = v
5760 }
5761 reqHeaders.Set("User-Agent", c.s.userAgent())
5762 var body io.Reader = nil
5763 c.urlParams_.Set("alt", alt)
5764 c.urlParams_.Set("prettyPrint", "false")
5765 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
5766 urls += "?" + c.urlParams_.Encode()
5767 req, err := http.NewRequest("DELETE", urls, body)
5768 if err != nil {
5769 return nil, err
5770 }
5771 req.Header = reqHeaders
5772 googleapi.Expand(req.URL, map[string]string{
5773 "bucket": c.bucket,
5774 "object": c.object,
5775 })
5776 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5777 }
5778
5779
5780 func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
5781 gensupport.SetOptions(c.urlParams_, opts...)
5782 res, err := c.doRequest("json")
5783 if err != nil {
5784 return err
5785 }
5786 defer googleapi.CloseBody(res)
5787 if err := googleapi.CheckResponse(res); err != nil {
5788 return err
5789 }
5790 return nil
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850 }
5851
5852
5853
5854 type ObjectsGetCall struct {
5855 s *Service
5856 bucket string
5857 object string
5858 urlParams_ gensupport.URLParams
5859 ifNoneMatch_ string
5860 ctx_ context.Context
5861 header_ http.Header
5862 }
5863
5864
5865 func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
5866 c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5867 c.bucket = bucket
5868 c.object = object
5869 return c
5870 }
5871
5872
5873
5874
5875 func (c *ObjectsGetCall) Generation(generation uint64) *ObjectsGetCall {
5876 c.urlParams_.Set("generation", fmt.Sprint(generation))
5877 return c
5878 }
5879
5880
5881
5882
5883 func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsGetCall {
5884 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
5885 return c
5886 }
5887
5888
5889
5890
5891 func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsGetCall {
5892 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
5893 return c
5894 }
5895
5896
5897
5898
5899 func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsGetCall {
5900 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
5901 return c
5902 }
5903
5904
5905
5906
5907
5908 func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsGetCall {
5909 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
5910 return c
5911 }
5912
5913
5914
5915
5916
5917
5918
5919
5920 func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
5921 c.urlParams_.Set("projection", projection)
5922 return c
5923 }
5924
5925
5926
5927
5928 func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
5929 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5930 return c
5931 }
5932
5933
5934
5935
5936
5937
5938 func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
5939 c.ifNoneMatch_ = entityTag
5940 return c
5941 }
5942
5943
5944
5945
5946 func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
5947 c.ctx_ = ctx
5948 return c
5949 }
5950
5951
5952
5953 func (c *ObjectsGetCall) Header() http.Header {
5954 if c.header_ == nil {
5955 c.header_ = make(http.Header)
5956 }
5957 return c.header_
5958 }
5959
5960 func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
5961 reqHeaders := make(http.Header)
5962 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
5963 for k, v := range c.header_ {
5964 reqHeaders[k] = v
5965 }
5966 reqHeaders.Set("User-Agent", c.s.userAgent())
5967 if c.ifNoneMatch_ != "" {
5968 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5969 }
5970 var body io.Reader = nil
5971 c.urlParams_.Set("alt", alt)
5972 c.urlParams_.Set("prettyPrint", "false")
5973 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
5974 urls += "?" + c.urlParams_.Encode()
5975 req, err := http.NewRequest("GET", urls, body)
5976 if err != nil {
5977 return nil, err
5978 }
5979 req.Header = reqHeaders
5980 googleapi.Expand(req.URL, map[string]string{
5981 "bucket": c.bucket,
5982 "object": c.object,
5983 })
5984 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5985 }
5986
5987
5988
5989
5990 func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
5991 gensupport.SetOptions(c.urlParams_, opts...)
5992 res, err := c.doRequest("media")
5993 if err != nil {
5994 return nil, err
5995 }
5996 if err := googleapi.CheckMediaResponse(res); err != nil {
5997 res.Body.Close()
5998 return nil, err
5999 }
6000 return res, nil
6001 }
6002
6003
6004
6005
6006
6007
6008
6009
6010 func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
6011 gensupport.SetOptions(c.urlParams_, opts...)
6012 res, err := c.doRequest("json")
6013 if res != nil && res.StatusCode == http.StatusNotModified {
6014 if res.Body != nil {
6015 res.Body.Close()
6016 }
6017 return nil, &googleapi.Error{
6018 Code: res.StatusCode,
6019 Header: res.Header,
6020 }
6021 }
6022 if err != nil {
6023 return nil, err
6024 }
6025 defer googleapi.CloseBody(res)
6026 if err := googleapi.CheckResponse(res); err != nil {
6027 return nil, err
6028 }
6029 ret := &Object{
6030 ServerResponse: googleapi.ServerResponse{
6031 Header: res.Header,
6032 HTTPStatusCode: res.StatusCode,
6033 },
6034 }
6035 target := &ret
6036 if err := gensupport.DecodeResponse(target, res); err != nil {
6037 return nil, err
6038 }
6039 return ret, nil
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117 }
6118
6119
6120
6121 type ObjectsInsertCall struct {
6122 s *Service
6123 bucket string
6124 object *Object
6125 urlParams_ gensupport.URLParams
6126 mediaInfo_ *gensupport.MediaInfo
6127 ctx_ context.Context
6128 header_ http.Header
6129 }
6130
6131
6132 func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
6133 c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6134 c.bucket = bucket
6135 c.object = object
6136 return c
6137 }
6138
6139
6140
6141
6142 func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsInsertCall {
6143 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
6144 return c
6145 }
6146
6147
6148
6149
6150 func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsInsertCall {
6151 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
6152 return c
6153 }
6154
6155
6156
6157
6158 func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsInsertCall {
6159 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
6160 return c
6161 }
6162
6163
6164
6165
6166
6167 func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsInsertCall {
6168 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
6169 return c
6170 }
6171
6172
6173
6174
6175 func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
6176 c.urlParams_.Set("name", name)
6177 return c
6178 }
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188 func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
6189 c.urlParams_.Set("projection", projection)
6190 return c
6191 }
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201 func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall {
6202 if ct := c.object.ContentType; ct != "" {
6203 options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...)
6204 }
6205 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
6206 return c
6207 }
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218 func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
6219 c.ctx_ = ctx
6220 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
6221 return c
6222 }
6223
6224
6225
6226
6227
6228 func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
6229 c.mediaInfo_.SetProgressUpdater(pu)
6230 return c
6231 }
6232
6233
6234
6235
6236 func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
6237 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6238 return c
6239 }
6240
6241
6242
6243
6244
6245
6246 func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
6247 c.ctx_ = ctx
6248 return c
6249 }
6250
6251
6252
6253 func (c *ObjectsInsertCall) Header() http.Header {
6254 if c.header_ == nil {
6255 c.header_ = make(http.Header)
6256 }
6257 return c.header_
6258 }
6259
6260 func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
6261 reqHeaders := make(http.Header)
6262 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
6263 for k, v := range c.header_ {
6264 reqHeaders[k] = v
6265 }
6266 reqHeaders.Set("User-Agent", c.s.userAgent())
6267 var body io.Reader = nil
6268 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
6269 if err != nil {
6270 return nil, err
6271 }
6272 reqHeaders.Set("Content-Type", "application/json")
6273 c.urlParams_.Set("alt", alt)
6274 c.urlParams_.Set("prettyPrint", "false")
6275 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
6276 if c.mediaInfo_ != nil {
6277 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/storage/v1beta2/b/{bucket}/o")
6278 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
6279 }
6280 if body == nil {
6281 body = new(bytes.Buffer)
6282 reqHeaders.Set("Content-Type", "application/json")
6283 }
6284 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
6285 defer cleanup()
6286 urls += "?" + c.urlParams_.Encode()
6287 req, err := http.NewRequest("POST", urls, body)
6288 if err != nil {
6289 return nil, err
6290 }
6291 req.Header = reqHeaders
6292 req.GetBody = getBody
6293 googleapi.Expand(req.URL, map[string]string{
6294 "bucket": c.bucket,
6295 })
6296 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6297 }
6298
6299
6300
6301
6302
6303
6304
6305
6306 func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
6307 gensupport.SetOptions(c.urlParams_, opts...)
6308 res, err := c.doRequest("json")
6309 if res != nil && res.StatusCode == http.StatusNotModified {
6310 if res.Body != nil {
6311 res.Body.Close()
6312 }
6313 return nil, &googleapi.Error{
6314 Code: res.StatusCode,
6315 Header: res.Header,
6316 }
6317 }
6318 if err != nil {
6319 return nil, err
6320 }
6321 defer googleapi.CloseBody(res)
6322 if err := googleapi.CheckResponse(res); err != nil {
6323 return nil, err
6324 }
6325 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
6326 if rx != nil {
6327 rx.Client = c.s.client
6328 rx.UserAgent = c.s.userAgent()
6329 ctx := c.ctx_
6330 if ctx == nil {
6331 ctx = context.TODO()
6332 }
6333 res, err = rx.Upload(ctx)
6334 if err != nil {
6335 return nil, err
6336 }
6337 defer res.Body.Close()
6338 if err := googleapi.CheckResponse(res); err != nil {
6339 return nil, err
6340 }
6341 }
6342 ret := &Object{
6343 ServerResponse: googleapi.ServerResponse{
6344 Header: res.Header,
6345 HTTPStatusCode: res.StatusCode,
6346 },
6347 }
6348 target := &ret
6349 if err := gensupport.DecodeResponse(target, res); err != nil {
6350 return nil, err
6351 }
6352 return ret, nil
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440 }
6441
6442
6443
6444 type ObjectsListCall struct {
6445 s *Service
6446 bucket string
6447 urlParams_ gensupport.URLParams
6448 ifNoneMatch_ string
6449 ctx_ context.Context
6450 header_ http.Header
6451 }
6452
6453
6454 func (r *ObjectsService) List(bucket string) *ObjectsListCall {
6455 c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6456 c.bucket = bucket
6457 return c
6458 }
6459
6460
6461
6462
6463
6464
6465
6466 func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
6467 c.urlParams_.Set("delimiter", delimiter)
6468 return c
6469 }
6470
6471
6472
6473
6474 func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
6475 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
6476 return c
6477 }
6478
6479
6480
6481
6482 func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
6483 c.urlParams_.Set("pageToken", pageToken)
6484 return c
6485 }
6486
6487
6488
6489 func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
6490 c.urlParams_.Set("prefix", prefix)
6491 return c
6492 }
6493
6494
6495
6496
6497
6498
6499
6500
6501 func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
6502 c.urlParams_.Set("projection", projection)
6503 return c
6504 }
6505
6506
6507
6508 func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall {
6509 c.urlParams_.Set("versions", fmt.Sprint(versions))
6510 return c
6511 }
6512
6513
6514
6515
6516 func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
6517 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6518 return c
6519 }
6520
6521
6522
6523
6524
6525
6526 func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
6527 c.ifNoneMatch_ = entityTag
6528 return c
6529 }
6530
6531
6532
6533
6534 func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
6535 c.ctx_ = ctx
6536 return c
6537 }
6538
6539
6540
6541 func (c *ObjectsListCall) Header() http.Header {
6542 if c.header_ == nil {
6543 c.header_ = make(http.Header)
6544 }
6545 return c.header_
6546 }
6547
6548 func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
6549 reqHeaders := make(http.Header)
6550 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
6551 for k, v := range c.header_ {
6552 reqHeaders[k] = v
6553 }
6554 reqHeaders.Set("User-Agent", c.s.userAgent())
6555 if c.ifNoneMatch_ != "" {
6556 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6557 }
6558 var body io.Reader = nil
6559 c.urlParams_.Set("alt", alt)
6560 c.urlParams_.Set("prettyPrint", "false")
6561 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
6562 urls += "?" + c.urlParams_.Encode()
6563 req, err := http.NewRequest("GET", urls, body)
6564 if err != nil {
6565 return nil, err
6566 }
6567 req.Header = reqHeaders
6568 googleapi.Expand(req.URL, map[string]string{
6569 "bucket": c.bucket,
6570 })
6571 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6572 }
6573
6574
6575
6576
6577
6578
6579
6580
6581 func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
6582 gensupport.SetOptions(c.urlParams_, opts...)
6583 res, err := c.doRequest("json")
6584 if res != nil && res.StatusCode == http.StatusNotModified {
6585 if res.Body != nil {
6586 res.Body.Close()
6587 }
6588 return nil, &googleapi.Error{
6589 Code: res.StatusCode,
6590 Header: res.Header,
6591 }
6592 }
6593 if err != nil {
6594 return nil, err
6595 }
6596 defer googleapi.CloseBody(res)
6597 if err := googleapi.CheckResponse(res); err != nil {
6598 return nil, err
6599 }
6600 ret := &Objects{
6601 ServerResponse: googleapi.ServerResponse{
6602 Header: res.Header,
6603 HTTPStatusCode: res.StatusCode,
6604 },
6605 }
6606 target := &ret
6607 if err := gensupport.DecodeResponse(target, res); err != nil {
6608 return nil, err
6609 }
6610 return ret, nil
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678 }
6679
6680
6681
6682
6683 func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
6684 c.ctx_ = ctx
6685 defer c.PageToken(c.urlParams_.Get("pageToken"))
6686 for {
6687 x, err := c.Do()
6688 if err != nil {
6689 return err
6690 }
6691 if err := f(x); err != nil {
6692 return err
6693 }
6694 if x.NextPageToken == "" {
6695 return nil
6696 }
6697 c.PageToken(x.NextPageToken)
6698 }
6699 }
6700
6701
6702
6703 type ObjectsPatchCall struct {
6704 s *Service
6705 bucket string
6706 object string
6707 object2 *Object
6708 urlParams_ gensupport.URLParams
6709 ctx_ context.Context
6710 header_ http.Header
6711 }
6712
6713
6714
6715 func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
6716 c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6717 c.bucket = bucket
6718 c.object = object
6719 c.object2 = object2
6720 return c
6721 }
6722
6723
6724
6725
6726 func (c *ObjectsPatchCall) Generation(generation uint64) *ObjectsPatchCall {
6727 c.urlParams_.Set("generation", fmt.Sprint(generation))
6728 return c
6729 }
6730
6731
6732
6733
6734 func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsPatchCall {
6735 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
6736 return c
6737 }
6738
6739
6740
6741
6742 func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsPatchCall {
6743 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
6744 return c
6745 }
6746
6747
6748
6749
6750 func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsPatchCall {
6751 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
6752 return c
6753 }
6754
6755
6756
6757
6758
6759 func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsPatchCall {
6760 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
6761 return c
6762 }
6763
6764
6765
6766
6767
6768
6769
6770
6771 func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
6772 c.urlParams_.Set("projection", projection)
6773 return c
6774 }
6775
6776
6777
6778
6779 func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
6780 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6781 return c
6782 }
6783
6784
6785
6786
6787 func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
6788 c.ctx_ = ctx
6789 return c
6790 }
6791
6792
6793
6794 func (c *ObjectsPatchCall) Header() http.Header {
6795 if c.header_ == nil {
6796 c.header_ = make(http.Header)
6797 }
6798 return c.header_
6799 }
6800
6801 func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
6802 reqHeaders := make(http.Header)
6803 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
6804 for k, v := range c.header_ {
6805 reqHeaders[k] = v
6806 }
6807 reqHeaders.Set("User-Agent", c.s.userAgent())
6808 var body io.Reader = nil
6809 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
6810 if err != nil {
6811 return nil, err
6812 }
6813 reqHeaders.Set("Content-Type", "application/json")
6814 c.urlParams_.Set("alt", alt)
6815 c.urlParams_.Set("prettyPrint", "false")
6816 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
6817 urls += "?" + c.urlParams_.Encode()
6818 req, err := http.NewRequest("PATCH", urls, body)
6819 if err != nil {
6820 return nil, err
6821 }
6822 req.Header = reqHeaders
6823 googleapi.Expand(req.URL, map[string]string{
6824 "bucket": c.bucket,
6825 "object": c.object,
6826 })
6827 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6828 }
6829
6830
6831
6832
6833
6834
6835
6836
6837 func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
6838 gensupport.SetOptions(c.urlParams_, opts...)
6839 res, err := c.doRequest("json")
6840 if res != nil && res.StatusCode == http.StatusNotModified {
6841 if res.Body != nil {
6842 res.Body.Close()
6843 }
6844 return nil, &googleapi.Error{
6845 Code: res.StatusCode,
6846 Header: res.Header,
6847 }
6848 }
6849 if err != nil {
6850 return nil, err
6851 }
6852 defer googleapi.CloseBody(res)
6853 if err := googleapi.CheckResponse(res); err != nil {
6854 return nil, err
6855 }
6856 ret := &Object{
6857 ServerResponse: googleapi.ServerResponse{
6858 Header: res.Header,
6859 HTTPStatusCode: res.StatusCode,
6860 },
6861 }
6862 target := &ret
6863 if err := gensupport.DecodeResponse(target, res); err != nil {
6864 return nil, err
6865 }
6866 return ret, nil
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945 }
6946
6947
6948
6949 type ObjectsUpdateCall struct {
6950 s *Service
6951 bucket string
6952 object string
6953 object2 *Object
6954 urlParams_ gensupport.URLParams
6955 ctx_ context.Context
6956 header_ http.Header
6957 }
6958
6959
6960 func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
6961 c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6962 c.bucket = bucket
6963 c.object = object
6964 c.object2 = object2
6965 return c
6966 }
6967
6968
6969
6970
6971 func (c *ObjectsUpdateCall) Generation(generation uint64) *ObjectsUpdateCall {
6972 c.urlParams_.Set("generation", fmt.Sprint(generation))
6973 return c
6974 }
6975
6976
6977
6978
6979 func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch uint64) *ObjectsUpdateCall {
6980 c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
6981 return c
6982 }
6983
6984
6985
6986
6987 func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch uint64) *ObjectsUpdateCall {
6988 c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
6989 return c
6990 }
6991
6992
6993
6994
6995 func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch uint64) *ObjectsUpdateCall {
6996 c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
6997 return c
6998 }
6999
7000
7001
7002
7003
7004 func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch uint64) *ObjectsUpdateCall {
7005 c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
7006 return c
7007 }
7008
7009
7010
7011
7012
7013
7014
7015
7016 func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
7017 c.urlParams_.Set("projection", projection)
7018 return c
7019 }
7020
7021
7022
7023
7024 func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
7025 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7026 return c
7027 }
7028
7029
7030
7031
7032 func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
7033 c.ctx_ = ctx
7034 return c
7035 }
7036
7037
7038
7039 func (c *ObjectsUpdateCall) Header() http.Header {
7040 if c.header_ == nil {
7041 c.header_ = make(http.Header)
7042 }
7043 return c.header_
7044 }
7045
7046 func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
7047 reqHeaders := make(http.Header)
7048 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
7049 for k, v := range c.header_ {
7050 reqHeaders[k] = v
7051 }
7052 reqHeaders.Set("User-Agent", c.s.userAgent())
7053 var body io.Reader = nil
7054 body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
7055 if err != nil {
7056 return nil, err
7057 }
7058 reqHeaders.Set("Content-Type", "application/json")
7059 c.urlParams_.Set("alt", alt)
7060 c.urlParams_.Set("prettyPrint", "false")
7061 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
7062 urls += "?" + c.urlParams_.Encode()
7063 req, err := http.NewRequest("PUT", urls, body)
7064 if err != nil {
7065 return nil, err
7066 }
7067 req.Header = reqHeaders
7068 googleapi.Expand(req.URL, map[string]string{
7069 "bucket": c.bucket,
7070 "object": c.object,
7071 })
7072 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7073 }
7074
7075
7076
7077
7078 func (c *ObjectsUpdateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
7079 gensupport.SetOptions(c.urlParams_, opts...)
7080 res, err := c.doRequest("media")
7081 if err != nil {
7082 return nil, err
7083 }
7084 if err := googleapi.CheckMediaResponse(res); err != nil {
7085 res.Body.Close()
7086 return nil, err
7087 }
7088 return res, nil
7089 }
7090
7091
7092
7093
7094
7095
7096
7097
7098 func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
7099 gensupport.SetOptions(c.urlParams_, opts...)
7100 res, err := c.doRequest("json")
7101 if res != nil && res.StatusCode == http.StatusNotModified {
7102 if res.Body != nil {
7103 res.Body.Close()
7104 }
7105 return nil, &googleapi.Error{
7106 Code: res.StatusCode,
7107 Header: res.Header,
7108 }
7109 }
7110 if err != nil {
7111 return nil, err
7112 }
7113 defer googleapi.CloseBody(res)
7114 if err := googleapi.CheckResponse(res); err != nil {
7115 return nil, err
7116 }
7117 ret := &Object{
7118 ServerResponse: googleapi.ServerResponse{
7119 Header: res.Header,
7120 HTTPStatusCode: res.StatusCode,
7121 },
7122 }
7123 target := &ret
7124 if err := gensupport.DecodeResponse(target, res); err != nil {
7125 return nil, err
7126 }
7127 return ret, nil
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207 }
7208
7209
7210
7211 type ObjectsWatchAllCall struct {
7212 s *Service
7213 bucket string
7214 channel *Channel
7215 urlParams_ gensupport.URLParams
7216 ctx_ context.Context
7217 header_ http.Header
7218 }
7219
7220
7221 func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall {
7222 c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7223 c.bucket = bucket
7224 c.channel = channel
7225 return c
7226 }
7227
7228
7229
7230
7231
7232
7233
7234 func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall {
7235 c.urlParams_.Set("delimiter", delimiter)
7236 return c
7237 }
7238
7239
7240
7241
7242 func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall {
7243 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
7244 return c
7245 }
7246
7247
7248
7249
7250 func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall {
7251 c.urlParams_.Set("pageToken", pageToken)
7252 return c
7253 }
7254
7255
7256
7257 func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall {
7258 c.urlParams_.Set("prefix", prefix)
7259 return c
7260 }
7261
7262
7263
7264
7265
7266
7267
7268
7269 func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall {
7270 c.urlParams_.Set("projection", projection)
7271 return c
7272 }
7273
7274
7275
7276 func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall {
7277 c.urlParams_.Set("versions", fmt.Sprint(versions))
7278 return c
7279 }
7280
7281
7282
7283
7284 func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall {
7285 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7286 return c
7287 }
7288
7289
7290
7291
7292 func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
7293 c.ctx_ = ctx
7294 return c
7295 }
7296
7297
7298
7299 func (c *ObjectsWatchAllCall) Header() http.Header {
7300 if c.header_ == nil {
7301 c.header_ = make(http.Header)
7302 }
7303 return c.header_
7304 }
7305
7306 func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
7307 reqHeaders := make(http.Header)
7308 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200728")
7309 for k, v := range c.header_ {
7310 reqHeaders[k] = v
7311 }
7312 reqHeaders.Set("User-Agent", c.s.userAgent())
7313 var body io.Reader = nil
7314 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
7315 if err != nil {
7316 return nil, err
7317 }
7318 reqHeaders.Set("Content-Type", "application/json")
7319 c.urlParams_.Set("alt", alt)
7320 c.urlParams_.Set("prettyPrint", "false")
7321 urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch")
7322 urls += "?" + c.urlParams_.Encode()
7323 req, err := http.NewRequest("POST", urls, body)
7324 if err != nil {
7325 return nil, err
7326 }
7327 req.Header = reqHeaders
7328 googleapi.Expand(req.URL, map[string]string{
7329 "bucket": c.bucket,
7330 })
7331 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7332 }
7333
7334
7335
7336
7337
7338
7339
7340
7341 func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
7342 gensupport.SetOptions(c.urlParams_, opts...)
7343 res, err := c.doRequest("json")
7344 if res != nil && res.StatusCode == http.StatusNotModified {
7345 if res.Body != nil {
7346 res.Body.Close()
7347 }
7348 return nil, &googleapi.Error{
7349 Code: res.StatusCode,
7350 Header: res.Header,
7351 }
7352 }
7353 if err != nil {
7354 return nil, err
7355 }
7356 defer googleapi.CloseBody(res)
7357 if err := googleapi.CheckResponse(res); err != nil {
7358 return nil, err
7359 }
7360 ret := &Channel{
7361 ServerResponse: googleapi.ServerResponse{
7362 Header: res.Header,
7363 HTTPStatusCode: res.StatusCode,
7364 },
7365 }
7366 target := &ret
7367 if err := gensupport.DecodeResponse(target, res); err != nil {
7368 return nil, err
7369 }
7370 return ret, nil
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442 }
7443
View as plain text