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