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