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