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