1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 package analyticshub
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "net/http"
66 "net/url"
67 "strconv"
68 "strings"
69
70 googleapi "google.golang.org/api/googleapi"
71 internal "google.golang.org/api/internal"
72 gensupport "google.golang.org/api/internal/gensupport"
73 option "google.golang.org/api/option"
74 internaloption "google.golang.org/api/option/internaloption"
75 htransport "google.golang.org/api/transport/http"
76 )
77
78
79
80 var _ = bytes.NewBuffer
81 var _ = strconv.Itoa
82 var _ = fmt.Sprintf
83 var _ = json.NewDecoder
84 var _ = io.Copy
85 var _ = url.Parse
86 var _ = gensupport.MarshalJSON
87 var _ = googleapi.Version
88 var _ = errors.New
89 var _ = strings.Replace
90 var _ = context.Canceled
91 var _ = internaloption.WithDefaultEndpoint
92 var _ = internal.Version
93
94 const apiId = "analyticshub:v1"
95 const apiName = "analyticshub"
96 const apiVersion = "v1"
97 const basePath = "https://analyticshub.googleapis.com/"
98 const basePathTemplate = "https://analyticshub.UNIVERSE_DOMAIN/"
99 const mtlsBasePath = "https://analyticshub.mtls.googleapis.com/"
100
101
102 const (
103
104
105 BigqueryScope = "https://www.googleapis.com/auth/bigquery"
106
107
108
109 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
110 )
111
112
113 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
114 scopesOption := internaloption.WithDefaultScopes(
115 "https://www.googleapis.com/auth/bigquery",
116 "https://www.googleapis.com/auth/cloud-platform",
117 )
118
119 opts = append([]option.ClientOption{scopesOption}, opts...)
120 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
121 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
122 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
123 opts = append(opts, internaloption.EnableNewAuthLibrary())
124 client, endpoint, err := htransport.NewClient(ctx, opts...)
125 if err != nil {
126 return nil, err
127 }
128 s, err := New(client)
129 if err != nil {
130 return nil, err
131 }
132 if endpoint != "" {
133 s.BasePath = endpoint
134 }
135 return s, nil
136 }
137
138
139
140
141
142
143 func New(client *http.Client) (*Service, error) {
144 if client == nil {
145 return nil, errors.New("client is nil")
146 }
147 s := &Service{client: client, BasePath: basePath}
148 s.Organizations = NewOrganizationsService(s)
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 Organizations *OrganizationsService
159
160 Projects *ProjectsService
161 }
162
163 func (s *Service) userAgent() string {
164 if s.UserAgent == "" {
165 return googleapi.UserAgent
166 }
167 return googleapi.UserAgent + " " + s.UserAgent
168 }
169
170 func NewOrganizationsService(s *Service) *OrganizationsService {
171 rs := &OrganizationsService{s: s}
172 rs.Locations = NewOrganizationsLocationsService(s)
173 return rs
174 }
175
176 type OrganizationsService struct {
177 s *Service
178
179 Locations *OrganizationsLocationsService
180 }
181
182 func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService {
183 rs := &OrganizationsLocationsService{s: s}
184 rs.DataExchanges = NewOrganizationsLocationsDataExchangesService(s)
185 return rs
186 }
187
188 type OrganizationsLocationsService struct {
189 s *Service
190
191 DataExchanges *OrganizationsLocationsDataExchangesService
192 }
193
194 func NewOrganizationsLocationsDataExchangesService(s *Service) *OrganizationsLocationsDataExchangesService {
195 rs := &OrganizationsLocationsDataExchangesService{s: s}
196 return rs
197 }
198
199 type OrganizationsLocationsDataExchangesService struct {
200 s *Service
201 }
202
203 func NewProjectsService(s *Service) *ProjectsService {
204 rs := &ProjectsService{s: s}
205 rs.Locations = NewProjectsLocationsService(s)
206 return rs
207 }
208
209 type ProjectsService struct {
210 s *Service
211
212 Locations *ProjectsLocationsService
213 }
214
215 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
216 rs := &ProjectsLocationsService{s: s}
217 rs.DataExchanges = NewProjectsLocationsDataExchangesService(s)
218 rs.Subscriptions = NewProjectsLocationsSubscriptionsService(s)
219 return rs
220 }
221
222 type ProjectsLocationsService struct {
223 s *Service
224
225 DataExchanges *ProjectsLocationsDataExchangesService
226
227 Subscriptions *ProjectsLocationsSubscriptionsService
228 }
229
230 func NewProjectsLocationsDataExchangesService(s *Service) *ProjectsLocationsDataExchangesService {
231 rs := &ProjectsLocationsDataExchangesService{s: s}
232 rs.Listings = NewProjectsLocationsDataExchangesListingsService(s)
233 return rs
234 }
235
236 type ProjectsLocationsDataExchangesService struct {
237 s *Service
238
239 Listings *ProjectsLocationsDataExchangesListingsService
240 }
241
242 func NewProjectsLocationsDataExchangesListingsService(s *Service) *ProjectsLocationsDataExchangesListingsService {
243 rs := &ProjectsLocationsDataExchangesListingsService{s: s}
244 return rs
245 }
246
247 type ProjectsLocationsDataExchangesListingsService struct {
248 s *Service
249 }
250
251 func NewProjectsLocationsSubscriptionsService(s *Service) *ProjectsLocationsSubscriptionsService {
252 rs := &ProjectsLocationsSubscriptionsService{s: s}
253 return rs
254 }
255
256 type ProjectsLocationsSubscriptionsService struct {
257 s *Service
258 }
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276 type AuditConfig struct {
277
278 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
279
280
281
282 Service string `json:"service,omitempty"`
283
284
285
286
287
288 ForceSendFields []string `json:"-"`
289
290
291
292
293 NullFields []string `json:"-"`
294 }
295
296 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
297 type NoMethod AuditConfig
298 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
299 }
300
301
302
303
304
305
306 type AuditLogConfig struct {
307
308
309 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
310
311
312
313
314
315
316
317 LogType string `json:"logType,omitempty"`
318
319
320
321
322
323 ForceSendFields []string `json:"-"`
324
325
326
327
328 NullFields []string `json:"-"`
329 }
330
331 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
332 type NoMethod AuditLogConfig
333 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
334 }
335
336
337
338
339
340
341
342 type BigQueryDatasetSource struct {
343
344
345 Dataset string `json:"dataset,omitempty"`
346
347
348 RestrictedExportPolicy *RestrictedExportPolicy `json:"restrictedExportPolicy,omitempty"`
349
350
351
352 SelectedResources []*SelectedResource `json:"selectedResources,omitempty"`
353
354
355
356
357
358 ForceSendFields []string `json:"-"`
359
360
361
362
363 NullFields []string `json:"-"`
364 }
365
366 func (s *BigQueryDatasetSource) MarshalJSON() ([]byte, error) {
367 type NoMethod BigQueryDatasetSource
368 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
369 }
370
371
372 type Binding struct {
373
374
375
376
377
378
379
380
381 Condition *Expr `json:"condition,omitempty"`
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444 Members []string `json:"members,omitempty"`
445
446
447
448
449
450
451 Role string `json:"role,omitempty"`
452
453
454
455
456
457 ForceSendFields []string `json:"-"`
458
459
460
461
462 NullFields []string `json:"-"`
463 }
464
465 func (s *Binding) MarshalJSON() ([]byte, error) {
466 type NoMethod Binding
467 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
468 }
469
470
471
472
473 type DataExchange struct {
474
475
476
477
478 Description string `json:"description,omitempty"`
479
480
481
482
483 DisplayName string `json:"displayName,omitempty"`
484
485 Documentation string `json:"documentation,omitempty"`
486
487
488
489
490
491 Icon string `json:"icon,omitempty"`
492
493
494 ListingCount int64 `json:"listingCount,omitempty"`
495
496
497 Name string `json:"name,omitempty"`
498
499
500 PrimaryContact string `json:"primaryContact,omitempty"`
501
502
503 SharingEnvironmentConfig *SharingEnvironmentConfig `json:"sharingEnvironmentConfig,omitempty"`
504
505
506 googleapi.ServerResponse `json:"-"`
507
508
509
510
511
512 ForceSendFields []string `json:"-"`
513
514
515
516
517 NullFields []string `json:"-"`
518 }
519
520 func (s *DataExchange) MarshalJSON() ([]byte, error) {
521 type NoMethod DataExchange
522 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
523 }
524
525
526 type DataProvider struct {
527
528 Name string `json:"name,omitempty"`
529
530
531 PrimaryContact string `json:"primaryContact,omitempty"`
532
533
534
535
536
537 ForceSendFields []string `json:"-"`
538
539
540
541
542 NullFields []string `json:"-"`
543 }
544
545 func (s *DataProvider) MarshalJSON() ([]byte, error) {
546 type NoMethod DataProvider
547 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
548 }
549
550
551
552 type DcrExchangeConfig struct {
553
554
555
556
557
558 SingleLinkedDatasetPerCleanroom bool `json:"singleLinkedDatasetPerCleanroom,omitempty"`
559
560
561
562
563
564
565
566 SingleSelectedResourceSharingRestriction bool `json:"singleSelectedResourceSharingRestriction,omitempty"`
567
568
569
570
571
572
573 ForceSendFields []string `json:"-"`
574
575
576
577
578 NullFields []string `json:"-"`
579 }
580
581 func (s *DcrExchangeConfig) MarshalJSON() ([]byte, error) {
582 type NoMethod DcrExchangeConfig
583 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
584 }
585
586
587
588 type DefaultExchangeConfig struct {
589 }
590
591
592 type DestinationDataset struct {
593
594
595 DatasetReference *DestinationDatasetReference `json:"datasetReference,omitempty"`
596
597 Description string `json:"description,omitempty"`
598
599 FriendlyName string `json:"friendlyName,omitempty"`
600
601
602
603
604
605 Labels map[string]string `json:"labels,omitempty"`
606
607
608
609 Location string `json:"location,omitempty"`
610
611
612
613
614
615 ForceSendFields []string `json:"-"`
616
617
618
619
620 NullFields []string `json:"-"`
621 }
622
623 func (s *DestinationDataset) MarshalJSON() ([]byte, error) {
624 type NoMethod DestinationDataset
625 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
626 }
627
628
629
630 type DestinationDatasetReference struct {
631
632
633
634 DatasetId string `json:"datasetId,omitempty"`
635
636 ProjectId string `json:"projectId,omitempty"`
637
638
639
640
641
642 ForceSendFields []string `json:"-"`
643
644
645
646
647 NullFields []string `json:"-"`
648 }
649
650 func (s *DestinationDatasetReference) MarshalJSON() ([]byte, error) {
651 type NoMethod DestinationDatasetReference
652 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
653 }
654
655
656
657
658
659 type Empty struct {
660
661 googleapi.ServerResponse `json:"-"`
662 }
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680 type Expr struct {
681
682
683 Description string `json:"description,omitempty"`
684
685
686 Expression string `json:"expression,omitempty"`
687
688
689 Location string `json:"location,omitempty"`
690
691
692
693 Title string `json:"title,omitempty"`
694
695
696
697
698
699 ForceSendFields []string `json:"-"`
700
701
702
703
704 NullFields []string `json:"-"`
705 }
706
707 func (s *Expr) MarshalJSON() ([]byte, error) {
708 type NoMethod Expr
709 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
710 }
711
712
713 type GetIamPolicyRequest struct {
714
715
716 Options *GetPolicyOptions `json:"options,omitempty"`
717
718
719
720
721
722 ForceSendFields []string `json:"-"`
723
724
725
726
727 NullFields []string `json:"-"`
728 }
729
730 func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) {
731 type NoMethod GetIamPolicyRequest
732 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
733 }
734
735
736 type GetPolicyOptions struct {
737
738
739
740
741
742
743
744
745
746
747
748 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"`
749
750
751
752
753
754 ForceSendFields []string `json:"-"`
755
756
757
758
759 NullFields []string `json:"-"`
760 }
761
762 func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) {
763 type NoMethod GetPolicyOptions
764 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
765 }
766
767
768 type LinkedResource struct {
769
770
771 LinkedDataset string `json:"linkedDataset,omitempty"`
772
773
774
775
776
777 ForceSendFields []string `json:"-"`
778
779
780
781
782 NullFields []string `json:"-"`
783 }
784
785 func (s *LinkedResource) MarshalJSON() ([]byte, error) {
786 type NoMethod LinkedResource
787 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
788 }
789
790
791
792 type ListDataExchangesResponse struct {
793
794 DataExchanges []*DataExchange `json:"dataExchanges,omitempty"`
795
796 NextPageToken string `json:"nextPageToken,omitempty"`
797
798
799 googleapi.ServerResponse `json:"-"`
800
801
802
803
804
805 ForceSendFields []string `json:"-"`
806
807
808
809
810 NullFields []string `json:"-"`
811 }
812
813 func (s *ListDataExchangesResponse) MarshalJSON() ([]byte, error) {
814 type NoMethod ListDataExchangesResponse
815 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
816 }
817
818
819 type ListListingsResponse struct {
820
821 Listings []*Listing `json:"listings,omitempty"`
822
823 NextPageToken string `json:"nextPageToken,omitempty"`
824
825
826 googleapi.ServerResponse `json:"-"`
827
828
829
830
831
832 ForceSendFields []string `json:"-"`
833
834
835
836
837 NullFields []string `json:"-"`
838 }
839
840 func (s *ListListingsResponse) MarshalJSON() ([]byte, error) {
841 type NoMethod ListListingsResponse
842 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
843 }
844
845
846
847 type ListOrgDataExchangesResponse struct {
848
849 DataExchanges []*DataExchange `json:"dataExchanges,omitempty"`
850
851 NextPageToken string `json:"nextPageToken,omitempty"`
852
853
854 googleapi.ServerResponse `json:"-"`
855
856
857
858
859
860 ForceSendFields []string `json:"-"`
861
862
863
864
865 NullFields []string `json:"-"`
866 }
867
868 func (s *ListOrgDataExchangesResponse) MarshalJSON() ([]byte, error) {
869 type NoMethod ListOrgDataExchangesResponse
870 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
871 }
872
873
874
875 type ListSharedResourceSubscriptionsResponse struct {
876
877 NextPageToken string `json:"nextPageToken,omitempty"`
878
879 SharedResourceSubscriptions []*Subscription `json:"sharedResourceSubscriptions,omitempty"`
880
881
882 googleapi.ServerResponse `json:"-"`
883
884
885
886
887
888 ForceSendFields []string `json:"-"`
889
890
891
892
893 NullFields []string `json:"-"`
894 }
895
896 func (s *ListSharedResourceSubscriptionsResponse) MarshalJSON() ([]byte, error) {
897 type NoMethod ListSharedResourceSubscriptionsResponse
898 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
899 }
900
901
902
903 type ListSubscriptionsResponse struct {
904
905 NextPageToken string `json:"nextPageToken,omitempty"`
906
907 Subscriptions []*Subscription `json:"subscriptions,omitempty"`
908
909
910 googleapi.ServerResponse `json:"-"`
911
912
913
914
915
916 ForceSendFields []string `json:"-"`
917
918
919
920
921 NullFields []string `json:"-"`
922 }
923
924 func (s *ListSubscriptionsResponse) MarshalJSON() ([]byte, error) {
925 type NoMethod ListSubscriptionsResponse
926 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
927 }
928
929
930
931
932
933 type Listing struct {
934
935 BigqueryDataset *BigQueryDatasetSource `json:"bigqueryDataset,omitempty"`
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960 Categories []string `json:"categories,omitempty"`
961
962
963 DataProvider *DataProvider `json:"dataProvider,omitempty"`
964
965
966
967
968 Description string `json:"description,omitempty"`
969
970
971
972
973 DisplayName string `json:"displayName,omitempty"`
974
975 Documentation string `json:"documentation,omitempty"`
976
977
978
979
980
981 Icon string `json:"icon,omitempty"`
982
983
984 Name string `json:"name,omitempty"`
985
986
987 PrimaryContact string `json:"primaryContact,omitempty"`
988
989
990 Publisher *Publisher `json:"publisher,omitempty"`
991
992
993
994 RequestAccess string `json:"requestAccess,omitempty"`
995
996
997 RestrictedExportConfig *RestrictedExportConfig `json:"restrictedExportConfig,omitempty"`
998
999
1000
1001
1002
1003
1004 State string `json:"state,omitempty"`
1005
1006
1007 googleapi.ServerResponse `json:"-"`
1008
1009
1010
1011
1012
1013 ForceSendFields []string `json:"-"`
1014
1015
1016
1017
1018 NullFields []string `json:"-"`
1019 }
1020
1021 func (s *Listing) MarshalJSON() ([]byte, error) {
1022 type NoMethod Listing
1023 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1024 }
1025
1026
1027
1028 type Operation struct {
1029
1030
1031
1032 Done bool `json:"done,omitempty"`
1033
1034 Error *Status `json:"error,omitempty"`
1035
1036
1037
1038
1039 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1040
1041
1042
1043 Name string `json:"name,omitempty"`
1044
1045
1046
1047
1048
1049
1050
1051 Response googleapi.RawMessage `json:"response,omitempty"`
1052
1053
1054 googleapi.ServerResponse `json:"-"`
1055
1056
1057
1058
1059
1060 ForceSendFields []string `json:"-"`
1061
1062
1063
1064
1065 NullFields []string `json:"-"`
1066 }
1067
1068 func (s *Operation) MarshalJSON() ([]byte, error) {
1069 type NoMethod Operation
1070 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1071 }
1072
1073
1074
1075 type OperationMetadata struct {
1076
1077 ApiVersion string `json:"apiVersion,omitempty"`
1078
1079 CreateTime string `json:"createTime,omitempty"`
1080
1081 EndTime string `json:"endTime,omitempty"`
1082
1083
1084
1085
1086 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
1087
1088 StatusMessage string `json:"statusMessage,omitempty"`
1089
1090
1091 Target string `json:"target,omitempty"`
1092
1093 Verb string `json:"verb,omitempty"`
1094
1095
1096
1097
1098
1099 ForceSendFields []string `json:"-"`
1100
1101
1102
1103
1104 NullFields []string `json:"-"`
1105 }
1106
1107 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
1108 type NoMethod OperationMetadata
1109 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1110 }
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142 type Policy struct {
1143
1144 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154 Bindings []*Binding `json:"bindings,omitempty"`
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166 Etag string `json:"etag,omitempty"`
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182 Version int64 `json:"version,omitempty"`
1183
1184
1185 googleapi.ServerResponse `json:"-"`
1186
1187
1188
1189
1190
1191 ForceSendFields []string `json:"-"`
1192
1193
1194
1195
1196 NullFields []string `json:"-"`
1197 }
1198
1199 func (s *Policy) MarshalJSON() ([]byte, error) {
1200 type NoMethod Policy
1201 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1202 }
1203
1204
1205 type Publisher struct {
1206
1207 Name string `json:"name,omitempty"`
1208
1209
1210 PrimaryContact string `json:"primaryContact,omitempty"`
1211
1212
1213
1214
1215
1216 ForceSendFields []string `json:"-"`
1217
1218
1219
1220
1221 NullFields []string `json:"-"`
1222 }
1223
1224 func (s *Publisher) MarshalJSON() ([]byte, error) {
1225 type NoMethod Publisher
1226 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1227 }
1228
1229
1230 type RefreshSubscriptionRequest struct {
1231 }
1232
1233
1234
1235 type RefreshSubscriptionResponse struct {
1236
1237 Subscription *Subscription `json:"subscription,omitempty"`
1238
1239
1240
1241
1242
1243 ForceSendFields []string `json:"-"`
1244
1245
1246
1247
1248 NullFields []string `json:"-"`
1249 }
1250
1251 func (s *RefreshSubscriptionResponse) MarshalJSON() ([]byte, error) {
1252 type NoMethod RefreshSubscriptionResponse
1253 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1254 }
1255
1256
1257
1258 type RestrictedExportConfig struct {
1259
1260 Enabled bool `json:"enabled,omitempty"`
1261
1262
1263 RestrictDirectTableAccess bool `json:"restrictDirectTableAccess,omitempty"`
1264
1265
1266 RestrictQueryResult bool `json:"restrictQueryResult,omitempty"`
1267
1268
1269
1270
1271
1272 ForceSendFields []string `json:"-"`
1273
1274
1275
1276
1277 NullFields []string `json:"-"`
1278 }
1279
1280 func (s *RestrictedExportConfig) MarshalJSON() ([]byte, error) {
1281 type NoMethod RestrictedExportConfig
1282 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1283 }
1284
1285
1286
1287 type RestrictedExportPolicy struct {
1288
1289 Enabled bool `json:"enabled,omitempty"`
1290
1291
1292 RestrictDirectTableAccess bool `json:"restrictDirectTableAccess,omitempty"`
1293
1294
1295 RestrictQueryResult bool `json:"restrictQueryResult,omitempty"`
1296
1297
1298
1299
1300
1301 ForceSendFields []string `json:"-"`
1302
1303
1304
1305
1306 NullFields []string `json:"-"`
1307 }
1308
1309 func (s *RestrictedExportPolicy) MarshalJSON() ([]byte, error) {
1310 type NoMethod RestrictedExportPolicy
1311 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1312 }
1313
1314
1315 type RevokeSubscriptionRequest struct {
1316 }
1317
1318
1319
1320 type RevokeSubscriptionResponse struct {
1321
1322 googleapi.ServerResponse `json:"-"`
1323 }
1324
1325
1326 type SelectedResource struct {
1327
1328
1329
1330 Table string `json:"table,omitempty"`
1331
1332
1333
1334
1335
1336 ForceSendFields []string `json:"-"`
1337
1338
1339
1340
1341 NullFields []string `json:"-"`
1342 }
1343
1344 func (s *SelectedResource) MarshalJSON() ([]byte, error) {
1345 type NoMethod SelectedResource
1346 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1347 }
1348
1349
1350 type SetIamPolicyRequest struct {
1351
1352
1353
1354
1355 Policy *Policy `json:"policy,omitempty"`
1356
1357
1358
1359 UpdateMask string `json:"updateMask,omitempty"`
1360
1361
1362
1363
1364
1365 ForceSendFields []string `json:"-"`
1366
1367
1368
1369
1370 NullFields []string `json:"-"`
1371 }
1372
1373 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1374 type NoMethod SetIamPolicyRequest
1375 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1376 }
1377
1378
1379
1380
1381 type SharingEnvironmentConfig struct {
1382
1383
1384 DcrExchangeConfig *DcrExchangeConfig `json:"dcrExchangeConfig,omitempty"`
1385
1386
1387 DefaultExchangeConfig *DefaultExchangeConfig `json:"defaultExchangeConfig,omitempty"`
1388
1389
1390
1391
1392
1393 ForceSendFields []string `json:"-"`
1394
1395
1396
1397
1398 NullFields []string `json:"-"`
1399 }
1400
1401 func (s *SharingEnvironmentConfig) MarshalJSON() ([]byte, error) {
1402 type NoMethod SharingEnvironmentConfig
1403 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1404 }
1405
1406
1407
1408
1409
1410
1411
1412 type Status struct {
1413
1414 Code int64 `json:"code,omitempty"`
1415
1416
1417 Details []googleapi.RawMessage `json:"details,omitempty"`
1418
1419
1420
1421 Message string `json:"message,omitempty"`
1422
1423
1424
1425
1426
1427 ForceSendFields []string `json:"-"`
1428
1429
1430
1431
1432 NullFields []string `json:"-"`
1433 }
1434
1435 func (s *Status) MarshalJSON() ([]byte, error) {
1436 type NoMethod Status
1437 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1438 }
1439
1440
1441 type SubscribeDataExchangeRequest struct {
1442
1443
1444 Destination string `json:"destination,omitempty"`
1445
1446 SubscriberContact string `json:"subscriberContact,omitempty"`
1447
1448
1449 Subscription string `json:"subscription,omitempty"`
1450
1451
1452
1453
1454
1455 ForceSendFields []string `json:"-"`
1456
1457
1458
1459
1460 NullFields []string `json:"-"`
1461 }
1462
1463 func (s *SubscribeDataExchangeRequest) MarshalJSON() ([]byte, error) {
1464 type NoMethod SubscribeDataExchangeRequest
1465 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1466 }
1467
1468
1469
1470 type SubscribeDataExchangeResponse struct {
1471
1472 Subscription *Subscription `json:"subscription,omitempty"`
1473
1474
1475
1476
1477
1478 ForceSendFields []string `json:"-"`
1479
1480
1481
1482
1483 NullFields []string `json:"-"`
1484 }
1485
1486 func (s *SubscribeDataExchangeResponse) MarshalJSON() ([]byte, error) {
1487 type NoMethod SubscribeDataExchangeResponse
1488 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1489 }
1490
1491
1492 type SubscribeListingRequest struct {
1493
1494
1495 DestinationDataset *DestinationDataset `json:"destinationDataset,omitempty"`
1496
1497
1498
1499
1500
1501 ForceSendFields []string `json:"-"`
1502
1503
1504
1505
1506 NullFields []string `json:"-"`
1507 }
1508
1509 func (s *SubscribeListingRequest) MarshalJSON() ([]byte, error) {
1510 type NoMethod SubscribeListingRequest
1511 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1512 }
1513
1514
1515
1516 type SubscribeListingResponse struct {
1517
1518 Subscription *Subscription `json:"subscription,omitempty"`
1519
1520
1521 googleapi.ServerResponse `json:"-"`
1522
1523
1524
1525
1526
1527 ForceSendFields []string `json:"-"`
1528
1529
1530
1531
1532 NullFields []string `json:"-"`
1533 }
1534
1535 func (s *SubscribeListingResponse) MarshalJSON() ([]byte, error) {
1536 type NoMethod SubscribeListingResponse
1537 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1538 }
1539
1540
1541
1542
1543 type Subscription struct {
1544
1545 CreationTime string `json:"creationTime,omitempty"`
1546
1547
1548 DataExchange string `json:"dataExchange,omitempty"`
1549
1550
1551 LastModifyTime string `json:"lastModifyTime,omitempty"`
1552
1553
1554
1555
1556
1557 LinkedDatasetMap map[string]LinkedResource `json:"linkedDatasetMap,omitempty"`
1558
1559
1560 Listing string `json:"listing,omitempty"`
1561
1562
1563 Name string `json:"name,omitempty"`
1564
1565
1566 OrganizationDisplayName string `json:"organizationDisplayName,omitempty"`
1567
1568
1569 OrganizationId string `json:"organizationId,omitempty"`
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580 State string `json:"state,omitempty"`
1581
1582 SubscriberContact string `json:"subscriberContact,omitempty"`
1583
1584
1585 googleapi.ServerResponse `json:"-"`
1586
1587
1588
1589
1590
1591 ForceSendFields []string `json:"-"`
1592
1593
1594
1595
1596 NullFields []string `json:"-"`
1597 }
1598
1599 func (s *Subscription) MarshalJSON() ([]byte, error) {
1600 type NoMethod Subscription
1601 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1602 }
1603
1604
1605 type TestIamPermissionsRequest struct {
1606
1607
1608
1609
1610 Permissions []string `json:"permissions,omitempty"`
1611
1612
1613
1614
1615
1616 ForceSendFields []string `json:"-"`
1617
1618
1619
1620
1621 NullFields []string `json:"-"`
1622 }
1623
1624 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1625 type NoMethod TestIamPermissionsRequest
1626 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1627 }
1628
1629
1630
1631 type TestIamPermissionsResponse struct {
1632
1633
1634 Permissions []string `json:"permissions,omitempty"`
1635
1636
1637 googleapi.ServerResponse `json:"-"`
1638
1639
1640
1641
1642
1643 ForceSendFields []string `json:"-"`
1644
1645
1646
1647
1648 NullFields []string `json:"-"`
1649 }
1650
1651 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1652 type NoMethod TestIamPermissionsResponse
1653 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1654 }
1655
1656 type OrganizationsLocationsDataExchangesListCall struct {
1657 s *Service
1658 organization string
1659 urlParams_ gensupport.URLParams
1660 ifNoneMatch_ string
1661 ctx_ context.Context
1662 header_ http.Header
1663 }
1664
1665
1666
1667
1668
1669
1670 func (r *OrganizationsLocationsDataExchangesService) List(organization string) *OrganizationsLocationsDataExchangesListCall {
1671 c := &OrganizationsLocationsDataExchangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1672 c.organization = organization
1673 return c
1674 }
1675
1676
1677
1678
1679 func (c *OrganizationsLocationsDataExchangesListCall) PageSize(pageSize int64) *OrganizationsLocationsDataExchangesListCall {
1680 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1681 return c
1682 }
1683
1684
1685
1686 func (c *OrganizationsLocationsDataExchangesListCall) PageToken(pageToken string) *OrganizationsLocationsDataExchangesListCall {
1687 c.urlParams_.Set("pageToken", pageToken)
1688 return c
1689 }
1690
1691
1692
1693
1694 func (c *OrganizationsLocationsDataExchangesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsDataExchangesListCall {
1695 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1696 return c
1697 }
1698
1699
1700
1701
1702 func (c *OrganizationsLocationsDataExchangesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsDataExchangesListCall {
1703 c.ifNoneMatch_ = entityTag
1704 return c
1705 }
1706
1707
1708 func (c *OrganizationsLocationsDataExchangesListCall) Context(ctx context.Context) *OrganizationsLocationsDataExchangesListCall {
1709 c.ctx_ = ctx
1710 return c
1711 }
1712
1713
1714
1715 func (c *OrganizationsLocationsDataExchangesListCall) Header() http.Header {
1716 if c.header_ == nil {
1717 c.header_ = make(http.Header)
1718 }
1719 return c.header_
1720 }
1721
1722 func (c *OrganizationsLocationsDataExchangesListCall) doRequest(alt string) (*http.Response, error) {
1723 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1724 if c.ifNoneMatch_ != "" {
1725 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1726 }
1727 var body io.Reader = nil
1728 c.urlParams_.Set("alt", alt)
1729 c.urlParams_.Set("prettyPrint", "false")
1730 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+organization}/dataExchanges")
1731 urls += "?" + c.urlParams_.Encode()
1732 req, err := http.NewRequest("GET", urls, body)
1733 if err != nil {
1734 return nil, err
1735 }
1736 req.Header = reqHeaders
1737 googleapi.Expand(req.URL, map[string]string{
1738 "organization": c.organization,
1739 })
1740 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1741 }
1742
1743
1744
1745
1746
1747
1748
1749 func (c *OrganizationsLocationsDataExchangesListCall) Do(opts ...googleapi.CallOption) (*ListOrgDataExchangesResponse, error) {
1750 gensupport.SetOptions(c.urlParams_, opts...)
1751 res, err := c.doRequest("json")
1752 if res != nil && res.StatusCode == http.StatusNotModified {
1753 if res.Body != nil {
1754 res.Body.Close()
1755 }
1756 return nil, gensupport.WrapError(&googleapi.Error{
1757 Code: res.StatusCode,
1758 Header: res.Header,
1759 })
1760 }
1761 if err != nil {
1762 return nil, err
1763 }
1764 defer googleapi.CloseBody(res)
1765 if err := googleapi.CheckResponse(res); err != nil {
1766 return nil, gensupport.WrapError(err)
1767 }
1768 ret := &ListOrgDataExchangesResponse{
1769 ServerResponse: googleapi.ServerResponse{
1770 Header: res.Header,
1771 HTTPStatusCode: res.StatusCode,
1772 },
1773 }
1774 target := &ret
1775 if err := gensupport.DecodeResponse(target, res); err != nil {
1776 return nil, err
1777 }
1778 return ret, nil
1779 }
1780
1781
1782
1783
1784 func (c *OrganizationsLocationsDataExchangesListCall) Pages(ctx context.Context, f func(*ListOrgDataExchangesResponse) error) error {
1785 c.ctx_ = ctx
1786 defer c.PageToken(c.urlParams_.Get("pageToken"))
1787 for {
1788 x, err := c.Do()
1789 if err != nil {
1790 return err
1791 }
1792 if err := f(x); err != nil {
1793 return err
1794 }
1795 if x.NextPageToken == "" {
1796 return nil
1797 }
1798 c.PageToken(x.NextPageToken)
1799 }
1800 }
1801
1802 type ProjectsLocationsDataExchangesCreateCall struct {
1803 s *Service
1804 parent string
1805 dataexchange *DataExchange
1806 urlParams_ gensupport.URLParams
1807 ctx_ context.Context
1808 header_ http.Header
1809 }
1810
1811
1812
1813
1814
1815 func (r *ProjectsLocationsDataExchangesService) Create(parent string, dataexchange *DataExchange) *ProjectsLocationsDataExchangesCreateCall {
1816 c := &ProjectsLocationsDataExchangesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1817 c.parent = parent
1818 c.dataexchange = dataexchange
1819 return c
1820 }
1821
1822
1823
1824
1825
1826 func (c *ProjectsLocationsDataExchangesCreateCall) DataExchangeId(dataExchangeId string) *ProjectsLocationsDataExchangesCreateCall {
1827 c.urlParams_.Set("dataExchangeId", dataExchangeId)
1828 return c
1829 }
1830
1831
1832
1833
1834 func (c *ProjectsLocationsDataExchangesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesCreateCall {
1835 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1836 return c
1837 }
1838
1839
1840 func (c *ProjectsLocationsDataExchangesCreateCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesCreateCall {
1841 c.ctx_ = ctx
1842 return c
1843 }
1844
1845
1846
1847 func (c *ProjectsLocationsDataExchangesCreateCall) Header() http.Header {
1848 if c.header_ == nil {
1849 c.header_ = make(http.Header)
1850 }
1851 return c.header_
1852 }
1853
1854 func (c *ProjectsLocationsDataExchangesCreateCall) doRequest(alt string) (*http.Response, error) {
1855 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1856 var body io.Reader = nil
1857 body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataexchange)
1858 if err != nil {
1859 return nil, err
1860 }
1861 c.urlParams_.Set("alt", alt)
1862 c.urlParams_.Set("prettyPrint", "false")
1863 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataExchanges")
1864 urls += "?" + c.urlParams_.Encode()
1865 req, err := http.NewRequest("POST", urls, body)
1866 if err != nil {
1867 return nil, err
1868 }
1869 req.Header = reqHeaders
1870 googleapi.Expand(req.URL, map[string]string{
1871 "parent": c.parent,
1872 })
1873 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1874 }
1875
1876
1877
1878
1879
1880
1881 func (c *ProjectsLocationsDataExchangesCreateCall) Do(opts ...googleapi.CallOption) (*DataExchange, error) {
1882 gensupport.SetOptions(c.urlParams_, opts...)
1883 res, err := c.doRequest("json")
1884 if res != nil && res.StatusCode == http.StatusNotModified {
1885 if res.Body != nil {
1886 res.Body.Close()
1887 }
1888 return nil, gensupport.WrapError(&googleapi.Error{
1889 Code: res.StatusCode,
1890 Header: res.Header,
1891 })
1892 }
1893 if err != nil {
1894 return nil, err
1895 }
1896 defer googleapi.CloseBody(res)
1897 if err := googleapi.CheckResponse(res); err != nil {
1898 return nil, gensupport.WrapError(err)
1899 }
1900 ret := &DataExchange{
1901 ServerResponse: googleapi.ServerResponse{
1902 Header: res.Header,
1903 HTTPStatusCode: res.StatusCode,
1904 },
1905 }
1906 target := &ret
1907 if err := gensupport.DecodeResponse(target, res); err != nil {
1908 return nil, err
1909 }
1910 return ret, nil
1911 }
1912
1913 type ProjectsLocationsDataExchangesDeleteCall struct {
1914 s *Service
1915 name string
1916 urlParams_ gensupport.URLParams
1917 ctx_ context.Context
1918 header_ http.Header
1919 }
1920
1921
1922
1923
1924
1925 func (r *ProjectsLocationsDataExchangesService) Delete(name string) *ProjectsLocationsDataExchangesDeleteCall {
1926 c := &ProjectsLocationsDataExchangesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1927 c.name = name
1928 return c
1929 }
1930
1931
1932
1933
1934 func (c *ProjectsLocationsDataExchangesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesDeleteCall {
1935 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1936 return c
1937 }
1938
1939
1940 func (c *ProjectsLocationsDataExchangesDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesDeleteCall {
1941 c.ctx_ = ctx
1942 return c
1943 }
1944
1945
1946
1947 func (c *ProjectsLocationsDataExchangesDeleteCall) Header() http.Header {
1948 if c.header_ == nil {
1949 c.header_ = make(http.Header)
1950 }
1951 return c.header_
1952 }
1953
1954 func (c *ProjectsLocationsDataExchangesDeleteCall) doRequest(alt string) (*http.Response, error) {
1955 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1956 var body io.Reader = nil
1957 c.urlParams_.Set("alt", alt)
1958 c.urlParams_.Set("prettyPrint", "false")
1959 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1960 urls += "?" + c.urlParams_.Encode()
1961 req, err := http.NewRequest("DELETE", urls, body)
1962 if err != nil {
1963 return nil, err
1964 }
1965 req.Header = reqHeaders
1966 googleapi.Expand(req.URL, map[string]string{
1967 "name": c.name,
1968 })
1969 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1970 }
1971
1972
1973
1974
1975
1976
1977 func (c *ProjectsLocationsDataExchangesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1978 gensupport.SetOptions(c.urlParams_, opts...)
1979 res, err := c.doRequest("json")
1980 if res != nil && res.StatusCode == http.StatusNotModified {
1981 if res.Body != nil {
1982 res.Body.Close()
1983 }
1984 return nil, gensupport.WrapError(&googleapi.Error{
1985 Code: res.StatusCode,
1986 Header: res.Header,
1987 })
1988 }
1989 if err != nil {
1990 return nil, err
1991 }
1992 defer googleapi.CloseBody(res)
1993 if err := googleapi.CheckResponse(res); err != nil {
1994 return nil, gensupport.WrapError(err)
1995 }
1996 ret := &Empty{
1997 ServerResponse: googleapi.ServerResponse{
1998 Header: res.Header,
1999 HTTPStatusCode: res.StatusCode,
2000 },
2001 }
2002 target := &ret
2003 if err := gensupport.DecodeResponse(target, res); err != nil {
2004 return nil, err
2005 }
2006 return ret, nil
2007 }
2008
2009 type ProjectsLocationsDataExchangesGetCall struct {
2010 s *Service
2011 name string
2012 urlParams_ gensupport.URLParams
2013 ifNoneMatch_ string
2014 ctx_ context.Context
2015 header_ http.Header
2016 }
2017
2018
2019
2020
2021
2022 func (r *ProjectsLocationsDataExchangesService) Get(name string) *ProjectsLocationsDataExchangesGetCall {
2023 c := &ProjectsLocationsDataExchangesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2024 c.name = name
2025 return c
2026 }
2027
2028
2029
2030
2031 func (c *ProjectsLocationsDataExchangesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesGetCall {
2032 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2033 return c
2034 }
2035
2036
2037
2038
2039 func (c *ProjectsLocationsDataExchangesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataExchangesGetCall {
2040 c.ifNoneMatch_ = entityTag
2041 return c
2042 }
2043
2044
2045 func (c *ProjectsLocationsDataExchangesGetCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesGetCall {
2046 c.ctx_ = ctx
2047 return c
2048 }
2049
2050
2051
2052 func (c *ProjectsLocationsDataExchangesGetCall) Header() http.Header {
2053 if c.header_ == nil {
2054 c.header_ = make(http.Header)
2055 }
2056 return c.header_
2057 }
2058
2059 func (c *ProjectsLocationsDataExchangesGetCall) doRequest(alt string) (*http.Response, error) {
2060 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2061 if c.ifNoneMatch_ != "" {
2062 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2063 }
2064 var body io.Reader = nil
2065 c.urlParams_.Set("alt", alt)
2066 c.urlParams_.Set("prettyPrint", "false")
2067 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2068 urls += "?" + c.urlParams_.Encode()
2069 req, err := http.NewRequest("GET", urls, body)
2070 if err != nil {
2071 return nil, err
2072 }
2073 req.Header = reqHeaders
2074 googleapi.Expand(req.URL, map[string]string{
2075 "name": c.name,
2076 })
2077 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2078 }
2079
2080
2081
2082
2083
2084
2085 func (c *ProjectsLocationsDataExchangesGetCall) Do(opts ...googleapi.CallOption) (*DataExchange, error) {
2086 gensupport.SetOptions(c.urlParams_, opts...)
2087 res, err := c.doRequest("json")
2088 if res != nil && res.StatusCode == http.StatusNotModified {
2089 if res.Body != nil {
2090 res.Body.Close()
2091 }
2092 return nil, gensupport.WrapError(&googleapi.Error{
2093 Code: res.StatusCode,
2094 Header: res.Header,
2095 })
2096 }
2097 if err != nil {
2098 return nil, err
2099 }
2100 defer googleapi.CloseBody(res)
2101 if err := googleapi.CheckResponse(res); err != nil {
2102 return nil, gensupport.WrapError(err)
2103 }
2104 ret := &DataExchange{
2105 ServerResponse: googleapi.ServerResponse{
2106 Header: res.Header,
2107 HTTPStatusCode: res.StatusCode,
2108 },
2109 }
2110 target := &ret
2111 if err := gensupport.DecodeResponse(target, res); err != nil {
2112 return nil, err
2113 }
2114 return ret, nil
2115 }
2116
2117 type ProjectsLocationsDataExchangesGetIamPolicyCall struct {
2118 s *Service
2119 resource string
2120 getiampolicyrequest *GetIamPolicyRequest
2121 urlParams_ gensupport.URLParams
2122 ctx_ context.Context
2123 header_ http.Header
2124 }
2125
2126
2127
2128
2129
2130
2131 func (r *ProjectsLocationsDataExchangesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsDataExchangesGetIamPolicyCall {
2132 c := &ProjectsLocationsDataExchangesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2133 c.resource = resource
2134 c.getiampolicyrequest = getiampolicyrequest
2135 return c
2136 }
2137
2138
2139
2140
2141 func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesGetIamPolicyCall {
2142 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2143 return c
2144 }
2145
2146
2147 func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesGetIamPolicyCall {
2148 c.ctx_ = ctx
2149 return c
2150 }
2151
2152
2153
2154 func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) Header() http.Header {
2155 if c.header_ == nil {
2156 c.header_ = make(http.Header)
2157 }
2158 return c.header_
2159 }
2160
2161 func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2162 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2163 var body io.Reader = nil
2164 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
2165 if err != nil {
2166 return nil, err
2167 }
2168 c.urlParams_.Set("alt", alt)
2169 c.urlParams_.Set("prettyPrint", "false")
2170 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
2171 urls += "?" + c.urlParams_.Encode()
2172 req, err := http.NewRequest("POST", urls, body)
2173 if err != nil {
2174 return nil, err
2175 }
2176 req.Header = reqHeaders
2177 googleapi.Expand(req.URL, map[string]string{
2178 "resource": c.resource,
2179 })
2180 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2181 }
2182
2183
2184
2185
2186
2187
2188 func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2189 gensupport.SetOptions(c.urlParams_, opts...)
2190 res, err := c.doRequest("json")
2191 if res != nil && res.StatusCode == http.StatusNotModified {
2192 if res.Body != nil {
2193 res.Body.Close()
2194 }
2195 return nil, gensupport.WrapError(&googleapi.Error{
2196 Code: res.StatusCode,
2197 Header: res.Header,
2198 })
2199 }
2200 if err != nil {
2201 return nil, err
2202 }
2203 defer googleapi.CloseBody(res)
2204 if err := googleapi.CheckResponse(res); err != nil {
2205 return nil, gensupport.WrapError(err)
2206 }
2207 ret := &Policy{
2208 ServerResponse: googleapi.ServerResponse{
2209 Header: res.Header,
2210 HTTPStatusCode: res.StatusCode,
2211 },
2212 }
2213 target := &ret
2214 if err := gensupport.DecodeResponse(target, res); err != nil {
2215 return nil, err
2216 }
2217 return ret, nil
2218 }
2219
2220 type ProjectsLocationsDataExchangesListCall struct {
2221 s *Service
2222 parent string
2223 urlParams_ gensupport.URLParams
2224 ifNoneMatch_ string
2225 ctx_ context.Context
2226 header_ http.Header
2227 }
2228
2229
2230
2231
2232
2233 func (r *ProjectsLocationsDataExchangesService) List(parent string) *ProjectsLocationsDataExchangesListCall {
2234 c := &ProjectsLocationsDataExchangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2235 c.parent = parent
2236 return c
2237 }
2238
2239
2240
2241
2242 func (c *ProjectsLocationsDataExchangesListCall) PageSize(pageSize int64) *ProjectsLocationsDataExchangesListCall {
2243 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2244 return c
2245 }
2246
2247
2248
2249 func (c *ProjectsLocationsDataExchangesListCall) PageToken(pageToken string) *ProjectsLocationsDataExchangesListCall {
2250 c.urlParams_.Set("pageToken", pageToken)
2251 return c
2252 }
2253
2254
2255
2256
2257 func (c *ProjectsLocationsDataExchangesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListCall {
2258 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2259 return c
2260 }
2261
2262
2263
2264
2265 func (c *ProjectsLocationsDataExchangesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataExchangesListCall {
2266 c.ifNoneMatch_ = entityTag
2267 return c
2268 }
2269
2270
2271 func (c *ProjectsLocationsDataExchangesListCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListCall {
2272 c.ctx_ = ctx
2273 return c
2274 }
2275
2276
2277
2278 func (c *ProjectsLocationsDataExchangesListCall) Header() http.Header {
2279 if c.header_ == nil {
2280 c.header_ = make(http.Header)
2281 }
2282 return c.header_
2283 }
2284
2285 func (c *ProjectsLocationsDataExchangesListCall) doRequest(alt string) (*http.Response, error) {
2286 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2287 if c.ifNoneMatch_ != "" {
2288 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2289 }
2290 var body io.Reader = nil
2291 c.urlParams_.Set("alt", alt)
2292 c.urlParams_.Set("prettyPrint", "false")
2293 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dataExchanges")
2294 urls += "?" + c.urlParams_.Encode()
2295 req, err := http.NewRequest("GET", urls, body)
2296 if err != nil {
2297 return nil, err
2298 }
2299 req.Header = reqHeaders
2300 googleapi.Expand(req.URL, map[string]string{
2301 "parent": c.parent,
2302 })
2303 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2304 }
2305
2306
2307
2308
2309
2310
2311
2312 func (c *ProjectsLocationsDataExchangesListCall) Do(opts ...googleapi.CallOption) (*ListDataExchangesResponse, error) {
2313 gensupport.SetOptions(c.urlParams_, opts...)
2314 res, err := c.doRequest("json")
2315 if res != nil && res.StatusCode == http.StatusNotModified {
2316 if res.Body != nil {
2317 res.Body.Close()
2318 }
2319 return nil, gensupport.WrapError(&googleapi.Error{
2320 Code: res.StatusCode,
2321 Header: res.Header,
2322 })
2323 }
2324 if err != nil {
2325 return nil, err
2326 }
2327 defer googleapi.CloseBody(res)
2328 if err := googleapi.CheckResponse(res); err != nil {
2329 return nil, gensupport.WrapError(err)
2330 }
2331 ret := &ListDataExchangesResponse{
2332 ServerResponse: googleapi.ServerResponse{
2333 Header: res.Header,
2334 HTTPStatusCode: res.StatusCode,
2335 },
2336 }
2337 target := &ret
2338 if err := gensupport.DecodeResponse(target, res); err != nil {
2339 return nil, err
2340 }
2341 return ret, nil
2342 }
2343
2344
2345
2346
2347 func (c *ProjectsLocationsDataExchangesListCall) Pages(ctx context.Context, f func(*ListDataExchangesResponse) error) error {
2348 c.ctx_ = ctx
2349 defer c.PageToken(c.urlParams_.Get("pageToken"))
2350 for {
2351 x, err := c.Do()
2352 if err != nil {
2353 return err
2354 }
2355 if err := f(x); err != nil {
2356 return err
2357 }
2358 if x.NextPageToken == "" {
2359 return nil
2360 }
2361 c.PageToken(x.NextPageToken)
2362 }
2363 }
2364
2365 type ProjectsLocationsDataExchangesListSubscriptionsCall struct {
2366 s *Service
2367 resource string
2368 urlParams_ gensupport.URLParams
2369 ifNoneMatch_ string
2370 ctx_ context.Context
2371 header_ http.Header
2372 }
2373
2374
2375
2376
2377
2378
2379
2380
2381 func (r *ProjectsLocationsDataExchangesService) ListSubscriptions(resource string) *ProjectsLocationsDataExchangesListSubscriptionsCall {
2382 c := &ProjectsLocationsDataExchangesListSubscriptionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2383 c.resource = resource
2384 return c
2385 }
2386
2387
2388
2389
2390 func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) IncludeDeletedSubscriptions(includeDeletedSubscriptions bool) *ProjectsLocationsDataExchangesListSubscriptionsCall {
2391 c.urlParams_.Set("includeDeletedSubscriptions", fmt.Sprint(includeDeletedSubscriptions))
2392 return c
2393 }
2394
2395
2396
2397 func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) PageSize(pageSize int64) *ProjectsLocationsDataExchangesListSubscriptionsCall {
2398 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2399 return c
2400 }
2401
2402
2403
2404 func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) PageToken(pageToken string) *ProjectsLocationsDataExchangesListSubscriptionsCall {
2405 c.urlParams_.Set("pageToken", pageToken)
2406 return c
2407 }
2408
2409
2410
2411
2412 func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListSubscriptionsCall {
2413 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2414 return c
2415 }
2416
2417
2418
2419
2420 func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataExchangesListSubscriptionsCall {
2421 c.ifNoneMatch_ = entityTag
2422 return c
2423 }
2424
2425
2426 func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListSubscriptionsCall {
2427 c.ctx_ = ctx
2428 return c
2429 }
2430
2431
2432
2433 func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) Header() http.Header {
2434 if c.header_ == nil {
2435 c.header_ = make(http.Header)
2436 }
2437 return c.header_
2438 }
2439
2440 func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) doRequest(alt string) (*http.Response, error) {
2441 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2442 if c.ifNoneMatch_ != "" {
2443 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2444 }
2445 var body io.Reader = nil
2446 c.urlParams_.Set("alt", alt)
2447 c.urlParams_.Set("prettyPrint", "false")
2448 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listSubscriptions")
2449 urls += "?" + c.urlParams_.Encode()
2450 req, err := http.NewRequest("GET", urls, body)
2451 if err != nil {
2452 return nil, err
2453 }
2454 req.Header = reqHeaders
2455 googleapi.Expand(req.URL, map[string]string{
2456 "resource": c.resource,
2457 })
2458 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2459 }
2460
2461
2462
2463
2464
2465
2466
2467 func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) Do(opts ...googleapi.CallOption) (*ListSharedResourceSubscriptionsResponse, error) {
2468 gensupport.SetOptions(c.urlParams_, opts...)
2469 res, err := c.doRequest("json")
2470 if res != nil && res.StatusCode == http.StatusNotModified {
2471 if res.Body != nil {
2472 res.Body.Close()
2473 }
2474 return nil, gensupport.WrapError(&googleapi.Error{
2475 Code: res.StatusCode,
2476 Header: res.Header,
2477 })
2478 }
2479 if err != nil {
2480 return nil, err
2481 }
2482 defer googleapi.CloseBody(res)
2483 if err := googleapi.CheckResponse(res); err != nil {
2484 return nil, gensupport.WrapError(err)
2485 }
2486 ret := &ListSharedResourceSubscriptionsResponse{
2487 ServerResponse: googleapi.ServerResponse{
2488 Header: res.Header,
2489 HTTPStatusCode: res.StatusCode,
2490 },
2491 }
2492 target := &ret
2493 if err := gensupport.DecodeResponse(target, res); err != nil {
2494 return nil, err
2495 }
2496 return ret, nil
2497 }
2498
2499
2500
2501
2502 func (c *ProjectsLocationsDataExchangesListSubscriptionsCall) Pages(ctx context.Context, f func(*ListSharedResourceSubscriptionsResponse) error) error {
2503 c.ctx_ = ctx
2504 defer c.PageToken(c.urlParams_.Get("pageToken"))
2505 for {
2506 x, err := c.Do()
2507 if err != nil {
2508 return err
2509 }
2510 if err := f(x); err != nil {
2511 return err
2512 }
2513 if x.NextPageToken == "" {
2514 return nil
2515 }
2516 c.PageToken(x.NextPageToken)
2517 }
2518 }
2519
2520 type ProjectsLocationsDataExchangesPatchCall struct {
2521 s *Service
2522 name string
2523 dataexchange *DataExchange
2524 urlParams_ gensupport.URLParams
2525 ctx_ context.Context
2526 header_ http.Header
2527 }
2528
2529
2530
2531
2532
2533 func (r *ProjectsLocationsDataExchangesService) Patch(name string, dataexchange *DataExchange) *ProjectsLocationsDataExchangesPatchCall {
2534 c := &ProjectsLocationsDataExchangesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2535 c.name = name
2536 c.dataexchange = dataexchange
2537 return c
2538 }
2539
2540
2541
2542
2543
2544 func (c *ProjectsLocationsDataExchangesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDataExchangesPatchCall {
2545 c.urlParams_.Set("updateMask", updateMask)
2546 return c
2547 }
2548
2549
2550
2551
2552 func (c *ProjectsLocationsDataExchangesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesPatchCall {
2553 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2554 return c
2555 }
2556
2557
2558 func (c *ProjectsLocationsDataExchangesPatchCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesPatchCall {
2559 c.ctx_ = ctx
2560 return c
2561 }
2562
2563
2564
2565 func (c *ProjectsLocationsDataExchangesPatchCall) Header() http.Header {
2566 if c.header_ == nil {
2567 c.header_ = make(http.Header)
2568 }
2569 return c.header_
2570 }
2571
2572 func (c *ProjectsLocationsDataExchangesPatchCall) doRequest(alt string) (*http.Response, error) {
2573 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2574 var body io.Reader = nil
2575 body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataexchange)
2576 if err != nil {
2577 return nil, err
2578 }
2579 c.urlParams_.Set("alt", alt)
2580 c.urlParams_.Set("prettyPrint", "false")
2581 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2582 urls += "?" + c.urlParams_.Encode()
2583 req, err := http.NewRequest("PATCH", urls, body)
2584 if err != nil {
2585 return nil, err
2586 }
2587 req.Header = reqHeaders
2588 googleapi.Expand(req.URL, map[string]string{
2589 "name": c.name,
2590 })
2591 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2592 }
2593
2594
2595
2596
2597
2598
2599 func (c *ProjectsLocationsDataExchangesPatchCall) Do(opts ...googleapi.CallOption) (*DataExchange, error) {
2600 gensupport.SetOptions(c.urlParams_, opts...)
2601 res, err := c.doRequest("json")
2602 if res != nil && res.StatusCode == http.StatusNotModified {
2603 if res.Body != nil {
2604 res.Body.Close()
2605 }
2606 return nil, gensupport.WrapError(&googleapi.Error{
2607 Code: res.StatusCode,
2608 Header: res.Header,
2609 })
2610 }
2611 if err != nil {
2612 return nil, err
2613 }
2614 defer googleapi.CloseBody(res)
2615 if err := googleapi.CheckResponse(res); err != nil {
2616 return nil, gensupport.WrapError(err)
2617 }
2618 ret := &DataExchange{
2619 ServerResponse: googleapi.ServerResponse{
2620 Header: res.Header,
2621 HTTPStatusCode: res.StatusCode,
2622 },
2623 }
2624 target := &ret
2625 if err := gensupport.DecodeResponse(target, res); err != nil {
2626 return nil, err
2627 }
2628 return ret, nil
2629 }
2630
2631 type ProjectsLocationsDataExchangesSetIamPolicyCall struct {
2632 s *Service
2633 resource string
2634 setiampolicyrequest *SetIamPolicyRequest
2635 urlParams_ gensupport.URLParams
2636 ctx_ context.Context
2637 header_ http.Header
2638 }
2639
2640
2641
2642
2643
2644
2645 func (r *ProjectsLocationsDataExchangesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsDataExchangesSetIamPolicyCall {
2646 c := &ProjectsLocationsDataExchangesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2647 c.resource = resource
2648 c.setiampolicyrequest = setiampolicyrequest
2649 return c
2650 }
2651
2652
2653
2654
2655 func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesSetIamPolicyCall {
2656 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2657 return c
2658 }
2659
2660
2661 func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesSetIamPolicyCall {
2662 c.ctx_ = ctx
2663 return c
2664 }
2665
2666
2667
2668 func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) Header() http.Header {
2669 if c.header_ == nil {
2670 c.header_ = make(http.Header)
2671 }
2672 return c.header_
2673 }
2674
2675 func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2676 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2677 var body io.Reader = nil
2678 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
2679 if err != nil {
2680 return nil, err
2681 }
2682 c.urlParams_.Set("alt", alt)
2683 c.urlParams_.Set("prettyPrint", "false")
2684 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
2685 urls += "?" + c.urlParams_.Encode()
2686 req, err := http.NewRequest("POST", urls, body)
2687 if err != nil {
2688 return nil, err
2689 }
2690 req.Header = reqHeaders
2691 googleapi.Expand(req.URL, map[string]string{
2692 "resource": c.resource,
2693 })
2694 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2695 }
2696
2697
2698
2699
2700
2701
2702 func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2703 gensupport.SetOptions(c.urlParams_, opts...)
2704 res, err := c.doRequest("json")
2705 if res != nil && res.StatusCode == http.StatusNotModified {
2706 if res.Body != nil {
2707 res.Body.Close()
2708 }
2709 return nil, gensupport.WrapError(&googleapi.Error{
2710 Code: res.StatusCode,
2711 Header: res.Header,
2712 })
2713 }
2714 if err != nil {
2715 return nil, err
2716 }
2717 defer googleapi.CloseBody(res)
2718 if err := googleapi.CheckResponse(res); err != nil {
2719 return nil, gensupport.WrapError(err)
2720 }
2721 ret := &Policy{
2722 ServerResponse: googleapi.ServerResponse{
2723 Header: res.Header,
2724 HTTPStatusCode: res.StatusCode,
2725 },
2726 }
2727 target := &ret
2728 if err := gensupport.DecodeResponse(target, res); err != nil {
2729 return nil, err
2730 }
2731 return ret, nil
2732 }
2733
2734 type ProjectsLocationsDataExchangesSubscribeCall struct {
2735 s *Service
2736 name string
2737 subscribedataexchangerequest *SubscribeDataExchangeRequest
2738 urlParams_ gensupport.URLParams
2739 ctx_ context.Context
2740 header_ http.Header
2741 }
2742
2743
2744
2745
2746
2747
2748 func (r *ProjectsLocationsDataExchangesService) Subscribe(name string, subscribedataexchangerequest *SubscribeDataExchangeRequest) *ProjectsLocationsDataExchangesSubscribeCall {
2749 c := &ProjectsLocationsDataExchangesSubscribeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2750 c.name = name
2751 c.subscribedataexchangerequest = subscribedataexchangerequest
2752 return c
2753 }
2754
2755
2756
2757
2758 func (c *ProjectsLocationsDataExchangesSubscribeCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesSubscribeCall {
2759 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2760 return c
2761 }
2762
2763
2764 func (c *ProjectsLocationsDataExchangesSubscribeCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesSubscribeCall {
2765 c.ctx_ = ctx
2766 return c
2767 }
2768
2769
2770
2771 func (c *ProjectsLocationsDataExchangesSubscribeCall) Header() http.Header {
2772 if c.header_ == nil {
2773 c.header_ = make(http.Header)
2774 }
2775 return c.header_
2776 }
2777
2778 func (c *ProjectsLocationsDataExchangesSubscribeCall) doRequest(alt string) (*http.Response, error) {
2779 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2780 var body io.Reader = nil
2781 body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscribedataexchangerequest)
2782 if err != nil {
2783 return nil, err
2784 }
2785 c.urlParams_.Set("alt", alt)
2786 c.urlParams_.Set("prettyPrint", "false")
2787 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:subscribe")
2788 urls += "?" + c.urlParams_.Encode()
2789 req, err := http.NewRequest("POST", urls, body)
2790 if err != nil {
2791 return nil, err
2792 }
2793 req.Header = reqHeaders
2794 googleapi.Expand(req.URL, map[string]string{
2795 "name": c.name,
2796 })
2797 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2798 }
2799
2800
2801
2802
2803
2804
2805 func (c *ProjectsLocationsDataExchangesSubscribeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2806 gensupport.SetOptions(c.urlParams_, opts...)
2807 res, err := c.doRequest("json")
2808 if res != nil && res.StatusCode == http.StatusNotModified {
2809 if res.Body != nil {
2810 res.Body.Close()
2811 }
2812 return nil, gensupport.WrapError(&googleapi.Error{
2813 Code: res.StatusCode,
2814 Header: res.Header,
2815 })
2816 }
2817 if err != nil {
2818 return nil, err
2819 }
2820 defer googleapi.CloseBody(res)
2821 if err := googleapi.CheckResponse(res); err != nil {
2822 return nil, gensupport.WrapError(err)
2823 }
2824 ret := &Operation{
2825 ServerResponse: googleapi.ServerResponse{
2826 Header: res.Header,
2827 HTTPStatusCode: res.StatusCode,
2828 },
2829 }
2830 target := &ret
2831 if err := gensupport.DecodeResponse(target, res); err != nil {
2832 return nil, err
2833 }
2834 return ret, nil
2835 }
2836
2837 type ProjectsLocationsDataExchangesTestIamPermissionsCall struct {
2838 s *Service
2839 resource string
2840 testiampermissionsrequest *TestIamPermissionsRequest
2841 urlParams_ gensupport.URLParams
2842 ctx_ context.Context
2843 header_ http.Header
2844 }
2845
2846
2847
2848
2849
2850
2851
2852 func (r *ProjectsLocationsDataExchangesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsDataExchangesTestIamPermissionsCall {
2853 c := &ProjectsLocationsDataExchangesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2854 c.resource = resource
2855 c.testiampermissionsrequest = testiampermissionsrequest
2856 return c
2857 }
2858
2859
2860
2861
2862 func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesTestIamPermissionsCall {
2863 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2864 return c
2865 }
2866
2867
2868 func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesTestIamPermissionsCall {
2869 c.ctx_ = ctx
2870 return c
2871 }
2872
2873
2874
2875 func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) Header() http.Header {
2876 if c.header_ == nil {
2877 c.header_ = make(http.Header)
2878 }
2879 return c.header_
2880 }
2881
2882 func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2883 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2884 var body io.Reader = nil
2885 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2886 if err != nil {
2887 return nil, err
2888 }
2889 c.urlParams_.Set("alt", alt)
2890 c.urlParams_.Set("prettyPrint", "false")
2891 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
2892 urls += "?" + c.urlParams_.Encode()
2893 req, err := http.NewRequest("POST", urls, body)
2894 if err != nil {
2895 return nil, err
2896 }
2897 req.Header = reqHeaders
2898 googleapi.Expand(req.URL, map[string]string{
2899 "resource": c.resource,
2900 })
2901 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2902 }
2903
2904
2905
2906
2907
2908
2909
2910 func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2911 gensupport.SetOptions(c.urlParams_, opts...)
2912 res, err := c.doRequest("json")
2913 if res != nil && res.StatusCode == http.StatusNotModified {
2914 if res.Body != nil {
2915 res.Body.Close()
2916 }
2917 return nil, gensupport.WrapError(&googleapi.Error{
2918 Code: res.StatusCode,
2919 Header: res.Header,
2920 })
2921 }
2922 if err != nil {
2923 return nil, err
2924 }
2925 defer googleapi.CloseBody(res)
2926 if err := googleapi.CheckResponse(res); err != nil {
2927 return nil, gensupport.WrapError(err)
2928 }
2929 ret := &TestIamPermissionsResponse{
2930 ServerResponse: googleapi.ServerResponse{
2931 Header: res.Header,
2932 HTTPStatusCode: res.StatusCode,
2933 },
2934 }
2935 target := &ret
2936 if err := gensupport.DecodeResponse(target, res); err != nil {
2937 return nil, err
2938 }
2939 return ret, nil
2940 }
2941
2942 type ProjectsLocationsDataExchangesListingsCreateCall struct {
2943 s *Service
2944 parent string
2945 listing *Listing
2946 urlParams_ gensupport.URLParams
2947 ctx_ context.Context
2948 header_ http.Header
2949 }
2950
2951
2952
2953
2954
2955 func (r *ProjectsLocationsDataExchangesListingsService) Create(parent string, listing *Listing) *ProjectsLocationsDataExchangesListingsCreateCall {
2956 c := &ProjectsLocationsDataExchangesListingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2957 c.parent = parent
2958 c.listing = listing
2959 return c
2960 }
2961
2962
2963
2964
2965
2966 func (c *ProjectsLocationsDataExchangesListingsCreateCall) ListingId(listingId string) *ProjectsLocationsDataExchangesListingsCreateCall {
2967 c.urlParams_.Set("listingId", listingId)
2968 return c
2969 }
2970
2971
2972
2973
2974 func (c *ProjectsLocationsDataExchangesListingsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsCreateCall {
2975 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2976 return c
2977 }
2978
2979
2980 func (c *ProjectsLocationsDataExchangesListingsCreateCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsCreateCall {
2981 c.ctx_ = ctx
2982 return c
2983 }
2984
2985
2986
2987 func (c *ProjectsLocationsDataExchangesListingsCreateCall) Header() http.Header {
2988 if c.header_ == nil {
2989 c.header_ = make(http.Header)
2990 }
2991 return c.header_
2992 }
2993
2994 func (c *ProjectsLocationsDataExchangesListingsCreateCall) doRequest(alt string) (*http.Response, error) {
2995 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2996 var body io.Reader = nil
2997 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
2998 if err != nil {
2999 return nil, err
3000 }
3001 c.urlParams_.Set("alt", alt)
3002 c.urlParams_.Set("prettyPrint", "false")
3003 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/listings")
3004 urls += "?" + c.urlParams_.Encode()
3005 req, err := http.NewRequest("POST", urls, body)
3006 if err != nil {
3007 return nil, err
3008 }
3009 req.Header = reqHeaders
3010 googleapi.Expand(req.URL, map[string]string{
3011 "parent": c.parent,
3012 })
3013 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3014 }
3015
3016
3017
3018
3019
3020
3021 func (c *ProjectsLocationsDataExchangesListingsCreateCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
3022 gensupport.SetOptions(c.urlParams_, opts...)
3023 res, err := c.doRequest("json")
3024 if res != nil && res.StatusCode == http.StatusNotModified {
3025 if res.Body != nil {
3026 res.Body.Close()
3027 }
3028 return nil, gensupport.WrapError(&googleapi.Error{
3029 Code: res.StatusCode,
3030 Header: res.Header,
3031 })
3032 }
3033 if err != nil {
3034 return nil, err
3035 }
3036 defer googleapi.CloseBody(res)
3037 if err := googleapi.CheckResponse(res); err != nil {
3038 return nil, gensupport.WrapError(err)
3039 }
3040 ret := &Listing{
3041 ServerResponse: googleapi.ServerResponse{
3042 Header: res.Header,
3043 HTTPStatusCode: res.StatusCode,
3044 },
3045 }
3046 target := &ret
3047 if err := gensupport.DecodeResponse(target, res); err != nil {
3048 return nil, err
3049 }
3050 return ret, nil
3051 }
3052
3053 type ProjectsLocationsDataExchangesListingsDeleteCall struct {
3054 s *Service
3055 name string
3056 urlParams_ gensupport.URLParams
3057 ctx_ context.Context
3058 header_ http.Header
3059 }
3060
3061
3062
3063
3064
3065 func (r *ProjectsLocationsDataExchangesListingsService) Delete(name string) *ProjectsLocationsDataExchangesListingsDeleteCall {
3066 c := &ProjectsLocationsDataExchangesListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3067 c.name = name
3068 return c
3069 }
3070
3071
3072
3073
3074 func (c *ProjectsLocationsDataExchangesListingsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsDeleteCall {
3075 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3076 return c
3077 }
3078
3079
3080 func (c *ProjectsLocationsDataExchangesListingsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsDeleteCall {
3081 c.ctx_ = ctx
3082 return c
3083 }
3084
3085
3086
3087 func (c *ProjectsLocationsDataExchangesListingsDeleteCall) Header() http.Header {
3088 if c.header_ == nil {
3089 c.header_ = make(http.Header)
3090 }
3091 return c.header_
3092 }
3093
3094 func (c *ProjectsLocationsDataExchangesListingsDeleteCall) doRequest(alt string) (*http.Response, error) {
3095 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
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}")
3100 urls += "?" + c.urlParams_.Encode()
3101 req, err := http.NewRequest("DELETE", 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 func (c *ProjectsLocationsDataExchangesListingsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3118 gensupport.SetOptions(c.urlParams_, opts...)
3119 res, err := c.doRequest("json")
3120 if res != nil && res.StatusCode == http.StatusNotModified {
3121 if res.Body != nil {
3122 res.Body.Close()
3123 }
3124 return nil, gensupport.WrapError(&googleapi.Error{
3125 Code: res.StatusCode,
3126 Header: res.Header,
3127 })
3128 }
3129 if err != nil {
3130 return nil, err
3131 }
3132 defer googleapi.CloseBody(res)
3133 if err := googleapi.CheckResponse(res); err != nil {
3134 return nil, gensupport.WrapError(err)
3135 }
3136 ret := &Empty{
3137 ServerResponse: googleapi.ServerResponse{
3138 Header: res.Header,
3139 HTTPStatusCode: res.StatusCode,
3140 },
3141 }
3142 target := &ret
3143 if err := gensupport.DecodeResponse(target, res); err != nil {
3144 return nil, err
3145 }
3146 return ret, nil
3147 }
3148
3149 type ProjectsLocationsDataExchangesListingsGetCall struct {
3150 s *Service
3151 name string
3152 urlParams_ gensupport.URLParams
3153 ifNoneMatch_ string
3154 ctx_ context.Context
3155 header_ http.Header
3156 }
3157
3158
3159
3160
3161
3162 func (r *ProjectsLocationsDataExchangesListingsService) Get(name string) *ProjectsLocationsDataExchangesListingsGetCall {
3163 c := &ProjectsLocationsDataExchangesListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3164 c.name = name
3165 return c
3166 }
3167
3168
3169
3170
3171 func (c *ProjectsLocationsDataExchangesListingsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsGetCall {
3172 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3173 return c
3174 }
3175
3176
3177
3178
3179 func (c *ProjectsLocationsDataExchangesListingsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataExchangesListingsGetCall {
3180 c.ifNoneMatch_ = entityTag
3181 return c
3182 }
3183
3184
3185 func (c *ProjectsLocationsDataExchangesListingsGetCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsGetCall {
3186 c.ctx_ = ctx
3187 return c
3188 }
3189
3190
3191
3192 func (c *ProjectsLocationsDataExchangesListingsGetCall) Header() http.Header {
3193 if c.header_ == nil {
3194 c.header_ = make(http.Header)
3195 }
3196 return c.header_
3197 }
3198
3199 func (c *ProjectsLocationsDataExchangesListingsGetCall) doRequest(alt string) (*http.Response, error) {
3200 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3201 if c.ifNoneMatch_ != "" {
3202 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3203 }
3204 var body io.Reader = nil
3205 c.urlParams_.Set("alt", alt)
3206 c.urlParams_.Set("prettyPrint", "false")
3207 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3208 urls += "?" + c.urlParams_.Encode()
3209 req, err := http.NewRequest("GET", urls, body)
3210 if err != nil {
3211 return nil, err
3212 }
3213 req.Header = reqHeaders
3214 googleapi.Expand(req.URL, map[string]string{
3215 "name": c.name,
3216 })
3217 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3218 }
3219
3220
3221
3222
3223
3224
3225 func (c *ProjectsLocationsDataExchangesListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
3226 gensupport.SetOptions(c.urlParams_, opts...)
3227 res, err := c.doRequest("json")
3228 if res != nil && res.StatusCode == http.StatusNotModified {
3229 if res.Body != nil {
3230 res.Body.Close()
3231 }
3232 return nil, gensupport.WrapError(&googleapi.Error{
3233 Code: res.StatusCode,
3234 Header: res.Header,
3235 })
3236 }
3237 if err != nil {
3238 return nil, err
3239 }
3240 defer googleapi.CloseBody(res)
3241 if err := googleapi.CheckResponse(res); err != nil {
3242 return nil, gensupport.WrapError(err)
3243 }
3244 ret := &Listing{
3245 ServerResponse: googleapi.ServerResponse{
3246 Header: res.Header,
3247 HTTPStatusCode: res.StatusCode,
3248 },
3249 }
3250 target := &ret
3251 if err := gensupport.DecodeResponse(target, res); err != nil {
3252 return nil, err
3253 }
3254 return ret, nil
3255 }
3256
3257 type ProjectsLocationsDataExchangesListingsGetIamPolicyCall struct {
3258 s *Service
3259 resource string
3260 getiampolicyrequest *GetIamPolicyRequest
3261 urlParams_ gensupport.URLParams
3262 ctx_ context.Context
3263 header_ http.Header
3264 }
3265
3266
3267
3268
3269
3270
3271 func (r *ProjectsLocationsDataExchangesListingsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsDataExchangesListingsGetIamPolicyCall {
3272 c := &ProjectsLocationsDataExchangesListingsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3273 c.resource = resource
3274 c.getiampolicyrequest = getiampolicyrequest
3275 return c
3276 }
3277
3278
3279
3280
3281 func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsGetIamPolicyCall {
3282 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3283 return c
3284 }
3285
3286
3287 func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsGetIamPolicyCall {
3288 c.ctx_ = ctx
3289 return c
3290 }
3291
3292
3293
3294 func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) Header() http.Header {
3295 if c.header_ == nil {
3296 c.header_ = make(http.Header)
3297 }
3298 return c.header_
3299 }
3300
3301 func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3302 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3303 var body io.Reader = nil
3304 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
3305 if err != nil {
3306 return nil, err
3307 }
3308 c.urlParams_.Set("alt", alt)
3309 c.urlParams_.Set("prettyPrint", "false")
3310 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
3311 urls += "?" + c.urlParams_.Encode()
3312 req, err := http.NewRequest("POST", urls, body)
3313 if err != nil {
3314 return nil, err
3315 }
3316 req.Header = reqHeaders
3317 googleapi.Expand(req.URL, map[string]string{
3318 "resource": c.resource,
3319 })
3320 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3321 }
3322
3323
3324
3325
3326
3327
3328 func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3329 gensupport.SetOptions(c.urlParams_, opts...)
3330 res, err := c.doRequest("json")
3331 if res != nil && res.StatusCode == http.StatusNotModified {
3332 if res.Body != nil {
3333 res.Body.Close()
3334 }
3335 return nil, gensupport.WrapError(&googleapi.Error{
3336 Code: res.StatusCode,
3337 Header: res.Header,
3338 })
3339 }
3340 if err != nil {
3341 return nil, err
3342 }
3343 defer googleapi.CloseBody(res)
3344 if err := googleapi.CheckResponse(res); err != nil {
3345 return nil, gensupport.WrapError(err)
3346 }
3347 ret := &Policy{
3348 ServerResponse: googleapi.ServerResponse{
3349 Header: res.Header,
3350 HTTPStatusCode: res.StatusCode,
3351 },
3352 }
3353 target := &ret
3354 if err := gensupport.DecodeResponse(target, res); err != nil {
3355 return nil, err
3356 }
3357 return ret, nil
3358 }
3359
3360 type ProjectsLocationsDataExchangesListingsListCall struct {
3361 s *Service
3362 parent string
3363 urlParams_ gensupport.URLParams
3364 ifNoneMatch_ string
3365 ctx_ context.Context
3366 header_ http.Header
3367 }
3368
3369
3370
3371
3372
3373 func (r *ProjectsLocationsDataExchangesListingsService) List(parent string) *ProjectsLocationsDataExchangesListingsListCall {
3374 c := &ProjectsLocationsDataExchangesListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3375 c.parent = parent
3376 return c
3377 }
3378
3379
3380
3381
3382 func (c *ProjectsLocationsDataExchangesListingsListCall) PageSize(pageSize int64) *ProjectsLocationsDataExchangesListingsListCall {
3383 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3384 return c
3385 }
3386
3387
3388
3389 func (c *ProjectsLocationsDataExchangesListingsListCall) PageToken(pageToken string) *ProjectsLocationsDataExchangesListingsListCall {
3390 c.urlParams_.Set("pageToken", pageToken)
3391 return c
3392 }
3393
3394
3395
3396
3397 func (c *ProjectsLocationsDataExchangesListingsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsListCall {
3398 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3399 return c
3400 }
3401
3402
3403
3404
3405 func (c *ProjectsLocationsDataExchangesListingsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataExchangesListingsListCall {
3406 c.ifNoneMatch_ = entityTag
3407 return c
3408 }
3409
3410
3411 func (c *ProjectsLocationsDataExchangesListingsListCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsListCall {
3412 c.ctx_ = ctx
3413 return c
3414 }
3415
3416
3417
3418 func (c *ProjectsLocationsDataExchangesListingsListCall) Header() http.Header {
3419 if c.header_ == nil {
3420 c.header_ = make(http.Header)
3421 }
3422 return c.header_
3423 }
3424
3425 func (c *ProjectsLocationsDataExchangesListingsListCall) doRequest(alt string) (*http.Response, error) {
3426 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3427 if c.ifNoneMatch_ != "" {
3428 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3429 }
3430 var body io.Reader = nil
3431 c.urlParams_.Set("alt", alt)
3432 c.urlParams_.Set("prettyPrint", "false")
3433 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/listings")
3434 urls += "?" + c.urlParams_.Encode()
3435 req, err := http.NewRequest("GET", urls, body)
3436 if err != nil {
3437 return nil, err
3438 }
3439 req.Header = reqHeaders
3440 googleapi.Expand(req.URL, map[string]string{
3441 "parent": c.parent,
3442 })
3443 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3444 }
3445
3446
3447
3448
3449
3450
3451
3452 func (c *ProjectsLocationsDataExchangesListingsListCall) Do(opts ...googleapi.CallOption) (*ListListingsResponse, error) {
3453 gensupport.SetOptions(c.urlParams_, opts...)
3454 res, err := c.doRequest("json")
3455 if res != nil && res.StatusCode == http.StatusNotModified {
3456 if res.Body != nil {
3457 res.Body.Close()
3458 }
3459 return nil, gensupport.WrapError(&googleapi.Error{
3460 Code: res.StatusCode,
3461 Header: res.Header,
3462 })
3463 }
3464 if err != nil {
3465 return nil, err
3466 }
3467 defer googleapi.CloseBody(res)
3468 if err := googleapi.CheckResponse(res); err != nil {
3469 return nil, gensupport.WrapError(err)
3470 }
3471 ret := &ListListingsResponse{
3472 ServerResponse: googleapi.ServerResponse{
3473 Header: res.Header,
3474 HTTPStatusCode: res.StatusCode,
3475 },
3476 }
3477 target := &ret
3478 if err := gensupport.DecodeResponse(target, res); err != nil {
3479 return nil, err
3480 }
3481 return ret, nil
3482 }
3483
3484
3485
3486
3487 func (c *ProjectsLocationsDataExchangesListingsListCall) Pages(ctx context.Context, f func(*ListListingsResponse) error) error {
3488 c.ctx_ = ctx
3489 defer c.PageToken(c.urlParams_.Get("pageToken"))
3490 for {
3491 x, err := c.Do()
3492 if err != nil {
3493 return err
3494 }
3495 if err := f(x); err != nil {
3496 return err
3497 }
3498 if x.NextPageToken == "" {
3499 return nil
3500 }
3501 c.PageToken(x.NextPageToken)
3502 }
3503 }
3504
3505 type ProjectsLocationsDataExchangesListingsListSubscriptionsCall struct {
3506 s *Service
3507 resource string
3508 urlParams_ gensupport.URLParams
3509 ifNoneMatch_ string
3510 ctx_ context.Context
3511 header_ http.Header
3512 }
3513
3514
3515
3516
3517
3518
3519
3520
3521 func (r *ProjectsLocationsDataExchangesListingsService) ListSubscriptions(resource string) *ProjectsLocationsDataExchangesListingsListSubscriptionsCall {
3522 c := &ProjectsLocationsDataExchangesListingsListSubscriptionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3523 c.resource = resource
3524 return c
3525 }
3526
3527
3528
3529
3530 func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) IncludeDeletedSubscriptions(includeDeletedSubscriptions bool) *ProjectsLocationsDataExchangesListingsListSubscriptionsCall {
3531 c.urlParams_.Set("includeDeletedSubscriptions", fmt.Sprint(includeDeletedSubscriptions))
3532 return c
3533 }
3534
3535
3536
3537 func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) PageSize(pageSize int64) *ProjectsLocationsDataExchangesListingsListSubscriptionsCall {
3538 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3539 return c
3540 }
3541
3542
3543
3544 func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) PageToken(pageToken string) *ProjectsLocationsDataExchangesListingsListSubscriptionsCall {
3545 c.urlParams_.Set("pageToken", pageToken)
3546 return c
3547 }
3548
3549
3550
3551
3552 func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsListSubscriptionsCall {
3553 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3554 return c
3555 }
3556
3557
3558
3559
3560 func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataExchangesListingsListSubscriptionsCall {
3561 c.ifNoneMatch_ = entityTag
3562 return c
3563 }
3564
3565
3566 func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsListSubscriptionsCall {
3567 c.ctx_ = ctx
3568 return c
3569 }
3570
3571
3572
3573 func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) Header() http.Header {
3574 if c.header_ == nil {
3575 c.header_ = make(http.Header)
3576 }
3577 return c.header_
3578 }
3579
3580 func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) doRequest(alt string) (*http.Response, error) {
3581 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3582 if c.ifNoneMatch_ != "" {
3583 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3584 }
3585 var body io.Reader = nil
3586 c.urlParams_.Set("alt", alt)
3587 c.urlParams_.Set("prettyPrint", "false")
3588 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listSubscriptions")
3589 urls += "?" + c.urlParams_.Encode()
3590 req, err := http.NewRequest("GET", urls, body)
3591 if err != nil {
3592 return nil, err
3593 }
3594 req.Header = reqHeaders
3595 googleapi.Expand(req.URL, map[string]string{
3596 "resource": c.resource,
3597 })
3598 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3599 }
3600
3601
3602
3603
3604
3605
3606
3607 func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) Do(opts ...googleapi.CallOption) (*ListSharedResourceSubscriptionsResponse, error) {
3608 gensupport.SetOptions(c.urlParams_, opts...)
3609 res, err := c.doRequest("json")
3610 if res != nil && res.StatusCode == http.StatusNotModified {
3611 if res.Body != nil {
3612 res.Body.Close()
3613 }
3614 return nil, gensupport.WrapError(&googleapi.Error{
3615 Code: res.StatusCode,
3616 Header: res.Header,
3617 })
3618 }
3619 if err != nil {
3620 return nil, err
3621 }
3622 defer googleapi.CloseBody(res)
3623 if err := googleapi.CheckResponse(res); err != nil {
3624 return nil, gensupport.WrapError(err)
3625 }
3626 ret := &ListSharedResourceSubscriptionsResponse{
3627 ServerResponse: googleapi.ServerResponse{
3628 Header: res.Header,
3629 HTTPStatusCode: res.StatusCode,
3630 },
3631 }
3632 target := &ret
3633 if err := gensupport.DecodeResponse(target, res); err != nil {
3634 return nil, err
3635 }
3636 return ret, nil
3637 }
3638
3639
3640
3641
3642 func (c *ProjectsLocationsDataExchangesListingsListSubscriptionsCall) Pages(ctx context.Context, f func(*ListSharedResourceSubscriptionsResponse) error) error {
3643 c.ctx_ = ctx
3644 defer c.PageToken(c.urlParams_.Get("pageToken"))
3645 for {
3646 x, err := c.Do()
3647 if err != nil {
3648 return err
3649 }
3650 if err := f(x); err != nil {
3651 return err
3652 }
3653 if x.NextPageToken == "" {
3654 return nil
3655 }
3656 c.PageToken(x.NextPageToken)
3657 }
3658 }
3659
3660 type ProjectsLocationsDataExchangesListingsPatchCall struct {
3661 s *Service
3662 name string
3663 listing *Listing
3664 urlParams_ gensupport.URLParams
3665 ctx_ context.Context
3666 header_ http.Header
3667 }
3668
3669
3670
3671
3672
3673 func (r *ProjectsLocationsDataExchangesListingsService) Patch(name string, listing *Listing) *ProjectsLocationsDataExchangesListingsPatchCall {
3674 c := &ProjectsLocationsDataExchangesListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3675 c.name = name
3676 c.listing = listing
3677 return c
3678 }
3679
3680
3681
3682
3683 func (c *ProjectsLocationsDataExchangesListingsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDataExchangesListingsPatchCall {
3684 c.urlParams_.Set("updateMask", updateMask)
3685 return c
3686 }
3687
3688
3689
3690
3691 func (c *ProjectsLocationsDataExchangesListingsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsPatchCall {
3692 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3693 return c
3694 }
3695
3696
3697 func (c *ProjectsLocationsDataExchangesListingsPatchCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsPatchCall {
3698 c.ctx_ = ctx
3699 return c
3700 }
3701
3702
3703
3704 func (c *ProjectsLocationsDataExchangesListingsPatchCall) Header() http.Header {
3705 if c.header_ == nil {
3706 c.header_ = make(http.Header)
3707 }
3708 return c.header_
3709 }
3710
3711 func (c *ProjectsLocationsDataExchangesListingsPatchCall) doRequest(alt string) (*http.Response, error) {
3712 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3713 var body io.Reader = nil
3714 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
3715 if err != nil {
3716 return nil, err
3717 }
3718 c.urlParams_.Set("alt", alt)
3719 c.urlParams_.Set("prettyPrint", "false")
3720 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3721 urls += "?" + c.urlParams_.Encode()
3722 req, err := http.NewRequest("PATCH", urls, body)
3723 if err != nil {
3724 return nil, err
3725 }
3726 req.Header = reqHeaders
3727 googleapi.Expand(req.URL, map[string]string{
3728 "name": c.name,
3729 })
3730 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3731 }
3732
3733
3734
3735
3736
3737
3738 func (c *ProjectsLocationsDataExchangesListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
3739 gensupport.SetOptions(c.urlParams_, opts...)
3740 res, err := c.doRequest("json")
3741 if res != nil && res.StatusCode == http.StatusNotModified {
3742 if res.Body != nil {
3743 res.Body.Close()
3744 }
3745 return nil, gensupport.WrapError(&googleapi.Error{
3746 Code: res.StatusCode,
3747 Header: res.Header,
3748 })
3749 }
3750 if err != nil {
3751 return nil, err
3752 }
3753 defer googleapi.CloseBody(res)
3754 if err := googleapi.CheckResponse(res); err != nil {
3755 return nil, gensupport.WrapError(err)
3756 }
3757 ret := &Listing{
3758 ServerResponse: googleapi.ServerResponse{
3759 Header: res.Header,
3760 HTTPStatusCode: res.StatusCode,
3761 },
3762 }
3763 target := &ret
3764 if err := gensupport.DecodeResponse(target, res); err != nil {
3765 return nil, err
3766 }
3767 return ret, nil
3768 }
3769
3770 type ProjectsLocationsDataExchangesListingsSetIamPolicyCall struct {
3771 s *Service
3772 resource string
3773 setiampolicyrequest *SetIamPolicyRequest
3774 urlParams_ gensupport.URLParams
3775 ctx_ context.Context
3776 header_ http.Header
3777 }
3778
3779
3780
3781
3782
3783
3784 func (r *ProjectsLocationsDataExchangesListingsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsDataExchangesListingsSetIamPolicyCall {
3785 c := &ProjectsLocationsDataExchangesListingsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3786 c.resource = resource
3787 c.setiampolicyrequest = setiampolicyrequest
3788 return c
3789 }
3790
3791
3792
3793
3794 func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsSetIamPolicyCall {
3795 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3796 return c
3797 }
3798
3799
3800 func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsSetIamPolicyCall {
3801 c.ctx_ = ctx
3802 return c
3803 }
3804
3805
3806
3807 func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) Header() http.Header {
3808 if c.header_ == nil {
3809 c.header_ = make(http.Header)
3810 }
3811 return c.header_
3812 }
3813
3814 func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3815 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3816 var body io.Reader = nil
3817 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
3818 if err != nil {
3819 return nil, err
3820 }
3821 c.urlParams_.Set("alt", alt)
3822 c.urlParams_.Set("prettyPrint", "false")
3823 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
3824 urls += "?" + c.urlParams_.Encode()
3825 req, err := http.NewRequest("POST", urls, body)
3826 if err != nil {
3827 return nil, err
3828 }
3829 req.Header = reqHeaders
3830 googleapi.Expand(req.URL, map[string]string{
3831 "resource": c.resource,
3832 })
3833 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3834 }
3835
3836
3837
3838
3839
3840
3841 func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3842 gensupport.SetOptions(c.urlParams_, opts...)
3843 res, err := c.doRequest("json")
3844 if res != nil && res.StatusCode == http.StatusNotModified {
3845 if res.Body != nil {
3846 res.Body.Close()
3847 }
3848 return nil, gensupport.WrapError(&googleapi.Error{
3849 Code: res.StatusCode,
3850 Header: res.Header,
3851 })
3852 }
3853 if err != nil {
3854 return nil, err
3855 }
3856 defer googleapi.CloseBody(res)
3857 if err := googleapi.CheckResponse(res); err != nil {
3858 return nil, gensupport.WrapError(err)
3859 }
3860 ret := &Policy{
3861 ServerResponse: googleapi.ServerResponse{
3862 Header: res.Header,
3863 HTTPStatusCode: res.StatusCode,
3864 },
3865 }
3866 target := &ret
3867 if err := gensupport.DecodeResponse(target, res); err != nil {
3868 return nil, err
3869 }
3870 return ret, nil
3871 }
3872
3873 type ProjectsLocationsDataExchangesListingsSubscribeCall struct {
3874 s *Service
3875 name string
3876 subscribelistingrequest *SubscribeListingRequest
3877 urlParams_ gensupport.URLParams
3878 ctx_ context.Context
3879 header_ http.Header
3880 }
3881
3882
3883
3884
3885
3886
3887
3888
3889 func (r *ProjectsLocationsDataExchangesListingsService) Subscribe(name string, subscribelistingrequest *SubscribeListingRequest) *ProjectsLocationsDataExchangesListingsSubscribeCall {
3890 c := &ProjectsLocationsDataExchangesListingsSubscribeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3891 c.name = name
3892 c.subscribelistingrequest = subscribelistingrequest
3893 return c
3894 }
3895
3896
3897
3898
3899 func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsSubscribeCall {
3900 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3901 return c
3902 }
3903
3904
3905 func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsSubscribeCall {
3906 c.ctx_ = ctx
3907 return c
3908 }
3909
3910
3911
3912 func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) Header() http.Header {
3913 if c.header_ == nil {
3914 c.header_ = make(http.Header)
3915 }
3916 return c.header_
3917 }
3918
3919 func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) doRequest(alt string) (*http.Response, error) {
3920 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3921 var body io.Reader = nil
3922 body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscribelistingrequest)
3923 if err != nil {
3924 return nil, err
3925 }
3926 c.urlParams_.Set("alt", alt)
3927 c.urlParams_.Set("prettyPrint", "false")
3928 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:subscribe")
3929 urls += "?" + c.urlParams_.Encode()
3930 req, err := http.NewRequest("POST", urls, body)
3931 if err != nil {
3932 return nil, err
3933 }
3934 req.Header = reqHeaders
3935 googleapi.Expand(req.URL, map[string]string{
3936 "name": c.name,
3937 })
3938 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3939 }
3940
3941
3942
3943
3944
3945
3946
3947 func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) Do(opts ...googleapi.CallOption) (*SubscribeListingResponse, error) {
3948 gensupport.SetOptions(c.urlParams_, opts...)
3949 res, err := c.doRequest("json")
3950 if res != nil && res.StatusCode == http.StatusNotModified {
3951 if res.Body != nil {
3952 res.Body.Close()
3953 }
3954 return nil, gensupport.WrapError(&googleapi.Error{
3955 Code: res.StatusCode,
3956 Header: res.Header,
3957 })
3958 }
3959 if err != nil {
3960 return nil, err
3961 }
3962 defer googleapi.CloseBody(res)
3963 if err := googleapi.CheckResponse(res); err != nil {
3964 return nil, gensupport.WrapError(err)
3965 }
3966 ret := &SubscribeListingResponse{
3967 ServerResponse: googleapi.ServerResponse{
3968 Header: res.Header,
3969 HTTPStatusCode: res.StatusCode,
3970 },
3971 }
3972 target := &ret
3973 if err := gensupport.DecodeResponse(target, res); err != nil {
3974 return nil, err
3975 }
3976 return ret, nil
3977 }
3978
3979 type ProjectsLocationsDataExchangesListingsTestIamPermissionsCall struct {
3980 s *Service
3981 resource string
3982 testiampermissionsrequest *TestIamPermissionsRequest
3983 urlParams_ gensupport.URLParams
3984 ctx_ context.Context
3985 header_ http.Header
3986 }
3987
3988
3989
3990
3991
3992
3993
3994 func (r *ProjectsLocationsDataExchangesListingsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall {
3995 c := &ProjectsLocationsDataExchangesListingsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3996 c.resource = resource
3997 c.testiampermissionsrequest = testiampermissionsrequest
3998 return c
3999 }
4000
4001
4002
4003
4004 func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall {
4005 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4006 return c
4007 }
4008
4009
4010 func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall {
4011 c.ctx_ = ctx
4012 return c
4013 }
4014
4015
4016
4017 func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) Header() http.Header {
4018 if c.header_ == nil {
4019 c.header_ = make(http.Header)
4020 }
4021 return c.header_
4022 }
4023
4024 func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
4025 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4026 var body io.Reader = nil
4027 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
4028 if err != nil {
4029 return nil, err
4030 }
4031 c.urlParams_.Set("alt", alt)
4032 c.urlParams_.Set("prettyPrint", "false")
4033 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
4034 urls += "?" + c.urlParams_.Encode()
4035 req, err := http.NewRequest("POST", urls, body)
4036 if err != nil {
4037 return nil, err
4038 }
4039 req.Header = reqHeaders
4040 googleapi.Expand(req.URL, map[string]string{
4041 "resource": c.resource,
4042 })
4043 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4044 }
4045
4046
4047
4048
4049
4050
4051
4052 func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
4053 gensupport.SetOptions(c.urlParams_, opts...)
4054 res, err := c.doRequest("json")
4055 if res != nil && res.StatusCode == http.StatusNotModified {
4056 if res.Body != nil {
4057 res.Body.Close()
4058 }
4059 return nil, gensupport.WrapError(&googleapi.Error{
4060 Code: res.StatusCode,
4061 Header: res.Header,
4062 })
4063 }
4064 if err != nil {
4065 return nil, err
4066 }
4067 defer googleapi.CloseBody(res)
4068 if err := googleapi.CheckResponse(res); err != nil {
4069 return nil, gensupport.WrapError(err)
4070 }
4071 ret := &TestIamPermissionsResponse{
4072 ServerResponse: googleapi.ServerResponse{
4073 Header: res.Header,
4074 HTTPStatusCode: res.StatusCode,
4075 },
4076 }
4077 target := &ret
4078 if err := gensupport.DecodeResponse(target, res); err != nil {
4079 return nil, err
4080 }
4081 return ret, nil
4082 }
4083
4084 type ProjectsLocationsSubscriptionsDeleteCall struct {
4085 s *Service
4086 name string
4087 urlParams_ gensupport.URLParams
4088 ctx_ context.Context
4089 header_ http.Header
4090 }
4091
4092
4093
4094
4095
4096 func (r *ProjectsLocationsSubscriptionsService) Delete(name string) *ProjectsLocationsSubscriptionsDeleteCall {
4097 c := &ProjectsLocationsSubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4098 c.name = name
4099 return c
4100 }
4101
4102
4103
4104
4105 func (c *ProjectsLocationsSubscriptionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsSubscriptionsDeleteCall {
4106 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4107 return c
4108 }
4109
4110
4111 func (c *ProjectsLocationsSubscriptionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsSubscriptionsDeleteCall {
4112 c.ctx_ = ctx
4113 return c
4114 }
4115
4116
4117
4118 func (c *ProjectsLocationsSubscriptionsDeleteCall) Header() http.Header {
4119 if c.header_ == nil {
4120 c.header_ = make(http.Header)
4121 }
4122 return c.header_
4123 }
4124
4125 func (c *ProjectsLocationsSubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
4126 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4127 var body io.Reader = nil
4128 c.urlParams_.Set("alt", alt)
4129 c.urlParams_.Set("prettyPrint", "false")
4130 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4131 urls += "?" + c.urlParams_.Encode()
4132 req, err := http.NewRequest("DELETE", urls, body)
4133 if err != nil {
4134 return nil, err
4135 }
4136 req.Header = reqHeaders
4137 googleapi.Expand(req.URL, map[string]string{
4138 "name": c.name,
4139 })
4140 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4141 }
4142
4143
4144
4145
4146
4147
4148 func (c *ProjectsLocationsSubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4149 gensupport.SetOptions(c.urlParams_, opts...)
4150 res, err := c.doRequest("json")
4151 if res != nil && res.StatusCode == http.StatusNotModified {
4152 if res.Body != nil {
4153 res.Body.Close()
4154 }
4155 return nil, gensupport.WrapError(&googleapi.Error{
4156 Code: res.StatusCode,
4157 Header: res.Header,
4158 })
4159 }
4160 if err != nil {
4161 return nil, err
4162 }
4163 defer googleapi.CloseBody(res)
4164 if err := googleapi.CheckResponse(res); err != nil {
4165 return nil, gensupport.WrapError(err)
4166 }
4167 ret := &Operation{
4168 ServerResponse: googleapi.ServerResponse{
4169 Header: res.Header,
4170 HTTPStatusCode: res.StatusCode,
4171 },
4172 }
4173 target := &ret
4174 if err := gensupport.DecodeResponse(target, res); err != nil {
4175 return nil, err
4176 }
4177 return ret, nil
4178 }
4179
4180 type ProjectsLocationsSubscriptionsGetCall struct {
4181 s *Service
4182 name string
4183 urlParams_ gensupport.URLParams
4184 ifNoneMatch_ string
4185 ctx_ context.Context
4186 header_ http.Header
4187 }
4188
4189
4190
4191
4192
4193 func (r *ProjectsLocationsSubscriptionsService) Get(name string) *ProjectsLocationsSubscriptionsGetCall {
4194 c := &ProjectsLocationsSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4195 c.name = name
4196 return c
4197 }
4198
4199
4200
4201
4202 func (c *ProjectsLocationsSubscriptionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsSubscriptionsGetCall {
4203 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4204 return c
4205 }
4206
4207
4208
4209
4210 func (c *ProjectsLocationsSubscriptionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsSubscriptionsGetCall {
4211 c.ifNoneMatch_ = entityTag
4212 return c
4213 }
4214
4215
4216 func (c *ProjectsLocationsSubscriptionsGetCall) Context(ctx context.Context) *ProjectsLocationsSubscriptionsGetCall {
4217 c.ctx_ = ctx
4218 return c
4219 }
4220
4221
4222
4223 func (c *ProjectsLocationsSubscriptionsGetCall) Header() http.Header {
4224 if c.header_ == nil {
4225 c.header_ = make(http.Header)
4226 }
4227 return c.header_
4228 }
4229
4230 func (c *ProjectsLocationsSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) {
4231 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4232 if c.ifNoneMatch_ != "" {
4233 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4234 }
4235 var body io.Reader = nil
4236 c.urlParams_.Set("alt", alt)
4237 c.urlParams_.Set("prettyPrint", "false")
4238 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4239 urls += "?" + c.urlParams_.Encode()
4240 req, err := http.NewRequest("GET", urls, body)
4241 if err != nil {
4242 return nil, err
4243 }
4244 req.Header = reqHeaders
4245 googleapi.Expand(req.URL, map[string]string{
4246 "name": c.name,
4247 })
4248 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4249 }
4250
4251
4252
4253
4254
4255
4256 func (c *ProjectsLocationsSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
4257 gensupport.SetOptions(c.urlParams_, opts...)
4258 res, err := c.doRequest("json")
4259 if res != nil && res.StatusCode == http.StatusNotModified {
4260 if res.Body != nil {
4261 res.Body.Close()
4262 }
4263 return nil, gensupport.WrapError(&googleapi.Error{
4264 Code: res.StatusCode,
4265 Header: res.Header,
4266 })
4267 }
4268 if err != nil {
4269 return nil, err
4270 }
4271 defer googleapi.CloseBody(res)
4272 if err := googleapi.CheckResponse(res); err != nil {
4273 return nil, gensupport.WrapError(err)
4274 }
4275 ret := &Subscription{
4276 ServerResponse: googleapi.ServerResponse{
4277 Header: res.Header,
4278 HTTPStatusCode: res.StatusCode,
4279 },
4280 }
4281 target := &ret
4282 if err := gensupport.DecodeResponse(target, res); err != nil {
4283 return nil, err
4284 }
4285 return ret, nil
4286 }
4287
4288 type ProjectsLocationsSubscriptionsGetIamPolicyCall struct {
4289 s *Service
4290 resource string
4291 getiampolicyrequest *GetIamPolicyRequest
4292 urlParams_ gensupport.URLParams
4293 ctx_ context.Context
4294 header_ http.Header
4295 }
4296
4297
4298
4299
4300
4301
4302 func (r *ProjectsLocationsSubscriptionsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsSubscriptionsGetIamPolicyCall {
4303 c := &ProjectsLocationsSubscriptionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4304 c.resource = resource
4305 c.getiampolicyrequest = getiampolicyrequest
4306 return c
4307 }
4308
4309
4310
4311
4312 func (c *ProjectsLocationsSubscriptionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsSubscriptionsGetIamPolicyCall {
4313 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4314 return c
4315 }
4316
4317
4318 func (c *ProjectsLocationsSubscriptionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsSubscriptionsGetIamPolicyCall {
4319 c.ctx_ = ctx
4320 return c
4321 }
4322
4323
4324
4325 func (c *ProjectsLocationsSubscriptionsGetIamPolicyCall) Header() http.Header {
4326 if c.header_ == nil {
4327 c.header_ = make(http.Header)
4328 }
4329 return c.header_
4330 }
4331
4332 func (c *ProjectsLocationsSubscriptionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4333 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4334 var body io.Reader = nil
4335 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
4336 if err != nil {
4337 return nil, err
4338 }
4339 c.urlParams_.Set("alt", alt)
4340 c.urlParams_.Set("prettyPrint", "false")
4341 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
4342 urls += "?" + c.urlParams_.Encode()
4343 req, err := http.NewRequest("POST", urls, body)
4344 if err != nil {
4345 return nil, err
4346 }
4347 req.Header = reqHeaders
4348 googleapi.Expand(req.URL, map[string]string{
4349 "resource": c.resource,
4350 })
4351 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4352 }
4353
4354
4355
4356
4357
4358
4359 func (c *ProjectsLocationsSubscriptionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4360 gensupport.SetOptions(c.urlParams_, opts...)
4361 res, err := c.doRequest("json")
4362 if res != nil && res.StatusCode == http.StatusNotModified {
4363 if res.Body != nil {
4364 res.Body.Close()
4365 }
4366 return nil, gensupport.WrapError(&googleapi.Error{
4367 Code: res.StatusCode,
4368 Header: res.Header,
4369 })
4370 }
4371 if err != nil {
4372 return nil, err
4373 }
4374 defer googleapi.CloseBody(res)
4375 if err := googleapi.CheckResponse(res); err != nil {
4376 return nil, gensupport.WrapError(err)
4377 }
4378 ret := &Policy{
4379 ServerResponse: googleapi.ServerResponse{
4380 Header: res.Header,
4381 HTTPStatusCode: res.StatusCode,
4382 },
4383 }
4384 target := &ret
4385 if err := gensupport.DecodeResponse(target, res); err != nil {
4386 return nil, err
4387 }
4388 return ret, nil
4389 }
4390
4391 type ProjectsLocationsSubscriptionsListCall struct {
4392 s *Service
4393 parent string
4394 urlParams_ gensupport.URLParams
4395 ifNoneMatch_ string
4396 ctx_ context.Context
4397 header_ http.Header
4398 }
4399
4400
4401
4402
4403
4404 func (r *ProjectsLocationsSubscriptionsService) List(parent string) *ProjectsLocationsSubscriptionsListCall {
4405 c := &ProjectsLocationsSubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4406 c.parent = parent
4407 return c
4408 }
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419 func (c *ProjectsLocationsSubscriptionsListCall) Filter(filter string) *ProjectsLocationsSubscriptionsListCall {
4420 c.urlParams_.Set("filter", filter)
4421 return c
4422 }
4423
4424
4425
4426 func (c *ProjectsLocationsSubscriptionsListCall) PageSize(pageSize int64) *ProjectsLocationsSubscriptionsListCall {
4427 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4428 return c
4429 }
4430
4431
4432
4433 func (c *ProjectsLocationsSubscriptionsListCall) PageToken(pageToken string) *ProjectsLocationsSubscriptionsListCall {
4434 c.urlParams_.Set("pageToken", pageToken)
4435 return c
4436 }
4437
4438
4439
4440
4441 func (c *ProjectsLocationsSubscriptionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsSubscriptionsListCall {
4442 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4443 return c
4444 }
4445
4446
4447
4448
4449 func (c *ProjectsLocationsSubscriptionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsSubscriptionsListCall {
4450 c.ifNoneMatch_ = entityTag
4451 return c
4452 }
4453
4454
4455 func (c *ProjectsLocationsSubscriptionsListCall) Context(ctx context.Context) *ProjectsLocationsSubscriptionsListCall {
4456 c.ctx_ = ctx
4457 return c
4458 }
4459
4460
4461
4462 func (c *ProjectsLocationsSubscriptionsListCall) Header() http.Header {
4463 if c.header_ == nil {
4464 c.header_ = make(http.Header)
4465 }
4466 return c.header_
4467 }
4468
4469 func (c *ProjectsLocationsSubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
4470 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4471 if c.ifNoneMatch_ != "" {
4472 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4473 }
4474 var body io.Reader = nil
4475 c.urlParams_.Set("alt", alt)
4476 c.urlParams_.Set("prettyPrint", "false")
4477 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subscriptions")
4478 urls += "?" + c.urlParams_.Encode()
4479 req, err := http.NewRequest("GET", urls, body)
4480 if err != nil {
4481 return nil, err
4482 }
4483 req.Header = reqHeaders
4484 googleapi.Expand(req.URL, map[string]string{
4485 "parent": c.parent,
4486 })
4487 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4488 }
4489
4490
4491
4492
4493
4494
4495
4496 func (c *ProjectsLocationsSubscriptionsListCall) Do(opts ...googleapi.CallOption) (*ListSubscriptionsResponse, error) {
4497 gensupport.SetOptions(c.urlParams_, opts...)
4498 res, err := c.doRequest("json")
4499 if res != nil && res.StatusCode == http.StatusNotModified {
4500 if res.Body != nil {
4501 res.Body.Close()
4502 }
4503 return nil, gensupport.WrapError(&googleapi.Error{
4504 Code: res.StatusCode,
4505 Header: res.Header,
4506 })
4507 }
4508 if err != nil {
4509 return nil, err
4510 }
4511 defer googleapi.CloseBody(res)
4512 if err := googleapi.CheckResponse(res); err != nil {
4513 return nil, gensupport.WrapError(err)
4514 }
4515 ret := &ListSubscriptionsResponse{
4516 ServerResponse: googleapi.ServerResponse{
4517 Header: res.Header,
4518 HTTPStatusCode: res.StatusCode,
4519 },
4520 }
4521 target := &ret
4522 if err := gensupport.DecodeResponse(target, res); err != nil {
4523 return nil, err
4524 }
4525 return ret, nil
4526 }
4527
4528
4529
4530
4531 func (c *ProjectsLocationsSubscriptionsListCall) Pages(ctx context.Context, f func(*ListSubscriptionsResponse) error) error {
4532 c.ctx_ = ctx
4533 defer c.PageToken(c.urlParams_.Get("pageToken"))
4534 for {
4535 x, err := c.Do()
4536 if err != nil {
4537 return err
4538 }
4539 if err := f(x); err != nil {
4540 return err
4541 }
4542 if x.NextPageToken == "" {
4543 return nil
4544 }
4545 c.PageToken(x.NextPageToken)
4546 }
4547 }
4548
4549 type ProjectsLocationsSubscriptionsRefreshCall struct {
4550 s *Service
4551 name string
4552 refreshsubscriptionrequest *RefreshSubscriptionRequest
4553 urlParams_ gensupport.URLParams
4554 ctx_ context.Context
4555 header_ http.Header
4556 }
4557
4558
4559
4560
4561
4562
4563
4564 func (r *ProjectsLocationsSubscriptionsService) Refresh(name string, refreshsubscriptionrequest *RefreshSubscriptionRequest) *ProjectsLocationsSubscriptionsRefreshCall {
4565 c := &ProjectsLocationsSubscriptionsRefreshCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4566 c.name = name
4567 c.refreshsubscriptionrequest = refreshsubscriptionrequest
4568 return c
4569 }
4570
4571
4572
4573
4574 func (c *ProjectsLocationsSubscriptionsRefreshCall) Fields(s ...googleapi.Field) *ProjectsLocationsSubscriptionsRefreshCall {
4575 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4576 return c
4577 }
4578
4579
4580 func (c *ProjectsLocationsSubscriptionsRefreshCall) Context(ctx context.Context) *ProjectsLocationsSubscriptionsRefreshCall {
4581 c.ctx_ = ctx
4582 return c
4583 }
4584
4585
4586
4587 func (c *ProjectsLocationsSubscriptionsRefreshCall) Header() http.Header {
4588 if c.header_ == nil {
4589 c.header_ = make(http.Header)
4590 }
4591 return c.header_
4592 }
4593
4594 func (c *ProjectsLocationsSubscriptionsRefreshCall) doRequest(alt string) (*http.Response, error) {
4595 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4596 var body io.Reader = nil
4597 body, err := googleapi.WithoutDataWrapper.JSONReader(c.refreshsubscriptionrequest)
4598 if err != nil {
4599 return nil, err
4600 }
4601 c.urlParams_.Set("alt", alt)
4602 c.urlParams_.Set("prettyPrint", "false")
4603 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:refresh")
4604 urls += "?" + c.urlParams_.Encode()
4605 req, err := http.NewRequest("POST", urls, body)
4606 if err != nil {
4607 return nil, err
4608 }
4609 req.Header = reqHeaders
4610 googleapi.Expand(req.URL, map[string]string{
4611 "name": c.name,
4612 })
4613 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4614 }
4615
4616
4617
4618
4619
4620
4621 func (c *ProjectsLocationsSubscriptionsRefreshCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4622 gensupport.SetOptions(c.urlParams_, opts...)
4623 res, err := c.doRequest("json")
4624 if res != nil && res.StatusCode == http.StatusNotModified {
4625 if res.Body != nil {
4626 res.Body.Close()
4627 }
4628 return nil, gensupport.WrapError(&googleapi.Error{
4629 Code: res.StatusCode,
4630 Header: res.Header,
4631 })
4632 }
4633 if err != nil {
4634 return nil, err
4635 }
4636 defer googleapi.CloseBody(res)
4637 if err := googleapi.CheckResponse(res); err != nil {
4638 return nil, gensupport.WrapError(err)
4639 }
4640 ret := &Operation{
4641 ServerResponse: googleapi.ServerResponse{
4642 Header: res.Header,
4643 HTTPStatusCode: res.StatusCode,
4644 },
4645 }
4646 target := &ret
4647 if err := gensupport.DecodeResponse(target, res); err != nil {
4648 return nil, err
4649 }
4650 return ret, nil
4651 }
4652
4653 type ProjectsLocationsSubscriptionsRevokeCall struct {
4654 s *Service
4655 name string
4656 revokesubscriptionrequest *RevokeSubscriptionRequest
4657 urlParams_ gensupport.URLParams
4658 ctx_ context.Context
4659 header_ http.Header
4660 }
4661
4662
4663
4664
4665
4666 func (r *ProjectsLocationsSubscriptionsService) Revoke(name string, revokesubscriptionrequest *RevokeSubscriptionRequest) *ProjectsLocationsSubscriptionsRevokeCall {
4667 c := &ProjectsLocationsSubscriptionsRevokeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4668 c.name = name
4669 c.revokesubscriptionrequest = revokesubscriptionrequest
4670 return c
4671 }
4672
4673
4674
4675
4676 func (c *ProjectsLocationsSubscriptionsRevokeCall) Fields(s ...googleapi.Field) *ProjectsLocationsSubscriptionsRevokeCall {
4677 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4678 return c
4679 }
4680
4681
4682 func (c *ProjectsLocationsSubscriptionsRevokeCall) Context(ctx context.Context) *ProjectsLocationsSubscriptionsRevokeCall {
4683 c.ctx_ = ctx
4684 return c
4685 }
4686
4687
4688
4689 func (c *ProjectsLocationsSubscriptionsRevokeCall) Header() http.Header {
4690 if c.header_ == nil {
4691 c.header_ = make(http.Header)
4692 }
4693 return c.header_
4694 }
4695
4696 func (c *ProjectsLocationsSubscriptionsRevokeCall) doRequest(alt string) (*http.Response, error) {
4697 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4698 var body io.Reader = nil
4699 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revokesubscriptionrequest)
4700 if err != nil {
4701 return nil, err
4702 }
4703 c.urlParams_.Set("alt", alt)
4704 c.urlParams_.Set("prettyPrint", "false")
4705 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:revoke")
4706 urls += "?" + c.urlParams_.Encode()
4707 req, err := http.NewRequest("POST", urls, body)
4708 if err != nil {
4709 return nil, err
4710 }
4711 req.Header = reqHeaders
4712 googleapi.Expand(req.URL, map[string]string{
4713 "name": c.name,
4714 })
4715 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4716 }
4717
4718
4719
4720
4721
4722
4723
4724 func (c *ProjectsLocationsSubscriptionsRevokeCall) Do(opts ...googleapi.CallOption) (*RevokeSubscriptionResponse, error) {
4725 gensupport.SetOptions(c.urlParams_, opts...)
4726 res, err := c.doRequest("json")
4727 if res != nil && res.StatusCode == http.StatusNotModified {
4728 if res.Body != nil {
4729 res.Body.Close()
4730 }
4731 return nil, gensupport.WrapError(&googleapi.Error{
4732 Code: res.StatusCode,
4733 Header: res.Header,
4734 })
4735 }
4736 if err != nil {
4737 return nil, err
4738 }
4739 defer googleapi.CloseBody(res)
4740 if err := googleapi.CheckResponse(res); err != nil {
4741 return nil, gensupport.WrapError(err)
4742 }
4743 ret := &RevokeSubscriptionResponse{
4744 ServerResponse: googleapi.ServerResponse{
4745 Header: res.Header,
4746 HTTPStatusCode: res.StatusCode,
4747 },
4748 }
4749 target := &ret
4750 if err := gensupport.DecodeResponse(target, res); err != nil {
4751 return nil, err
4752 }
4753 return ret, nil
4754 }
4755
4756 type ProjectsLocationsSubscriptionsSetIamPolicyCall struct {
4757 s *Service
4758 resource string
4759 setiampolicyrequest *SetIamPolicyRequest
4760 urlParams_ gensupport.URLParams
4761 ctx_ context.Context
4762 header_ http.Header
4763 }
4764
4765
4766
4767
4768
4769
4770 func (r *ProjectsLocationsSubscriptionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsSubscriptionsSetIamPolicyCall {
4771 c := &ProjectsLocationsSubscriptionsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4772 c.resource = resource
4773 c.setiampolicyrequest = setiampolicyrequest
4774 return c
4775 }
4776
4777
4778
4779
4780 func (c *ProjectsLocationsSubscriptionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsSubscriptionsSetIamPolicyCall {
4781 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4782 return c
4783 }
4784
4785
4786 func (c *ProjectsLocationsSubscriptionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsSubscriptionsSetIamPolicyCall {
4787 c.ctx_ = ctx
4788 return c
4789 }
4790
4791
4792
4793 func (c *ProjectsLocationsSubscriptionsSetIamPolicyCall) Header() http.Header {
4794 if c.header_ == nil {
4795 c.header_ = make(http.Header)
4796 }
4797 return c.header_
4798 }
4799
4800 func (c *ProjectsLocationsSubscriptionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4801 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4802 var body io.Reader = nil
4803 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
4804 if err != nil {
4805 return nil, err
4806 }
4807 c.urlParams_.Set("alt", alt)
4808 c.urlParams_.Set("prettyPrint", "false")
4809 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
4810 urls += "?" + c.urlParams_.Encode()
4811 req, err := http.NewRequest("POST", urls, body)
4812 if err != nil {
4813 return nil, err
4814 }
4815 req.Header = reqHeaders
4816 googleapi.Expand(req.URL, map[string]string{
4817 "resource": c.resource,
4818 })
4819 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4820 }
4821
4822
4823
4824
4825
4826
4827 func (c *ProjectsLocationsSubscriptionsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4828 gensupport.SetOptions(c.urlParams_, opts...)
4829 res, err := c.doRequest("json")
4830 if res != nil && res.StatusCode == http.StatusNotModified {
4831 if res.Body != nil {
4832 res.Body.Close()
4833 }
4834 return nil, gensupport.WrapError(&googleapi.Error{
4835 Code: res.StatusCode,
4836 Header: res.Header,
4837 })
4838 }
4839 if err != nil {
4840 return nil, err
4841 }
4842 defer googleapi.CloseBody(res)
4843 if err := googleapi.CheckResponse(res); err != nil {
4844 return nil, gensupport.WrapError(err)
4845 }
4846 ret := &Policy{
4847 ServerResponse: googleapi.ServerResponse{
4848 Header: res.Header,
4849 HTTPStatusCode: res.StatusCode,
4850 },
4851 }
4852 target := &ret
4853 if err := gensupport.DecodeResponse(target, res); err != nil {
4854 return nil, err
4855 }
4856 return ret, nil
4857 }
4858
View as plain text