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 ids
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 = "ids:v1"
90 const apiName = "ids"
91 const apiVersion = "v1"
92 const basePath = "https://ids.googleapis.com/"
93 const basePathTemplate = "https://ids.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://ids.mtls.googleapis.com/"
95
96
97 const (
98
99
100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
101 )
102
103
104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
105 scopesOption := internaloption.WithDefaultScopes(
106 "https://www.googleapis.com/auth/cloud-platform",
107 )
108
109 opts = append([]option.ClientOption{scopesOption}, opts...)
110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
113 opts = append(opts, internaloption.EnableNewAuthLibrary())
114 client, endpoint, err := htransport.NewClient(ctx, opts...)
115 if err != nil {
116 return nil, err
117 }
118 s, err := New(client)
119 if err != nil {
120 return nil, err
121 }
122 if endpoint != "" {
123 s.BasePath = endpoint
124 }
125 return s, nil
126 }
127
128
129
130
131
132
133 func New(client *http.Client) (*Service, error) {
134 if client == nil {
135 return nil, errors.New("client is nil")
136 }
137 s := &Service{client: client, BasePath: basePath}
138 s.Projects = NewProjectsService(s)
139 return s, nil
140 }
141
142 type Service struct {
143 client *http.Client
144 BasePath string
145 UserAgent string
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 Locations *ProjectsLocationsService
167 }
168
169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
170 rs := &ProjectsLocationsService{s: s}
171 rs.Endpoints = NewProjectsLocationsEndpointsService(s)
172 rs.Operations = NewProjectsLocationsOperationsService(s)
173 return rs
174 }
175
176 type ProjectsLocationsService struct {
177 s *Service
178
179 Endpoints *ProjectsLocationsEndpointsService
180
181 Operations *ProjectsLocationsOperationsService
182 }
183
184 func NewProjectsLocationsEndpointsService(s *Service) *ProjectsLocationsEndpointsService {
185 rs := &ProjectsLocationsEndpointsService{s: s}
186 return rs
187 }
188
189 type ProjectsLocationsEndpointsService struct {
190 s *Service
191 }
192
193 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
194 rs := &ProjectsLocationsOperationsService{s: s}
195 return rs
196 }
197
198 type ProjectsLocationsOperationsService struct {
199 s *Service
200 }
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218 type AuditConfig struct {
219
220 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
221
222
223
224 Service string `json:"service,omitempty"`
225
226
227
228
229
230 ForceSendFields []string `json:"-"`
231
232
233
234
235 NullFields []string `json:"-"`
236 }
237
238 func (s *AuditConfig) MarshalJSON() ([]byte, error) {
239 type NoMethod AuditConfig
240 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
241 }
242
243
244
245
246
247
248 type AuditLogConfig struct {
249
250
251 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
252
253
254
255
256
257
258
259 LogType string `json:"logType,omitempty"`
260
261
262
263
264
265 ForceSendFields []string `json:"-"`
266
267
268
269
270 NullFields []string `json:"-"`
271 }
272
273 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
274 type NoMethod AuditLogConfig
275 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
276 }
277
278
279 type Binding struct {
280
281
282
283
284
285
286
287
288 Condition *Expr `json:"condition,omitempty"`
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324 Members []string `json:"members,omitempty"`
325
326
327 Role string `json:"role,omitempty"`
328
329
330
331
332
333 ForceSendFields []string `json:"-"`
334
335
336
337
338 NullFields []string `json:"-"`
339 }
340
341 func (s *Binding) MarshalJSON() ([]byte, error) {
342 type NoMethod Binding
343 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
344 }
345
346
347 type CancelOperationRequest struct {
348 }
349
350
351
352
353
354 type Empty struct {
355
356 googleapi.ServerResponse `json:"-"`
357 }
358
359
360
361 type Endpoint struct {
362
363 CreateTime string `json:"createTime,omitempty"`
364
365 Description string `json:"description,omitempty"`
366
367
368 EndpointForwardingRule string `json:"endpointForwardingRule,omitempty"`
369
370 EndpointIp string `json:"endpointIp,omitempty"`
371
372 Labels map[string]string `json:"labels,omitempty"`
373
374 Name string `json:"name,omitempty"`
375
376
377 Network string `json:"network,omitempty"`
378
379
380
381
382
383
384
385
386
387 Severity string `json:"severity,omitempty"`
388
389
390
391
392
393
394
395
396 State string `json:"state,omitempty"`
397
398 ThreatExceptions []string `json:"threatExceptions,omitempty"`
399
400
401 TrafficLogs bool `json:"trafficLogs,omitempty"`
402
403 UpdateTime string `json:"updateTime,omitempty"`
404
405
406 googleapi.ServerResponse `json:"-"`
407
408
409
410
411
412 ForceSendFields []string `json:"-"`
413
414
415
416
417 NullFields []string `json:"-"`
418 }
419
420 func (s *Endpoint) MarshalJSON() ([]byte, error) {
421 type NoMethod Endpoint
422 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
423 }
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441 type Expr struct {
442
443
444 Description string `json:"description,omitempty"`
445
446
447 Expression string `json:"expression,omitempty"`
448
449
450 Location string `json:"location,omitempty"`
451
452
453
454 Title string `json:"title,omitempty"`
455
456
457
458
459
460 ForceSendFields []string `json:"-"`
461
462
463
464
465 NullFields []string `json:"-"`
466 }
467
468 func (s *Expr) MarshalJSON() ([]byte, error) {
469 type NoMethod Expr
470 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
471 }
472
473 type ListEndpointsResponse struct {
474
475 Endpoints []*Endpoint `json:"endpoints,omitempty"`
476
477
478 NextPageToken string `json:"nextPageToken,omitempty"`
479
480 Unreachable []string `json:"unreachable,omitempty"`
481
482
483 googleapi.ServerResponse `json:"-"`
484
485
486
487
488
489 ForceSendFields []string `json:"-"`
490
491
492
493
494 NullFields []string `json:"-"`
495 }
496
497 func (s *ListEndpointsResponse) MarshalJSON() ([]byte, error) {
498 type NoMethod ListEndpointsResponse
499 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
500 }
501
502
503 type ListLocationsResponse struct {
504
505
506 Locations []*Location `json:"locations,omitempty"`
507
508 NextPageToken string `json:"nextPageToken,omitempty"`
509
510
511 googleapi.ServerResponse `json:"-"`
512
513
514
515
516
517 ForceSendFields []string `json:"-"`
518
519
520
521
522 NullFields []string `json:"-"`
523 }
524
525 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
526 type NoMethod ListLocationsResponse
527 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
528 }
529
530
531 type ListOperationsResponse struct {
532
533 NextPageToken string `json:"nextPageToken,omitempty"`
534
535
536 Operations []*Operation `json:"operations,omitempty"`
537
538
539 googleapi.ServerResponse `json:"-"`
540
541
542
543
544
545 ForceSendFields []string `json:"-"`
546
547
548
549
550 NullFields []string `json:"-"`
551 }
552
553 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
554 type NoMethod ListOperationsResponse
555 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
556 }
557
558
559 type Location struct {
560
561
562 DisplayName string `json:"displayName,omitempty"`
563
564
565 Labels map[string]string `json:"labels,omitempty"`
566
567 LocationId string `json:"locationId,omitempty"`
568
569
570 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
571
572
573
574 Name string `json:"name,omitempty"`
575
576
577 googleapi.ServerResponse `json:"-"`
578
579
580
581
582
583 ForceSendFields []string `json:"-"`
584
585
586
587
588 NullFields []string `json:"-"`
589 }
590
591 func (s *Location) MarshalJSON() ([]byte, error) {
592 type NoMethod Location
593 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
594 }
595
596
597
598 type Operation struct {
599
600
601
602 Done bool `json:"done,omitempty"`
603
604 Error *Status `json:"error,omitempty"`
605
606
607
608
609 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
610
611
612
613 Name string `json:"name,omitempty"`
614
615
616
617
618
619
620
621 Response googleapi.RawMessage `json:"response,omitempty"`
622
623
624 googleapi.ServerResponse `json:"-"`
625
626
627
628
629
630 ForceSendFields []string `json:"-"`
631
632
633
634
635 NullFields []string `json:"-"`
636 }
637
638 func (s *Operation) MarshalJSON() ([]byte, error) {
639 type NoMethod Operation
640 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
641 }
642
643
644 type OperationMetadata struct {
645
646 ApiVersion string `json:"apiVersion,omitempty"`
647
648 CreateTime string `json:"createTime,omitempty"`
649
650 EndTime string `json:"endTime,omitempty"`
651
652
653
654
655 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
656
657 StatusMessage string `json:"statusMessage,omitempty"`
658
659
660 Target string `json:"target,omitempty"`
661
662 Verb string `json:"verb,omitempty"`
663
664
665
666
667
668 ForceSendFields []string `json:"-"`
669
670
671
672
673 NullFields []string `json:"-"`
674 }
675
676 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
677 type NoMethod OperationMetadata
678 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
679 }
680
681
682
683
684
685
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 type Policy struct {
712
713 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
714
715
716
717
718
719
720
721
722
723 Bindings []*Binding `json:"bindings,omitempty"`
724
725
726
727
728
729
730
731
732
733
734
735 Etag string `json:"etag,omitempty"`
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751 Version int64 `json:"version,omitempty"`
752
753
754 googleapi.ServerResponse `json:"-"`
755
756
757
758
759
760 ForceSendFields []string `json:"-"`
761
762
763
764
765 NullFields []string `json:"-"`
766 }
767
768 func (s *Policy) MarshalJSON() ([]byte, error) {
769 type NoMethod Policy
770 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
771 }
772
773
774 type SetIamPolicyRequest struct {
775
776
777
778
779 Policy *Policy `json:"policy,omitempty"`
780
781
782
783 UpdateMask string `json:"updateMask,omitempty"`
784
785
786
787
788
789 ForceSendFields []string `json:"-"`
790
791
792
793
794 NullFields []string `json:"-"`
795 }
796
797 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
798 type NoMethod SetIamPolicyRequest
799 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
800 }
801
802
803
804
805
806
807
808 type Status struct {
809
810 Code int64 `json:"code,omitempty"`
811
812
813 Details []googleapi.RawMessage `json:"details,omitempty"`
814
815
816
817 Message string `json:"message,omitempty"`
818
819
820
821
822
823 ForceSendFields []string `json:"-"`
824
825
826
827
828 NullFields []string `json:"-"`
829 }
830
831 func (s *Status) MarshalJSON() ([]byte, error) {
832 type NoMethod Status
833 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
834 }
835
836
837 type TestIamPermissionsRequest struct {
838
839
840
841
842 Permissions []string `json:"permissions,omitempty"`
843
844
845
846
847
848 ForceSendFields []string `json:"-"`
849
850
851
852
853 NullFields []string `json:"-"`
854 }
855
856 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
857 type NoMethod TestIamPermissionsRequest
858 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
859 }
860
861
862
863 type TestIamPermissionsResponse struct {
864
865
866 Permissions []string `json:"permissions,omitempty"`
867
868
869 googleapi.ServerResponse `json:"-"`
870
871
872
873
874
875 ForceSendFields []string `json:"-"`
876
877
878
879
880 NullFields []string `json:"-"`
881 }
882
883 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
884 type NoMethod TestIamPermissionsResponse
885 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
886 }
887
888 type ProjectsLocationsGetCall struct {
889 s *Service
890 name string
891 urlParams_ gensupport.URLParams
892 ifNoneMatch_ string
893 ctx_ context.Context
894 header_ http.Header
895 }
896
897
898
899
900 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
901 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
902 c.name = name
903 return c
904 }
905
906
907
908
909 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
910 c.urlParams_.Set("fields", googleapi.CombineFields(s))
911 return c
912 }
913
914
915
916
917 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
918 c.ifNoneMatch_ = entityTag
919 return c
920 }
921
922
923 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
924 c.ctx_ = ctx
925 return c
926 }
927
928
929
930 func (c *ProjectsLocationsGetCall) Header() http.Header {
931 if c.header_ == nil {
932 c.header_ = make(http.Header)
933 }
934 return c.header_
935 }
936
937 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
938 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
939 if c.ifNoneMatch_ != "" {
940 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
941 }
942 var body io.Reader = nil
943 c.urlParams_.Set("alt", alt)
944 c.urlParams_.Set("prettyPrint", "false")
945 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
946 urls += "?" + c.urlParams_.Encode()
947 req, err := http.NewRequest("GET", urls, body)
948 if err != nil {
949 return nil, err
950 }
951 req.Header = reqHeaders
952 googleapi.Expand(req.URL, map[string]string{
953 "name": c.name,
954 })
955 return gensupport.SendRequest(c.ctx_, c.s.client, req)
956 }
957
958
959
960
961
962
963 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
964 gensupport.SetOptions(c.urlParams_, opts...)
965 res, err := c.doRequest("json")
966 if res != nil && res.StatusCode == http.StatusNotModified {
967 if res.Body != nil {
968 res.Body.Close()
969 }
970 return nil, gensupport.WrapError(&googleapi.Error{
971 Code: res.StatusCode,
972 Header: res.Header,
973 })
974 }
975 if err != nil {
976 return nil, err
977 }
978 defer googleapi.CloseBody(res)
979 if err := googleapi.CheckResponse(res); err != nil {
980 return nil, gensupport.WrapError(err)
981 }
982 ret := &Location{
983 ServerResponse: googleapi.ServerResponse{
984 Header: res.Header,
985 HTTPStatusCode: res.StatusCode,
986 },
987 }
988 target := &ret
989 if err := gensupport.DecodeResponse(target, res); err != nil {
990 return nil, err
991 }
992 return ret, nil
993 }
994
995 type ProjectsLocationsListCall struct {
996 s *Service
997 name string
998 urlParams_ gensupport.URLParams
999 ifNoneMatch_ string
1000 ctx_ context.Context
1001 header_ http.Header
1002 }
1003
1004
1005
1006
1007 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1008 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1009 c.name = name
1010 return c
1011 }
1012
1013
1014
1015
1016
1017 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1018 c.urlParams_.Set("filter", filter)
1019 return c
1020 }
1021
1022
1023
1024 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1025 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1026 return c
1027 }
1028
1029
1030
1031
1032 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1033 c.urlParams_.Set("pageToken", pageToken)
1034 return c
1035 }
1036
1037
1038
1039
1040 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1041 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1042 return c
1043 }
1044
1045
1046
1047
1048 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1049 c.ifNoneMatch_ = entityTag
1050 return c
1051 }
1052
1053
1054 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1055 c.ctx_ = ctx
1056 return c
1057 }
1058
1059
1060
1061 func (c *ProjectsLocationsListCall) Header() http.Header {
1062 if c.header_ == nil {
1063 c.header_ = make(http.Header)
1064 }
1065 return c.header_
1066 }
1067
1068 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1069 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1070 if c.ifNoneMatch_ != "" {
1071 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1072 }
1073 var body io.Reader = nil
1074 c.urlParams_.Set("alt", alt)
1075 c.urlParams_.Set("prettyPrint", "false")
1076 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
1077 urls += "?" + c.urlParams_.Encode()
1078 req, err := http.NewRequest("GET", urls, body)
1079 if err != nil {
1080 return nil, err
1081 }
1082 req.Header = reqHeaders
1083 googleapi.Expand(req.URL, map[string]string{
1084 "name": c.name,
1085 })
1086 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1087 }
1088
1089
1090
1091
1092
1093
1094
1095 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1096 gensupport.SetOptions(c.urlParams_, opts...)
1097 res, err := c.doRequest("json")
1098 if res != nil && res.StatusCode == http.StatusNotModified {
1099 if res.Body != nil {
1100 res.Body.Close()
1101 }
1102 return nil, gensupport.WrapError(&googleapi.Error{
1103 Code: res.StatusCode,
1104 Header: res.Header,
1105 })
1106 }
1107 if err != nil {
1108 return nil, err
1109 }
1110 defer googleapi.CloseBody(res)
1111 if err := googleapi.CheckResponse(res); err != nil {
1112 return nil, gensupport.WrapError(err)
1113 }
1114 ret := &ListLocationsResponse{
1115 ServerResponse: googleapi.ServerResponse{
1116 Header: res.Header,
1117 HTTPStatusCode: res.StatusCode,
1118 },
1119 }
1120 target := &ret
1121 if err := gensupport.DecodeResponse(target, res); err != nil {
1122 return nil, err
1123 }
1124 return ret, nil
1125 }
1126
1127
1128
1129
1130 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1131 c.ctx_ = ctx
1132 defer c.PageToken(c.urlParams_.Get("pageToken"))
1133 for {
1134 x, err := c.Do()
1135 if err != nil {
1136 return err
1137 }
1138 if err := f(x); err != nil {
1139 return err
1140 }
1141 if x.NextPageToken == "" {
1142 return nil
1143 }
1144 c.PageToken(x.NextPageToken)
1145 }
1146 }
1147
1148 type ProjectsLocationsEndpointsCreateCall struct {
1149 s *Service
1150 parent string
1151 endpoint *Endpoint
1152 urlParams_ gensupport.URLParams
1153 ctx_ context.Context
1154 header_ http.Header
1155 }
1156
1157
1158
1159
1160 func (r *ProjectsLocationsEndpointsService) Create(parent string, endpoint *Endpoint) *ProjectsLocationsEndpointsCreateCall {
1161 c := &ProjectsLocationsEndpointsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1162 c.parent = parent
1163 c.endpoint = endpoint
1164 return c
1165 }
1166
1167
1168
1169
1170
1171
1172 func (c *ProjectsLocationsEndpointsCreateCall) EndpointId(endpointId string) *ProjectsLocationsEndpointsCreateCall {
1173 c.urlParams_.Set("endpointId", endpointId)
1174 return c
1175 }
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188 func (c *ProjectsLocationsEndpointsCreateCall) RequestId(requestId string) *ProjectsLocationsEndpointsCreateCall {
1189 c.urlParams_.Set("requestId", requestId)
1190 return c
1191 }
1192
1193
1194
1195
1196 func (c *ProjectsLocationsEndpointsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointsCreateCall {
1197 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1198 return c
1199 }
1200
1201
1202 func (c *ProjectsLocationsEndpointsCreateCall) Context(ctx context.Context) *ProjectsLocationsEndpointsCreateCall {
1203 c.ctx_ = ctx
1204 return c
1205 }
1206
1207
1208
1209 func (c *ProjectsLocationsEndpointsCreateCall) Header() http.Header {
1210 if c.header_ == nil {
1211 c.header_ = make(http.Header)
1212 }
1213 return c.header_
1214 }
1215
1216 func (c *ProjectsLocationsEndpointsCreateCall) doRequest(alt string) (*http.Response, error) {
1217 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1218 var body io.Reader = nil
1219 body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint)
1220 if err != nil {
1221 return nil, err
1222 }
1223 c.urlParams_.Set("alt", alt)
1224 c.urlParams_.Set("prettyPrint", "false")
1225 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpoints")
1226 urls += "?" + c.urlParams_.Encode()
1227 req, err := http.NewRequest("POST", urls, body)
1228 if err != nil {
1229 return nil, err
1230 }
1231 req.Header = reqHeaders
1232 googleapi.Expand(req.URL, map[string]string{
1233 "parent": c.parent,
1234 })
1235 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1236 }
1237
1238
1239
1240
1241
1242
1243 func (c *ProjectsLocationsEndpointsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1244 gensupport.SetOptions(c.urlParams_, opts...)
1245 res, err := c.doRequest("json")
1246 if res != nil && res.StatusCode == http.StatusNotModified {
1247 if res.Body != nil {
1248 res.Body.Close()
1249 }
1250 return nil, gensupport.WrapError(&googleapi.Error{
1251 Code: res.StatusCode,
1252 Header: res.Header,
1253 })
1254 }
1255 if err != nil {
1256 return nil, err
1257 }
1258 defer googleapi.CloseBody(res)
1259 if err := googleapi.CheckResponse(res); err != nil {
1260 return nil, gensupport.WrapError(err)
1261 }
1262 ret := &Operation{
1263 ServerResponse: googleapi.ServerResponse{
1264 Header: res.Header,
1265 HTTPStatusCode: res.StatusCode,
1266 },
1267 }
1268 target := &ret
1269 if err := gensupport.DecodeResponse(target, res); err != nil {
1270 return nil, err
1271 }
1272 return ret, nil
1273 }
1274
1275 type ProjectsLocationsEndpointsDeleteCall struct {
1276 s *Service
1277 name string
1278 urlParams_ gensupport.URLParams
1279 ctx_ context.Context
1280 header_ http.Header
1281 }
1282
1283
1284
1285
1286 func (r *ProjectsLocationsEndpointsService) Delete(name string) *ProjectsLocationsEndpointsDeleteCall {
1287 c := &ProjectsLocationsEndpointsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1288 c.name = name
1289 return c
1290 }
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303 func (c *ProjectsLocationsEndpointsDeleteCall) RequestId(requestId string) *ProjectsLocationsEndpointsDeleteCall {
1304 c.urlParams_.Set("requestId", requestId)
1305 return c
1306 }
1307
1308
1309
1310
1311 func (c *ProjectsLocationsEndpointsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointsDeleteCall {
1312 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1313 return c
1314 }
1315
1316
1317 func (c *ProjectsLocationsEndpointsDeleteCall) Context(ctx context.Context) *ProjectsLocationsEndpointsDeleteCall {
1318 c.ctx_ = ctx
1319 return c
1320 }
1321
1322
1323
1324 func (c *ProjectsLocationsEndpointsDeleteCall) Header() http.Header {
1325 if c.header_ == nil {
1326 c.header_ = make(http.Header)
1327 }
1328 return c.header_
1329 }
1330
1331 func (c *ProjectsLocationsEndpointsDeleteCall) doRequest(alt string) (*http.Response, error) {
1332 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1333 var body io.Reader = nil
1334 c.urlParams_.Set("alt", alt)
1335 c.urlParams_.Set("prettyPrint", "false")
1336 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1337 urls += "?" + c.urlParams_.Encode()
1338 req, err := http.NewRequest("DELETE", urls, body)
1339 if err != nil {
1340 return nil, err
1341 }
1342 req.Header = reqHeaders
1343 googleapi.Expand(req.URL, map[string]string{
1344 "name": c.name,
1345 })
1346 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1347 }
1348
1349
1350
1351
1352
1353
1354 func (c *ProjectsLocationsEndpointsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1355 gensupport.SetOptions(c.urlParams_, opts...)
1356 res, err := c.doRequest("json")
1357 if res != nil && res.StatusCode == http.StatusNotModified {
1358 if res.Body != nil {
1359 res.Body.Close()
1360 }
1361 return nil, gensupport.WrapError(&googleapi.Error{
1362 Code: res.StatusCode,
1363 Header: res.Header,
1364 })
1365 }
1366 if err != nil {
1367 return nil, err
1368 }
1369 defer googleapi.CloseBody(res)
1370 if err := googleapi.CheckResponse(res); err != nil {
1371 return nil, gensupport.WrapError(err)
1372 }
1373 ret := &Operation{
1374 ServerResponse: googleapi.ServerResponse{
1375 Header: res.Header,
1376 HTTPStatusCode: res.StatusCode,
1377 },
1378 }
1379 target := &ret
1380 if err := gensupport.DecodeResponse(target, res); err != nil {
1381 return nil, err
1382 }
1383 return ret, nil
1384 }
1385
1386 type ProjectsLocationsEndpointsGetCall struct {
1387 s *Service
1388 name string
1389 urlParams_ gensupport.URLParams
1390 ifNoneMatch_ string
1391 ctx_ context.Context
1392 header_ http.Header
1393 }
1394
1395
1396
1397
1398
1399 func (r *ProjectsLocationsEndpointsService) Get(name string) *ProjectsLocationsEndpointsGetCall {
1400 c := &ProjectsLocationsEndpointsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1401 c.name = name
1402 return c
1403 }
1404
1405
1406
1407
1408 func (c *ProjectsLocationsEndpointsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointsGetCall {
1409 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1410 return c
1411 }
1412
1413
1414
1415
1416 func (c *ProjectsLocationsEndpointsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEndpointsGetCall {
1417 c.ifNoneMatch_ = entityTag
1418 return c
1419 }
1420
1421
1422 func (c *ProjectsLocationsEndpointsGetCall) Context(ctx context.Context) *ProjectsLocationsEndpointsGetCall {
1423 c.ctx_ = ctx
1424 return c
1425 }
1426
1427
1428
1429 func (c *ProjectsLocationsEndpointsGetCall) Header() http.Header {
1430 if c.header_ == nil {
1431 c.header_ = make(http.Header)
1432 }
1433 return c.header_
1434 }
1435
1436 func (c *ProjectsLocationsEndpointsGetCall) doRequest(alt string) (*http.Response, error) {
1437 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1438 if c.ifNoneMatch_ != "" {
1439 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1440 }
1441 var body io.Reader = nil
1442 c.urlParams_.Set("alt", alt)
1443 c.urlParams_.Set("prettyPrint", "false")
1444 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1445 urls += "?" + c.urlParams_.Encode()
1446 req, err := http.NewRequest("GET", urls, body)
1447 if err != nil {
1448 return nil, err
1449 }
1450 req.Header = reqHeaders
1451 googleapi.Expand(req.URL, map[string]string{
1452 "name": c.name,
1453 })
1454 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1455 }
1456
1457
1458
1459
1460
1461
1462 func (c *ProjectsLocationsEndpointsGetCall) Do(opts ...googleapi.CallOption) (*Endpoint, error) {
1463 gensupport.SetOptions(c.urlParams_, opts...)
1464 res, err := c.doRequest("json")
1465 if res != nil && res.StatusCode == http.StatusNotModified {
1466 if res.Body != nil {
1467 res.Body.Close()
1468 }
1469 return nil, gensupport.WrapError(&googleapi.Error{
1470 Code: res.StatusCode,
1471 Header: res.Header,
1472 })
1473 }
1474 if err != nil {
1475 return nil, err
1476 }
1477 defer googleapi.CloseBody(res)
1478 if err := googleapi.CheckResponse(res); err != nil {
1479 return nil, gensupport.WrapError(err)
1480 }
1481 ret := &Endpoint{
1482 ServerResponse: googleapi.ServerResponse{
1483 Header: res.Header,
1484 HTTPStatusCode: res.StatusCode,
1485 },
1486 }
1487 target := &ret
1488 if err := gensupport.DecodeResponse(target, res); err != nil {
1489 return nil, err
1490 }
1491 return ret, nil
1492 }
1493
1494 type ProjectsLocationsEndpointsGetIamPolicyCall struct {
1495 s *Service
1496 resource string
1497 urlParams_ gensupport.URLParams
1498 ifNoneMatch_ string
1499 ctx_ context.Context
1500 header_ http.Header
1501 }
1502
1503
1504
1505
1506
1507
1508
1509 func (r *ProjectsLocationsEndpointsService) GetIamPolicy(resource string) *ProjectsLocationsEndpointsGetIamPolicyCall {
1510 c := &ProjectsLocationsEndpointsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1511 c.resource = resource
1512 return c
1513 }
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527 func (c *ProjectsLocationsEndpointsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsEndpointsGetIamPolicyCall {
1528 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
1529 return c
1530 }
1531
1532
1533
1534
1535 func (c *ProjectsLocationsEndpointsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointsGetIamPolicyCall {
1536 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1537 return c
1538 }
1539
1540
1541
1542
1543 func (c *ProjectsLocationsEndpointsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsEndpointsGetIamPolicyCall {
1544 c.ifNoneMatch_ = entityTag
1545 return c
1546 }
1547
1548
1549 func (c *ProjectsLocationsEndpointsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEndpointsGetIamPolicyCall {
1550 c.ctx_ = ctx
1551 return c
1552 }
1553
1554
1555
1556 func (c *ProjectsLocationsEndpointsGetIamPolicyCall) Header() http.Header {
1557 if c.header_ == nil {
1558 c.header_ = make(http.Header)
1559 }
1560 return c.header_
1561 }
1562
1563 func (c *ProjectsLocationsEndpointsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1564 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1565 if c.ifNoneMatch_ != "" {
1566 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1567 }
1568 var body io.Reader = nil
1569 c.urlParams_.Set("alt", alt)
1570 c.urlParams_.Set("prettyPrint", "false")
1571 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
1572 urls += "?" + c.urlParams_.Encode()
1573 req, err := http.NewRequest("GET", urls, body)
1574 if err != nil {
1575 return nil, err
1576 }
1577 req.Header = reqHeaders
1578 googleapi.Expand(req.URL, map[string]string{
1579 "resource": c.resource,
1580 })
1581 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1582 }
1583
1584
1585
1586
1587
1588
1589 func (c *ProjectsLocationsEndpointsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1590 gensupport.SetOptions(c.urlParams_, opts...)
1591 res, err := c.doRequest("json")
1592 if res != nil && res.StatusCode == http.StatusNotModified {
1593 if res.Body != nil {
1594 res.Body.Close()
1595 }
1596 return nil, gensupport.WrapError(&googleapi.Error{
1597 Code: res.StatusCode,
1598 Header: res.Header,
1599 })
1600 }
1601 if err != nil {
1602 return nil, err
1603 }
1604 defer googleapi.CloseBody(res)
1605 if err := googleapi.CheckResponse(res); err != nil {
1606 return nil, gensupport.WrapError(err)
1607 }
1608 ret := &Policy{
1609 ServerResponse: googleapi.ServerResponse{
1610 Header: res.Header,
1611 HTTPStatusCode: res.StatusCode,
1612 },
1613 }
1614 target := &ret
1615 if err := gensupport.DecodeResponse(target, res); err != nil {
1616 return nil, err
1617 }
1618 return ret, nil
1619 }
1620
1621 type ProjectsLocationsEndpointsListCall struct {
1622 s *Service
1623 parent string
1624 urlParams_ gensupport.URLParams
1625 ifNoneMatch_ string
1626 ctx_ context.Context
1627 header_ http.Header
1628 }
1629
1630
1631
1632
1633 func (r *ProjectsLocationsEndpointsService) List(parent string) *ProjectsLocationsEndpointsListCall {
1634 c := &ProjectsLocationsEndpointsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1635 c.parent = parent
1636 return c
1637 }
1638
1639
1640
1641 func (c *ProjectsLocationsEndpointsListCall) Filter(filter string) *ProjectsLocationsEndpointsListCall {
1642 c.urlParams_.Set("filter", filter)
1643 return c
1644 }
1645
1646
1647
1648 func (c *ProjectsLocationsEndpointsListCall) OrderBy(orderBy string) *ProjectsLocationsEndpointsListCall {
1649 c.urlParams_.Set("orderBy", orderBy)
1650 return c
1651 }
1652
1653
1654
1655 func (c *ProjectsLocationsEndpointsListCall) PageSize(pageSize int64) *ProjectsLocationsEndpointsListCall {
1656 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1657 return c
1658 }
1659
1660
1661
1662
1663
1664 func (c *ProjectsLocationsEndpointsListCall) PageToken(pageToken string) *ProjectsLocationsEndpointsListCall {
1665 c.urlParams_.Set("pageToken", pageToken)
1666 return c
1667 }
1668
1669
1670
1671
1672 func (c *ProjectsLocationsEndpointsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointsListCall {
1673 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1674 return c
1675 }
1676
1677
1678
1679
1680 func (c *ProjectsLocationsEndpointsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEndpointsListCall {
1681 c.ifNoneMatch_ = entityTag
1682 return c
1683 }
1684
1685
1686 func (c *ProjectsLocationsEndpointsListCall) Context(ctx context.Context) *ProjectsLocationsEndpointsListCall {
1687 c.ctx_ = ctx
1688 return c
1689 }
1690
1691
1692
1693 func (c *ProjectsLocationsEndpointsListCall) Header() http.Header {
1694 if c.header_ == nil {
1695 c.header_ = make(http.Header)
1696 }
1697 return c.header_
1698 }
1699
1700 func (c *ProjectsLocationsEndpointsListCall) doRequest(alt string) (*http.Response, error) {
1701 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1702 if c.ifNoneMatch_ != "" {
1703 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1704 }
1705 var body io.Reader = nil
1706 c.urlParams_.Set("alt", alt)
1707 c.urlParams_.Set("prettyPrint", "false")
1708 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/endpoints")
1709 urls += "?" + c.urlParams_.Encode()
1710 req, err := http.NewRequest("GET", urls, body)
1711 if err != nil {
1712 return nil, err
1713 }
1714 req.Header = reqHeaders
1715 googleapi.Expand(req.URL, map[string]string{
1716 "parent": c.parent,
1717 })
1718 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1719 }
1720
1721
1722
1723
1724
1725
1726
1727 func (c *ProjectsLocationsEndpointsListCall) Do(opts ...googleapi.CallOption) (*ListEndpointsResponse, error) {
1728 gensupport.SetOptions(c.urlParams_, opts...)
1729 res, err := c.doRequest("json")
1730 if res != nil && res.StatusCode == http.StatusNotModified {
1731 if res.Body != nil {
1732 res.Body.Close()
1733 }
1734 return nil, gensupport.WrapError(&googleapi.Error{
1735 Code: res.StatusCode,
1736 Header: res.Header,
1737 })
1738 }
1739 if err != nil {
1740 return nil, err
1741 }
1742 defer googleapi.CloseBody(res)
1743 if err := googleapi.CheckResponse(res); err != nil {
1744 return nil, gensupport.WrapError(err)
1745 }
1746 ret := &ListEndpointsResponse{
1747 ServerResponse: googleapi.ServerResponse{
1748 Header: res.Header,
1749 HTTPStatusCode: res.StatusCode,
1750 },
1751 }
1752 target := &ret
1753 if err := gensupport.DecodeResponse(target, res); err != nil {
1754 return nil, err
1755 }
1756 return ret, nil
1757 }
1758
1759
1760
1761
1762 func (c *ProjectsLocationsEndpointsListCall) Pages(ctx context.Context, f func(*ListEndpointsResponse) error) error {
1763 c.ctx_ = ctx
1764 defer c.PageToken(c.urlParams_.Get("pageToken"))
1765 for {
1766 x, err := c.Do()
1767 if err != nil {
1768 return err
1769 }
1770 if err := f(x); err != nil {
1771 return err
1772 }
1773 if x.NextPageToken == "" {
1774 return nil
1775 }
1776 c.PageToken(x.NextPageToken)
1777 }
1778 }
1779
1780 type ProjectsLocationsEndpointsPatchCall struct {
1781 s *Service
1782 name string
1783 endpoint *Endpoint
1784 urlParams_ gensupport.URLParams
1785 ctx_ context.Context
1786 header_ http.Header
1787 }
1788
1789
1790
1791
1792 func (r *ProjectsLocationsEndpointsService) Patch(name string, endpoint *Endpoint) *ProjectsLocationsEndpointsPatchCall {
1793 c := &ProjectsLocationsEndpointsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1794 c.name = name
1795 c.endpoint = endpoint
1796 return c
1797 }
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810 func (c *ProjectsLocationsEndpointsPatchCall) RequestId(requestId string) *ProjectsLocationsEndpointsPatchCall {
1811 c.urlParams_.Set("requestId", requestId)
1812 return c
1813 }
1814
1815
1816
1817
1818
1819
1820 func (c *ProjectsLocationsEndpointsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsEndpointsPatchCall {
1821 c.urlParams_.Set("updateMask", updateMask)
1822 return c
1823 }
1824
1825
1826
1827
1828 func (c *ProjectsLocationsEndpointsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointsPatchCall {
1829 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1830 return c
1831 }
1832
1833
1834 func (c *ProjectsLocationsEndpointsPatchCall) Context(ctx context.Context) *ProjectsLocationsEndpointsPatchCall {
1835 c.ctx_ = ctx
1836 return c
1837 }
1838
1839
1840
1841 func (c *ProjectsLocationsEndpointsPatchCall) Header() http.Header {
1842 if c.header_ == nil {
1843 c.header_ = make(http.Header)
1844 }
1845 return c.header_
1846 }
1847
1848 func (c *ProjectsLocationsEndpointsPatchCall) doRequest(alt string) (*http.Response, error) {
1849 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1850 var body io.Reader = nil
1851 body, err := googleapi.WithoutDataWrapper.JSONReader(c.endpoint)
1852 if err != nil {
1853 return nil, err
1854 }
1855 c.urlParams_.Set("alt", alt)
1856 c.urlParams_.Set("prettyPrint", "false")
1857 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1858 urls += "?" + c.urlParams_.Encode()
1859 req, err := http.NewRequest("PATCH", urls, body)
1860 if err != nil {
1861 return nil, err
1862 }
1863 req.Header = reqHeaders
1864 googleapi.Expand(req.URL, map[string]string{
1865 "name": c.name,
1866 })
1867 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1868 }
1869
1870
1871
1872
1873
1874
1875 func (c *ProjectsLocationsEndpointsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1876 gensupport.SetOptions(c.urlParams_, opts...)
1877 res, err := c.doRequest("json")
1878 if res != nil && res.StatusCode == http.StatusNotModified {
1879 if res.Body != nil {
1880 res.Body.Close()
1881 }
1882 return nil, gensupport.WrapError(&googleapi.Error{
1883 Code: res.StatusCode,
1884 Header: res.Header,
1885 })
1886 }
1887 if err != nil {
1888 return nil, err
1889 }
1890 defer googleapi.CloseBody(res)
1891 if err := googleapi.CheckResponse(res); err != nil {
1892 return nil, gensupport.WrapError(err)
1893 }
1894 ret := &Operation{
1895 ServerResponse: googleapi.ServerResponse{
1896 Header: res.Header,
1897 HTTPStatusCode: res.StatusCode,
1898 },
1899 }
1900 target := &ret
1901 if err := gensupport.DecodeResponse(target, res); err != nil {
1902 return nil, err
1903 }
1904 return ret, nil
1905 }
1906
1907 type ProjectsLocationsEndpointsSetIamPolicyCall struct {
1908 s *Service
1909 resource string
1910 setiampolicyrequest *SetIamPolicyRequest
1911 urlParams_ gensupport.URLParams
1912 ctx_ context.Context
1913 header_ http.Header
1914 }
1915
1916
1917
1918
1919
1920
1921
1922
1923 func (r *ProjectsLocationsEndpointsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsEndpointsSetIamPolicyCall {
1924 c := &ProjectsLocationsEndpointsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1925 c.resource = resource
1926 c.setiampolicyrequest = setiampolicyrequest
1927 return c
1928 }
1929
1930
1931
1932
1933 func (c *ProjectsLocationsEndpointsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointsSetIamPolicyCall {
1934 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1935 return c
1936 }
1937
1938
1939 func (c *ProjectsLocationsEndpointsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsEndpointsSetIamPolicyCall {
1940 c.ctx_ = ctx
1941 return c
1942 }
1943
1944
1945
1946 func (c *ProjectsLocationsEndpointsSetIamPolicyCall) Header() http.Header {
1947 if c.header_ == nil {
1948 c.header_ = make(http.Header)
1949 }
1950 return c.header_
1951 }
1952
1953 func (c *ProjectsLocationsEndpointsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
1954 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1955 var body io.Reader = nil
1956 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
1957 if err != nil {
1958 return nil, err
1959 }
1960 c.urlParams_.Set("alt", alt)
1961 c.urlParams_.Set("prettyPrint", "false")
1962 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
1963 urls += "?" + c.urlParams_.Encode()
1964 req, err := http.NewRequest("POST", urls, body)
1965 if err != nil {
1966 return nil, err
1967 }
1968 req.Header = reqHeaders
1969 googleapi.Expand(req.URL, map[string]string{
1970 "resource": c.resource,
1971 })
1972 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1973 }
1974
1975
1976
1977
1978
1979
1980 func (c *ProjectsLocationsEndpointsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
1981 gensupport.SetOptions(c.urlParams_, opts...)
1982 res, err := c.doRequest("json")
1983 if res != nil && res.StatusCode == http.StatusNotModified {
1984 if res.Body != nil {
1985 res.Body.Close()
1986 }
1987 return nil, gensupport.WrapError(&googleapi.Error{
1988 Code: res.StatusCode,
1989 Header: res.Header,
1990 })
1991 }
1992 if err != nil {
1993 return nil, err
1994 }
1995 defer googleapi.CloseBody(res)
1996 if err := googleapi.CheckResponse(res); err != nil {
1997 return nil, gensupport.WrapError(err)
1998 }
1999 ret := &Policy{
2000 ServerResponse: googleapi.ServerResponse{
2001 Header: res.Header,
2002 HTTPStatusCode: res.StatusCode,
2003 },
2004 }
2005 target := &ret
2006 if err := gensupport.DecodeResponse(target, res); err != nil {
2007 return nil, err
2008 }
2009 return ret, nil
2010 }
2011
2012 type ProjectsLocationsEndpointsTestIamPermissionsCall struct {
2013 s *Service
2014 resource string
2015 testiampermissionsrequest *TestIamPermissionsRequest
2016 urlParams_ gensupport.URLParams
2017 ctx_ context.Context
2018 header_ http.Header
2019 }
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031 func (r *ProjectsLocationsEndpointsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsEndpointsTestIamPermissionsCall {
2032 c := &ProjectsLocationsEndpointsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2033 c.resource = resource
2034 c.testiampermissionsrequest = testiampermissionsrequest
2035 return c
2036 }
2037
2038
2039
2040
2041 func (c *ProjectsLocationsEndpointsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsEndpointsTestIamPermissionsCall {
2042 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2043 return c
2044 }
2045
2046
2047 func (c *ProjectsLocationsEndpointsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsEndpointsTestIamPermissionsCall {
2048 c.ctx_ = ctx
2049 return c
2050 }
2051
2052
2053
2054 func (c *ProjectsLocationsEndpointsTestIamPermissionsCall) Header() http.Header {
2055 if c.header_ == nil {
2056 c.header_ = make(http.Header)
2057 }
2058 return c.header_
2059 }
2060
2061 func (c *ProjectsLocationsEndpointsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2062 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2063 var body io.Reader = nil
2064 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
2065 if err != nil {
2066 return nil, err
2067 }
2068 c.urlParams_.Set("alt", alt)
2069 c.urlParams_.Set("prettyPrint", "false")
2070 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
2071 urls += "?" + c.urlParams_.Encode()
2072 req, err := http.NewRequest("POST", urls, body)
2073 if err != nil {
2074 return nil, err
2075 }
2076 req.Header = reqHeaders
2077 googleapi.Expand(req.URL, map[string]string{
2078 "resource": c.resource,
2079 })
2080 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2081 }
2082
2083
2084
2085
2086
2087
2088
2089 func (c *ProjectsLocationsEndpointsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2090 gensupport.SetOptions(c.urlParams_, opts...)
2091 res, err := c.doRequest("json")
2092 if res != nil && res.StatusCode == http.StatusNotModified {
2093 if res.Body != nil {
2094 res.Body.Close()
2095 }
2096 return nil, gensupport.WrapError(&googleapi.Error{
2097 Code: res.StatusCode,
2098 Header: res.Header,
2099 })
2100 }
2101 if err != nil {
2102 return nil, err
2103 }
2104 defer googleapi.CloseBody(res)
2105 if err := googleapi.CheckResponse(res); err != nil {
2106 return nil, gensupport.WrapError(err)
2107 }
2108 ret := &TestIamPermissionsResponse{
2109 ServerResponse: googleapi.ServerResponse{
2110 Header: res.Header,
2111 HTTPStatusCode: res.StatusCode,
2112 },
2113 }
2114 target := &ret
2115 if err := gensupport.DecodeResponse(target, res); err != nil {
2116 return nil, err
2117 }
2118 return ret, nil
2119 }
2120
2121 type ProjectsLocationsOperationsCancelCall struct {
2122 s *Service
2123 name string
2124 canceloperationrequest *CancelOperationRequest
2125 urlParams_ gensupport.URLParams
2126 ctx_ context.Context
2127 header_ http.Header
2128 }
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
2142 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2143 c.name = name
2144 c.canceloperationrequest = canceloperationrequest
2145 return c
2146 }
2147
2148
2149
2150
2151 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
2152 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2153 return c
2154 }
2155
2156
2157 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
2158 c.ctx_ = ctx
2159 return c
2160 }
2161
2162
2163
2164 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
2165 if c.header_ == nil {
2166 c.header_ = make(http.Header)
2167 }
2168 return c.header_
2169 }
2170
2171 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
2172 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2173 var body io.Reader = nil
2174 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
2175 if err != nil {
2176 return nil, err
2177 }
2178 c.urlParams_.Set("alt", alt)
2179 c.urlParams_.Set("prettyPrint", "false")
2180 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
2181 urls += "?" + c.urlParams_.Encode()
2182 req, err := http.NewRequest("POST", urls, body)
2183 if err != nil {
2184 return nil, err
2185 }
2186 req.Header = reqHeaders
2187 googleapi.Expand(req.URL, map[string]string{
2188 "name": c.name,
2189 })
2190 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2191 }
2192
2193
2194
2195
2196
2197
2198 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2199 gensupport.SetOptions(c.urlParams_, opts...)
2200 res, err := c.doRequest("json")
2201 if res != nil && res.StatusCode == http.StatusNotModified {
2202 if res.Body != nil {
2203 res.Body.Close()
2204 }
2205 return nil, gensupport.WrapError(&googleapi.Error{
2206 Code: res.StatusCode,
2207 Header: res.Header,
2208 })
2209 }
2210 if err != nil {
2211 return nil, err
2212 }
2213 defer googleapi.CloseBody(res)
2214 if err := googleapi.CheckResponse(res); err != nil {
2215 return nil, gensupport.WrapError(err)
2216 }
2217 ret := &Empty{
2218 ServerResponse: googleapi.ServerResponse{
2219 Header: res.Header,
2220 HTTPStatusCode: res.StatusCode,
2221 },
2222 }
2223 target := &ret
2224 if err := gensupport.DecodeResponse(target, res); err != nil {
2225 return nil, err
2226 }
2227 return ret, nil
2228 }
2229
2230 type ProjectsLocationsOperationsDeleteCall struct {
2231 s *Service
2232 name string
2233 urlParams_ gensupport.URLParams
2234 ctx_ context.Context
2235 header_ http.Header
2236 }
2237
2238
2239
2240
2241
2242
2243
2244 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
2245 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2246 c.name = name
2247 return c
2248 }
2249
2250
2251
2252
2253 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
2254 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2255 return c
2256 }
2257
2258
2259 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
2260 c.ctx_ = ctx
2261 return c
2262 }
2263
2264
2265
2266 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
2267 if c.header_ == nil {
2268 c.header_ = make(http.Header)
2269 }
2270 return c.header_
2271 }
2272
2273 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
2274 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2275 var body io.Reader = nil
2276 c.urlParams_.Set("alt", alt)
2277 c.urlParams_.Set("prettyPrint", "false")
2278 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2279 urls += "?" + c.urlParams_.Encode()
2280 req, err := http.NewRequest("DELETE", urls, body)
2281 if err != nil {
2282 return nil, err
2283 }
2284 req.Header = reqHeaders
2285 googleapi.Expand(req.URL, map[string]string{
2286 "name": c.name,
2287 })
2288 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2289 }
2290
2291
2292
2293
2294
2295
2296 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2297 gensupport.SetOptions(c.urlParams_, opts...)
2298 res, err := c.doRequest("json")
2299 if res != nil && res.StatusCode == http.StatusNotModified {
2300 if res.Body != nil {
2301 res.Body.Close()
2302 }
2303 return nil, gensupport.WrapError(&googleapi.Error{
2304 Code: res.StatusCode,
2305 Header: res.Header,
2306 })
2307 }
2308 if err != nil {
2309 return nil, err
2310 }
2311 defer googleapi.CloseBody(res)
2312 if err := googleapi.CheckResponse(res); err != nil {
2313 return nil, gensupport.WrapError(err)
2314 }
2315 ret := &Empty{
2316 ServerResponse: googleapi.ServerResponse{
2317 Header: res.Header,
2318 HTTPStatusCode: res.StatusCode,
2319 },
2320 }
2321 target := &ret
2322 if err := gensupport.DecodeResponse(target, res); err != nil {
2323 return nil, err
2324 }
2325 return ret, nil
2326 }
2327
2328 type ProjectsLocationsOperationsGetCall struct {
2329 s *Service
2330 name string
2331 urlParams_ gensupport.URLParams
2332 ifNoneMatch_ string
2333 ctx_ context.Context
2334 header_ http.Header
2335 }
2336
2337
2338
2339
2340
2341
2342 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
2343 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2344 c.name = name
2345 return c
2346 }
2347
2348
2349
2350
2351 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
2352 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2353 return c
2354 }
2355
2356
2357
2358
2359 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
2360 c.ifNoneMatch_ = entityTag
2361 return c
2362 }
2363
2364
2365 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
2366 c.ctx_ = ctx
2367 return c
2368 }
2369
2370
2371
2372 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
2373 if c.header_ == nil {
2374 c.header_ = make(http.Header)
2375 }
2376 return c.header_
2377 }
2378
2379 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2380 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2381 if c.ifNoneMatch_ != "" {
2382 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2383 }
2384 var body io.Reader = nil
2385 c.urlParams_.Set("alt", alt)
2386 c.urlParams_.Set("prettyPrint", "false")
2387 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2388 urls += "?" + c.urlParams_.Encode()
2389 req, err := http.NewRequest("GET", urls, body)
2390 if err != nil {
2391 return nil, err
2392 }
2393 req.Header = reqHeaders
2394 googleapi.Expand(req.URL, map[string]string{
2395 "name": c.name,
2396 })
2397 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2398 }
2399
2400
2401
2402
2403
2404
2405 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2406 gensupport.SetOptions(c.urlParams_, opts...)
2407 res, err := c.doRequest("json")
2408 if res != nil && res.StatusCode == http.StatusNotModified {
2409 if res.Body != nil {
2410 res.Body.Close()
2411 }
2412 return nil, gensupport.WrapError(&googleapi.Error{
2413 Code: res.StatusCode,
2414 Header: res.Header,
2415 })
2416 }
2417 if err != nil {
2418 return nil, err
2419 }
2420 defer googleapi.CloseBody(res)
2421 if err := googleapi.CheckResponse(res); err != nil {
2422 return nil, gensupport.WrapError(err)
2423 }
2424 ret := &Operation{
2425 ServerResponse: googleapi.ServerResponse{
2426 Header: res.Header,
2427 HTTPStatusCode: res.StatusCode,
2428 },
2429 }
2430 target := &ret
2431 if err := gensupport.DecodeResponse(target, res); err != nil {
2432 return nil, err
2433 }
2434 return ret, nil
2435 }
2436
2437 type ProjectsLocationsOperationsListCall struct {
2438 s *Service
2439 name string
2440 urlParams_ gensupport.URLParams
2441 ifNoneMatch_ string
2442 ctx_ context.Context
2443 header_ http.Header
2444 }
2445
2446
2447
2448
2449
2450 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
2451 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2452 c.name = name
2453 return c
2454 }
2455
2456
2457 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
2458 c.urlParams_.Set("filter", filter)
2459 return c
2460 }
2461
2462
2463
2464 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
2465 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2466 return c
2467 }
2468
2469
2470
2471 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
2472 c.urlParams_.Set("pageToken", pageToken)
2473 return c
2474 }
2475
2476
2477
2478
2479 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
2480 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2481 return c
2482 }
2483
2484
2485
2486
2487 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
2488 c.ifNoneMatch_ = entityTag
2489 return c
2490 }
2491
2492
2493 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
2494 c.ctx_ = ctx
2495 return c
2496 }
2497
2498
2499
2500 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
2501 if c.header_ == nil {
2502 c.header_ = make(http.Header)
2503 }
2504 return c.header_
2505 }
2506
2507 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
2508 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2509 if c.ifNoneMatch_ != "" {
2510 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2511 }
2512 var body io.Reader = nil
2513 c.urlParams_.Set("alt", alt)
2514 c.urlParams_.Set("prettyPrint", "false")
2515 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
2516 urls += "?" + c.urlParams_.Encode()
2517 req, err := http.NewRequest("GET", urls, body)
2518 if err != nil {
2519 return nil, err
2520 }
2521 req.Header = reqHeaders
2522 googleapi.Expand(req.URL, map[string]string{
2523 "name": c.name,
2524 })
2525 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2526 }
2527
2528
2529
2530
2531
2532
2533
2534 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
2535 gensupport.SetOptions(c.urlParams_, opts...)
2536 res, err := c.doRequest("json")
2537 if res != nil && res.StatusCode == http.StatusNotModified {
2538 if res.Body != nil {
2539 res.Body.Close()
2540 }
2541 return nil, gensupport.WrapError(&googleapi.Error{
2542 Code: res.StatusCode,
2543 Header: res.Header,
2544 })
2545 }
2546 if err != nil {
2547 return nil, err
2548 }
2549 defer googleapi.CloseBody(res)
2550 if err := googleapi.CheckResponse(res); err != nil {
2551 return nil, gensupport.WrapError(err)
2552 }
2553 ret := &ListOperationsResponse{
2554 ServerResponse: googleapi.ServerResponse{
2555 Header: res.Header,
2556 HTTPStatusCode: res.StatusCode,
2557 },
2558 }
2559 target := &ret
2560 if err := gensupport.DecodeResponse(target, res); err != nil {
2561 return nil, err
2562 }
2563 return ret, nil
2564 }
2565
2566
2567
2568
2569 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
2570 c.ctx_ = ctx
2571 defer c.PageToken(c.urlParams_.Get("pageToken"))
2572 for {
2573 x, err := c.Do()
2574 if err != nil {
2575 return err
2576 }
2577 if err := f(x); err != nil {
2578 return err
2579 }
2580 if x.NextPageToken == "" {
2581 return nil
2582 }
2583 c.PageToken(x.NextPageToken)
2584 }
2585 }
2586
View as plain text