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