Skip to main content

google_cloud_blockchainnodeengine_v1/
builder.rs

1// Copyright 2026 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [BlockchainNodeEngine][crate::client::BlockchainNodeEngine].
18pub mod blockchain_node_engine {
19    use crate::Result;
20
21    /// A builder for [BlockchainNodeEngine][crate::client::BlockchainNodeEngine].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_blockchainnodeengine_v1::*;
26    /// # use builder::blockchain_node_engine::ClientBuilder;
27    /// # use client::BlockchainNodeEngine;
28    /// let builder : ClientBuilder = BlockchainNodeEngine::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://blockchainnodeengine.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::BlockchainNodeEngine;
38        pub struct Factory;
39        impl crate::ClientFactory for Factory {
40            type Client = BlockchainNodeEngine;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> crate::ClientBuilderResult<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::BlockchainNodeEngine] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
55        request: R,
56        options: crate::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [BlockchainNodeEngine::list_blockchain_nodes][crate::client::BlockchainNodeEngine::list_blockchain_nodes] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::ListBlockchainNodes;
79    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
80    /// use google_cloud_gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListBlockchainNodes {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListBlockchainNodes(RequestBuilder<crate::model::ListBlockchainNodesRequest>);
96
97    impl ListBlockchainNodes {
98        pub(crate) fn new(
99            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
100        ) -> Self {
101            Self(RequestBuilder::new(stub))
102        }
103
104        /// Sets the full request, replacing any prior values.
105        pub fn with_request<V: Into<crate::model::ListBlockchainNodesRequest>>(
106            mut self,
107            v: V,
108        ) -> Self {
109            self.0.request = v.into();
110            self
111        }
112
113        /// Sets all the options, replacing any prior values.
114        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
115            self.0.options = v.into();
116            self
117        }
118
119        /// Sends the request.
120        pub async fn send(self) -> Result<crate::model::ListBlockchainNodesResponse> {
121            (*self.0.stub)
122                .list_blockchain_nodes(self.0.request, self.0.options)
123                .await
124                .map(crate::Response::into_body)
125        }
126
127        /// Streams each page in the collection.
128        pub fn by_page(
129            self,
130        ) -> impl google_cloud_gax::paginator::Paginator<
131            crate::model::ListBlockchainNodesResponse,
132            crate::Error,
133        > {
134            use std::clone::Clone;
135            let token = self.0.request.page_token.clone();
136            let execute = move |token: String| {
137                let mut builder = self.clone();
138                builder.0.request = builder.0.request.set_page_token(token);
139                builder.send()
140            };
141            google_cloud_gax::paginator::internal::new_paginator(token, execute)
142        }
143
144        /// Streams each item in the collection.
145        pub fn by_item(
146            self,
147        ) -> impl google_cloud_gax::paginator::ItemPaginator<
148            crate::model::ListBlockchainNodesResponse,
149            crate::Error,
150        > {
151            use google_cloud_gax::paginator::Paginator;
152            self.by_page().items()
153        }
154
155        /// Sets the value of [parent][crate::model::ListBlockchainNodesRequest::parent].
156        ///
157        /// This is a **required** field for requests.
158        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
159            self.0.request.parent = v.into();
160            self
161        }
162
163        /// Sets the value of [page_size][crate::model::ListBlockchainNodesRequest::page_size].
164        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
165            self.0.request.page_size = v.into();
166            self
167        }
168
169        /// Sets the value of [page_token][crate::model::ListBlockchainNodesRequest::page_token].
170        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
171            self.0.request.page_token = v.into();
172            self
173        }
174
175        /// Sets the value of [filter][crate::model::ListBlockchainNodesRequest::filter].
176        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
177            self.0.request.filter = v.into();
178            self
179        }
180
181        /// Sets the value of [order_by][crate::model::ListBlockchainNodesRequest::order_by].
182        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
183            self.0.request.order_by = v.into();
184            self
185        }
186    }
187
188    #[doc(hidden)]
189    impl crate::RequestBuilder for ListBlockchainNodes {
190        fn request_options(&mut self) -> &mut crate::RequestOptions {
191            &mut self.0.options
192        }
193    }
194
195    /// The request builder for [BlockchainNodeEngine::get_blockchain_node][crate::client::BlockchainNodeEngine::get_blockchain_node] calls.
196    ///
197    /// # Example
198    /// ```
199    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::GetBlockchainNode;
200    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
201    ///
202    /// let builder = prepare_request_builder();
203    /// let response = builder.send().await?;
204    /// # Ok(()) }
205    ///
206    /// fn prepare_request_builder() -> GetBlockchainNode {
207    ///   # panic!();
208    ///   // ... details omitted ...
209    /// }
210    /// ```
211    #[derive(Clone, Debug)]
212    pub struct GetBlockchainNode(RequestBuilder<crate::model::GetBlockchainNodeRequest>);
213
214    impl GetBlockchainNode {
215        pub(crate) fn new(
216            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
217        ) -> Self {
218            Self(RequestBuilder::new(stub))
219        }
220
221        /// Sets the full request, replacing any prior values.
222        pub fn with_request<V: Into<crate::model::GetBlockchainNodeRequest>>(
223            mut self,
224            v: V,
225        ) -> Self {
226            self.0.request = v.into();
227            self
228        }
229
230        /// Sets all the options, replacing any prior values.
231        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
232            self.0.options = v.into();
233            self
234        }
235
236        /// Sends the request.
237        pub async fn send(self) -> Result<crate::model::BlockchainNode> {
238            (*self.0.stub)
239                .get_blockchain_node(self.0.request, self.0.options)
240                .await
241                .map(crate::Response::into_body)
242        }
243
244        /// Sets the value of [name][crate::model::GetBlockchainNodeRequest::name].
245        ///
246        /// This is a **required** field for requests.
247        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
248            self.0.request.name = v.into();
249            self
250        }
251    }
252
253    #[doc(hidden)]
254    impl crate::RequestBuilder for GetBlockchainNode {
255        fn request_options(&mut self) -> &mut crate::RequestOptions {
256            &mut self.0.options
257        }
258    }
259
260    /// The request builder for [BlockchainNodeEngine::create_blockchain_node][crate::client::BlockchainNodeEngine::create_blockchain_node] calls.
261    ///
262    /// # Example
263    /// ```
264    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::CreateBlockchainNode;
265    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
266    /// use google_cloud_lro::Poller;
267    ///
268    /// let builder = prepare_request_builder();
269    /// let response = builder.poller().until_done().await?;
270    /// # Ok(()) }
271    ///
272    /// fn prepare_request_builder() -> CreateBlockchainNode {
273    ///   # panic!();
274    ///   // ... details omitted ...
275    /// }
276    /// ```
277    #[derive(Clone, Debug)]
278    pub struct CreateBlockchainNode(RequestBuilder<crate::model::CreateBlockchainNodeRequest>);
279
280    impl CreateBlockchainNode {
281        pub(crate) fn new(
282            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
283        ) -> Self {
284            Self(RequestBuilder::new(stub))
285        }
286
287        /// Sets the full request, replacing any prior values.
288        pub fn with_request<V: Into<crate::model::CreateBlockchainNodeRequest>>(
289            mut self,
290            v: V,
291        ) -> Self {
292            self.0.request = v.into();
293            self
294        }
295
296        /// Sets all the options, replacing any prior values.
297        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
298            self.0.options = v.into();
299            self
300        }
301
302        /// Sends the request.
303        ///
304        /// # Long running operations
305        ///
306        /// This starts, but does not poll, a longrunning operation. More information
307        /// on [create_blockchain_node][crate::client::BlockchainNodeEngine::create_blockchain_node].
308        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
309            (*self.0.stub)
310                .create_blockchain_node(self.0.request, self.0.options)
311                .await
312                .map(crate::Response::into_body)
313        }
314
315        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_blockchain_node`.
316        pub fn poller(
317            self,
318        ) -> impl google_cloud_lro::Poller<crate::model::BlockchainNode, crate::model::OperationMetadata>
319        {
320            type Operation = google_cloud_lro::internal::Operation<
321                crate::model::BlockchainNode,
322                crate::model::OperationMetadata,
323            >;
324            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
325            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
326            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
327            if let Some(ref mut details) = poller_options.tracing {
328                details.method_name = "google_cloud_blockchainnodeengine_v1::client::BlockchainNodeEngine::create_blockchain_node::until_done";
329            }
330
331            let stub = self.0.stub.clone();
332            let mut options = self.0.options.clone();
333            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
334            let query = move |name| {
335                let stub = stub.clone();
336                let options = options.clone();
337                async {
338                    let op = GetOperation::new(stub)
339                        .set_name(name)
340                        .with_options(options)
341                        .send()
342                        .await?;
343                    Ok(Operation::new(op))
344                }
345            };
346
347            let start = move || async {
348                let op = self.send().await?;
349                Ok(Operation::new(op))
350            };
351
352            use google_cloud_lro::internal::PollerExt;
353            {
354                google_cloud_lro::internal::new_poller(
355                    polling_error_policy,
356                    polling_backoff_policy,
357                    start,
358                    query,
359                )
360            }
361            .with_options(poller_options)
362        }
363
364        /// Sets the value of [parent][crate::model::CreateBlockchainNodeRequest::parent].
365        ///
366        /// This is a **required** field for requests.
367        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
368            self.0.request.parent = v.into();
369            self
370        }
371
372        /// Sets the value of [blockchain_node_id][crate::model::CreateBlockchainNodeRequest::blockchain_node_id].
373        ///
374        /// This is a **required** field for requests.
375        pub fn set_blockchain_node_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
376            self.0.request.blockchain_node_id = v.into();
377            self
378        }
379
380        /// Sets the value of [blockchain_node][crate::model::CreateBlockchainNodeRequest::blockchain_node].
381        ///
382        /// This is a **required** field for requests.
383        pub fn set_blockchain_node<T>(mut self, v: T) -> Self
384        where
385            T: std::convert::Into<crate::model::BlockchainNode>,
386        {
387            self.0.request.blockchain_node = std::option::Option::Some(v.into());
388            self
389        }
390
391        /// Sets or clears the value of [blockchain_node][crate::model::CreateBlockchainNodeRequest::blockchain_node].
392        ///
393        /// This is a **required** field for requests.
394        pub fn set_or_clear_blockchain_node<T>(mut self, v: std::option::Option<T>) -> Self
395        where
396            T: std::convert::Into<crate::model::BlockchainNode>,
397        {
398            self.0.request.blockchain_node = v.map(|x| x.into());
399            self
400        }
401
402        /// Sets the value of [request_id][crate::model::CreateBlockchainNodeRequest::request_id].
403        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
404            self.0.request.request_id = v.into();
405            self
406        }
407    }
408
409    #[doc(hidden)]
410    impl crate::RequestBuilder for CreateBlockchainNode {
411        fn request_options(&mut self) -> &mut crate::RequestOptions {
412            &mut self.0.options
413        }
414    }
415
416    /// The request builder for [BlockchainNodeEngine::update_blockchain_node][crate::client::BlockchainNodeEngine::update_blockchain_node] calls.
417    ///
418    /// # Example
419    /// ```
420    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::UpdateBlockchainNode;
421    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
422    /// use google_cloud_lro::Poller;
423    ///
424    /// let builder = prepare_request_builder();
425    /// let response = builder.poller().until_done().await?;
426    /// # Ok(()) }
427    ///
428    /// fn prepare_request_builder() -> UpdateBlockchainNode {
429    ///   # panic!();
430    ///   // ... details omitted ...
431    /// }
432    /// ```
433    #[derive(Clone, Debug)]
434    pub struct UpdateBlockchainNode(RequestBuilder<crate::model::UpdateBlockchainNodeRequest>);
435
436    impl UpdateBlockchainNode {
437        pub(crate) fn new(
438            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
439        ) -> Self {
440            Self(RequestBuilder::new(stub))
441        }
442
443        /// Sets the full request, replacing any prior values.
444        pub fn with_request<V: Into<crate::model::UpdateBlockchainNodeRequest>>(
445            mut self,
446            v: V,
447        ) -> Self {
448            self.0.request = v.into();
449            self
450        }
451
452        /// Sets all the options, replacing any prior values.
453        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
454            self.0.options = v.into();
455            self
456        }
457
458        /// Sends the request.
459        ///
460        /// # Long running operations
461        ///
462        /// This starts, but does not poll, a longrunning operation. More information
463        /// on [update_blockchain_node][crate::client::BlockchainNodeEngine::update_blockchain_node].
464        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
465            (*self.0.stub)
466                .update_blockchain_node(self.0.request, self.0.options)
467                .await
468                .map(crate::Response::into_body)
469        }
470
471        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_blockchain_node`.
472        pub fn poller(
473            self,
474        ) -> impl google_cloud_lro::Poller<crate::model::BlockchainNode, crate::model::OperationMetadata>
475        {
476            type Operation = google_cloud_lro::internal::Operation<
477                crate::model::BlockchainNode,
478                crate::model::OperationMetadata,
479            >;
480            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
481            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
482            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
483            if let Some(ref mut details) = poller_options.tracing {
484                details.method_name = "google_cloud_blockchainnodeengine_v1::client::BlockchainNodeEngine::update_blockchain_node::until_done";
485            }
486
487            let stub = self.0.stub.clone();
488            let mut options = self.0.options.clone();
489            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
490            let query = move |name| {
491                let stub = stub.clone();
492                let options = options.clone();
493                async {
494                    let op = GetOperation::new(stub)
495                        .set_name(name)
496                        .with_options(options)
497                        .send()
498                        .await?;
499                    Ok(Operation::new(op))
500                }
501            };
502
503            let start = move || async {
504                let op = self.send().await?;
505                Ok(Operation::new(op))
506            };
507
508            use google_cloud_lro::internal::PollerExt;
509            {
510                google_cloud_lro::internal::new_poller(
511                    polling_error_policy,
512                    polling_backoff_policy,
513                    start,
514                    query,
515                )
516            }
517            .with_options(poller_options)
518        }
519
520        /// Sets the value of [update_mask][crate::model::UpdateBlockchainNodeRequest::update_mask].
521        ///
522        /// This is a **required** field for requests.
523        pub fn set_update_mask<T>(mut self, v: T) -> Self
524        where
525            T: std::convert::Into<wkt::FieldMask>,
526        {
527            self.0.request.update_mask = std::option::Option::Some(v.into());
528            self
529        }
530
531        /// Sets or clears the value of [update_mask][crate::model::UpdateBlockchainNodeRequest::update_mask].
532        ///
533        /// This is a **required** field for requests.
534        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
535        where
536            T: std::convert::Into<wkt::FieldMask>,
537        {
538            self.0.request.update_mask = v.map(|x| x.into());
539            self
540        }
541
542        /// Sets the value of [blockchain_node][crate::model::UpdateBlockchainNodeRequest::blockchain_node].
543        ///
544        /// This is a **required** field for requests.
545        pub fn set_blockchain_node<T>(mut self, v: T) -> Self
546        where
547            T: std::convert::Into<crate::model::BlockchainNode>,
548        {
549            self.0.request.blockchain_node = std::option::Option::Some(v.into());
550            self
551        }
552
553        /// Sets or clears the value of [blockchain_node][crate::model::UpdateBlockchainNodeRequest::blockchain_node].
554        ///
555        /// This is a **required** field for requests.
556        pub fn set_or_clear_blockchain_node<T>(mut self, v: std::option::Option<T>) -> Self
557        where
558            T: std::convert::Into<crate::model::BlockchainNode>,
559        {
560            self.0.request.blockchain_node = v.map(|x| x.into());
561            self
562        }
563
564        /// Sets the value of [request_id][crate::model::UpdateBlockchainNodeRequest::request_id].
565        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
566            self.0.request.request_id = v.into();
567            self
568        }
569    }
570
571    #[doc(hidden)]
572    impl crate::RequestBuilder for UpdateBlockchainNode {
573        fn request_options(&mut self) -> &mut crate::RequestOptions {
574            &mut self.0.options
575        }
576    }
577
578    /// The request builder for [BlockchainNodeEngine::delete_blockchain_node][crate::client::BlockchainNodeEngine::delete_blockchain_node] calls.
579    ///
580    /// # Example
581    /// ```
582    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::DeleteBlockchainNode;
583    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
584    /// use google_cloud_lro::Poller;
585    ///
586    /// let builder = prepare_request_builder();
587    /// let response = builder.poller().until_done().await?;
588    /// # Ok(()) }
589    ///
590    /// fn prepare_request_builder() -> DeleteBlockchainNode {
591    ///   # panic!();
592    ///   // ... details omitted ...
593    /// }
594    /// ```
595    #[derive(Clone, Debug)]
596    pub struct DeleteBlockchainNode(RequestBuilder<crate::model::DeleteBlockchainNodeRequest>);
597
598    impl DeleteBlockchainNode {
599        pub(crate) fn new(
600            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
601        ) -> Self {
602            Self(RequestBuilder::new(stub))
603        }
604
605        /// Sets the full request, replacing any prior values.
606        pub fn with_request<V: Into<crate::model::DeleteBlockchainNodeRequest>>(
607            mut self,
608            v: V,
609        ) -> Self {
610            self.0.request = v.into();
611            self
612        }
613
614        /// Sets all the options, replacing any prior values.
615        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
616            self.0.options = v.into();
617            self
618        }
619
620        /// Sends the request.
621        ///
622        /// # Long running operations
623        ///
624        /// This starts, but does not poll, a longrunning operation. More information
625        /// on [delete_blockchain_node][crate::client::BlockchainNodeEngine::delete_blockchain_node].
626        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
627            (*self.0.stub)
628                .delete_blockchain_node(self.0.request, self.0.options)
629                .await
630                .map(crate::Response::into_body)
631        }
632
633        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_blockchain_node`.
634        pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
635            type Operation =
636                google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
637            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
638            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
639            let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
640            if let Some(ref mut details) = poller_options.tracing {
641                details.method_name = "google_cloud_blockchainnodeengine_v1::client::BlockchainNodeEngine::delete_blockchain_node::until_done";
642            }
643
644            let stub = self.0.stub.clone();
645            let mut options = self.0.options.clone();
646            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
647            let query = move |name| {
648                let stub = stub.clone();
649                let options = options.clone();
650                async {
651                    let op = GetOperation::new(stub)
652                        .set_name(name)
653                        .with_options(options)
654                        .send()
655                        .await?;
656                    Ok(Operation::new(op))
657                }
658            };
659
660            let start = move || async {
661                let op = self.send().await?;
662                Ok(Operation::new(op))
663            };
664
665            use google_cloud_lro::internal::PollerExt;
666            {
667                google_cloud_lro::internal::new_unit_response_poller(
668                    polling_error_policy,
669                    polling_backoff_policy,
670                    start,
671                    query,
672                )
673            }
674            .with_options(poller_options)
675        }
676
677        /// Sets the value of [name][crate::model::DeleteBlockchainNodeRequest::name].
678        ///
679        /// This is a **required** field for requests.
680        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
681            self.0.request.name = v.into();
682            self
683        }
684
685        /// Sets the value of [request_id][crate::model::DeleteBlockchainNodeRequest::request_id].
686        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
687            self.0.request.request_id = v.into();
688            self
689        }
690    }
691
692    #[doc(hidden)]
693    impl crate::RequestBuilder for DeleteBlockchainNode {
694        fn request_options(&mut self) -> &mut crate::RequestOptions {
695            &mut self.0.options
696        }
697    }
698
699    /// The request builder for [BlockchainNodeEngine::list_locations][crate::client::BlockchainNodeEngine::list_locations] calls.
700    ///
701    /// # Example
702    /// ```
703    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::ListLocations;
704    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
705    /// use google_cloud_gax::paginator::ItemPaginator;
706    ///
707    /// let builder = prepare_request_builder();
708    /// let mut items = builder.by_item();
709    /// while let Some(result) = items.next().await {
710    ///   let item = result?;
711    /// }
712    /// # Ok(()) }
713    ///
714    /// fn prepare_request_builder() -> ListLocations {
715    ///   # panic!();
716    ///   // ... details omitted ...
717    /// }
718    /// ```
719    #[derive(Clone, Debug)]
720    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
721
722    impl ListLocations {
723        pub(crate) fn new(
724            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
725        ) -> Self {
726            Self(RequestBuilder::new(stub))
727        }
728
729        /// Sets the full request, replacing any prior values.
730        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
731            mut self,
732            v: V,
733        ) -> Self {
734            self.0.request = v.into();
735            self
736        }
737
738        /// Sets all the options, replacing any prior values.
739        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
740            self.0.options = v.into();
741            self
742        }
743
744        /// Sends the request.
745        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
746            (*self.0.stub)
747                .list_locations(self.0.request, self.0.options)
748                .await
749                .map(crate::Response::into_body)
750        }
751
752        /// Streams each page in the collection.
753        pub fn by_page(
754            self,
755        ) -> impl google_cloud_gax::paginator::Paginator<
756            google_cloud_location::model::ListLocationsResponse,
757            crate::Error,
758        > {
759            use std::clone::Clone;
760            let token = self.0.request.page_token.clone();
761            let execute = move |token: String| {
762                let mut builder = self.clone();
763                builder.0.request = builder.0.request.set_page_token(token);
764                builder.send()
765            };
766            google_cloud_gax::paginator::internal::new_paginator(token, execute)
767        }
768
769        /// Streams each item in the collection.
770        pub fn by_item(
771            self,
772        ) -> impl google_cloud_gax::paginator::ItemPaginator<
773            google_cloud_location::model::ListLocationsResponse,
774            crate::Error,
775        > {
776            use google_cloud_gax::paginator::Paginator;
777            self.by_page().items()
778        }
779
780        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
781        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
782            self.0.request.name = v.into();
783            self
784        }
785
786        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
787        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
788            self.0.request.filter = v.into();
789            self
790        }
791
792        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
793        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
794            self.0.request.page_size = v.into();
795            self
796        }
797
798        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
799        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
800            self.0.request.page_token = v.into();
801            self
802        }
803    }
804
805    #[doc(hidden)]
806    impl crate::RequestBuilder for ListLocations {
807        fn request_options(&mut self) -> &mut crate::RequestOptions {
808            &mut self.0.options
809        }
810    }
811
812    /// The request builder for [BlockchainNodeEngine::get_location][crate::client::BlockchainNodeEngine::get_location] calls.
813    ///
814    /// # Example
815    /// ```
816    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::GetLocation;
817    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
818    ///
819    /// let builder = prepare_request_builder();
820    /// let response = builder.send().await?;
821    /// # Ok(()) }
822    ///
823    /// fn prepare_request_builder() -> GetLocation {
824    ///   # panic!();
825    ///   // ... details omitted ...
826    /// }
827    /// ```
828    #[derive(Clone, Debug)]
829    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
830
831    impl GetLocation {
832        pub(crate) fn new(
833            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
834        ) -> Self {
835            Self(RequestBuilder::new(stub))
836        }
837
838        /// Sets the full request, replacing any prior values.
839        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
840            mut self,
841            v: V,
842        ) -> Self {
843            self.0.request = v.into();
844            self
845        }
846
847        /// Sets all the options, replacing any prior values.
848        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
849            self.0.options = v.into();
850            self
851        }
852
853        /// Sends the request.
854        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
855            (*self.0.stub)
856                .get_location(self.0.request, self.0.options)
857                .await
858                .map(crate::Response::into_body)
859        }
860
861        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
862        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
863            self.0.request.name = v.into();
864            self
865        }
866    }
867
868    #[doc(hidden)]
869    impl crate::RequestBuilder for GetLocation {
870        fn request_options(&mut self) -> &mut crate::RequestOptions {
871            &mut self.0.options
872        }
873    }
874
875    /// The request builder for [BlockchainNodeEngine::list_operations][crate::client::BlockchainNodeEngine::list_operations] calls.
876    ///
877    /// # Example
878    /// ```
879    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::ListOperations;
880    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
881    /// use google_cloud_gax::paginator::ItemPaginator;
882    ///
883    /// let builder = prepare_request_builder();
884    /// let mut items = builder.by_item();
885    /// while let Some(result) = items.next().await {
886    ///   let item = result?;
887    /// }
888    /// # Ok(()) }
889    ///
890    /// fn prepare_request_builder() -> ListOperations {
891    ///   # panic!();
892    ///   // ... details omitted ...
893    /// }
894    /// ```
895    #[derive(Clone, Debug)]
896    pub struct ListOperations(
897        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
898    );
899
900    impl ListOperations {
901        pub(crate) fn new(
902            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
903        ) -> Self {
904            Self(RequestBuilder::new(stub))
905        }
906
907        /// Sets the full request, replacing any prior values.
908        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
909            mut self,
910            v: V,
911        ) -> Self {
912            self.0.request = v.into();
913            self
914        }
915
916        /// Sets all the options, replacing any prior values.
917        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
918            self.0.options = v.into();
919            self
920        }
921
922        /// Sends the request.
923        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
924            (*self.0.stub)
925                .list_operations(self.0.request, self.0.options)
926                .await
927                .map(crate::Response::into_body)
928        }
929
930        /// Streams each page in the collection.
931        pub fn by_page(
932            self,
933        ) -> impl google_cloud_gax::paginator::Paginator<
934            google_cloud_longrunning::model::ListOperationsResponse,
935            crate::Error,
936        > {
937            use std::clone::Clone;
938            let token = self.0.request.page_token.clone();
939            let execute = move |token: String| {
940                let mut builder = self.clone();
941                builder.0.request = builder.0.request.set_page_token(token);
942                builder.send()
943            };
944            google_cloud_gax::paginator::internal::new_paginator(token, execute)
945        }
946
947        /// Streams each item in the collection.
948        pub fn by_item(
949            self,
950        ) -> impl google_cloud_gax::paginator::ItemPaginator<
951            google_cloud_longrunning::model::ListOperationsResponse,
952            crate::Error,
953        > {
954            use google_cloud_gax::paginator::Paginator;
955            self.by_page().items()
956        }
957
958        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
959        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
960            self.0.request.name = v.into();
961            self
962        }
963
964        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
965        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
966            self.0.request.filter = v.into();
967            self
968        }
969
970        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
971        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
972            self.0.request.page_size = v.into();
973            self
974        }
975
976        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
977        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
978            self.0.request.page_token = v.into();
979            self
980        }
981
982        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
983        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
984            self.0.request.return_partial_success = v.into();
985            self
986        }
987    }
988
989    #[doc(hidden)]
990    impl crate::RequestBuilder for ListOperations {
991        fn request_options(&mut self) -> &mut crate::RequestOptions {
992            &mut self.0.options
993        }
994    }
995
996    /// The request builder for [BlockchainNodeEngine::get_operation][crate::client::BlockchainNodeEngine::get_operation] calls.
997    ///
998    /// # Example
999    /// ```
1000    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::GetOperation;
1001    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
1002    ///
1003    /// let builder = prepare_request_builder();
1004    /// let response = builder.send().await?;
1005    /// # Ok(()) }
1006    ///
1007    /// fn prepare_request_builder() -> GetOperation {
1008    ///   # panic!();
1009    ///   // ... details omitted ...
1010    /// }
1011    /// ```
1012    #[derive(Clone, Debug)]
1013    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1014
1015    impl GetOperation {
1016        pub(crate) fn new(
1017            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
1018        ) -> Self {
1019            Self(RequestBuilder::new(stub))
1020        }
1021
1022        /// Sets the full request, replacing any prior values.
1023        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1024            mut self,
1025            v: V,
1026        ) -> Self {
1027            self.0.request = v.into();
1028            self
1029        }
1030
1031        /// Sets all the options, replacing any prior values.
1032        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1033            self.0.options = v.into();
1034            self
1035        }
1036
1037        /// Sends the request.
1038        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1039            (*self.0.stub)
1040                .get_operation(self.0.request, self.0.options)
1041                .await
1042                .map(crate::Response::into_body)
1043        }
1044
1045        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1046        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1047            self.0.request.name = v.into();
1048            self
1049        }
1050    }
1051
1052    #[doc(hidden)]
1053    impl crate::RequestBuilder for GetOperation {
1054        fn request_options(&mut self) -> &mut crate::RequestOptions {
1055            &mut self.0.options
1056        }
1057    }
1058
1059    /// The request builder for [BlockchainNodeEngine::delete_operation][crate::client::BlockchainNodeEngine::delete_operation] calls.
1060    ///
1061    /// # Example
1062    /// ```
1063    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::DeleteOperation;
1064    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
1065    ///
1066    /// let builder = prepare_request_builder();
1067    /// let response = builder.send().await?;
1068    /// # Ok(()) }
1069    ///
1070    /// fn prepare_request_builder() -> DeleteOperation {
1071    ///   # panic!();
1072    ///   // ... details omitted ...
1073    /// }
1074    /// ```
1075    #[derive(Clone, Debug)]
1076    pub struct DeleteOperation(
1077        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1078    );
1079
1080    impl DeleteOperation {
1081        pub(crate) fn new(
1082            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
1083        ) -> Self {
1084            Self(RequestBuilder::new(stub))
1085        }
1086
1087        /// Sets the full request, replacing any prior values.
1088        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1089            mut self,
1090            v: V,
1091        ) -> Self {
1092            self.0.request = v.into();
1093            self
1094        }
1095
1096        /// Sets all the options, replacing any prior values.
1097        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1098            self.0.options = v.into();
1099            self
1100        }
1101
1102        /// Sends the request.
1103        pub async fn send(self) -> Result<()> {
1104            (*self.0.stub)
1105                .delete_operation(self.0.request, self.0.options)
1106                .await
1107                .map(crate::Response::into_body)
1108        }
1109
1110        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
1111        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1112            self.0.request.name = v.into();
1113            self
1114        }
1115    }
1116
1117    #[doc(hidden)]
1118    impl crate::RequestBuilder for DeleteOperation {
1119        fn request_options(&mut self) -> &mut crate::RequestOptions {
1120            &mut self.0.options
1121        }
1122    }
1123
1124    /// The request builder for [BlockchainNodeEngine::cancel_operation][crate::client::BlockchainNodeEngine::cancel_operation] calls.
1125    ///
1126    /// # Example
1127    /// ```
1128    /// # use google_cloud_blockchainnodeengine_v1::builder::blockchain_node_engine::CancelOperation;
1129    /// # async fn sample() -> google_cloud_blockchainnodeengine_v1::Result<()> {
1130    ///
1131    /// let builder = prepare_request_builder();
1132    /// let response = builder.send().await?;
1133    /// # Ok(()) }
1134    ///
1135    /// fn prepare_request_builder() -> CancelOperation {
1136    ///   # panic!();
1137    ///   // ... details omitted ...
1138    /// }
1139    /// ```
1140    #[derive(Clone, Debug)]
1141    pub struct CancelOperation(
1142        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1143    );
1144
1145    impl CancelOperation {
1146        pub(crate) fn new(
1147            stub: std::sync::Arc<dyn super::super::stub::dynamic::BlockchainNodeEngine>,
1148        ) -> Self {
1149            Self(RequestBuilder::new(stub))
1150        }
1151
1152        /// Sets the full request, replacing any prior values.
1153        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1154            mut self,
1155            v: V,
1156        ) -> Self {
1157            self.0.request = v.into();
1158            self
1159        }
1160
1161        /// Sets all the options, replacing any prior values.
1162        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1163            self.0.options = v.into();
1164            self
1165        }
1166
1167        /// Sends the request.
1168        pub async fn send(self) -> Result<()> {
1169            (*self.0.stub)
1170                .cancel_operation(self.0.request, self.0.options)
1171                .await
1172                .map(crate::Response::into_body)
1173        }
1174
1175        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1176        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1177            self.0.request.name = v.into();
1178            self
1179        }
1180    }
1181
1182    #[doc(hidden)]
1183    impl crate::RequestBuilder for CancelOperation {
1184        fn request_options(&mut self) -> &mut crate::RequestOptions {
1185            &mut self.0.options
1186        }
1187    }
1188}