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 blockchainnodeengine
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 = "blockchainnodeengine:v1"
90 const apiName = "blockchainnodeengine"
91 const apiVersion = "v1"
92 const basePath = "https://blockchainnodeengine.googleapis.com/"
93 const basePathTemplate = "https://blockchainnodeengine.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://blockchainnodeengine.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.BlockchainNodes = NewProjectsLocationsBlockchainNodesService(s)
172 rs.Operations = NewProjectsLocationsOperationsService(s)
173 return rs
174 }
175
176 type ProjectsLocationsService struct {
177 s *Service
178
179 BlockchainNodes *ProjectsLocationsBlockchainNodesService
180
181 Operations *ProjectsLocationsOperationsService
182 }
183
184 func NewProjectsLocationsBlockchainNodesService(s *Service) *ProjectsLocationsBlockchainNodesService {
185 rs := &ProjectsLocationsBlockchainNodesService{s: s}
186 return rs
187 }
188
189 type ProjectsLocationsBlockchainNodesService 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 type BlockchainNode struct {
204
205
206
207
208
209
210 BlockchainType string `json:"blockchainType,omitempty"`
211
212
213 ConnectionInfo *ConnectionInfo `json:"connectionInfo,omitempty"`
214
215
216 CreateTime string `json:"createTime,omitempty"`
217
218 EthereumDetails *EthereumDetails `json:"ethereumDetails,omitempty"`
219
220 Labels map[string]string `json:"labels,omitempty"`
221
222
223 Name string `json:"name,omitempty"`
224
225
226
227
228
229
230
231
232 PrivateServiceConnectEnabled bool `json:"privateServiceConnectEnabled,omitempty"`
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248 State string `json:"state,omitempty"`
249
250
251 UpdateTime string `json:"updateTime,omitempty"`
252
253
254 googleapi.ServerResponse `json:"-"`
255
256
257
258
259
260 ForceSendFields []string `json:"-"`
261
262
263
264
265 NullFields []string `json:"-"`
266 }
267
268 func (s *BlockchainNode) MarshalJSON() ([]byte, error) {
269 type NoMethod BlockchainNode
270 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
271 }
272
273
274 type CancelOperationRequest struct {
275 }
276
277
278
279 type ConnectionInfo struct {
280
281
282 EndpointInfo *EndpointInfo `json:"endpointInfo,omitempty"`
283
284
285
286
287 ServiceAttachment string `json:"serviceAttachment,omitempty"`
288
289
290
291
292
293 ForceSendFields []string `json:"-"`
294
295
296
297
298 NullFields []string `json:"-"`
299 }
300
301 func (s *ConnectionInfo) MarshalJSON() ([]byte, error) {
302 type NoMethod ConnectionInfo
303 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
304 }
305
306
307
308 type EndpointInfo struct {
309
310
311 JsonRpcApiEndpoint string `json:"jsonRpcApiEndpoint,omitempty"`
312
313
314 WebsocketsApiEndpoint string `json:"websocketsApiEndpoint,omitempty"`
315
316
317
318
319
320 ForceSendFields []string `json:"-"`
321
322
323
324
325 NullFields []string `json:"-"`
326 }
327
328 func (s *EndpointInfo) MarshalJSON() ([]byte, error) {
329 type NoMethod EndpointInfo
330 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
331 }
332
333
334 type EthereumDetails struct {
335
336 AdditionalEndpoints *EthereumEndpoints `json:"additionalEndpoints,omitempty"`
337
338
339 ApiEnableAdmin bool `json:"apiEnableAdmin,omitempty"`
340
341
342 ApiEnableDebug bool `json:"apiEnableDebug,omitempty"`
343
344
345
346
347
348
349
350
351
352
353
354
355
356 ConsensusClient string `json:"consensusClient,omitempty"`
357
358
359
360
361
362
363
364
365
366
367 ExecutionClient string `json:"executionClient,omitempty"`
368
369 GethDetails *GethDetails `json:"gethDetails,omitempty"`
370
371
372
373
374
375
376
377
378
379
380
381 Network string `json:"network,omitempty"`
382
383
384
385
386
387
388
389
390
391 NodeType string `json:"nodeType,omitempty"`
392
393
394 ValidatorConfig *ValidatorConfig `json:"validatorConfig,omitempty"`
395
396
397
398
399
400 ForceSendFields []string `json:"-"`
401
402
403
404
405 NullFields []string `json:"-"`
406 }
407
408 func (s *EthereumDetails) MarshalJSON() ([]byte, error) {
409 type NoMethod EthereumDetails
410 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
411 }
412
413
414 type EthereumEndpoints struct {
415
416
417 BeaconApiEndpoint string `json:"beaconApiEndpoint,omitempty"`
418
419
420
421
422 BeaconPrometheusMetricsApiEndpoint string `json:"beaconPrometheusMetricsApiEndpoint,omitempty"`
423
424
425 ExecutionClientPrometheusMetricsApiEndpoint string `json:"executionClientPrometheusMetricsApiEndpoint,omitempty"`
426
427
428
429
430
431 ForceSendFields []string `json:"-"`
432
433
434
435
436 NullFields []string `json:"-"`
437 }
438
439 func (s *EthereumEndpoints) MarshalJSON() ([]byte, error) {
440 type NoMethod EthereumEndpoints
441 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
442 }
443
444
445
446
447 type GethDetails struct {
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462 GarbageCollectionMode string `json:"garbageCollectionMode,omitempty"`
463
464
465
466
467
468 ForceSendFields []string `json:"-"`
469
470
471
472
473 NullFields []string `json:"-"`
474 }
475
476 func (s *GethDetails) MarshalJSON() ([]byte, error) {
477 type NoMethod GethDetails
478 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
479 }
480
481
482
483
484
485
486 type GoogleProtobufEmpty struct {
487
488 googleapi.ServerResponse `json:"-"`
489 }
490
491
492
493 type ListBlockchainNodesResponse struct {
494
495 BlockchainNodes []*BlockchainNode `json:"blockchainNodes,omitempty"`
496
497
498 NextPageToken string `json:"nextPageToken,omitempty"`
499
500 Unreachable []string `json:"unreachable,omitempty"`
501
502
503 googleapi.ServerResponse `json:"-"`
504
505
506
507
508
509 ForceSendFields []string `json:"-"`
510
511
512
513
514 NullFields []string `json:"-"`
515 }
516
517 func (s *ListBlockchainNodesResponse) MarshalJSON() ([]byte, error) {
518 type NoMethod ListBlockchainNodesResponse
519 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
520 }
521
522
523 type ListLocationsResponse struct {
524
525
526 Locations []*Location `json:"locations,omitempty"`
527
528 NextPageToken string `json:"nextPageToken,omitempty"`
529
530
531 googleapi.ServerResponse `json:"-"`
532
533
534
535
536
537 ForceSendFields []string `json:"-"`
538
539
540
541
542 NullFields []string `json:"-"`
543 }
544
545 func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
546 type NoMethod ListLocationsResponse
547 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
548 }
549
550
551 type ListOperationsResponse struct {
552
553 NextPageToken string `json:"nextPageToken,omitempty"`
554
555
556 Operations []*Operation `json:"operations,omitempty"`
557
558
559 googleapi.ServerResponse `json:"-"`
560
561
562
563
564
565 ForceSendFields []string `json:"-"`
566
567
568
569
570 NullFields []string `json:"-"`
571 }
572
573 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
574 type NoMethod ListOperationsResponse
575 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
576 }
577
578
579 type Location struct {
580
581
582 DisplayName string `json:"displayName,omitempty"`
583
584
585 Labels map[string]string `json:"labels,omitempty"`
586
587 LocationId string `json:"locationId,omitempty"`
588
589
590 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
591
592
593
594 Name string `json:"name,omitempty"`
595
596
597 googleapi.ServerResponse `json:"-"`
598
599
600
601
602
603 ForceSendFields []string `json:"-"`
604
605
606
607
608 NullFields []string `json:"-"`
609 }
610
611 func (s *Location) MarshalJSON() ([]byte, error) {
612 type NoMethod Location
613 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
614 }
615
616
617
618 type Operation struct {
619
620
621
622 Done bool `json:"done,omitempty"`
623
624 Error *Status `json:"error,omitempty"`
625
626
627
628
629 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
630
631
632
633 Name string `json:"name,omitempty"`
634
635
636
637
638
639
640
641 Response googleapi.RawMessage `json:"response,omitempty"`
642
643
644 googleapi.ServerResponse `json:"-"`
645
646
647
648
649
650 ForceSendFields []string `json:"-"`
651
652
653
654
655 NullFields []string `json:"-"`
656 }
657
658 func (s *Operation) MarshalJSON() ([]byte, error) {
659 type NoMethod Operation
660 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
661 }
662
663
664 type OperationMetadata struct {
665
666 ApiVersion string `json:"apiVersion,omitempty"`
667
668 CreateTime string `json:"createTime,omitempty"`
669
670 EndTime string `json:"endTime,omitempty"`
671
672
673
674
675 RequestedCancellation bool `json:"requestedCancellation,omitempty"`
676
677 StatusMessage string `json:"statusMessage,omitempty"`
678
679
680 Target string `json:"target,omitempty"`
681
682 Verb string `json:"verb,omitempty"`
683
684
685
686
687
688 ForceSendFields []string `json:"-"`
689
690
691
692
693 NullFields []string `json:"-"`
694 }
695
696 func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
697 type NoMethod OperationMetadata
698 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
699 }
700
701
702
703
704
705
706
707 type Status struct {
708
709 Code int64 `json:"code,omitempty"`
710
711
712 Details []googleapi.RawMessage `json:"details,omitempty"`
713
714
715
716 Message string `json:"message,omitempty"`
717
718
719
720
721
722 ForceSendFields []string `json:"-"`
723
724
725
726
727 NullFields []string `json:"-"`
728 }
729
730 func (s *Status) MarshalJSON() ([]byte, error) {
731 type NoMethod Status
732 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
733 }
734
735
736
737 type ValidatorConfig struct {
738
739
740
741
742
743
744
745 BeaconFeeRecipient string `json:"beaconFeeRecipient,omitempty"`
746
747
748 ManagedValidatorClient bool `json:"managedValidatorClient,omitempty"`
749
750
751 MevRelayUrls []string `json:"mevRelayUrls,omitempty"`
752
753
754
755
756
757 ForceSendFields []string `json:"-"`
758
759
760
761
762 NullFields []string `json:"-"`
763 }
764
765 func (s *ValidatorConfig) MarshalJSON() ([]byte, error) {
766 type NoMethod ValidatorConfig
767 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
768 }
769
770 type ProjectsLocationsGetCall struct {
771 s *Service
772 name string
773 urlParams_ gensupport.URLParams
774 ifNoneMatch_ string
775 ctx_ context.Context
776 header_ http.Header
777 }
778
779
780
781
782 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
783 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
784 c.name = name
785 return c
786 }
787
788
789
790
791 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
792 c.urlParams_.Set("fields", googleapi.CombineFields(s))
793 return c
794 }
795
796
797
798
799 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
800 c.ifNoneMatch_ = entityTag
801 return c
802 }
803
804
805 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
806 c.ctx_ = ctx
807 return c
808 }
809
810
811
812 func (c *ProjectsLocationsGetCall) Header() http.Header {
813 if c.header_ == nil {
814 c.header_ = make(http.Header)
815 }
816 return c.header_
817 }
818
819 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
820 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
821 if c.ifNoneMatch_ != "" {
822 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
823 }
824 var body io.Reader = nil
825 c.urlParams_.Set("alt", alt)
826 c.urlParams_.Set("prettyPrint", "false")
827 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
828 urls += "?" + c.urlParams_.Encode()
829 req, err := http.NewRequest("GET", urls, body)
830 if err != nil {
831 return nil, err
832 }
833 req.Header = reqHeaders
834 googleapi.Expand(req.URL, map[string]string{
835 "name": c.name,
836 })
837 return gensupport.SendRequest(c.ctx_, c.s.client, req)
838 }
839
840
841
842
843
844
845 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
846 gensupport.SetOptions(c.urlParams_, opts...)
847 res, err := c.doRequest("json")
848 if res != nil && res.StatusCode == http.StatusNotModified {
849 if res.Body != nil {
850 res.Body.Close()
851 }
852 return nil, gensupport.WrapError(&googleapi.Error{
853 Code: res.StatusCode,
854 Header: res.Header,
855 })
856 }
857 if err != nil {
858 return nil, err
859 }
860 defer googleapi.CloseBody(res)
861 if err := googleapi.CheckResponse(res); err != nil {
862 return nil, gensupport.WrapError(err)
863 }
864 ret := &Location{
865 ServerResponse: googleapi.ServerResponse{
866 Header: res.Header,
867 HTTPStatusCode: res.StatusCode,
868 },
869 }
870 target := &ret
871 if err := gensupport.DecodeResponse(target, res); err != nil {
872 return nil, err
873 }
874 return ret, nil
875 }
876
877 type ProjectsLocationsListCall struct {
878 s *Service
879 name string
880 urlParams_ gensupport.URLParams
881 ifNoneMatch_ string
882 ctx_ context.Context
883 header_ http.Header
884 }
885
886
887
888
889 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
890 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
891 c.name = name
892 return c
893 }
894
895
896
897
898
899 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
900 c.urlParams_.Set("filter", filter)
901 return c
902 }
903
904
905
906 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
907 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
908 return c
909 }
910
911
912
913
914 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
915 c.urlParams_.Set("pageToken", pageToken)
916 return c
917 }
918
919
920
921
922 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
923 c.urlParams_.Set("fields", googleapi.CombineFields(s))
924 return c
925 }
926
927
928
929
930 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
931 c.ifNoneMatch_ = entityTag
932 return c
933 }
934
935
936 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
937 c.ctx_ = ctx
938 return c
939 }
940
941
942
943 func (c *ProjectsLocationsListCall) Header() http.Header {
944 if c.header_ == nil {
945 c.header_ = make(http.Header)
946 }
947 return c.header_
948 }
949
950 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
951 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
952 if c.ifNoneMatch_ != "" {
953 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
954 }
955 var body io.Reader = nil
956 c.urlParams_.Set("alt", alt)
957 c.urlParams_.Set("prettyPrint", "false")
958 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
959 urls += "?" + c.urlParams_.Encode()
960 req, err := http.NewRequest("GET", urls, body)
961 if err != nil {
962 return nil, err
963 }
964 req.Header = reqHeaders
965 googleapi.Expand(req.URL, map[string]string{
966 "name": c.name,
967 })
968 return gensupport.SendRequest(c.ctx_, c.s.client, req)
969 }
970
971
972
973
974
975
976
977 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
978 gensupport.SetOptions(c.urlParams_, opts...)
979 res, err := c.doRequest("json")
980 if res != nil && res.StatusCode == http.StatusNotModified {
981 if res.Body != nil {
982 res.Body.Close()
983 }
984 return nil, gensupport.WrapError(&googleapi.Error{
985 Code: res.StatusCode,
986 Header: res.Header,
987 })
988 }
989 if err != nil {
990 return nil, err
991 }
992 defer googleapi.CloseBody(res)
993 if err := googleapi.CheckResponse(res); err != nil {
994 return nil, gensupport.WrapError(err)
995 }
996 ret := &ListLocationsResponse{
997 ServerResponse: googleapi.ServerResponse{
998 Header: res.Header,
999 HTTPStatusCode: res.StatusCode,
1000 },
1001 }
1002 target := &ret
1003 if err := gensupport.DecodeResponse(target, res); err != nil {
1004 return nil, err
1005 }
1006 return ret, nil
1007 }
1008
1009
1010
1011
1012 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1013 c.ctx_ = ctx
1014 defer c.PageToken(c.urlParams_.Get("pageToken"))
1015 for {
1016 x, err := c.Do()
1017 if err != nil {
1018 return err
1019 }
1020 if err := f(x); err != nil {
1021 return err
1022 }
1023 if x.NextPageToken == "" {
1024 return nil
1025 }
1026 c.PageToken(x.NextPageToken)
1027 }
1028 }
1029
1030 type ProjectsLocationsBlockchainNodesCreateCall struct {
1031 s *Service
1032 parent string
1033 blockchainnode *BlockchainNode
1034 urlParams_ gensupport.URLParams
1035 ctx_ context.Context
1036 header_ http.Header
1037 }
1038
1039
1040
1041
1042 func (r *ProjectsLocationsBlockchainNodesService) Create(parent string, blockchainnode *BlockchainNode) *ProjectsLocationsBlockchainNodesCreateCall {
1043 c := &ProjectsLocationsBlockchainNodesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1044 c.parent = parent
1045 c.blockchainnode = blockchainnode
1046 return c
1047 }
1048
1049
1050
1051 func (c *ProjectsLocationsBlockchainNodesCreateCall) BlockchainNodeId(blockchainNodeId string) *ProjectsLocationsBlockchainNodesCreateCall {
1052 c.urlParams_.Set("blockchainNodeId", blockchainNodeId)
1053 return c
1054 }
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067 func (c *ProjectsLocationsBlockchainNodesCreateCall) RequestId(requestId string) *ProjectsLocationsBlockchainNodesCreateCall {
1068 c.urlParams_.Set("requestId", requestId)
1069 return c
1070 }
1071
1072
1073
1074
1075 func (c *ProjectsLocationsBlockchainNodesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBlockchainNodesCreateCall {
1076 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1077 return c
1078 }
1079
1080
1081 func (c *ProjectsLocationsBlockchainNodesCreateCall) Context(ctx context.Context) *ProjectsLocationsBlockchainNodesCreateCall {
1082 c.ctx_ = ctx
1083 return c
1084 }
1085
1086
1087
1088 func (c *ProjectsLocationsBlockchainNodesCreateCall) Header() http.Header {
1089 if c.header_ == nil {
1090 c.header_ = make(http.Header)
1091 }
1092 return c.header_
1093 }
1094
1095 func (c *ProjectsLocationsBlockchainNodesCreateCall) doRequest(alt string) (*http.Response, error) {
1096 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1097 var body io.Reader = nil
1098 body, err := googleapi.WithoutDataWrapper.JSONReader(c.blockchainnode)
1099 if err != nil {
1100 return nil, err
1101 }
1102 c.urlParams_.Set("alt", alt)
1103 c.urlParams_.Set("prettyPrint", "false")
1104 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/blockchainNodes")
1105 urls += "?" + c.urlParams_.Encode()
1106 req, err := http.NewRequest("POST", urls, body)
1107 if err != nil {
1108 return nil, err
1109 }
1110 req.Header = reqHeaders
1111 googleapi.Expand(req.URL, map[string]string{
1112 "parent": c.parent,
1113 })
1114 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1115 }
1116
1117
1118
1119
1120
1121
1122 func (c *ProjectsLocationsBlockchainNodesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1123 gensupport.SetOptions(c.urlParams_, opts...)
1124 res, err := c.doRequest("json")
1125 if res != nil && res.StatusCode == http.StatusNotModified {
1126 if res.Body != nil {
1127 res.Body.Close()
1128 }
1129 return nil, gensupport.WrapError(&googleapi.Error{
1130 Code: res.StatusCode,
1131 Header: res.Header,
1132 })
1133 }
1134 if err != nil {
1135 return nil, err
1136 }
1137 defer googleapi.CloseBody(res)
1138 if err := googleapi.CheckResponse(res); err != nil {
1139 return nil, gensupport.WrapError(err)
1140 }
1141 ret := &Operation{
1142 ServerResponse: googleapi.ServerResponse{
1143 Header: res.Header,
1144 HTTPStatusCode: res.StatusCode,
1145 },
1146 }
1147 target := &ret
1148 if err := gensupport.DecodeResponse(target, res); err != nil {
1149 return nil, err
1150 }
1151 return ret, nil
1152 }
1153
1154 type ProjectsLocationsBlockchainNodesDeleteCall struct {
1155 s *Service
1156 name string
1157 urlParams_ gensupport.URLParams
1158 ctx_ context.Context
1159 header_ http.Header
1160 }
1161
1162
1163
1164
1165
1166 func (r *ProjectsLocationsBlockchainNodesService) Delete(name string) *ProjectsLocationsBlockchainNodesDeleteCall {
1167 c := &ProjectsLocationsBlockchainNodesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1168 c.name = name
1169 return c
1170 }
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183 func (c *ProjectsLocationsBlockchainNodesDeleteCall) RequestId(requestId string) *ProjectsLocationsBlockchainNodesDeleteCall {
1184 c.urlParams_.Set("requestId", requestId)
1185 return c
1186 }
1187
1188
1189
1190
1191 func (c *ProjectsLocationsBlockchainNodesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBlockchainNodesDeleteCall {
1192 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1193 return c
1194 }
1195
1196
1197 func (c *ProjectsLocationsBlockchainNodesDeleteCall) Context(ctx context.Context) *ProjectsLocationsBlockchainNodesDeleteCall {
1198 c.ctx_ = ctx
1199 return c
1200 }
1201
1202
1203
1204 func (c *ProjectsLocationsBlockchainNodesDeleteCall) Header() http.Header {
1205 if c.header_ == nil {
1206 c.header_ = make(http.Header)
1207 }
1208 return c.header_
1209 }
1210
1211 func (c *ProjectsLocationsBlockchainNodesDeleteCall) doRequest(alt string) (*http.Response, error) {
1212 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1213 var body io.Reader = nil
1214 c.urlParams_.Set("alt", alt)
1215 c.urlParams_.Set("prettyPrint", "false")
1216 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1217 urls += "?" + c.urlParams_.Encode()
1218 req, err := http.NewRequest("DELETE", urls, body)
1219 if err != nil {
1220 return nil, err
1221 }
1222 req.Header = reqHeaders
1223 googleapi.Expand(req.URL, map[string]string{
1224 "name": c.name,
1225 })
1226 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1227 }
1228
1229
1230
1231
1232
1233
1234 func (c *ProjectsLocationsBlockchainNodesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1235 gensupport.SetOptions(c.urlParams_, opts...)
1236 res, err := c.doRequest("json")
1237 if res != nil && res.StatusCode == http.StatusNotModified {
1238 if res.Body != nil {
1239 res.Body.Close()
1240 }
1241 return nil, gensupport.WrapError(&googleapi.Error{
1242 Code: res.StatusCode,
1243 Header: res.Header,
1244 })
1245 }
1246 if err != nil {
1247 return nil, err
1248 }
1249 defer googleapi.CloseBody(res)
1250 if err := googleapi.CheckResponse(res); err != nil {
1251 return nil, gensupport.WrapError(err)
1252 }
1253 ret := &Operation{
1254 ServerResponse: googleapi.ServerResponse{
1255 Header: res.Header,
1256 HTTPStatusCode: res.StatusCode,
1257 },
1258 }
1259 target := &ret
1260 if err := gensupport.DecodeResponse(target, res); err != nil {
1261 return nil, err
1262 }
1263 return ret, nil
1264 }
1265
1266 type ProjectsLocationsBlockchainNodesGetCall struct {
1267 s *Service
1268 name string
1269 urlParams_ gensupport.URLParams
1270 ifNoneMatch_ string
1271 ctx_ context.Context
1272 header_ http.Header
1273 }
1274
1275
1276
1277
1278
1279 func (r *ProjectsLocationsBlockchainNodesService) Get(name string) *ProjectsLocationsBlockchainNodesGetCall {
1280 c := &ProjectsLocationsBlockchainNodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1281 c.name = name
1282 return c
1283 }
1284
1285
1286
1287
1288 func (c *ProjectsLocationsBlockchainNodesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBlockchainNodesGetCall {
1289 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1290 return c
1291 }
1292
1293
1294
1295
1296 func (c *ProjectsLocationsBlockchainNodesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBlockchainNodesGetCall {
1297 c.ifNoneMatch_ = entityTag
1298 return c
1299 }
1300
1301
1302 func (c *ProjectsLocationsBlockchainNodesGetCall) Context(ctx context.Context) *ProjectsLocationsBlockchainNodesGetCall {
1303 c.ctx_ = ctx
1304 return c
1305 }
1306
1307
1308
1309 func (c *ProjectsLocationsBlockchainNodesGetCall) Header() http.Header {
1310 if c.header_ == nil {
1311 c.header_ = make(http.Header)
1312 }
1313 return c.header_
1314 }
1315
1316 func (c *ProjectsLocationsBlockchainNodesGetCall) doRequest(alt string) (*http.Response, error) {
1317 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1318 if c.ifNoneMatch_ != "" {
1319 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1320 }
1321 var body io.Reader = nil
1322 c.urlParams_.Set("alt", alt)
1323 c.urlParams_.Set("prettyPrint", "false")
1324 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1325 urls += "?" + c.urlParams_.Encode()
1326 req, err := http.NewRequest("GET", urls, body)
1327 if err != nil {
1328 return nil, err
1329 }
1330 req.Header = reqHeaders
1331 googleapi.Expand(req.URL, map[string]string{
1332 "name": c.name,
1333 })
1334 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1335 }
1336
1337
1338
1339
1340
1341
1342 func (c *ProjectsLocationsBlockchainNodesGetCall) Do(opts ...googleapi.CallOption) (*BlockchainNode, error) {
1343 gensupport.SetOptions(c.urlParams_, opts...)
1344 res, err := c.doRequest("json")
1345 if res != nil && res.StatusCode == http.StatusNotModified {
1346 if res.Body != nil {
1347 res.Body.Close()
1348 }
1349 return nil, gensupport.WrapError(&googleapi.Error{
1350 Code: res.StatusCode,
1351 Header: res.Header,
1352 })
1353 }
1354 if err != nil {
1355 return nil, err
1356 }
1357 defer googleapi.CloseBody(res)
1358 if err := googleapi.CheckResponse(res); err != nil {
1359 return nil, gensupport.WrapError(err)
1360 }
1361 ret := &BlockchainNode{
1362 ServerResponse: googleapi.ServerResponse{
1363 Header: res.Header,
1364 HTTPStatusCode: res.StatusCode,
1365 },
1366 }
1367 target := &ret
1368 if err := gensupport.DecodeResponse(target, res); err != nil {
1369 return nil, err
1370 }
1371 return ret, nil
1372 }
1373
1374 type ProjectsLocationsBlockchainNodesListCall struct {
1375 s *Service
1376 parent string
1377 urlParams_ gensupport.URLParams
1378 ifNoneMatch_ string
1379 ctx_ context.Context
1380 header_ http.Header
1381 }
1382
1383
1384
1385
1386 func (r *ProjectsLocationsBlockchainNodesService) List(parent string) *ProjectsLocationsBlockchainNodesListCall {
1387 c := &ProjectsLocationsBlockchainNodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1388 c.parent = parent
1389 return c
1390 }
1391
1392
1393 func (c *ProjectsLocationsBlockchainNodesListCall) Filter(filter string) *ProjectsLocationsBlockchainNodesListCall {
1394 c.urlParams_.Set("filter", filter)
1395 return c
1396 }
1397
1398
1399
1400 func (c *ProjectsLocationsBlockchainNodesListCall) OrderBy(orderBy string) *ProjectsLocationsBlockchainNodesListCall {
1401 c.urlParams_.Set("orderBy", orderBy)
1402 return c
1403 }
1404
1405
1406
1407
1408 func (c *ProjectsLocationsBlockchainNodesListCall) PageSize(pageSize int64) *ProjectsLocationsBlockchainNodesListCall {
1409 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1410 return c
1411 }
1412
1413
1414
1415 func (c *ProjectsLocationsBlockchainNodesListCall) PageToken(pageToken string) *ProjectsLocationsBlockchainNodesListCall {
1416 c.urlParams_.Set("pageToken", pageToken)
1417 return c
1418 }
1419
1420
1421
1422
1423 func (c *ProjectsLocationsBlockchainNodesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBlockchainNodesListCall {
1424 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1425 return c
1426 }
1427
1428
1429
1430
1431 func (c *ProjectsLocationsBlockchainNodesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBlockchainNodesListCall {
1432 c.ifNoneMatch_ = entityTag
1433 return c
1434 }
1435
1436
1437 func (c *ProjectsLocationsBlockchainNodesListCall) Context(ctx context.Context) *ProjectsLocationsBlockchainNodesListCall {
1438 c.ctx_ = ctx
1439 return c
1440 }
1441
1442
1443
1444 func (c *ProjectsLocationsBlockchainNodesListCall) Header() http.Header {
1445 if c.header_ == nil {
1446 c.header_ = make(http.Header)
1447 }
1448 return c.header_
1449 }
1450
1451 func (c *ProjectsLocationsBlockchainNodesListCall) doRequest(alt string) (*http.Response, error) {
1452 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1453 if c.ifNoneMatch_ != "" {
1454 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1455 }
1456 var body io.Reader = nil
1457 c.urlParams_.Set("alt", alt)
1458 c.urlParams_.Set("prettyPrint", "false")
1459 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/blockchainNodes")
1460 urls += "?" + c.urlParams_.Encode()
1461 req, err := http.NewRequest("GET", urls, body)
1462 if err != nil {
1463 return nil, err
1464 }
1465 req.Header = reqHeaders
1466 googleapi.Expand(req.URL, map[string]string{
1467 "parent": c.parent,
1468 })
1469 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1470 }
1471
1472
1473
1474
1475
1476
1477
1478 func (c *ProjectsLocationsBlockchainNodesListCall) Do(opts ...googleapi.CallOption) (*ListBlockchainNodesResponse, error) {
1479 gensupport.SetOptions(c.urlParams_, opts...)
1480 res, err := c.doRequest("json")
1481 if res != nil && res.StatusCode == http.StatusNotModified {
1482 if res.Body != nil {
1483 res.Body.Close()
1484 }
1485 return nil, gensupport.WrapError(&googleapi.Error{
1486 Code: res.StatusCode,
1487 Header: res.Header,
1488 })
1489 }
1490 if err != nil {
1491 return nil, err
1492 }
1493 defer googleapi.CloseBody(res)
1494 if err := googleapi.CheckResponse(res); err != nil {
1495 return nil, gensupport.WrapError(err)
1496 }
1497 ret := &ListBlockchainNodesResponse{
1498 ServerResponse: googleapi.ServerResponse{
1499 Header: res.Header,
1500 HTTPStatusCode: res.StatusCode,
1501 },
1502 }
1503 target := &ret
1504 if err := gensupport.DecodeResponse(target, res); err != nil {
1505 return nil, err
1506 }
1507 return ret, nil
1508 }
1509
1510
1511
1512
1513 func (c *ProjectsLocationsBlockchainNodesListCall) Pages(ctx context.Context, f func(*ListBlockchainNodesResponse) error) error {
1514 c.ctx_ = ctx
1515 defer c.PageToken(c.urlParams_.Get("pageToken"))
1516 for {
1517 x, err := c.Do()
1518 if err != nil {
1519 return err
1520 }
1521 if err := f(x); err != nil {
1522 return err
1523 }
1524 if x.NextPageToken == "" {
1525 return nil
1526 }
1527 c.PageToken(x.NextPageToken)
1528 }
1529 }
1530
1531 type ProjectsLocationsBlockchainNodesPatchCall struct {
1532 s *Service
1533 name string
1534 blockchainnode *BlockchainNode
1535 urlParams_ gensupport.URLParams
1536 ctx_ context.Context
1537 header_ http.Header
1538 }
1539
1540
1541
1542
1543
1544 func (r *ProjectsLocationsBlockchainNodesService) Patch(name string, blockchainnode *BlockchainNode) *ProjectsLocationsBlockchainNodesPatchCall {
1545 c := &ProjectsLocationsBlockchainNodesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1546 c.name = name
1547 c.blockchainnode = blockchainnode
1548 return c
1549 }
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562 func (c *ProjectsLocationsBlockchainNodesPatchCall) RequestId(requestId string) *ProjectsLocationsBlockchainNodesPatchCall {
1563 c.urlParams_.Set("requestId", requestId)
1564 return c
1565 }
1566
1567
1568
1569
1570
1571
1572
1573 func (c *ProjectsLocationsBlockchainNodesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBlockchainNodesPatchCall {
1574 c.urlParams_.Set("updateMask", updateMask)
1575 return c
1576 }
1577
1578
1579
1580
1581 func (c *ProjectsLocationsBlockchainNodesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBlockchainNodesPatchCall {
1582 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1583 return c
1584 }
1585
1586
1587 func (c *ProjectsLocationsBlockchainNodesPatchCall) Context(ctx context.Context) *ProjectsLocationsBlockchainNodesPatchCall {
1588 c.ctx_ = ctx
1589 return c
1590 }
1591
1592
1593
1594 func (c *ProjectsLocationsBlockchainNodesPatchCall) Header() http.Header {
1595 if c.header_ == nil {
1596 c.header_ = make(http.Header)
1597 }
1598 return c.header_
1599 }
1600
1601 func (c *ProjectsLocationsBlockchainNodesPatchCall) doRequest(alt string) (*http.Response, error) {
1602 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1603 var body io.Reader = nil
1604 body, err := googleapi.WithoutDataWrapper.JSONReader(c.blockchainnode)
1605 if err != nil {
1606 return nil, err
1607 }
1608 c.urlParams_.Set("alt", alt)
1609 c.urlParams_.Set("prettyPrint", "false")
1610 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1611 urls += "?" + c.urlParams_.Encode()
1612 req, err := http.NewRequest("PATCH", urls, body)
1613 if err != nil {
1614 return nil, err
1615 }
1616 req.Header = reqHeaders
1617 googleapi.Expand(req.URL, map[string]string{
1618 "name": c.name,
1619 })
1620 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1621 }
1622
1623
1624
1625
1626
1627
1628 func (c *ProjectsLocationsBlockchainNodesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1629 gensupport.SetOptions(c.urlParams_, opts...)
1630 res, err := c.doRequest("json")
1631 if res != nil && res.StatusCode == http.StatusNotModified {
1632 if res.Body != nil {
1633 res.Body.Close()
1634 }
1635 return nil, gensupport.WrapError(&googleapi.Error{
1636 Code: res.StatusCode,
1637 Header: res.Header,
1638 })
1639 }
1640 if err != nil {
1641 return nil, err
1642 }
1643 defer googleapi.CloseBody(res)
1644 if err := googleapi.CheckResponse(res); err != nil {
1645 return nil, gensupport.WrapError(err)
1646 }
1647 ret := &Operation{
1648 ServerResponse: googleapi.ServerResponse{
1649 Header: res.Header,
1650 HTTPStatusCode: res.StatusCode,
1651 },
1652 }
1653 target := &ret
1654 if err := gensupport.DecodeResponse(target, res); err != nil {
1655 return nil, err
1656 }
1657 return ret, nil
1658 }
1659
1660 type ProjectsLocationsOperationsCancelCall struct {
1661 s *Service
1662 name string
1663 canceloperationrequest *CancelOperationRequest
1664 urlParams_ gensupport.URLParams
1665 ctx_ context.Context
1666 header_ http.Header
1667 }
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
1681 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1682 c.name = name
1683 c.canceloperationrequest = canceloperationrequest
1684 return c
1685 }
1686
1687
1688
1689
1690 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
1691 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1692 return c
1693 }
1694
1695
1696 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
1697 c.ctx_ = ctx
1698 return c
1699 }
1700
1701
1702
1703 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
1704 if c.header_ == nil {
1705 c.header_ = make(http.Header)
1706 }
1707 return c.header_
1708 }
1709
1710 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
1711 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1712 var body io.Reader = nil
1713 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
1714 if err != nil {
1715 return nil, err
1716 }
1717 c.urlParams_.Set("alt", alt)
1718 c.urlParams_.Set("prettyPrint", "false")
1719 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
1720 urls += "?" + c.urlParams_.Encode()
1721 req, err := http.NewRequest("POST", urls, body)
1722 if err != nil {
1723 return nil, err
1724 }
1725 req.Header = reqHeaders
1726 googleapi.Expand(req.URL, map[string]string{
1727 "name": c.name,
1728 })
1729 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1730 }
1731
1732
1733
1734
1735
1736
1737
1738 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
1739 gensupport.SetOptions(c.urlParams_, opts...)
1740 res, err := c.doRequest("json")
1741 if res != nil && res.StatusCode == http.StatusNotModified {
1742 if res.Body != nil {
1743 res.Body.Close()
1744 }
1745 return nil, gensupport.WrapError(&googleapi.Error{
1746 Code: res.StatusCode,
1747 Header: res.Header,
1748 })
1749 }
1750 if err != nil {
1751 return nil, err
1752 }
1753 defer googleapi.CloseBody(res)
1754 if err := googleapi.CheckResponse(res); err != nil {
1755 return nil, gensupport.WrapError(err)
1756 }
1757 ret := &GoogleProtobufEmpty{
1758 ServerResponse: googleapi.ServerResponse{
1759 Header: res.Header,
1760 HTTPStatusCode: res.StatusCode,
1761 },
1762 }
1763 target := &ret
1764 if err := gensupport.DecodeResponse(target, res); err != nil {
1765 return nil, err
1766 }
1767 return ret, nil
1768 }
1769
1770 type ProjectsLocationsOperationsDeleteCall struct {
1771 s *Service
1772 name string
1773 urlParams_ gensupport.URLParams
1774 ctx_ context.Context
1775 header_ http.Header
1776 }
1777
1778
1779
1780
1781
1782
1783
1784 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
1785 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1786 c.name = name
1787 return c
1788 }
1789
1790
1791
1792
1793 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
1794 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1795 return c
1796 }
1797
1798
1799 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
1800 c.ctx_ = ctx
1801 return c
1802 }
1803
1804
1805
1806 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
1807 if c.header_ == nil {
1808 c.header_ = make(http.Header)
1809 }
1810 return c.header_
1811 }
1812
1813 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
1814 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1815 var body io.Reader = nil
1816 c.urlParams_.Set("alt", alt)
1817 c.urlParams_.Set("prettyPrint", "false")
1818 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1819 urls += "?" + c.urlParams_.Encode()
1820 req, err := http.NewRequest("DELETE", urls, body)
1821 if err != nil {
1822 return nil, err
1823 }
1824 req.Header = reqHeaders
1825 googleapi.Expand(req.URL, map[string]string{
1826 "name": c.name,
1827 })
1828 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1829 }
1830
1831
1832
1833
1834
1835
1836
1837 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
1838 gensupport.SetOptions(c.urlParams_, opts...)
1839 res, err := c.doRequest("json")
1840 if res != nil && res.StatusCode == http.StatusNotModified {
1841 if res.Body != nil {
1842 res.Body.Close()
1843 }
1844 return nil, gensupport.WrapError(&googleapi.Error{
1845 Code: res.StatusCode,
1846 Header: res.Header,
1847 })
1848 }
1849 if err != nil {
1850 return nil, err
1851 }
1852 defer googleapi.CloseBody(res)
1853 if err := googleapi.CheckResponse(res); err != nil {
1854 return nil, gensupport.WrapError(err)
1855 }
1856 ret := &GoogleProtobufEmpty{
1857 ServerResponse: googleapi.ServerResponse{
1858 Header: res.Header,
1859 HTTPStatusCode: res.StatusCode,
1860 },
1861 }
1862 target := &ret
1863 if err := gensupport.DecodeResponse(target, res); err != nil {
1864 return nil, err
1865 }
1866 return ret, nil
1867 }
1868
1869 type ProjectsLocationsOperationsGetCall struct {
1870 s *Service
1871 name string
1872 urlParams_ gensupport.URLParams
1873 ifNoneMatch_ string
1874 ctx_ context.Context
1875 header_ http.Header
1876 }
1877
1878
1879
1880
1881
1882
1883 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
1884 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1885 c.name = name
1886 return c
1887 }
1888
1889
1890
1891
1892 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
1893 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1894 return c
1895 }
1896
1897
1898
1899
1900 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
1901 c.ifNoneMatch_ = entityTag
1902 return c
1903 }
1904
1905
1906 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
1907 c.ctx_ = ctx
1908 return c
1909 }
1910
1911
1912
1913 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
1914 if c.header_ == nil {
1915 c.header_ = make(http.Header)
1916 }
1917 return c.header_
1918 }
1919
1920 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
1921 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1922 if c.ifNoneMatch_ != "" {
1923 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1924 }
1925 var body io.Reader = nil
1926 c.urlParams_.Set("alt", alt)
1927 c.urlParams_.Set("prettyPrint", "false")
1928 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1929 urls += "?" + c.urlParams_.Encode()
1930 req, err := http.NewRequest("GET", urls, body)
1931 if err != nil {
1932 return nil, err
1933 }
1934 req.Header = reqHeaders
1935 googleapi.Expand(req.URL, map[string]string{
1936 "name": c.name,
1937 })
1938 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1939 }
1940
1941
1942
1943
1944
1945
1946 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
1947 gensupport.SetOptions(c.urlParams_, opts...)
1948 res, err := c.doRequest("json")
1949 if res != nil && res.StatusCode == http.StatusNotModified {
1950 if res.Body != nil {
1951 res.Body.Close()
1952 }
1953 return nil, gensupport.WrapError(&googleapi.Error{
1954 Code: res.StatusCode,
1955 Header: res.Header,
1956 })
1957 }
1958 if err != nil {
1959 return nil, err
1960 }
1961 defer googleapi.CloseBody(res)
1962 if err := googleapi.CheckResponse(res); err != nil {
1963 return nil, gensupport.WrapError(err)
1964 }
1965 ret := &Operation{
1966 ServerResponse: googleapi.ServerResponse{
1967 Header: res.Header,
1968 HTTPStatusCode: res.StatusCode,
1969 },
1970 }
1971 target := &ret
1972 if err := gensupport.DecodeResponse(target, res); err != nil {
1973 return nil, err
1974 }
1975 return ret, nil
1976 }
1977
1978 type ProjectsLocationsOperationsListCall struct {
1979 s *Service
1980 name string
1981 urlParams_ gensupport.URLParams
1982 ifNoneMatch_ string
1983 ctx_ context.Context
1984 header_ http.Header
1985 }
1986
1987
1988
1989
1990
1991 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
1992 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1993 c.name = name
1994 return c
1995 }
1996
1997
1998 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
1999 c.urlParams_.Set("filter", filter)
2000 return c
2001 }
2002
2003
2004
2005 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
2006 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2007 return c
2008 }
2009
2010
2011
2012 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
2013 c.urlParams_.Set("pageToken", pageToken)
2014 return c
2015 }
2016
2017
2018
2019
2020 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
2021 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2022 return c
2023 }
2024
2025
2026
2027
2028 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
2029 c.ifNoneMatch_ = entityTag
2030 return c
2031 }
2032
2033
2034 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
2035 c.ctx_ = ctx
2036 return c
2037 }
2038
2039
2040
2041 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
2042 if c.header_ == nil {
2043 c.header_ = make(http.Header)
2044 }
2045 return c.header_
2046 }
2047
2048 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
2049 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2050 if c.ifNoneMatch_ != "" {
2051 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2052 }
2053 var body io.Reader = nil
2054 c.urlParams_.Set("alt", alt)
2055 c.urlParams_.Set("prettyPrint", "false")
2056 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
2057 urls += "?" + c.urlParams_.Encode()
2058 req, err := http.NewRequest("GET", urls, body)
2059 if err != nil {
2060 return nil, err
2061 }
2062 req.Header = reqHeaders
2063 googleapi.Expand(req.URL, map[string]string{
2064 "name": c.name,
2065 })
2066 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2067 }
2068
2069
2070
2071
2072
2073
2074
2075 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
2076 gensupport.SetOptions(c.urlParams_, opts...)
2077 res, err := c.doRequest("json")
2078 if res != nil && res.StatusCode == http.StatusNotModified {
2079 if res.Body != nil {
2080 res.Body.Close()
2081 }
2082 return nil, gensupport.WrapError(&googleapi.Error{
2083 Code: res.StatusCode,
2084 Header: res.Header,
2085 })
2086 }
2087 if err != nil {
2088 return nil, err
2089 }
2090 defer googleapi.CloseBody(res)
2091 if err := googleapi.CheckResponse(res); err != nil {
2092 return nil, gensupport.WrapError(err)
2093 }
2094 ret := &ListOperationsResponse{
2095 ServerResponse: googleapi.ServerResponse{
2096 Header: res.Header,
2097 HTTPStatusCode: res.StatusCode,
2098 },
2099 }
2100 target := &ret
2101 if err := gensupport.DecodeResponse(target, res); err != nil {
2102 return nil, err
2103 }
2104 return ret, nil
2105 }
2106
2107
2108
2109
2110 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
2111 c.ctx_ = ctx
2112 defer c.PageToken(c.urlParams_.Get("pageToken"))
2113 for {
2114 x, err := c.Do()
2115 if err != nil {
2116 return err
2117 }
2118 if err := f(x); err != nil {
2119 return err
2120 }
2121 if x.NextPageToken == "" {
2122 return nil
2123 }
2124 c.PageToken(x.NextPageToken)
2125 }
2126 }
2127
View as plain text