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:v1beta1"
95 const apiName = "analyticshub"
96 const apiVersion = "v1beta1"
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 return rs
219 }
220
221 type ProjectsLocationsService struct {
222 s *Service
223
224 DataExchanges *ProjectsLocationsDataExchangesService
225 }
226
227 func NewProjectsLocationsDataExchangesService(s *Service) *ProjectsLocationsDataExchangesService {
228 rs := &ProjectsLocationsDataExchangesService{s: s}
229 rs.Listings = NewProjectsLocationsDataExchangesListingsService(s)
230 return rs
231 }
232
233 type ProjectsLocationsDataExchangesService struct {
234 s *Service
235
236 Listings *ProjectsLocationsDataExchangesListingsService
237 }
238
239 func NewProjectsLocationsDataExchangesListingsService(s *Service) *ProjectsLocationsDataExchangesListingsService {
240 rs := &ProjectsLocationsDataExchangesListingsService{s: s}
241 return rs
242 }
243
244 type ProjectsLocationsDataExchangesListingsService struct {
245 s *Service
246 }
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264 type AuditConfig struct {
265
266 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
267
268
269
270 Service string `json:"service,omitempty"`
271
272
273
274
275
276 ForceSendFields []string `json:"-"`
277
278
279
280
281 NullFields []string `json:"-"`
282 }
283
284 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
285 type NoMethod AuditConfig
286 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
287 }
288
289
290
291
292
293
294 type AuditLogConfig struct {
295
296
297 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
298
299
300
301
302
303
304
305 LogType string `json:"logType,omitempty"`
306
307
308
309
310
311 ForceSendFields []string `json:"-"`
312
313
314
315
316 NullFields []string `json:"-"`
317 }
318
319 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
320 type NoMethod AuditLogConfig
321 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
322 }
323
324
325
326
327
328
329
330 type BigQueryDatasetSource struct {
331
332
333 Dataset string `json:"dataset,omitempty"`
334
335
336
337
338
339 ForceSendFields []string `json:"-"`
340
341
342
343
344 NullFields []string `json:"-"`
345 }
346
347 func (s *BigQueryDatasetSource) MarshalJSON() ([]byte, error) {
348 type NoMethod BigQueryDatasetSource
349 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
350 }
351
352
353 type Binding struct {
354
355
356
357
358
359
360
361
362 Condition *Expr `json:"condition,omitempty"`
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
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 Members []string `json:"members,omitempty"`
426
427
428
429
430
431
432 Role string `json:"role,omitempty"`
433
434
435
436
437
438 ForceSendFields []string `json:"-"`
439
440
441
442
443 NullFields []string `json:"-"`
444 }
445
446 func (s *Binding) MarshalJSON() ([]byte, error) {
447 type NoMethod Binding
448 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
449 }
450
451
452
453
454 type DataExchange struct {
455
456
457
458
459 Description string `json:"description,omitempty"`
460
461
462
463
464 DisplayName string `json:"displayName,omitempty"`
465
466 Documentation string `json:"documentation,omitempty"`
467
468
469
470
471
472 Icon string `json:"icon,omitempty"`
473
474
475 ListingCount int64 `json:"listingCount,omitempty"`
476
477
478 Name string `json:"name,omitempty"`
479
480
481 PrimaryContact string `json:"primaryContact,omitempty"`
482
483
484 googleapi.ServerResponse `json:"-"`
485
486
487
488
489
490 ForceSendFields []string `json:"-"`
491
492
493
494
495 NullFields []string `json:"-"`
496 }
497
498 func (s *DataExchange) MarshalJSON() ([]byte, error) {
499 type NoMethod DataExchange
500 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
501 }
502
503
504 type DataProvider struct {
505
506 Name string `json:"name,omitempty"`
507
508
509 PrimaryContact string `json:"primaryContact,omitempty"`
510
511
512
513
514
515 ForceSendFields []string `json:"-"`
516
517
518
519
520 NullFields []string `json:"-"`
521 }
522
523 func (s *DataProvider) MarshalJSON() ([]byte, error) {
524 type NoMethod DataProvider
525 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
526 }
527
528
529 type DestinationDataset struct {
530
531
532 DatasetReference *DestinationDatasetReference `json:"datasetReference,omitempty"`
533
534 Description string `json:"description,omitempty"`
535
536 FriendlyName string `json:"friendlyName,omitempty"`
537
538
539
540
541
542 Labels map[string]string `json:"labels,omitempty"`
543
544
545
546 Location string `json:"location,omitempty"`
547
548
549
550
551
552 ForceSendFields []string `json:"-"`
553
554
555
556
557 NullFields []string `json:"-"`
558 }
559
560 func (s *DestinationDataset) MarshalJSON() ([]byte, error) {
561 type NoMethod DestinationDataset
562 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
563 }
564
565
566
567 type DestinationDatasetReference struct {
568
569
570
571 DatasetId string `json:"datasetId,omitempty"`
572
573 ProjectId string `json:"projectId,omitempty"`
574
575
576
577
578
579 ForceSendFields []string `json:"-"`
580
581
582
583
584 NullFields []string `json:"-"`
585 }
586
587 func (s *DestinationDatasetReference) MarshalJSON() ([]byte, error) {
588 type NoMethod DestinationDatasetReference
589 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
590 }
591
592
593
594
595
596 type Empty struct {
597
598 googleapi.ServerResponse `json:"-"`
599 }
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617 type Expr struct {
618
619
620 Description string `json:"description,omitempty"`
621
622
623 Expression string `json:"expression,omitempty"`
624
625
626 Location string `json:"location,omitempty"`
627
628
629
630 Title string `json:"title,omitempty"`
631
632
633
634
635
636 ForceSendFields []string `json:"-"`
637
638
639
640
641 NullFields []string `json:"-"`
642 }
643
644 func (s *Expr) MarshalJSON() ([]byte, error) {
645 type NoMethod Expr
646 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
647 }
648
649
650 type GetIamPolicyRequest struct {
651
652
653 Options *GetPolicyOptions `json:"options,omitempty"`
654
655
656
657
658
659 ForceSendFields []string `json:"-"`
660
661
662
663
664 NullFields []string `json:"-"`
665 }
666
667 func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) {
668 type NoMethod GetIamPolicyRequest
669 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
670 }
671
672
673 type GetPolicyOptions struct {
674
675
676
677
678
679
680
681
682
683
684
685 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"`
686
687
688
689
690
691 ForceSendFields []string `json:"-"`
692
693
694
695
696 NullFields []string `json:"-"`
697 }
698
699 func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) {
700 type NoMethod GetPolicyOptions
701 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
702 }
703
704
705 type LinkedResource struct {
706
707
708 LinkedDataset string `json:"linkedDataset,omitempty"`
709
710
711
712
713
714 ForceSendFields []string `json:"-"`
715
716
717
718
719 NullFields []string `json:"-"`
720 }
721
722 func (s *LinkedResource) MarshalJSON() ([]byte, error) {
723 type NoMethod LinkedResource
724 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
725 }
726
727
728
729 type ListDataExchangesResponse struct {
730
731 DataExchanges []*DataExchange `json:"dataExchanges,omitempty"`
732
733 NextPageToken string `json:"nextPageToken,omitempty"`
734
735
736 googleapi.ServerResponse `json:"-"`
737
738
739
740
741
742 ForceSendFields []string `json:"-"`
743
744
745
746
747 NullFields []string `json:"-"`
748 }
749
750 func (s *ListDataExchangesResponse) MarshalJSON() ([]byte, error) {
751 type NoMethod ListDataExchangesResponse
752 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
753 }
754
755
756 type ListListingsResponse struct {
757
758 Listings []*Listing `json:"listings,omitempty"`
759
760 NextPageToken string `json:"nextPageToken,omitempty"`
761
762
763 googleapi.ServerResponse `json:"-"`
764
765
766
767
768
769 ForceSendFields []string `json:"-"`
770
771
772
773
774 NullFields []string `json:"-"`
775 }
776
777 func (s *ListListingsResponse) MarshalJSON() ([]byte, error) {
778 type NoMethod ListListingsResponse
779 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
780 }
781
782
783
784 type ListOrgDataExchangesResponse struct {
785
786 DataExchanges []*DataExchange `json:"dataExchanges,omitempty"`
787
788 NextPageToken string `json:"nextPageToken,omitempty"`
789
790
791 googleapi.ServerResponse `json:"-"`
792
793
794
795
796
797 ForceSendFields []string `json:"-"`
798
799
800
801
802 NullFields []string `json:"-"`
803 }
804
805 func (s *ListOrgDataExchangesResponse) MarshalJSON() ([]byte, error) {
806 type NoMethod ListOrgDataExchangesResponse
807 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
808 }
809
810
811
812
813
814 type Listing struct {
815
816 BigqueryDataset *BigQueryDatasetSource `json:"bigqueryDataset,omitempty"`
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841 Categories []string `json:"categories,omitempty"`
842
843
844 DataProvider *DataProvider `json:"dataProvider,omitempty"`
845
846
847
848
849 Description string `json:"description,omitempty"`
850
851
852
853
854 DisplayName string `json:"displayName,omitempty"`
855
856 Documentation string `json:"documentation,omitempty"`
857
858
859
860
861
862 Icon string `json:"icon,omitempty"`
863
864
865 Name string `json:"name,omitempty"`
866
867
868 PrimaryContact string `json:"primaryContact,omitempty"`
869
870
871 Publisher *Publisher `json:"publisher,omitempty"`
872
873
874
875 RequestAccess string `json:"requestAccess,omitempty"`
876
877
878 RestrictedExportConfig *RestrictedExportConfig `json:"restrictedExportConfig,omitempty"`
879
880
881
882
883
884
885 State string `json:"state,omitempty"`
886
887
888 googleapi.ServerResponse `json:"-"`
889
890
891
892
893
894 ForceSendFields []string `json:"-"`
895
896
897
898
899 NullFields []string `json:"-"`
900 }
901
902 func (s *Listing) MarshalJSON() ([]byte, error) {
903 type NoMethod Listing
904 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
905 }
906
907
908
909 type OperationMetadata struct {
910
911 ApiVersion string `json:"apiVersion,omitempty"`
912
913 CreateTime string `json:"createTime,omitempty"`
914
915 EndTime string `json:"endTime,omitempty"`
916
917
918
919
920 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
921
922 StatusMessage string `json:"statusMessage,omitempty"`
923
924
925 Target string `json:"target,omitempty"`
926
927 Verb string `json:"verb,omitempty"`
928
929
930
931
932
933 ForceSendFields []string `json:"-"`
934
935
936
937
938 NullFields []string `json:"-"`
939 }
940
941 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
942 type NoMethod OperationMetadata
943 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
944 }
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976 type Policy struct {
977
978 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
979
980
981
982
983
984
985
986
987
988 Bindings []*Binding `json:"bindings,omitempty"`
989
990
991
992
993
994
995
996
997
998
999
1000 Etag string `json:"etag,omitempty"`
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016 Version int64 `json:"version,omitempty"`
1017
1018
1019 googleapi.ServerResponse `json:"-"`
1020
1021
1022
1023
1024
1025 ForceSendFields []string `json:"-"`
1026
1027
1028
1029
1030 NullFields []string `json:"-"`
1031 }
1032
1033 func (s *Policy) MarshalJSON() ([]byte, error) {
1034 type NoMethod Policy
1035 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1036 }
1037
1038
1039 type Publisher struct {
1040
1041 Name string `json:"name,omitempty"`
1042
1043
1044 PrimaryContact string `json:"primaryContact,omitempty"`
1045
1046
1047
1048
1049
1050 ForceSendFields []string `json:"-"`
1051
1052
1053
1054
1055 NullFields []string `json:"-"`
1056 }
1057
1058 func (s *Publisher) MarshalJSON() ([]byte, error) {
1059 type NoMethod Publisher
1060 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1061 }
1062
1063
1064
1065 type RefreshSubscriptionResponse struct {
1066
1067 Subscription *Subscription `json:"subscription,omitempty"`
1068
1069
1070
1071
1072
1073 ForceSendFields []string `json:"-"`
1074
1075
1076
1077
1078 NullFields []string `json:"-"`
1079 }
1080
1081 func (s *RefreshSubscriptionResponse) MarshalJSON() ([]byte, error) {
1082 type NoMethod RefreshSubscriptionResponse
1083 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1084 }
1085
1086
1087
1088 type RestrictedExportConfig struct {
1089
1090 Enabled bool `json:"enabled,omitempty"`
1091
1092
1093 RestrictDirectTableAccess bool `json:"restrictDirectTableAccess,omitempty"`
1094
1095
1096 RestrictQueryResult bool `json:"restrictQueryResult,omitempty"`
1097
1098
1099
1100
1101
1102 ForceSendFields []string `json:"-"`
1103
1104
1105
1106
1107 NullFields []string `json:"-"`
1108 }
1109
1110 func (s *RestrictedExportConfig) MarshalJSON() ([]byte, error) {
1111 type NoMethod RestrictedExportConfig
1112 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1113 }
1114
1115
1116 type SetIamPolicyRequest struct {
1117
1118
1119
1120
1121 Policy *Policy `json:"policy,omitempty"`
1122
1123
1124
1125 UpdateMask string `json:"updateMask,omitempty"`
1126
1127
1128
1129
1130
1131 ForceSendFields []string `json:"-"`
1132
1133
1134
1135
1136 NullFields []string `json:"-"`
1137 }
1138
1139 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1140 type NoMethod SetIamPolicyRequest
1141 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1142 }
1143
1144
1145
1146 type SubscribeDataExchangeResponse struct {
1147
1148 Subscription *Subscription `json:"subscription,omitempty"`
1149
1150
1151
1152
1153
1154 ForceSendFields []string `json:"-"`
1155
1156
1157
1158
1159 NullFields []string `json:"-"`
1160 }
1161
1162 func (s *SubscribeDataExchangeResponse) MarshalJSON() ([]byte, error) {
1163 type NoMethod SubscribeDataExchangeResponse
1164 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1165 }
1166
1167
1168 type SubscribeListingRequest struct {
1169
1170
1171 DestinationDataset *DestinationDataset `json:"destinationDataset,omitempty"`
1172
1173
1174
1175
1176
1177 ForceSendFields []string `json:"-"`
1178
1179
1180
1181
1182 NullFields []string `json:"-"`
1183 }
1184
1185 func (s *SubscribeListingRequest) MarshalJSON() ([]byte, error) {
1186 type NoMethod SubscribeListingRequest
1187 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1188 }
1189
1190
1191
1192 type SubscribeListingResponse struct {
1193
1194 googleapi.ServerResponse `json:"-"`
1195 }
1196
1197
1198
1199
1200 type Subscription struct {
1201
1202 CreationTime string `json:"creationTime,omitempty"`
1203
1204
1205 DataExchange string `json:"dataExchange,omitempty"`
1206
1207
1208 LastModifyTime string `json:"lastModifyTime,omitempty"`
1209
1210
1211
1212
1213
1214 LinkedDatasetMap map[string]LinkedResource `json:"linkedDatasetMap,omitempty"`
1215
1216
1217 Listing string `json:"listing,omitempty"`
1218
1219
1220 Name string `json:"name,omitempty"`
1221
1222
1223 OrganizationDisplayName string `json:"organizationDisplayName,omitempty"`
1224
1225
1226 OrganizationId string `json:"organizationId,omitempty"`
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237 State string `json:"state,omitempty"`
1238
1239 SubscriberContact string `json:"subscriberContact,omitempty"`
1240
1241
1242
1243
1244
1245 ForceSendFields []string `json:"-"`
1246
1247
1248
1249
1250 NullFields []string `json:"-"`
1251 }
1252
1253 func (s *Subscription) MarshalJSON() ([]byte, error) {
1254 type NoMethod Subscription
1255 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1256 }
1257
1258
1259 type TestIamPermissionsRequest struct {
1260
1261
1262
1263
1264 Permissions []string `json:"permissions,omitempty"`
1265
1266
1267
1268
1269
1270 ForceSendFields []string `json:"-"`
1271
1272
1273
1274
1275 NullFields []string `json:"-"`
1276 }
1277
1278 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1279 type NoMethod TestIamPermissionsRequest
1280 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1281 }
1282
1283
1284
1285 type TestIamPermissionsResponse struct {
1286
1287
1288 Permissions []string `json:"permissions,omitempty"`
1289
1290
1291 googleapi.ServerResponse `json:"-"`
1292
1293
1294
1295
1296
1297 ForceSendFields []string `json:"-"`
1298
1299
1300
1301
1302 NullFields []string `json:"-"`
1303 }
1304
1305 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1306 type NoMethod TestIamPermissionsResponse
1307 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1308 }
1309
1310 type OrganizationsLocationsDataExchangesListCall struct {
1311 s *Service
1312 organization string
1313 urlParams_ gensupport.URLParams
1314 ifNoneMatch_ string
1315 ctx_ context.Context
1316 header_ http.Header
1317 }
1318
1319
1320
1321
1322
1323
1324 func (r *OrganizationsLocationsDataExchangesService) List(organization string) *OrganizationsLocationsDataExchangesListCall {
1325 c := &OrganizationsLocationsDataExchangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1326 c.organization = organization
1327 return c
1328 }
1329
1330
1331
1332
1333 func (c *OrganizationsLocationsDataExchangesListCall) PageSize(pageSize int64) *OrganizationsLocationsDataExchangesListCall {
1334 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1335 return c
1336 }
1337
1338
1339
1340 func (c *OrganizationsLocationsDataExchangesListCall) PageToken(pageToken string) *OrganizationsLocationsDataExchangesListCall {
1341 c.urlParams_.Set("pageToken", pageToken)
1342 return c
1343 }
1344
1345
1346
1347
1348 func (c *OrganizationsLocationsDataExchangesListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsDataExchangesListCall {
1349 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1350 return c
1351 }
1352
1353
1354
1355
1356 func (c *OrganizationsLocationsDataExchangesListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsDataExchangesListCall {
1357 c.ifNoneMatch_ = entityTag
1358 return c
1359 }
1360
1361
1362 func (c *OrganizationsLocationsDataExchangesListCall) Context(ctx context.Context) *OrganizationsLocationsDataExchangesListCall {
1363 c.ctx_ = ctx
1364 return c
1365 }
1366
1367
1368
1369 func (c *OrganizationsLocationsDataExchangesListCall) Header() http.Header {
1370 if c.header_ == nil {
1371 c.header_ = make(http.Header)
1372 }
1373 return c.header_
1374 }
1375
1376 func (c *OrganizationsLocationsDataExchangesListCall) doRequest(alt string) (*http.Response, error) {
1377 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1378 if c.ifNoneMatch_ != "" {
1379 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1380 }
1381 var body io.Reader = nil
1382 c.urlParams_.Set("alt", alt)
1383 c.urlParams_.Set("prettyPrint", "false")
1384 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+organization}/dataExchanges")
1385 urls += "?" + c.urlParams_.Encode()
1386 req, err := http.NewRequest("GET", urls, body)
1387 if err != nil {
1388 return nil, err
1389 }
1390 req.Header = reqHeaders
1391 googleapi.Expand(req.URL, map[string]string{
1392 "organization": c.organization,
1393 })
1394 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1395 }
1396
1397
1398
1399
1400
1401
1402
1403 func (c *OrganizationsLocationsDataExchangesListCall) Do(opts ...googleapi.CallOption) (*ListOrgDataExchangesResponse, error) {
1404 gensupport.SetOptions(c.urlParams_, opts...)
1405 res, err := c.doRequest("json")
1406 if res != nil && res.StatusCode == http.StatusNotModified {
1407 if res.Body != nil {
1408 res.Body.Close()
1409 }
1410 return nil, gensupport.WrapError(&googleapi.Error{
1411 Code: res.StatusCode,
1412 Header: res.Header,
1413 })
1414 }
1415 if err != nil {
1416 return nil, err
1417 }
1418 defer googleapi.CloseBody(res)
1419 if err := googleapi.CheckResponse(res); err != nil {
1420 return nil, gensupport.WrapError(err)
1421 }
1422 ret := &ListOrgDataExchangesResponse{
1423 ServerResponse: googleapi.ServerResponse{
1424 Header: res.Header,
1425 HTTPStatusCode: res.StatusCode,
1426 },
1427 }
1428 target := &ret
1429 if err := gensupport.DecodeResponse(target, res); err != nil {
1430 return nil, err
1431 }
1432 return ret, nil
1433 }
1434
1435
1436
1437
1438 func (c *OrganizationsLocationsDataExchangesListCall) Pages(ctx context.Context, f func(*ListOrgDataExchangesResponse) error) error {
1439 c.ctx_ = ctx
1440 defer c.PageToken(c.urlParams_.Get("pageToken"))
1441 for {
1442 x, err := c.Do()
1443 if err != nil {
1444 return err
1445 }
1446 if err := f(x); err != nil {
1447 return err
1448 }
1449 if x.NextPageToken == "" {
1450 return nil
1451 }
1452 c.PageToken(x.NextPageToken)
1453 }
1454 }
1455
1456 type ProjectsLocationsDataExchangesCreateCall struct {
1457 s *Service
1458 parent string
1459 dataexchange *DataExchange
1460 urlParams_ gensupport.URLParams
1461 ctx_ context.Context
1462 header_ http.Header
1463 }
1464
1465
1466
1467
1468
1469 func (r *ProjectsLocationsDataExchangesService) Create(parent string, dataexchange *DataExchange) *ProjectsLocationsDataExchangesCreateCall {
1470 c := &ProjectsLocationsDataExchangesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1471 c.parent = parent
1472 c.dataexchange = dataexchange
1473 return c
1474 }
1475
1476
1477
1478
1479
1480 func (c *ProjectsLocationsDataExchangesCreateCall) DataExchangeId(dataExchangeId string) *ProjectsLocationsDataExchangesCreateCall {
1481 c.urlParams_.Set("dataExchangeId", dataExchangeId)
1482 return c
1483 }
1484
1485
1486
1487
1488 func (c *ProjectsLocationsDataExchangesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesCreateCall {
1489 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1490 return c
1491 }
1492
1493
1494 func (c *ProjectsLocationsDataExchangesCreateCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesCreateCall {
1495 c.ctx_ = ctx
1496 return c
1497 }
1498
1499
1500
1501 func (c *ProjectsLocationsDataExchangesCreateCall) Header() http.Header {
1502 if c.header_ == nil {
1503 c.header_ = make(http.Header)
1504 }
1505 return c.header_
1506 }
1507
1508 func (c *ProjectsLocationsDataExchangesCreateCall) doRequest(alt string) (*http.Response, error) {
1509 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1510 var body io.Reader = nil
1511 body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataexchange)
1512 if err != nil {
1513 return nil, err
1514 }
1515 c.urlParams_.Set("alt", alt)
1516 c.urlParams_.Set("prettyPrint", "false")
1517 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dataExchanges")
1518 urls += "?" + c.urlParams_.Encode()
1519 req, err := http.NewRequest("POST", urls, body)
1520 if err != nil {
1521 return nil, err
1522 }
1523 req.Header = reqHeaders
1524 googleapi.Expand(req.URL, map[string]string{
1525 "parent": c.parent,
1526 })
1527 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1528 }
1529
1530
1531
1532
1533
1534
1535 func (c *ProjectsLocationsDataExchangesCreateCall) Do(opts ...googleapi.CallOption) (*DataExchange, error) {
1536 gensupport.SetOptions(c.urlParams_, opts...)
1537 res, err := c.doRequest("json")
1538 if res != nil && res.StatusCode == http.StatusNotModified {
1539 if res.Body != nil {
1540 res.Body.Close()
1541 }
1542 return nil, gensupport.WrapError(&googleapi.Error{
1543 Code: res.StatusCode,
1544 Header: res.Header,
1545 })
1546 }
1547 if err != nil {
1548 return nil, err
1549 }
1550 defer googleapi.CloseBody(res)
1551 if err := googleapi.CheckResponse(res); err != nil {
1552 return nil, gensupport.WrapError(err)
1553 }
1554 ret := &DataExchange{
1555 ServerResponse: googleapi.ServerResponse{
1556 Header: res.Header,
1557 HTTPStatusCode: res.StatusCode,
1558 },
1559 }
1560 target := &ret
1561 if err := gensupport.DecodeResponse(target, res); err != nil {
1562 return nil, err
1563 }
1564 return ret, nil
1565 }
1566
1567 type ProjectsLocationsDataExchangesDeleteCall struct {
1568 s *Service
1569 name string
1570 urlParams_ gensupport.URLParams
1571 ctx_ context.Context
1572 header_ http.Header
1573 }
1574
1575
1576
1577
1578
1579 func (r *ProjectsLocationsDataExchangesService) Delete(name string) *ProjectsLocationsDataExchangesDeleteCall {
1580 c := &ProjectsLocationsDataExchangesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1581 c.name = name
1582 return c
1583 }
1584
1585
1586
1587
1588 func (c *ProjectsLocationsDataExchangesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesDeleteCall {
1589 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1590 return c
1591 }
1592
1593
1594 func (c *ProjectsLocationsDataExchangesDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesDeleteCall {
1595 c.ctx_ = ctx
1596 return c
1597 }
1598
1599
1600
1601 func (c *ProjectsLocationsDataExchangesDeleteCall) Header() http.Header {
1602 if c.header_ == nil {
1603 c.header_ = make(http.Header)
1604 }
1605 return c.header_
1606 }
1607
1608 func (c *ProjectsLocationsDataExchangesDeleteCall) doRequest(alt string) (*http.Response, error) {
1609 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1610 var body io.Reader = nil
1611 c.urlParams_.Set("alt", alt)
1612 c.urlParams_.Set("prettyPrint", "false")
1613 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1614 urls += "?" + c.urlParams_.Encode()
1615 req, err := http.NewRequest("DELETE", urls, body)
1616 if err != nil {
1617 return nil, err
1618 }
1619 req.Header = reqHeaders
1620 googleapi.Expand(req.URL, map[string]string{
1621 "name": c.name,
1622 })
1623 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1624 }
1625
1626
1627
1628
1629
1630
1631 func (c *ProjectsLocationsDataExchangesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1632 gensupport.SetOptions(c.urlParams_, opts...)
1633 res, err := c.doRequest("json")
1634 if res != nil && res.StatusCode == http.StatusNotModified {
1635 if res.Body != nil {
1636 res.Body.Close()
1637 }
1638 return nil, gensupport.WrapError(&googleapi.Error{
1639 Code: res.StatusCode,
1640 Header: res.Header,
1641 })
1642 }
1643 if err != nil {
1644 return nil, err
1645 }
1646 defer googleapi.CloseBody(res)
1647 if err := googleapi.CheckResponse(res); err != nil {
1648 return nil, gensupport.WrapError(err)
1649 }
1650 ret := &Empty{
1651 ServerResponse: googleapi.ServerResponse{
1652 Header: res.Header,
1653 HTTPStatusCode: res.StatusCode,
1654 },
1655 }
1656 target := &ret
1657 if err := gensupport.DecodeResponse(target, res); err != nil {
1658 return nil, err
1659 }
1660 return ret, nil
1661 }
1662
1663 type ProjectsLocationsDataExchangesGetCall struct {
1664 s *Service
1665 name string
1666 urlParams_ gensupport.URLParams
1667 ifNoneMatch_ string
1668 ctx_ context.Context
1669 header_ http.Header
1670 }
1671
1672
1673
1674
1675
1676 func (r *ProjectsLocationsDataExchangesService) Get(name string) *ProjectsLocationsDataExchangesGetCall {
1677 c := &ProjectsLocationsDataExchangesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1678 c.name = name
1679 return c
1680 }
1681
1682
1683
1684
1685 func (c *ProjectsLocationsDataExchangesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesGetCall {
1686 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1687 return c
1688 }
1689
1690
1691
1692
1693 func (c *ProjectsLocationsDataExchangesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataExchangesGetCall {
1694 c.ifNoneMatch_ = entityTag
1695 return c
1696 }
1697
1698
1699 func (c *ProjectsLocationsDataExchangesGetCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesGetCall {
1700 c.ctx_ = ctx
1701 return c
1702 }
1703
1704
1705
1706 func (c *ProjectsLocationsDataExchangesGetCall) Header() http.Header {
1707 if c.header_ == nil {
1708 c.header_ = make(http.Header)
1709 }
1710 return c.header_
1711 }
1712
1713 func (c *ProjectsLocationsDataExchangesGetCall) doRequest(alt string) (*http.Response, error) {
1714 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1715 if c.ifNoneMatch_ != "" {
1716 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1717 }
1718 var body io.Reader = nil
1719 c.urlParams_.Set("alt", alt)
1720 c.urlParams_.Set("prettyPrint", "false")
1721 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1722 urls += "?" + c.urlParams_.Encode()
1723 req, err := http.NewRequest("GET", urls, body)
1724 if err != nil {
1725 return nil, err
1726 }
1727 req.Header = reqHeaders
1728 googleapi.Expand(req.URL, map[string]string{
1729 "name": c.name,
1730 })
1731 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1732 }
1733
1734
1735
1736
1737
1738
1739 func (c *ProjectsLocationsDataExchangesGetCall) Do(opts ...googleapi.CallOption) (*DataExchange, error) {
1740 gensupport.SetOptions(c.urlParams_, opts...)
1741 res, err := c.doRequest("json")
1742 if res != nil && res.StatusCode == http.StatusNotModified {
1743 if res.Body != nil {
1744 res.Body.Close()
1745 }
1746 return nil, gensupport.WrapError(&googleapi.Error{
1747 Code: res.StatusCode,
1748 Header: res.Header,
1749 })
1750 }
1751 if err != nil {
1752 return nil, err
1753 }
1754 defer googleapi.CloseBody(res)
1755 if err := googleapi.CheckResponse(res); err != nil {
1756 return nil, gensupport.WrapError(err)
1757 }
1758 ret := &DataExchange{
1759 ServerResponse: googleapi.ServerResponse{
1760 Header: res.Header,
1761 HTTPStatusCode: res.StatusCode,
1762 },
1763 }
1764 target := &ret
1765 if err := gensupport.DecodeResponse(target, res); err != nil {
1766 return nil, err
1767 }
1768 return ret, nil
1769 }
1770
1771 type ProjectsLocationsDataExchangesGetIamPolicyCall struct {
1772 s *Service
1773 resource string
1774 getiampolicyrequest *GetIamPolicyRequest
1775 urlParams_ gensupport.URLParams
1776 ctx_ context.Context
1777 header_ http.Header
1778 }
1779
1780
1781
1782
1783
1784
1785 func (r *ProjectsLocationsDataExchangesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsDataExchangesGetIamPolicyCall {
1786 c := &ProjectsLocationsDataExchangesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1787 c.resource = resource
1788 c.getiampolicyrequest = getiampolicyrequest
1789 return c
1790 }
1791
1792
1793
1794
1795 func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesGetIamPolicyCall {
1796 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1797 return c
1798 }
1799
1800
1801 func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesGetIamPolicyCall {
1802 c.ctx_ = ctx
1803 return c
1804 }
1805
1806
1807
1808 func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) Header() http.Header {
1809 if c.header_ == nil {
1810 c.header_ = make(http.Header)
1811 }
1812 return c.header_
1813 }
1814
1815 func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1816 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1817 var body io.Reader = nil
1818 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
1819 if err != nil {
1820 return nil, err
1821 }
1822 c.urlParams_.Set("alt", alt)
1823 c.urlParams_.Set("prettyPrint", "false")
1824 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
1825 urls += "?" + c.urlParams_.Encode()
1826 req, err := http.NewRequest("POST", urls, body)
1827 if err != nil {
1828 return nil, err
1829 }
1830 req.Header = reqHeaders
1831 googleapi.Expand(req.URL, map[string]string{
1832 "resource": c.resource,
1833 })
1834 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1835 }
1836
1837
1838
1839
1840
1841
1842 func (c *ProjectsLocationsDataExchangesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1843 gensupport.SetOptions(c.urlParams_, opts...)
1844 res, err := c.doRequest("json")
1845 if res != nil && res.StatusCode == http.StatusNotModified {
1846 if res.Body != nil {
1847 res.Body.Close()
1848 }
1849 return nil, gensupport.WrapError(&googleapi.Error{
1850 Code: res.StatusCode,
1851 Header: res.Header,
1852 })
1853 }
1854 if err != nil {
1855 return nil, err
1856 }
1857 defer googleapi.CloseBody(res)
1858 if err := googleapi.CheckResponse(res); err != nil {
1859 return nil, gensupport.WrapError(err)
1860 }
1861 ret := &Policy{
1862 ServerResponse: googleapi.ServerResponse{
1863 Header: res.Header,
1864 HTTPStatusCode: res.StatusCode,
1865 },
1866 }
1867 target := &ret
1868 if err := gensupport.DecodeResponse(target, res); err != nil {
1869 return nil, err
1870 }
1871 return ret, nil
1872 }
1873
1874 type ProjectsLocationsDataExchangesListCall struct {
1875 s *Service
1876 parent string
1877 urlParams_ gensupport.URLParams
1878 ifNoneMatch_ string
1879 ctx_ context.Context
1880 header_ http.Header
1881 }
1882
1883
1884
1885
1886
1887 func (r *ProjectsLocationsDataExchangesService) List(parent string) *ProjectsLocationsDataExchangesListCall {
1888 c := &ProjectsLocationsDataExchangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1889 c.parent = parent
1890 return c
1891 }
1892
1893
1894
1895
1896 func (c *ProjectsLocationsDataExchangesListCall) PageSize(pageSize int64) *ProjectsLocationsDataExchangesListCall {
1897 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1898 return c
1899 }
1900
1901
1902
1903 func (c *ProjectsLocationsDataExchangesListCall) PageToken(pageToken string) *ProjectsLocationsDataExchangesListCall {
1904 c.urlParams_.Set("pageToken", pageToken)
1905 return c
1906 }
1907
1908
1909
1910
1911 func (c *ProjectsLocationsDataExchangesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListCall {
1912 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1913 return c
1914 }
1915
1916
1917
1918
1919 func (c *ProjectsLocationsDataExchangesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataExchangesListCall {
1920 c.ifNoneMatch_ = entityTag
1921 return c
1922 }
1923
1924
1925 func (c *ProjectsLocationsDataExchangesListCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListCall {
1926 c.ctx_ = ctx
1927 return c
1928 }
1929
1930
1931
1932 func (c *ProjectsLocationsDataExchangesListCall) Header() http.Header {
1933 if c.header_ == nil {
1934 c.header_ = make(http.Header)
1935 }
1936 return c.header_
1937 }
1938
1939 func (c *ProjectsLocationsDataExchangesListCall) doRequest(alt string) (*http.Response, error) {
1940 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1941 if c.ifNoneMatch_ != "" {
1942 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1943 }
1944 var body io.Reader = nil
1945 c.urlParams_.Set("alt", alt)
1946 c.urlParams_.Set("prettyPrint", "false")
1947 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/dataExchanges")
1948 urls += "?" + c.urlParams_.Encode()
1949 req, err := http.NewRequest("GET", urls, body)
1950 if err != nil {
1951 return nil, err
1952 }
1953 req.Header = reqHeaders
1954 googleapi.Expand(req.URL, map[string]string{
1955 "parent": c.parent,
1956 })
1957 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1958 }
1959
1960
1961
1962
1963
1964
1965
1966 func (c *ProjectsLocationsDataExchangesListCall) Do(opts ...googleapi.CallOption) (*ListDataExchangesResponse, error) {
1967 gensupport.SetOptions(c.urlParams_, opts...)
1968 res, err := c.doRequest("json")
1969 if res != nil && res.StatusCode == http.StatusNotModified {
1970 if res.Body != nil {
1971 res.Body.Close()
1972 }
1973 return nil, gensupport.WrapError(&googleapi.Error{
1974 Code: res.StatusCode,
1975 Header: res.Header,
1976 })
1977 }
1978 if err != nil {
1979 return nil, err
1980 }
1981 defer googleapi.CloseBody(res)
1982 if err := googleapi.CheckResponse(res); err != nil {
1983 return nil, gensupport.WrapError(err)
1984 }
1985 ret := &ListDataExchangesResponse{
1986 ServerResponse: googleapi.ServerResponse{
1987 Header: res.Header,
1988 HTTPStatusCode: res.StatusCode,
1989 },
1990 }
1991 target := &ret
1992 if err := gensupport.DecodeResponse(target, res); err != nil {
1993 return nil, err
1994 }
1995 return ret, nil
1996 }
1997
1998
1999
2000
2001 func (c *ProjectsLocationsDataExchangesListCall) Pages(ctx context.Context, f func(*ListDataExchangesResponse) error) error {
2002 c.ctx_ = ctx
2003 defer c.PageToken(c.urlParams_.Get("pageToken"))
2004 for {
2005 x, err := c.Do()
2006 if err != nil {
2007 return err
2008 }
2009 if err := f(x); err != nil {
2010 return err
2011 }
2012 if x.NextPageToken == "" {
2013 return nil
2014 }
2015 c.PageToken(x.NextPageToken)
2016 }
2017 }
2018
2019 type ProjectsLocationsDataExchangesPatchCall struct {
2020 s *Service
2021 name string
2022 dataexchange *DataExchange
2023 urlParams_ gensupport.URLParams
2024 ctx_ context.Context
2025 header_ http.Header
2026 }
2027
2028
2029
2030
2031
2032 func (r *ProjectsLocationsDataExchangesService) Patch(name string, dataexchange *DataExchange) *ProjectsLocationsDataExchangesPatchCall {
2033 c := &ProjectsLocationsDataExchangesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2034 c.name = name
2035 c.dataexchange = dataexchange
2036 return c
2037 }
2038
2039
2040
2041
2042
2043 func (c *ProjectsLocationsDataExchangesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDataExchangesPatchCall {
2044 c.urlParams_.Set("updateMask", updateMask)
2045 return c
2046 }
2047
2048
2049
2050
2051 func (c *ProjectsLocationsDataExchangesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesPatchCall {
2052 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2053 return c
2054 }
2055
2056
2057 func (c *ProjectsLocationsDataExchangesPatchCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesPatchCall {
2058 c.ctx_ = ctx
2059 return c
2060 }
2061
2062
2063
2064 func (c *ProjectsLocationsDataExchangesPatchCall) Header() http.Header {
2065 if c.header_ == nil {
2066 c.header_ = make(http.Header)
2067 }
2068 return c.header_
2069 }
2070
2071 func (c *ProjectsLocationsDataExchangesPatchCall) doRequest(alt string) (*http.Response, error) {
2072 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2073 var body io.Reader = nil
2074 body, err := googleapi.WithoutDataWrapper.JSONReader(c.dataexchange)
2075 if err != nil {
2076 return nil, err
2077 }
2078 c.urlParams_.Set("alt", alt)
2079 c.urlParams_.Set("prettyPrint", "false")
2080 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2081 urls += "?" + c.urlParams_.Encode()
2082 req, err := http.NewRequest("PATCH", urls, body)
2083 if err != nil {
2084 return nil, err
2085 }
2086 req.Header = reqHeaders
2087 googleapi.Expand(req.URL, map[string]string{
2088 "name": c.name,
2089 })
2090 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2091 }
2092
2093
2094
2095
2096
2097
2098 func (c *ProjectsLocationsDataExchangesPatchCall) Do(opts ...googleapi.CallOption) (*DataExchange, error) {
2099 gensupport.SetOptions(c.urlParams_, opts...)
2100 res, err := c.doRequest("json")
2101 if res != nil && res.StatusCode == http.StatusNotModified {
2102 if res.Body != nil {
2103 res.Body.Close()
2104 }
2105 return nil, gensupport.WrapError(&googleapi.Error{
2106 Code: res.StatusCode,
2107 Header: res.Header,
2108 })
2109 }
2110 if err != nil {
2111 return nil, err
2112 }
2113 defer googleapi.CloseBody(res)
2114 if err := googleapi.CheckResponse(res); err != nil {
2115 return nil, gensupport.WrapError(err)
2116 }
2117 ret := &DataExchange{
2118 ServerResponse: googleapi.ServerResponse{
2119 Header: res.Header,
2120 HTTPStatusCode: res.StatusCode,
2121 },
2122 }
2123 target := &ret
2124 if err := gensupport.DecodeResponse(target, res); err != nil {
2125 return nil, err
2126 }
2127 return ret, nil
2128 }
2129
2130 type ProjectsLocationsDataExchangesSetIamPolicyCall struct {
2131 s *Service
2132 resource string
2133 setiampolicyrequest *SetIamPolicyRequest
2134 urlParams_ gensupport.URLParams
2135 ctx_ context.Context
2136 header_ http.Header
2137 }
2138
2139
2140
2141
2142
2143
2144 func (r *ProjectsLocationsDataExchangesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsDataExchangesSetIamPolicyCall {
2145 c := &ProjectsLocationsDataExchangesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2146 c.resource = resource
2147 c.setiampolicyrequest = setiampolicyrequest
2148 return c
2149 }
2150
2151
2152
2153
2154 func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesSetIamPolicyCall {
2155 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2156 return c
2157 }
2158
2159
2160 func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesSetIamPolicyCall {
2161 c.ctx_ = ctx
2162 return c
2163 }
2164
2165
2166
2167 func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) Header() http.Header {
2168 if c.header_ == nil {
2169 c.header_ = make(http.Header)
2170 }
2171 return c.header_
2172 }
2173
2174 func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2175 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2176 var body io.Reader = nil
2177 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
2178 if err != nil {
2179 return nil, err
2180 }
2181 c.urlParams_.Set("alt", alt)
2182 c.urlParams_.Set("prettyPrint", "false")
2183 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
2184 urls += "?" + c.urlParams_.Encode()
2185 req, err := http.NewRequest("POST", urls, body)
2186 if err != nil {
2187 return nil, err
2188 }
2189 req.Header = reqHeaders
2190 googleapi.Expand(req.URL, map[string]string{
2191 "resource": c.resource,
2192 })
2193 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2194 }
2195
2196
2197
2198
2199
2200
2201 func (c *ProjectsLocationsDataExchangesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2202 gensupport.SetOptions(c.urlParams_, opts...)
2203 res, err := c.doRequest("json")
2204 if res != nil && res.StatusCode == http.StatusNotModified {
2205 if res.Body != nil {
2206 res.Body.Close()
2207 }
2208 return nil, gensupport.WrapError(&googleapi.Error{
2209 Code: res.StatusCode,
2210 Header: res.Header,
2211 })
2212 }
2213 if err != nil {
2214 return nil, err
2215 }
2216 defer googleapi.CloseBody(res)
2217 if err := googleapi.CheckResponse(res); err != nil {
2218 return nil, gensupport.WrapError(err)
2219 }
2220 ret := &Policy{
2221 ServerResponse: googleapi.ServerResponse{
2222 Header: res.Header,
2223 HTTPStatusCode: res.StatusCode,
2224 },
2225 }
2226 target := &ret
2227 if err := gensupport.DecodeResponse(target, res); err != nil {
2228 return nil, err
2229 }
2230 return ret, nil
2231 }
2232
2233 type ProjectsLocationsDataExchangesTestIamPermissionsCall struct {
2234 s *Service
2235 resource string
2236 testiampermissionsrequest *TestIamPermissionsRequest
2237 urlParams_ gensupport.URLParams
2238 ctx_ context.Context
2239 header_ http.Header
2240 }
2241
2242
2243
2244
2245
2246
2247
2248 func (r *ProjectsLocationsDataExchangesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsDataExchangesTestIamPermissionsCall {
2249 c := &ProjectsLocationsDataExchangesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2250 c.resource = resource
2251 c.testiampermissionsrequest = testiampermissionsrequest
2252 return c
2253 }
2254
2255
2256
2257
2258 func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesTestIamPermissionsCall {
2259 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2260 return c
2261 }
2262
2263
2264 func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesTestIamPermissionsCall {
2265 c.ctx_ = ctx
2266 return c
2267 }
2268
2269
2270
2271 func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) Header() http.Header {
2272 if c.header_ == nil {
2273 c.header_ = make(http.Header)
2274 }
2275 return c.header_
2276 }
2277
2278 func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2279 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2280 var body io.Reader = nil
2281 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2282 if err != nil {
2283 return nil, err
2284 }
2285 c.urlParams_.Set("alt", alt)
2286 c.urlParams_.Set("prettyPrint", "false")
2287 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
2288 urls += "?" + c.urlParams_.Encode()
2289 req, err := http.NewRequest("POST", urls, body)
2290 if err != nil {
2291 return nil, err
2292 }
2293 req.Header = reqHeaders
2294 googleapi.Expand(req.URL, map[string]string{
2295 "resource": c.resource,
2296 })
2297 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2298 }
2299
2300
2301
2302
2303
2304
2305
2306 func (c *ProjectsLocationsDataExchangesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2307 gensupport.SetOptions(c.urlParams_, opts...)
2308 res, err := c.doRequest("json")
2309 if res != nil && res.StatusCode == http.StatusNotModified {
2310 if res.Body != nil {
2311 res.Body.Close()
2312 }
2313 return nil, gensupport.WrapError(&googleapi.Error{
2314 Code: res.StatusCode,
2315 Header: res.Header,
2316 })
2317 }
2318 if err != nil {
2319 return nil, err
2320 }
2321 defer googleapi.CloseBody(res)
2322 if err := googleapi.CheckResponse(res); err != nil {
2323 return nil, gensupport.WrapError(err)
2324 }
2325 ret := &TestIamPermissionsResponse{
2326 ServerResponse: googleapi.ServerResponse{
2327 Header: res.Header,
2328 HTTPStatusCode: res.StatusCode,
2329 },
2330 }
2331 target := &ret
2332 if err := gensupport.DecodeResponse(target, res); err != nil {
2333 return nil, err
2334 }
2335 return ret, nil
2336 }
2337
2338 type ProjectsLocationsDataExchangesListingsCreateCall struct {
2339 s *Service
2340 parent string
2341 listing *Listing
2342 urlParams_ gensupport.URLParams
2343 ctx_ context.Context
2344 header_ http.Header
2345 }
2346
2347
2348
2349
2350
2351 func (r *ProjectsLocationsDataExchangesListingsService) Create(parent string, listing *Listing) *ProjectsLocationsDataExchangesListingsCreateCall {
2352 c := &ProjectsLocationsDataExchangesListingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2353 c.parent = parent
2354 c.listing = listing
2355 return c
2356 }
2357
2358
2359
2360
2361
2362 func (c *ProjectsLocationsDataExchangesListingsCreateCall) ListingId(listingId string) *ProjectsLocationsDataExchangesListingsCreateCall {
2363 c.urlParams_.Set("listingId", listingId)
2364 return c
2365 }
2366
2367
2368
2369
2370 func (c *ProjectsLocationsDataExchangesListingsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsCreateCall {
2371 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2372 return c
2373 }
2374
2375
2376 func (c *ProjectsLocationsDataExchangesListingsCreateCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsCreateCall {
2377 c.ctx_ = ctx
2378 return c
2379 }
2380
2381
2382
2383 func (c *ProjectsLocationsDataExchangesListingsCreateCall) Header() http.Header {
2384 if c.header_ == nil {
2385 c.header_ = make(http.Header)
2386 }
2387 return c.header_
2388 }
2389
2390 func (c *ProjectsLocationsDataExchangesListingsCreateCall) doRequest(alt string) (*http.Response, error) {
2391 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2392 var body io.Reader = nil
2393 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
2394 if err != nil {
2395 return nil, err
2396 }
2397 c.urlParams_.Set("alt", alt)
2398 c.urlParams_.Set("prettyPrint", "false")
2399 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/listings")
2400 urls += "?" + c.urlParams_.Encode()
2401 req, err := http.NewRequest("POST", urls, body)
2402 if err != nil {
2403 return nil, err
2404 }
2405 req.Header = reqHeaders
2406 googleapi.Expand(req.URL, map[string]string{
2407 "parent": c.parent,
2408 })
2409 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2410 }
2411
2412
2413
2414
2415
2416
2417 func (c *ProjectsLocationsDataExchangesListingsCreateCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
2418 gensupport.SetOptions(c.urlParams_, opts...)
2419 res, err := c.doRequest("json")
2420 if res != nil && res.StatusCode == http.StatusNotModified {
2421 if res.Body != nil {
2422 res.Body.Close()
2423 }
2424 return nil, gensupport.WrapError(&googleapi.Error{
2425 Code: res.StatusCode,
2426 Header: res.Header,
2427 })
2428 }
2429 if err != nil {
2430 return nil, err
2431 }
2432 defer googleapi.CloseBody(res)
2433 if err := googleapi.CheckResponse(res); err != nil {
2434 return nil, gensupport.WrapError(err)
2435 }
2436 ret := &Listing{
2437 ServerResponse: googleapi.ServerResponse{
2438 Header: res.Header,
2439 HTTPStatusCode: res.StatusCode,
2440 },
2441 }
2442 target := &ret
2443 if err := gensupport.DecodeResponse(target, res); err != nil {
2444 return nil, err
2445 }
2446 return ret, nil
2447 }
2448
2449 type ProjectsLocationsDataExchangesListingsDeleteCall struct {
2450 s *Service
2451 name string
2452 urlParams_ gensupport.URLParams
2453 ctx_ context.Context
2454 header_ http.Header
2455 }
2456
2457
2458
2459
2460
2461 func (r *ProjectsLocationsDataExchangesListingsService) Delete(name string) *ProjectsLocationsDataExchangesListingsDeleteCall {
2462 c := &ProjectsLocationsDataExchangesListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2463 c.name = name
2464 return c
2465 }
2466
2467
2468
2469
2470 func (c *ProjectsLocationsDataExchangesListingsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsDeleteCall {
2471 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2472 return c
2473 }
2474
2475
2476 func (c *ProjectsLocationsDataExchangesListingsDeleteCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsDeleteCall {
2477 c.ctx_ = ctx
2478 return c
2479 }
2480
2481
2482
2483 func (c *ProjectsLocationsDataExchangesListingsDeleteCall) Header() http.Header {
2484 if c.header_ == nil {
2485 c.header_ = make(http.Header)
2486 }
2487 return c.header_
2488 }
2489
2490 func (c *ProjectsLocationsDataExchangesListingsDeleteCall) doRequest(alt string) (*http.Response, error) {
2491 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2492 var body io.Reader = nil
2493 c.urlParams_.Set("alt", alt)
2494 c.urlParams_.Set("prettyPrint", "false")
2495 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2496 urls += "?" + c.urlParams_.Encode()
2497 req, err := http.NewRequest("DELETE", urls, body)
2498 if err != nil {
2499 return nil, err
2500 }
2501 req.Header = reqHeaders
2502 googleapi.Expand(req.URL, map[string]string{
2503 "name": c.name,
2504 })
2505 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2506 }
2507
2508
2509
2510
2511
2512
2513 func (c *ProjectsLocationsDataExchangesListingsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2514 gensupport.SetOptions(c.urlParams_, opts...)
2515 res, err := c.doRequest("json")
2516 if res != nil && res.StatusCode == http.StatusNotModified {
2517 if res.Body != nil {
2518 res.Body.Close()
2519 }
2520 return nil, gensupport.WrapError(&googleapi.Error{
2521 Code: res.StatusCode,
2522 Header: res.Header,
2523 })
2524 }
2525 if err != nil {
2526 return nil, err
2527 }
2528 defer googleapi.CloseBody(res)
2529 if err := googleapi.CheckResponse(res); err != nil {
2530 return nil, gensupport.WrapError(err)
2531 }
2532 ret := &Empty{
2533 ServerResponse: googleapi.ServerResponse{
2534 Header: res.Header,
2535 HTTPStatusCode: res.StatusCode,
2536 },
2537 }
2538 target := &ret
2539 if err := gensupport.DecodeResponse(target, res); err != nil {
2540 return nil, err
2541 }
2542 return ret, nil
2543 }
2544
2545 type ProjectsLocationsDataExchangesListingsGetCall struct {
2546 s *Service
2547 name string
2548 urlParams_ gensupport.URLParams
2549 ifNoneMatch_ string
2550 ctx_ context.Context
2551 header_ http.Header
2552 }
2553
2554
2555
2556
2557
2558 func (r *ProjectsLocationsDataExchangesListingsService) Get(name string) *ProjectsLocationsDataExchangesListingsGetCall {
2559 c := &ProjectsLocationsDataExchangesListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2560 c.name = name
2561 return c
2562 }
2563
2564
2565
2566
2567 func (c *ProjectsLocationsDataExchangesListingsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsGetCall {
2568 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2569 return c
2570 }
2571
2572
2573
2574
2575 func (c *ProjectsLocationsDataExchangesListingsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataExchangesListingsGetCall {
2576 c.ifNoneMatch_ = entityTag
2577 return c
2578 }
2579
2580
2581 func (c *ProjectsLocationsDataExchangesListingsGetCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsGetCall {
2582 c.ctx_ = ctx
2583 return c
2584 }
2585
2586
2587
2588 func (c *ProjectsLocationsDataExchangesListingsGetCall) Header() http.Header {
2589 if c.header_ == nil {
2590 c.header_ = make(http.Header)
2591 }
2592 return c.header_
2593 }
2594
2595 func (c *ProjectsLocationsDataExchangesListingsGetCall) doRequest(alt string) (*http.Response, error) {
2596 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2597 if c.ifNoneMatch_ != "" {
2598 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2599 }
2600 var body io.Reader = nil
2601 c.urlParams_.Set("alt", alt)
2602 c.urlParams_.Set("prettyPrint", "false")
2603 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2604 urls += "?" + c.urlParams_.Encode()
2605 req, err := http.NewRequest("GET", urls, body)
2606 if err != nil {
2607 return nil, err
2608 }
2609 req.Header = reqHeaders
2610 googleapi.Expand(req.URL, map[string]string{
2611 "name": c.name,
2612 })
2613 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2614 }
2615
2616
2617
2618
2619
2620
2621 func (c *ProjectsLocationsDataExchangesListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
2622 gensupport.SetOptions(c.urlParams_, opts...)
2623 res, err := c.doRequest("json")
2624 if res != nil && res.StatusCode == http.StatusNotModified {
2625 if res.Body != nil {
2626 res.Body.Close()
2627 }
2628 return nil, gensupport.WrapError(&googleapi.Error{
2629 Code: res.StatusCode,
2630 Header: res.Header,
2631 })
2632 }
2633 if err != nil {
2634 return nil, err
2635 }
2636 defer googleapi.CloseBody(res)
2637 if err := googleapi.CheckResponse(res); err != nil {
2638 return nil, gensupport.WrapError(err)
2639 }
2640 ret := &Listing{
2641 ServerResponse: googleapi.ServerResponse{
2642 Header: res.Header,
2643 HTTPStatusCode: res.StatusCode,
2644 },
2645 }
2646 target := &ret
2647 if err := gensupport.DecodeResponse(target, res); err != nil {
2648 return nil, err
2649 }
2650 return ret, nil
2651 }
2652
2653 type ProjectsLocationsDataExchangesListingsGetIamPolicyCall struct {
2654 s *Service
2655 resource string
2656 getiampolicyrequest *GetIamPolicyRequest
2657 urlParams_ gensupport.URLParams
2658 ctx_ context.Context
2659 header_ http.Header
2660 }
2661
2662
2663
2664
2665
2666
2667 func (r *ProjectsLocationsDataExchangesListingsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsDataExchangesListingsGetIamPolicyCall {
2668 c := &ProjectsLocationsDataExchangesListingsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2669 c.resource = resource
2670 c.getiampolicyrequest = getiampolicyrequest
2671 return c
2672 }
2673
2674
2675
2676
2677 func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsGetIamPolicyCall {
2678 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2679 return c
2680 }
2681
2682
2683 func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsGetIamPolicyCall {
2684 c.ctx_ = ctx
2685 return c
2686 }
2687
2688
2689
2690 func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) Header() http.Header {
2691 if c.header_ == nil {
2692 c.header_ = make(http.Header)
2693 }
2694 return c.header_
2695 }
2696
2697 func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2698 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2699 var body io.Reader = nil
2700 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
2701 if err != nil {
2702 return nil, err
2703 }
2704 c.urlParams_.Set("alt", alt)
2705 c.urlParams_.Set("prettyPrint", "false")
2706 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
2707 urls += "?" + c.urlParams_.Encode()
2708 req, err := http.NewRequest("POST", urls, body)
2709 if err != nil {
2710 return nil, err
2711 }
2712 req.Header = reqHeaders
2713 googleapi.Expand(req.URL, map[string]string{
2714 "resource": c.resource,
2715 })
2716 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2717 }
2718
2719
2720
2721
2722
2723
2724 func (c *ProjectsLocationsDataExchangesListingsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2725 gensupport.SetOptions(c.urlParams_, opts...)
2726 res, err := c.doRequest("json")
2727 if res != nil && res.StatusCode == http.StatusNotModified {
2728 if res.Body != nil {
2729 res.Body.Close()
2730 }
2731 return nil, gensupport.WrapError(&googleapi.Error{
2732 Code: res.StatusCode,
2733 Header: res.Header,
2734 })
2735 }
2736 if err != nil {
2737 return nil, err
2738 }
2739 defer googleapi.CloseBody(res)
2740 if err := googleapi.CheckResponse(res); err != nil {
2741 return nil, gensupport.WrapError(err)
2742 }
2743 ret := &Policy{
2744 ServerResponse: googleapi.ServerResponse{
2745 Header: res.Header,
2746 HTTPStatusCode: res.StatusCode,
2747 },
2748 }
2749 target := &ret
2750 if err := gensupport.DecodeResponse(target, res); err != nil {
2751 return nil, err
2752 }
2753 return ret, nil
2754 }
2755
2756 type ProjectsLocationsDataExchangesListingsListCall struct {
2757 s *Service
2758 parent string
2759 urlParams_ gensupport.URLParams
2760 ifNoneMatch_ string
2761 ctx_ context.Context
2762 header_ http.Header
2763 }
2764
2765
2766
2767
2768
2769 func (r *ProjectsLocationsDataExchangesListingsService) List(parent string) *ProjectsLocationsDataExchangesListingsListCall {
2770 c := &ProjectsLocationsDataExchangesListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2771 c.parent = parent
2772 return c
2773 }
2774
2775
2776
2777
2778 func (c *ProjectsLocationsDataExchangesListingsListCall) PageSize(pageSize int64) *ProjectsLocationsDataExchangesListingsListCall {
2779 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2780 return c
2781 }
2782
2783
2784
2785 func (c *ProjectsLocationsDataExchangesListingsListCall) PageToken(pageToken string) *ProjectsLocationsDataExchangesListingsListCall {
2786 c.urlParams_.Set("pageToken", pageToken)
2787 return c
2788 }
2789
2790
2791
2792
2793 func (c *ProjectsLocationsDataExchangesListingsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsListCall {
2794 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2795 return c
2796 }
2797
2798
2799
2800
2801 func (c *ProjectsLocationsDataExchangesListingsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsDataExchangesListingsListCall {
2802 c.ifNoneMatch_ = entityTag
2803 return c
2804 }
2805
2806
2807 func (c *ProjectsLocationsDataExchangesListingsListCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsListCall {
2808 c.ctx_ = ctx
2809 return c
2810 }
2811
2812
2813
2814 func (c *ProjectsLocationsDataExchangesListingsListCall) Header() http.Header {
2815 if c.header_ == nil {
2816 c.header_ = make(http.Header)
2817 }
2818 return c.header_
2819 }
2820
2821 func (c *ProjectsLocationsDataExchangesListingsListCall) doRequest(alt string) (*http.Response, error) {
2822 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2823 if c.ifNoneMatch_ != "" {
2824 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2825 }
2826 var body io.Reader = nil
2827 c.urlParams_.Set("alt", alt)
2828 c.urlParams_.Set("prettyPrint", "false")
2829 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/listings")
2830 urls += "?" + c.urlParams_.Encode()
2831 req, err := http.NewRequest("GET", urls, body)
2832 if err != nil {
2833 return nil, err
2834 }
2835 req.Header = reqHeaders
2836 googleapi.Expand(req.URL, map[string]string{
2837 "parent": c.parent,
2838 })
2839 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2840 }
2841
2842
2843
2844
2845
2846
2847
2848 func (c *ProjectsLocationsDataExchangesListingsListCall) Do(opts ...googleapi.CallOption) (*ListListingsResponse, error) {
2849 gensupport.SetOptions(c.urlParams_, opts...)
2850 res, err := c.doRequest("json")
2851 if res != nil && res.StatusCode == http.StatusNotModified {
2852 if res.Body != nil {
2853 res.Body.Close()
2854 }
2855 return nil, gensupport.WrapError(&googleapi.Error{
2856 Code: res.StatusCode,
2857 Header: res.Header,
2858 })
2859 }
2860 if err != nil {
2861 return nil, err
2862 }
2863 defer googleapi.CloseBody(res)
2864 if err := googleapi.CheckResponse(res); err != nil {
2865 return nil, gensupport.WrapError(err)
2866 }
2867 ret := &ListListingsResponse{
2868 ServerResponse: googleapi.ServerResponse{
2869 Header: res.Header,
2870 HTTPStatusCode: res.StatusCode,
2871 },
2872 }
2873 target := &ret
2874 if err := gensupport.DecodeResponse(target, res); err != nil {
2875 return nil, err
2876 }
2877 return ret, nil
2878 }
2879
2880
2881
2882
2883 func (c *ProjectsLocationsDataExchangesListingsListCall) Pages(ctx context.Context, f func(*ListListingsResponse) error) error {
2884 c.ctx_ = ctx
2885 defer c.PageToken(c.urlParams_.Get("pageToken"))
2886 for {
2887 x, err := c.Do()
2888 if err != nil {
2889 return err
2890 }
2891 if err := f(x); err != nil {
2892 return err
2893 }
2894 if x.NextPageToken == "" {
2895 return nil
2896 }
2897 c.PageToken(x.NextPageToken)
2898 }
2899 }
2900
2901 type ProjectsLocationsDataExchangesListingsPatchCall struct {
2902 s *Service
2903 name string
2904 listing *Listing
2905 urlParams_ gensupport.URLParams
2906 ctx_ context.Context
2907 header_ http.Header
2908 }
2909
2910
2911
2912
2913
2914 func (r *ProjectsLocationsDataExchangesListingsService) Patch(name string, listing *Listing) *ProjectsLocationsDataExchangesListingsPatchCall {
2915 c := &ProjectsLocationsDataExchangesListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2916 c.name = name
2917 c.listing = listing
2918 return c
2919 }
2920
2921
2922
2923
2924 func (c *ProjectsLocationsDataExchangesListingsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsDataExchangesListingsPatchCall {
2925 c.urlParams_.Set("updateMask", updateMask)
2926 return c
2927 }
2928
2929
2930
2931
2932 func (c *ProjectsLocationsDataExchangesListingsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsPatchCall {
2933 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2934 return c
2935 }
2936
2937
2938 func (c *ProjectsLocationsDataExchangesListingsPatchCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsPatchCall {
2939 c.ctx_ = ctx
2940 return c
2941 }
2942
2943
2944
2945 func (c *ProjectsLocationsDataExchangesListingsPatchCall) Header() http.Header {
2946 if c.header_ == nil {
2947 c.header_ = make(http.Header)
2948 }
2949 return c.header_
2950 }
2951
2952 func (c *ProjectsLocationsDataExchangesListingsPatchCall) doRequest(alt string) (*http.Response, error) {
2953 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2954 var body io.Reader = nil
2955 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
2956 if err != nil {
2957 return nil, err
2958 }
2959 c.urlParams_.Set("alt", alt)
2960 c.urlParams_.Set("prettyPrint", "false")
2961 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2962 urls += "?" + c.urlParams_.Encode()
2963 req, err := http.NewRequest("PATCH", urls, body)
2964 if err != nil {
2965 return nil, err
2966 }
2967 req.Header = reqHeaders
2968 googleapi.Expand(req.URL, map[string]string{
2969 "name": c.name,
2970 })
2971 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2972 }
2973
2974
2975
2976
2977
2978
2979 func (c *ProjectsLocationsDataExchangesListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
2980 gensupport.SetOptions(c.urlParams_, opts...)
2981 res, err := c.doRequest("json")
2982 if res != nil && res.StatusCode == http.StatusNotModified {
2983 if res.Body != nil {
2984 res.Body.Close()
2985 }
2986 return nil, gensupport.WrapError(&googleapi.Error{
2987 Code: res.StatusCode,
2988 Header: res.Header,
2989 })
2990 }
2991 if err != nil {
2992 return nil, err
2993 }
2994 defer googleapi.CloseBody(res)
2995 if err := googleapi.CheckResponse(res); err != nil {
2996 return nil, gensupport.WrapError(err)
2997 }
2998 ret := &Listing{
2999 ServerResponse: googleapi.ServerResponse{
3000 Header: res.Header,
3001 HTTPStatusCode: res.StatusCode,
3002 },
3003 }
3004 target := &ret
3005 if err := gensupport.DecodeResponse(target, res); err != nil {
3006 return nil, err
3007 }
3008 return ret, nil
3009 }
3010
3011 type ProjectsLocationsDataExchangesListingsSetIamPolicyCall struct {
3012 s *Service
3013 resource string
3014 setiampolicyrequest *SetIamPolicyRequest
3015 urlParams_ gensupport.URLParams
3016 ctx_ context.Context
3017 header_ http.Header
3018 }
3019
3020
3021
3022
3023
3024
3025 func (r *ProjectsLocationsDataExchangesListingsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsDataExchangesListingsSetIamPolicyCall {
3026 c := &ProjectsLocationsDataExchangesListingsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3027 c.resource = resource
3028 c.setiampolicyrequest = setiampolicyrequest
3029 return c
3030 }
3031
3032
3033
3034
3035 func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsSetIamPolicyCall {
3036 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3037 return c
3038 }
3039
3040
3041 func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsSetIamPolicyCall {
3042 c.ctx_ = ctx
3043 return c
3044 }
3045
3046
3047
3048 func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) Header() http.Header {
3049 if c.header_ == nil {
3050 c.header_ = make(http.Header)
3051 }
3052 return c.header_
3053 }
3054
3055 func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3056 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3057 var body io.Reader = nil
3058 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
3059 if err != nil {
3060 return nil, err
3061 }
3062 c.urlParams_.Set("alt", alt)
3063 c.urlParams_.Set("prettyPrint", "false")
3064 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
3065 urls += "?" + c.urlParams_.Encode()
3066 req, err := http.NewRequest("POST", urls, body)
3067 if err != nil {
3068 return nil, err
3069 }
3070 req.Header = reqHeaders
3071 googleapi.Expand(req.URL, map[string]string{
3072 "resource": c.resource,
3073 })
3074 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3075 }
3076
3077
3078
3079
3080
3081
3082 func (c *ProjectsLocationsDataExchangesListingsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3083 gensupport.SetOptions(c.urlParams_, opts...)
3084 res, err := c.doRequest("json")
3085 if res != nil && res.StatusCode == http.StatusNotModified {
3086 if res.Body != nil {
3087 res.Body.Close()
3088 }
3089 return nil, gensupport.WrapError(&googleapi.Error{
3090 Code: res.StatusCode,
3091 Header: res.Header,
3092 })
3093 }
3094 if err != nil {
3095 return nil, err
3096 }
3097 defer googleapi.CloseBody(res)
3098 if err := googleapi.CheckResponse(res); err != nil {
3099 return nil, gensupport.WrapError(err)
3100 }
3101 ret := &Policy{
3102 ServerResponse: googleapi.ServerResponse{
3103 Header: res.Header,
3104 HTTPStatusCode: res.StatusCode,
3105 },
3106 }
3107 target := &ret
3108 if err := gensupport.DecodeResponse(target, res); err != nil {
3109 return nil, err
3110 }
3111 return ret, nil
3112 }
3113
3114 type ProjectsLocationsDataExchangesListingsSubscribeCall struct {
3115 s *Service
3116 name string
3117 subscribelistingrequest *SubscribeListingRequest
3118 urlParams_ gensupport.URLParams
3119 ctx_ context.Context
3120 header_ http.Header
3121 }
3122
3123
3124
3125
3126
3127
3128
3129
3130 func (r *ProjectsLocationsDataExchangesListingsService) Subscribe(name string, subscribelistingrequest *SubscribeListingRequest) *ProjectsLocationsDataExchangesListingsSubscribeCall {
3131 c := &ProjectsLocationsDataExchangesListingsSubscribeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3132 c.name = name
3133 c.subscribelistingrequest = subscribelistingrequest
3134 return c
3135 }
3136
3137
3138
3139
3140 func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsSubscribeCall {
3141 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3142 return c
3143 }
3144
3145
3146 func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsSubscribeCall {
3147 c.ctx_ = ctx
3148 return c
3149 }
3150
3151
3152
3153 func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) Header() http.Header {
3154 if c.header_ == nil {
3155 c.header_ = make(http.Header)
3156 }
3157 return c.header_
3158 }
3159
3160 func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) doRequest(alt string) (*http.Response, error) {
3161 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3162 var body io.Reader = nil
3163 body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscribelistingrequest)
3164 if err != nil {
3165 return nil, err
3166 }
3167 c.urlParams_.Set("alt", alt)
3168 c.urlParams_.Set("prettyPrint", "false")
3169 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:subscribe")
3170 urls += "?" + c.urlParams_.Encode()
3171 req, err := http.NewRequest("POST", urls, body)
3172 if err != nil {
3173 return nil, err
3174 }
3175 req.Header = reqHeaders
3176 googleapi.Expand(req.URL, map[string]string{
3177 "name": c.name,
3178 })
3179 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3180 }
3181
3182
3183
3184
3185
3186
3187
3188 func (c *ProjectsLocationsDataExchangesListingsSubscribeCall) Do(opts ...googleapi.CallOption) (*SubscribeListingResponse, error) {
3189 gensupport.SetOptions(c.urlParams_, opts...)
3190 res, err := c.doRequest("json")
3191 if res != nil && res.StatusCode == http.StatusNotModified {
3192 if res.Body != nil {
3193 res.Body.Close()
3194 }
3195 return nil, gensupport.WrapError(&googleapi.Error{
3196 Code: res.StatusCode,
3197 Header: res.Header,
3198 })
3199 }
3200 if err != nil {
3201 return nil, err
3202 }
3203 defer googleapi.CloseBody(res)
3204 if err := googleapi.CheckResponse(res); err != nil {
3205 return nil, gensupport.WrapError(err)
3206 }
3207 ret := &SubscribeListingResponse{
3208 ServerResponse: googleapi.ServerResponse{
3209 Header: res.Header,
3210 HTTPStatusCode: res.StatusCode,
3211 },
3212 }
3213 target := &ret
3214 if err := gensupport.DecodeResponse(target, res); err != nil {
3215 return nil, err
3216 }
3217 return ret, nil
3218 }
3219
3220 type ProjectsLocationsDataExchangesListingsTestIamPermissionsCall struct {
3221 s *Service
3222 resource string
3223 testiampermissionsrequest *TestIamPermissionsRequest
3224 urlParams_ gensupport.URLParams
3225 ctx_ context.Context
3226 header_ http.Header
3227 }
3228
3229
3230
3231
3232
3233
3234
3235 func (r *ProjectsLocationsDataExchangesListingsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall {
3236 c := &ProjectsLocationsDataExchangesListingsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3237 c.resource = resource
3238 c.testiampermissionsrequest = testiampermissionsrequest
3239 return c
3240 }
3241
3242
3243
3244
3245 func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall {
3246 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3247 return c
3248 }
3249
3250
3251 func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall {
3252 c.ctx_ = ctx
3253 return c
3254 }
3255
3256
3257
3258 func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) Header() http.Header {
3259 if c.header_ == nil {
3260 c.header_ = make(http.Header)
3261 }
3262 return c.header_
3263 }
3264
3265 func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
3266 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3267 var body io.Reader = nil
3268 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
3269 if err != nil {
3270 return nil, err
3271 }
3272 c.urlParams_.Set("alt", alt)
3273 c.urlParams_.Set("prettyPrint", "false")
3274 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
3275 urls += "?" + c.urlParams_.Encode()
3276 req, err := http.NewRequest("POST", urls, body)
3277 if err != nil {
3278 return nil, err
3279 }
3280 req.Header = reqHeaders
3281 googleapi.Expand(req.URL, map[string]string{
3282 "resource": c.resource,
3283 })
3284 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3285 }
3286
3287
3288
3289
3290
3291
3292
3293 func (c *ProjectsLocationsDataExchangesListingsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
3294 gensupport.SetOptions(c.urlParams_, opts...)
3295 res, err := c.doRequest("json")
3296 if res != nil && res.StatusCode == http.StatusNotModified {
3297 if res.Body != nil {
3298 res.Body.Close()
3299 }
3300 return nil, gensupport.WrapError(&googleapi.Error{
3301 Code: res.StatusCode,
3302 Header: res.Header,
3303 })
3304 }
3305 if err != nil {
3306 return nil, err
3307 }
3308 defer googleapi.CloseBody(res)
3309 if err := googleapi.CheckResponse(res); err != nil {
3310 return nil, gensupport.WrapError(err)
3311 }
3312 ret := &TestIamPermissionsResponse{
3313 ServerResponse: googleapi.ServerResponse{
3314 Header: res.Header,
3315 HTTPStatusCode: res.StatusCode,
3316 },
3317 }
3318 target := &ret
3319 if err := gensupport.DecodeResponse(target, res); err != nil {
3320 return nil, err
3321 }
3322 return ret, nil
3323 }
3324
View as plain text