google_cloud_edgecontainer_v1/
builder.rs

1// Copyright 2025 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
17pub mod edge_container {
18    use crate::Result;
19
20    /// A builder for [EdgeContainer][crate::client::EdgeContainer].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_edgecontainer_v1::*;
25    /// # use builder::edge_container::ClientBuilder;
26    /// # use client::EdgeContainer;
27    /// let builder : ClientBuilder = EdgeContainer::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://edgecontainer.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::EdgeContainer;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = EdgeContainer;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::EdgeContainer] 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::EdgeContainer>,
55        request: R,
56        options: gax::options::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::EdgeContainer>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [EdgeContainer::list_clusters][crate::client::EdgeContainer::list_clusters] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_edgecontainer_v1::builder;
79    /// use builder::edge_container::ListClusters;
80    /// # tokio_test::block_on(async {
81    /// use gax::paginator::ItemPaginator;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let mut items = builder.by_item();
85    /// while let Some(result) = items.next().await {
86    ///   let item = result?;
87    /// }
88    /// # gax::Result::<()>::Ok(()) });
89    ///
90    /// fn prepare_request_builder() -> ListClusters {
91    ///   # panic!();
92    ///   // ... details omitted ...
93    /// }
94    /// ```
95    #[derive(Clone, Debug)]
96    pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
97
98    impl ListClusters {
99        pub(crate) fn new(
100            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
101        ) -> Self {
102            Self(RequestBuilder::new(stub))
103        }
104
105        /// Sets the full request, replacing any prior values.
106        pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
107            self.0.request = v.into();
108            self
109        }
110
111        /// Sets all the options, replacing any prior values.
112        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113            self.0.options = v.into();
114            self
115        }
116
117        /// Sends the request.
118        pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
119            (*self.0.stub)
120                .list_clusters(self.0.request, self.0.options)
121                .await
122                .map(gax::response::Response::into_body)
123        }
124
125        /// Streams each page in the collection.
126        pub fn by_page(
127            self,
128        ) -> impl gax::paginator::Paginator<crate::model::ListClustersResponse, gax::error::Error>
129        {
130            use std::clone::Clone;
131            let token = self.0.request.page_token.clone();
132            let execute = move |token: String| {
133                let mut builder = self.clone();
134                builder.0.request = builder.0.request.set_page_token(token);
135                builder.send()
136            };
137            gax::paginator::internal::new_paginator(token, execute)
138        }
139
140        /// Streams each item in the collection.
141        pub fn by_item(
142            self,
143        ) -> impl gax::paginator::ItemPaginator<crate::model::ListClustersResponse, gax::error::Error>
144        {
145            use gax::paginator::Paginator;
146            self.by_page().items()
147        }
148
149        /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
150        ///
151        /// This is a **required** field for requests.
152        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153            self.0.request.parent = v.into();
154            self
155        }
156
157        /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
158        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159            self.0.request.page_size = v.into();
160            self
161        }
162
163        /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
164        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165            self.0.request.page_token = v.into();
166            self
167        }
168
169        /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
170        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171            self.0.request.filter = v.into();
172            self
173        }
174
175        /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
176        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
177            self.0.request.order_by = v.into();
178            self
179        }
180    }
181
182    #[doc(hidden)]
183    impl gax::options::internal::RequestBuilder for ListClusters {
184        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
185            &mut self.0.options
186        }
187    }
188
189    /// The request builder for [EdgeContainer::get_cluster][crate::client::EdgeContainer::get_cluster] calls.
190    ///
191    /// # Example
192    /// ```no_run
193    /// # use google_cloud_edgecontainer_v1::builder;
194    /// use builder::edge_container::GetCluster;
195    /// # tokio_test::block_on(async {
196    ///
197    /// let builder = prepare_request_builder();
198    /// let response = builder.send().await?;
199    /// # gax::Result::<()>::Ok(()) });
200    ///
201    /// fn prepare_request_builder() -> GetCluster {
202    ///   # panic!();
203    ///   // ... details omitted ...
204    /// }
205    /// ```
206    #[derive(Clone, Debug)]
207    pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
208
209    impl GetCluster {
210        pub(crate) fn new(
211            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
212        ) -> Self {
213            Self(RequestBuilder::new(stub))
214        }
215
216        /// Sets the full request, replacing any prior values.
217        pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
218            self.0.request = v.into();
219            self
220        }
221
222        /// Sets all the options, replacing any prior values.
223        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
224            self.0.options = v.into();
225            self
226        }
227
228        /// Sends the request.
229        pub async fn send(self) -> Result<crate::model::Cluster> {
230            (*self.0.stub)
231                .get_cluster(self.0.request, self.0.options)
232                .await
233                .map(gax::response::Response::into_body)
234        }
235
236        /// Sets the value of [name][crate::model::GetClusterRequest::name].
237        ///
238        /// This is a **required** field for requests.
239        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240            self.0.request.name = v.into();
241            self
242        }
243    }
244
245    #[doc(hidden)]
246    impl gax::options::internal::RequestBuilder for GetCluster {
247        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
248            &mut self.0.options
249        }
250    }
251
252    /// The request builder for [EdgeContainer::create_cluster][crate::client::EdgeContainer::create_cluster] calls.
253    ///
254    /// # Example
255    /// ```no_run
256    /// # use google_cloud_edgecontainer_v1::builder;
257    /// use builder::edge_container::CreateCluster;
258    /// # tokio_test::block_on(async {
259    /// use lro::Poller;
260    ///
261    /// let builder = prepare_request_builder();
262    /// let response = builder.poller().until_done().await?;
263    /// # gax::Result::<()>::Ok(()) });
264    ///
265    /// fn prepare_request_builder() -> CreateCluster {
266    ///   # panic!();
267    ///   // ... details omitted ...
268    /// }
269    /// ```
270    #[derive(Clone, Debug)]
271    pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
272
273    impl CreateCluster {
274        pub(crate) fn new(
275            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
276        ) -> Self {
277            Self(RequestBuilder::new(stub))
278        }
279
280        /// Sets the full request, replacing any prior values.
281        pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
282            self.0.request = v.into();
283            self
284        }
285
286        /// Sets all the options, replacing any prior values.
287        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
288            self.0.options = v.into();
289            self
290        }
291
292        /// Sends the request.
293        ///
294        /// # Long running operations
295        ///
296        /// This starts, but does not poll, a longrunning operation. More information
297        /// on [create_cluster][crate::client::EdgeContainer::create_cluster].
298        pub async fn send(self) -> Result<longrunning::model::Operation> {
299            (*self.0.stub)
300                .create_cluster(self.0.request, self.0.options)
301                .await
302                .map(gax::response::Response::into_body)
303        }
304
305        /// Creates a [Poller][lro::Poller] to work with `create_cluster`.
306        pub fn poller(
307            self,
308        ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
309            type Operation =
310                lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
311            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
312            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
313
314            let stub = self.0.stub.clone();
315            let mut options = self.0.options.clone();
316            options.set_retry_policy(gax::retry_policy::NeverRetry);
317            let query = move |name| {
318                let stub = stub.clone();
319                let options = options.clone();
320                async {
321                    let op = GetOperation::new(stub)
322                        .set_name(name)
323                        .with_options(options)
324                        .send()
325                        .await?;
326                    Ok(Operation::new(op))
327                }
328            };
329
330            let start = move || async {
331                let op = self.send().await?;
332                Ok(Operation::new(op))
333            };
334
335            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
336        }
337
338        /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
339        ///
340        /// This is a **required** field for requests.
341        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
342            self.0.request.parent = v.into();
343            self
344        }
345
346        /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
347        ///
348        /// This is a **required** field for requests.
349        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
350            self.0.request.cluster_id = v.into();
351            self
352        }
353
354        /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
355        ///
356        /// This is a **required** field for requests.
357        pub fn set_cluster<T>(mut self, v: T) -> Self
358        where
359            T: std::convert::Into<crate::model::Cluster>,
360        {
361            self.0.request.cluster = std::option::Option::Some(v.into());
362            self
363        }
364
365        /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
366        ///
367        /// This is a **required** field for requests.
368        pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
369        where
370            T: std::convert::Into<crate::model::Cluster>,
371        {
372            self.0.request.cluster = v.map(|x| x.into());
373            self
374        }
375
376        /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
377        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
378            self.0.request.request_id = v.into();
379            self
380        }
381    }
382
383    #[doc(hidden)]
384    impl gax::options::internal::RequestBuilder for CreateCluster {
385        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
386            &mut self.0.options
387        }
388    }
389
390    /// The request builder for [EdgeContainer::update_cluster][crate::client::EdgeContainer::update_cluster] calls.
391    ///
392    /// # Example
393    /// ```no_run
394    /// # use google_cloud_edgecontainer_v1::builder;
395    /// use builder::edge_container::UpdateCluster;
396    /// # tokio_test::block_on(async {
397    /// use lro::Poller;
398    ///
399    /// let builder = prepare_request_builder();
400    /// let response = builder.poller().until_done().await?;
401    /// # gax::Result::<()>::Ok(()) });
402    ///
403    /// fn prepare_request_builder() -> UpdateCluster {
404    ///   # panic!();
405    ///   // ... details omitted ...
406    /// }
407    /// ```
408    #[derive(Clone, Debug)]
409    pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
410
411    impl UpdateCluster {
412        pub(crate) fn new(
413            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
414        ) -> Self {
415            Self(RequestBuilder::new(stub))
416        }
417
418        /// Sets the full request, replacing any prior values.
419        pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
420            self.0.request = v.into();
421            self
422        }
423
424        /// Sets all the options, replacing any prior values.
425        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
426            self.0.options = v.into();
427            self
428        }
429
430        /// Sends the request.
431        ///
432        /// # Long running operations
433        ///
434        /// This starts, but does not poll, a longrunning operation. More information
435        /// on [update_cluster][crate::client::EdgeContainer::update_cluster].
436        pub async fn send(self) -> Result<longrunning::model::Operation> {
437            (*self.0.stub)
438                .update_cluster(self.0.request, self.0.options)
439                .await
440                .map(gax::response::Response::into_body)
441        }
442
443        /// Creates a [Poller][lro::Poller] to work with `update_cluster`.
444        pub fn poller(
445            self,
446        ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
447            type Operation =
448                lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
449            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
450            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
451
452            let stub = self.0.stub.clone();
453            let mut options = self.0.options.clone();
454            options.set_retry_policy(gax::retry_policy::NeverRetry);
455            let query = move |name| {
456                let stub = stub.clone();
457                let options = options.clone();
458                async {
459                    let op = GetOperation::new(stub)
460                        .set_name(name)
461                        .with_options(options)
462                        .send()
463                        .await?;
464                    Ok(Operation::new(op))
465                }
466            };
467
468            let start = move || async {
469                let op = self.send().await?;
470                Ok(Operation::new(op))
471            };
472
473            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
474        }
475
476        /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
477        pub fn set_update_mask<T>(mut self, v: T) -> Self
478        where
479            T: std::convert::Into<wkt::FieldMask>,
480        {
481            self.0.request.update_mask = std::option::Option::Some(v.into());
482            self
483        }
484
485        /// Sets or clears the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
486        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
487        where
488            T: std::convert::Into<wkt::FieldMask>,
489        {
490            self.0.request.update_mask = v.map(|x| x.into());
491            self
492        }
493
494        /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
495        pub fn set_cluster<T>(mut self, v: T) -> Self
496        where
497            T: std::convert::Into<crate::model::Cluster>,
498        {
499            self.0.request.cluster = std::option::Option::Some(v.into());
500            self
501        }
502
503        /// Sets or clears the value of [cluster][crate::model::UpdateClusterRequest::cluster].
504        pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
505        where
506            T: std::convert::Into<crate::model::Cluster>,
507        {
508            self.0.request.cluster = v.map(|x| x.into());
509            self
510        }
511
512        /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
513        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
514            self.0.request.request_id = v.into();
515            self
516        }
517    }
518
519    #[doc(hidden)]
520    impl gax::options::internal::RequestBuilder for UpdateCluster {
521        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
522            &mut self.0.options
523        }
524    }
525
526    /// The request builder for [EdgeContainer::upgrade_cluster][crate::client::EdgeContainer::upgrade_cluster] calls.
527    ///
528    /// # Example
529    /// ```no_run
530    /// # use google_cloud_edgecontainer_v1::builder;
531    /// use builder::edge_container::UpgradeCluster;
532    /// # tokio_test::block_on(async {
533    /// use lro::Poller;
534    ///
535    /// let builder = prepare_request_builder();
536    /// let response = builder.poller().until_done().await?;
537    /// # gax::Result::<()>::Ok(()) });
538    ///
539    /// fn prepare_request_builder() -> UpgradeCluster {
540    ///   # panic!();
541    ///   // ... details omitted ...
542    /// }
543    /// ```
544    #[derive(Clone, Debug)]
545    pub struct UpgradeCluster(RequestBuilder<crate::model::UpgradeClusterRequest>);
546
547    impl UpgradeCluster {
548        pub(crate) fn new(
549            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
550        ) -> Self {
551            Self(RequestBuilder::new(stub))
552        }
553
554        /// Sets the full request, replacing any prior values.
555        pub fn with_request<V: Into<crate::model::UpgradeClusterRequest>>(mut self, v: V) -> Self {
556            self.0.request = v.into();
557            self
558        }
559
560        /// Sets all the options, replacing any prior values.
561        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
562            self.0.options = v.into();
563            self
564        }
565
566        /// Sends the request.
567        ///
568        /// # Long running operations
569        ///
570        /// This starts, but does not poll, a longrunning operation. More information
571        /// on [upgrade_cluster][crate::client::EdgeContainer::upgrade_cluster].
572        pub async fn send(self) -> Result<longrunning::model::Operation> {
573            (*self.0.stub)
574                .upgrade_cluster(self.0.request, self.0.options)
575                .await
576                .map(gax::response::Response::into_body)
577        }
578
579        /// Creates a [Poller][lro::Poller] to work with `upgrade_cluster`.
580        pub fn poller(
581            self,
582        ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
583            type Operation =
584                lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
585            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
586            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
587
588            let stub = self.0.stub.clone();
589            let mut options = self.0.options.clone();
590            options.set_retry_policy(gax::retry_policy::NeverRetry);
591            let query = move |name| {
592                let stub = stub.clone();
593                let options = options.clone();
594                async {
595                    let op = GetOperation::new(stub)
596                        .set_name(name)
597                        .with_options(options)
598                        .send()
599                        .await?;
600                    Ok(Operation::new(op))
601                }
602            };
603
604            let start = move || async {
605                let op = self.send().await?;
606                Ok(Operation::new(op))
607            };
608
609            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
610        }
611
612        /// Sets the value of [name][crate::model::UpgradeClusterRequest::name].
613        ///
614        /// This is a **required** field for requests.
615        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
616            self.0.request.name = v.into();
617            self
618        }
619
620        /// Sets the value of [target_version][crate::model::UpgradeClusterRequest::target_version].
621        ///
622        /// This is a **required** field for requests.
623        pub fn set_target_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
624            self.0.request.target_version = v.into();
625            self
626        }
627
628        /// Sets the value of [schedule][crate::model::UpgradeClusterRequest::schedule].
629        pub fn set_schedule<T: Into<crate::model::upgrade_cluster_request::Schedule>>(
630            mut self,
631            v: T,
632        ) -> Self {
633            self.0.request.schedule = v.into();
634            self
635        }
636
637        /// Sets the value of [request_id][crate::model::UpgradeClusterRequest::request_id].
638        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
639            self.0.request.request_id = v.into();
640            self
641        }
642    }
643
644    #[doc(hidden)]
645    impl gax::options::internal::RequestBuilder for UpgradeCluster {
646        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
647            &mut self.0.options
648        }
649    }
650
651    /// The request builder for [EdgeContainer::delete_cluster][crate::client::EdgeContainer::delete_cluster] calls.
652    ///
653    /// # Example
654    /// ```no_run
655    /// # use google_cloud_edgecontainer_v1::builder;
656    /// use builder::edge_container::DeleteCluster;
657    /// # tokio_test::block_on(async {
658    /// use lro::Poller;
659    ///
660    /// let builder = prepare_request_builder();
661    /// let response = builder.poller().until_done().await?;
662    /// # gax::Result::<()>::Ok(()) });
663    ///
664    /// fn prepare_request_builder() -> DeleteCluster {
665    ///   # panic!();
666    ///   // ... details omitted ...
667    /// }
668    /// ```
669    #[derive(Clone, Debug)]
670    pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
671
672    impl DeleteCluster {
673        pub(crate) fn new(
674            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
675        ) -> Self {
676            Self(RequestBuilder::new(stub))
677        }
678
679        /// Sets the full request, replacing any prior values.
680        pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
681            self.0.request = v.into();
682            self
683        }
684
685        /// Sets all the options, replacing any prior values.
686        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
687            self.0.options = v.into();
688            self
689        }
690
691        /// Sends the request.
692        ///
693        /// # Long running operations
694        ///
695        /// This starts, but does not poll, a longrunning operation. More information
696        /// on [delete_cluster][crate::client::EdgeContainer::delete_cluster].
697        pub async fn send(self) -> Result<longrunning::model::Operation> {
698            (*self.0.stub)
699                .delete_cluster(self.0.request, self.0.options)
700                .await
701                .map(gax::response::Response::into_body)
702        }
703
704        /// Creates a [Poller][lro::Poller] to work with `delete_cluster`.
705        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
706            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
707            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
708            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
709
710            let stub = self.0.stub.clone();
711            let mut options = self.0.options.clone();
712            options.set_retry_policy(gax::retry_policy::NeverRetry);
713            let query = move |name| {
714                let stub = stub.clone();
715                let options = options.clone();
716                async {
717                    let op = GetOperation::new(stub)
718                        .set_name(name)
719                        .with_options(options)
720                        .send()
721                        .await?;
722                    Ok(Operation::new(op))
723                }
724            };
725
726            let start = move || async {
727                let op = self.send().await?;
728                Ok(Operation::new(op))
729            };
730
731            lro::internal::new_unit_response_poller(
732                polling_error_policy,
733                polling_backoff_policy,
734                start,
735                query,
736            )
737        }
738
739        /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
740        ///
741        /// This is a **required** field for requests.
742        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
743            self.0.request.name = v.into();
744            self
745        }
746
747        /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
748        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
749            self.0.request.request_id = v.into();
750            self
751        }
752    }
753
754    #[doc(hidden)]
755    impl gax::options::internal::RequestBuilder for DeleteCluster {
756        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
757            &mut self.0.options
758        }
759    }
760
761    /// The request builder for [EdgeContainer::generate_access_token][crate::client::EdgeContainer::generate_access_token] calls.
762    ///
763    /// # Example
764    /// ```no_run
765    /// # use google_cloud_edgecontainer_v1::builder;
766    /// use builder::edge_container::GenerateAccessToken;
767    /// # tokio_test::block_on(async {
768    ///
769    /// let builder = prepare_request_builder();
770    /// let response = builder.send().await?;
771    /// # gax::Result::<()>::Ok(()) });
772    ///
773    /// fn prepare_request_builder() -> GenerateAccessToken {
774    ///   # panic!();
775    ///   // ... details omitted ...
776    /// }
777    /// ```
778    #[derive(Clone, Debug)]
779    pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
780
781    impl GenerateAccessToken {
782        pub(crate) fn new(
783            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
784        ) -> Self {
785            Self(RequestBuilder::new(stub))
786        }
787
788        /// Sets the full request, replacing any prior values.
789        pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
790            mut self,
791            v: V,
792        ) -> Self {
793            self.0.request = v.into();
794            self
795        }
796
797        /// Sets all the options, replacing any prior values.
798        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
799            self.0.options = v.into();
800            self
801        }
802
803        /// Sends the request.
804        pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
805            (*self.0.stub)
806                .generate_access_token(self.0.request, self.0.options)
807                .await
808                .map(gax::response::Response::into_body)
809        }
810
811        /// Sets the value of [cluster][crate::model::GenerateAccessTokenRequest::cluster].
812        ///
813        /// This is a **required** field for requests.
814        pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
815            self.0.request.cluster = v.into();
816            self
817        }
818    }
819
820    #[doc(hidden)]
821    impl gax::options::internal::RequestBuilder for GenerateAccessToken {
822        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
823            &mut self.0.options
824        }
825    }
826
827    /// The request builder for [EdgeContainer::generate_offline_credential][crate::client::EdgeContainer::generate_offline_credential] calls.
828    ///
829    /// # Example
830    /// ```no_run
831    /// # use google_cloud_edgecontainer_v1::builder;
832    /// use builder::edge_container::GenerateOfflineCredential;
833    /// # tokio_test::block_on(async {
834    ///
835    /// let builder = prepare_request_builder();
836    /// let response = builder.send().await?;
837    /// # gax::Result::<()>::Ok(()) });
838    ///
839    /// fn prepare_request_builder() -> GenerateOfflineCredential {
840    ///   # panic!();
841    ///   // ... details omitted ...
842    /// }
843    /// ```
844    #[derive(Clone, Debug)]
845    pub struct GenerateOfflineCredential(
846        RequestBuilder<crate::model::GenerateOfflineCredentialRequest>,
847    );
848
849    impl GenerateOfflineCredential {
850        pub(crate) fn new(
851            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
852        ) -> Self {
853            Self(RequestBuilder::new(stub))
854        }
855
856        /// Sets the full request, replacing any prior values.
857        pub fn with_request<V: Into<crate::model::GenerateOfflineCredentialRequest>>(
858            mut self,
859            v: V,
860        ) -> Self {
861            self.0.request = v.into();
862            self
863        }
864
865        /// Sets all the options, replacing any prior values.
866        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
867            self.0.options = v.into();
868            self
869        }
870
871        /// Sends the request.
872        pub async fn send(self) -> Result<crate::model::GenerateOfflineCredentialResponse> {
873            (*self.0.stub)
874                .generate_offline_credential(self.0.request, self.0.options)
875                .await
876                .map(gax::response::Response::into_body)
877        }
878
879        /// Sets the value of [cluster][crate::model::GenerateOfflineCredentialRequest::cluster].
880        ///
881        /// This is a **required** field for requests.
882        pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
883            self.0.request.cluster = v.into();
884            self
885        }
886    }
887
888    #[doc(hidden)]
889    impl gax::options::internal::RequestBuilder for GenerateOfflineCredential {
890        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
891            &mut self.0.options
892        }
893    }
894
895    /// The request builder for [EdgeContainer::list_node_pools][crate::client::EdgeContainer::list_node_pools] calls.
896    ///
897    /// # Example
898    /// ```no_run
899    /// # use google_cloud_edgecontainer_v1::builder;
900    /// use builder::edge_container::ListNodePools;
901    /// # tokio_test::block_on(async {
902    /// use gax::paginator::ItemPaginator;
903    ///
904    /// let builder = prepare_request_builder();
905    /// let mut items = builder.by_item();
906    /// while let Some(result) = items.next().await {
907    ///   let item = result?;
908    /// }
909    /// # gax::Result::<()>::Ok(()) });
910    ///
911    /// fn prepare_request_builder() -> ListNodePools {
912    ///   # panic!();
913    ///   // ... details omitted ...
914    /// }
915    /// ```
916    #[derive(Clone, Debug)]
917    pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
918
919    impl ListNodePools {
920        pub(crate) fn new(
921            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
922        ) -> Self {
923            Self(RequestBuilder::new(stub))
924        }
925
926        /// Sets the full request, replacing any prior values.
927        pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
928            self.0.request = v.into();
929            self
930        }
931
932        /// Sets all the options, replacing any prior values.
933        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
934            self.0.options = v.into();
935            self
936        }
937
938        /// Sends the request.
939        pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
940            (*self.0.stub)
941                .list_node_pools(self.0.request, self.0.options)
942                .await
943                .map(gax::response::Response::into_body)
944        }
945
946        /// Streams each page in the collection.
947        pub fn by_page(
948            self,
949        ) -> impl gax::paginator::Paginator<crate::model::ListNodePoolsResponse, gax::error::Error>
950        {
951            use std::clone::Clone;
952            let token = self.0.request.page_token.clone();
953            let execute = move |token: String| {
954                let mut builder = self.clone();
955                builder.0.request = builder.0.request.set_page_token(token);
956                builder.send()
957            };
958            gax::paginator::internal::new_paginator(token, execute)
959        }
960
961        /// Streams each item in the collection.
962        pub fn by_item(
963            self,
964        ) -> impl gax::paginator::ItemPaginator<crate::model::ListNodePoolsResponse, gax::error::Error>
965        {
966            use gax::paginator::Paginator;
967            self.by_page().items()
968        }
969
970        /// Sets the value of [parent][crate::model::ListNodePoolsRequest::parent].
971        ///
972        /// This is a **required** field for requests.
973        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
974            self.0.request.parent = v.into();
975            self
976        }
977
978        /// Sets the value of [page_size][crate::model::ListNodePoolsRequest::page_size].
979        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
980            self.0.request.page_size = v.into();
981            self
982        }
983
984        /// Sets the value of [page_token][crate::model::ListNodePoolsRequest::page_token].
985        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
986            self.0.request.page_token = v.into();
987            self
988        }
989
990        /// Sets the value of [filter][crate::model::ListNodePoolsRequest::filter].
991        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
992            self.0.request.filter = v.into();
993            self
994        }
995
996        /// Sets the value of [order_by][crate::model::ListNodePoolsRequest::order_by].
997        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
998            self.0.request.order_by = v.into();
999            self
1000        }
1001    }
1002
1003    #[doc(hidden)]
1004    impl gax::options::internal::RequestBuilder for ListNodePools {
1005        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1006            &mut self.0.options
1007        }
1008    }
1009
1010    /// The request builder for [EdgeContainer::get_node_pool][crate::client::EdgeContainer::get_node_pool] calls.
1011    ///
1012    /// # Example
1013    /// ```no_run
1014    /// # use google_cloud_edgecontainer_v1::builder;
1015    /// use builder::edge_container::GetNodePool;
1016    /// # tokio_test::block_on(async {
1017    ///
1018    /// let builder = prepare_request_builder();
1019    /// let response = builder.send().await?;
1020    /// # gax::Result::<()>::Ok(()) });
1021    ///
1022    /// fn prepare_request_builder() -> GetNodePool {
1023    ///   # panic!();
1024    ///   // ... details omitted ...
1025    /// }
1026    /// ```
1027    #[derive(Clone, Debug)]
1028    pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
1029
1030    impl GetNodePool {
1031        pub(crate) fn new(
1032            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1033        ) -> Self {
1034            Self(RequestBuilder::new(stub))
1035        }
1036
1037        /// Sets the full request, replacing any prior values.
1038        pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
1039            self.0.request = v.into();
1040            self
1041        }
1042
1043        /// Sets all the options, replacing any prior values.
1044        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1045            self.0.options = v.into();
1046            self
1047        }
1048
1049        /// Sends the request.
1050        pub async fn send(self) -> Result<crate::model::NodePool> {
1051            (*self.0.stub)
1052                .get_node_pool(self.0.request, self.0.options)
1053                .await
1054                .map(gax::response::Response::into_body)
1055        }
1056
1057        /// Sets the value of [name][crate::model::GetNodePoolRequest::name].
1058        ///
1059        /// This is a **required** field for requests.
1060        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1061            self.0.request.name = v.into();
1062            self
1063        }
1064    }
1065
1066    #[doc(hidden)]
1067    impl gax::options::internal::RequestBuilder for GetNodePool {
1068        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1069            &mut self.0.options
1070        }
1071    }
1072
1073    /// The request builder for [EdgeContainer::create_node_pool][crate::client::EdgeContainer::create_node_pool] calls.
1074    ///
1075    /// # Example
1076    /// ```no_run
1077    /// # use google_cloud_edgecontainer_v1::builder;
1078    /// use builder::edge_container::CreateNodePool;
1079    /// # tokio_test::block_on(async {
1080    /// use lro::Poller;
1081    ///
1082    /// let builder = prepare_request_builder();
1083    /// let response = builder.poller().until_done().await?;
1084    /// # gax::Result::<()>::Ok(()) });
1085    ///
1086    /// fn prepare_request_builder() -> CreateNodePool {
1087    ///   # panic!();
1088    ///   // ... details omitted ...
1089    /// }
1090    /// ```
1091    #[derive(Clone, Debug)]
1092    pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
1093
1094    impl CreateNodePool {
1095        pub(crate) fn new(
1096            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1097        ) -> Self {
1098            Self(RequestBuilder::new(stub))
1099        }
1100
1101        /// Sets the full request, replacing any prior values.
1102        pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
1103            self.0.request = v.into();
1104            self
1105        }
1106
1107        /// Sets all the options, replacing any prior values.
1108        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1109            self.0.options = v.into();
1110            self
1111        }
1112
1113        /// Sends the request.
1114        ///
1115        /// # Long running operations
1116        ///
1117        /// This starts, but does not poll, a longrunning operation. More information
1118        /// on [create_node_pool][crate::client::EdgeContainer::create_node_pool].
1119        pub async fn send(self) -> Result<longrunning::model::Operation> {
1120            (*self.0.stub)
1121                .create_node_pool(self.0.request, self.0.options)
1122                .await
1123                .map(gax::response::Response::into_body)
1124        }
1125
1126        /// Creates a [Poller][lro::Poller] to work with `create_node_pool`.
1127        pub fn poller(
1128            self,
1129        ) -> impl lro::Poller<crate::model::NodePool, crate::model::OperationMetadata> {
1130            type Operation =
1131                lro::internal::Operation<crate::model::NodePool, crate::model::OperationMetadata>;
1132            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1133            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1134
1135            let stub = self.0.stub.clone();
1136            let mut options = self.0.options.clone();
1137            options.set_retry_policy(gax::retry_policy::NeverRetry);
1138            let query = move |name| {
1139                let stub = stub.clone();
1140                let options = options.clone();
1141                async {
1142                    let op = GetOperation::new(stub)
1143                        .set_name(name)
1144                        .with_options(options)
1145                        .send()
1146                        .await?;
1147                    Ok(Operation::new(op))
1148                }
1149            };
1150
1151            let start = move || async {
1152                let op = self.send().await?;
1153                Ok(Operation::new(op))
1154            };
1155
1156            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1157        }
1158
1159        /// Sets the value of [parent][crate::model::CreateNodePoolRequest::parent].
1160        ///
1161        /// This is a **required** field for requests.
1162        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1163            self.0.request.parent = v.into();
1164            self
1165        }
1166
1167        /// Sets the value of [node_pool_id][crate::model::CreateNodePoolRequest::node_pool_id].
1168        ///
1169        /// This is a **required** field for requests.
1170        pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1171            self.0.request.node_pool_id = v.into();
1172            self
1173        }
1174
1175        /// Sets the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
1176        ///
1177        /// This is a **required** field for requests.
1178        pub fn set_node_pool<T>(mut self, v: T) -> Self
1179        where
1180            T: std::convert::Into<crate::model::NodePool>,
1181        {
1182            self.0.request.node_pool = std::option::Option::Some(v.into());
1183            self
1184        }
1185
1186        /// Sets or clears the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
1187        ///
1188        /// This is a **required** field for requests.
1189        pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1190        where
1191            T: std::convert::Into<crate::model::NodePool>,
1192        {
1193            self.0.request.node_pool = v.map(|x| x.into());
1194            self
1195        }
1196
1197        /// Sets the value of [request_id][crate::model::CreateNodePoolRequest::request_id].
1198        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1199            self.0.request.request_id = v.into();
1200            self
1201        }
1202    }
1203
1204    #[doc(hidden)]
1205    impl gax::options::internal::RequestBuilder for CreateNodePool {
1206        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1207            &mut self.0.options
1208        }
1209    }
1210
1211    /// The request builder for [EdgeContainer::update_node_pool][crate::client::EdgeContainer::update_node_pool] calls.
1212    ///
1213    /// # Example
1214    /// ```no_run
1215    /// # use google_cloud_edgecontainer_v1::builder;
1216    /// use builder::edge_container::UpdateNodePool;
1217    /// # tokio_test::block_on(async {
1218    /// use lro::Poller;
1219    ///
1220    /// let builder = prepare_request_builder();
1221    /// let response = builder.poller().until_done().await?;
1222    /// # gax::Result::<()>::Ok(()) });
1223    ///
1224    /// fn prepare_request_builder() -> UpdateNodePool {
1225    ///   # panic!();
1226    ///   // ... details omitted ...
1227    /// }
1228    /// ```
1229    #[derive(Clone, Debug)]
1230    pub struct UpdateNodePool(RequestBuilder<crate::model::UpdateNodePoolRequest>);
1231
1232    impl UpdateNodePool {
1233        pub(crate) fn new(
1234            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1235        ) -> Self {
1236            Self(RequestBuilder::new(stub))
1237        }
1238
1239        /// Sets the full request, replacing any prior values.
1240        pub fn with_request<V: Into<crate::model::UpdateNodePoolRequest>>(mut self, v: V) -> Self {
1241            self.0.request = v.into();
1242            self
1243        }
1244
1245        /// Sets all the options, replacing any prior values.
1246        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1247            self.0.options = v.into();
1248            self
1249        }
1250
1251        /// Sends the request.
1252        ///
1253        /// # Long running operations
1254        ///
1255        /// This starts, but does not poll, a longrunning operation. More information
1256        /// on [update_node_pool][crate::client::EdgeContainer::update_node_pool].
1257        pub async fn send(self) -> Result<longrunning::model::Operation> {
1258            (*self.0.stub)
1259                .update_node_pool(self.0.request, self.0.options)
1260                .await
1261                .map(gax::response::Response::into_body)
1262        }
1263
1264        /// Creates a [Poller][lro::Poller] to work with `update_node_pool`.
1265        pub fn poller(
1266            self,
1267        ) -> impl lro::Poller<crate::model::NodePool, crate::model::OperationMetadata> {
1268            type Operation =
1269                lro::internal::Operation<crate::model::NodePool, crate::model::OperationMetadata>;
1270            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1271            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1272
1273            let stub = self.0.stub.clone();
1274            let mut options = self.0.options.clone();
1275            options.set_retry_policy(gax::retry_policy::NeverRetry);
1276            let query = move |name| {
1277                let stub = stub.clone();
1278                let options = options.clone();
1279                async {
1280                    let op = GetOperation::new(stub)
1281                        .set_name(name)
1282                        .with_options(options)
1283                        .send()
1284                        .await?;
1285                    Ok(Operation::new(op))
1286                }
1287            };
1288
1289            let start = move || async {
1290                let op = self.send().await?;
1291                Ok(Operation::new(op))
1292            };
1293
1294            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1295        }
1296
1297        /// Sets the value of [update_mask][crate::model::UpdateNodePoolRequest::update_mask].
1298        pub fn set_update_mask<T>(mut self, v: T) -> Self
1299        where
1300            T: std::convert::Into<wkt::FieldMask>,
1301        {
1302            self.0.request.update_mask = std::option::Option::Some(v.into());
1303            self
1304        }
1305
1306        /// Sets or clears the value of [update_mask][crate::model::UpdateNodePoolRequest::update_mask].
1307        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1308        where
1309            T: std::convert::Into<wkt::FieldMask>,
1310        {
1311            self.0.request.update_mask = v.map(|x| x.into());
1312            self
1313        }
1314
1315        /// Sets the value of [node_pool][crate::model::UpdateNodePoolRequest::node_pool].
1316        pub fn set_node_pool<T>(mut self, v: T) -> Self
1317        where
1318            T: std::convert::Into<crate::model::NodePool>,
1319        {
1320            self.0.request.node_pool = std::option::Option::Some(v.into());
1321            self
1322        }
1323
1324        /// Sets or clears the value of [node_pool][crate::model::UpdateNodePoolRequest::node_pool].
1325        pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1326        where
1327            T: std::convert::Into<crate::model::NodePool>,
1328        {
1329            self.0.request.node_pool = v.map(|x| x.into());
1330            self
1331        }
1332
1333        /// Sets the value of [request_id][crate::model::UpdateNodePoolRequest::request_id].
1334        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1335            self.0.request.request_id = v.into();
1336            self
1337        }
1338    }
1339
1340    #[doc(hidden)]
1341    impl gax::options::internal::RequestBuilder for UpdateNodePool {
1342        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1343            &mut self.0.options
1344        }
1345    }
1346
1347    /// The request builder for [EdgeContainer::delete_node_pool][crate::client::EdgeContainer::delete_node_pool] calls.
1348    ///
1349    /// # Example
1350    /// ```no_run
1351    /// # use google_cloud_edgecontainer_v1::builder;
1352    /// use builder::edge_container::DeleteNodePool;
1353    /// # tokio_test::block_on(async {
1354    /// use lro::Poller;
1355    ///
1356    /// let builder = prepare_request_builder();
1357    /// let response = builder.poller().until_done().await?;
1358    /// # gax::Result::<()>::Ok(()) });
1359    ///
1360    /// fn prepare_request_builder() -> DeleteNodePool {
1361    ///   # panic!();
1362    ///   // ... details omitted ...
1363    /// }
1364    /// ```
1365    #[derive(Clone, Debug)]
1366    pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
1367
1368    impl DeleteNodePool {
1369        pub(crate) fn new(
1370            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1371        ) -> Self {
1372            Self(RequestBuilder::new(stub))
1373        }
1374
1375        /// Sets the full request, replacing any prior values.
1376        pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
1377            self.0.request = v.into();
1378            self
1379        }
1380
1381        /// Sets all the options, replacing any prior values.
1382        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1383            self.0.options = v.into();
1384            self
1385        }
1386
1387        /// Sends the request.
1388        ///
1389        /// # Long running operations
1390        ///
1391        /// This starts, but does not poll, a longrunning operation. More information
1392        /// on [delete_node_pool][crate::client::EdgeContainer::delete_node_pool].
1393        pub async fn send(self) -> Result<longrunning::model::Operation> {
1394            (*self.0.stub)
1395                .delete_node_pool(self.0.request, self.0.options)
1396                .await
1397                .map(gax::response::Response::into_body)
1398        }
1399
1400        /// Creates a [Poller][lro::Poller] to work with `delete_node_pool`.
1401        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1402            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1403            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1404            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1405
1406            let stub = self.0.stub.clone();
1407            let mut options = self.0.options.clone();
1408            options.set_retry_policy(gax::retry_policy::NeverRetry);
1409            let query = move |name| {
1410                let stub = stub.clone();
1411                let options = options.clone();
1412                async {
1413                    let op = GetOperation::new(stub)
1414                        .set_name(name)
1415                        .with_options(options)
1416                        .send()
1417                        .await?;
1418                    Ok(Operation::new(op))
1419                }
1420            };
1421
1422            let start = move || async {
1423                let op = self.send().await?;
1424                Ok(Operation::new(op))
1425            };
1426
1427            lro::internal::new_unit_response_poller(
1428                polling_error_policy,
1429                polling_backoff_policy,
1430                start,
1431                query,
1432            )
1433        }
1434
1435        /// Sets the value of [name][crate::model::DeleteNodePoolRequest::name].
1436        ///
1437        /// This is a **required** field for requests.
1438        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1439            self.0.request.name = v.into();
1440            self
1441        }
1442
1443        /// Sets the value of [request_id][crate::model::DeleteNodePoolRequest::request_id].
1444        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1445            self.0.request.request_id = v.into();
1446            self
1447        }
1448    }
1449
1450    #[doc(hidden)]
1451    impl gax::options::internal::RequestBuilder for DeleteNodePool {
1452        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1453            &mut self.0.options
1454        }
1455    }
1456
1457    /// The request builder for [EdgeContainer::list_machines][crate::client::EdgeContainer::list_machines] calls.
1458    ///
1459    /// # Example
1460    /// ```no_run
1461    /// # use google_cloud_edgecontainer_v1::builder;
1462    /// use builder::edge_container::ListMachines;
1463    /// # tokio_test::block_on(async {
1464    /// use gax::paginator::ItemPaginator;
1465    ///
1466    /// let builder = prepare_request_builder();
1467    /// let mut items = builder.by_item();
1468    /// while let Some(result) = items.next().await {
1469    ///   let item = result?;
1470    /// }
1471    /// # gax::Result::<()>::Ok(()) });
1472    ///
1473    /// fn prepare_request_builder() -> ListMachines {
1474    ///   # panic!();
1475    ///   // ... details omitted ...
1476    /// }
1477    /// ```
1478    #[derive(Clone, Debug)]
1479    pub struct ListMachines(RequestBuilder<crate::model::ListMachinesRequest>);
1480
1481    impl ListMachines {
1482        pub(crate) fn new(
1483            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1484        ) -> Self {
1485            Self(RequestBuilder::new(stub))
1486        }
1487
1488        /// Sets the full request, replacing any prior values.
1489        pub fn with_request<V: Into<crate::model::ListMachinesRequest>>(mut self, v: V) -> Self {
1490            self.0.request = v.into();
1491            self
1492        }
1493
1494        /// Sets all the options, replacing any prior values.
1495        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1496            self.0.options = v.into();
1497            self
1498        }
1499
1500        /// Sends the request.
1501        pub async fn send(self) -> Result<crate::model::ListMachinesResponse> {
1502            (*self.0.stub)
1503                .list_machines(self.0.request, self.0.options)
1504                .await
1505                .map(gax::response::Response::into_body)
1506        }
1507
1508        /// Streams each page in the collection.
1509        pub fn by_page(
1510            self,
1511        ) -> impl gax::paginator::Paginator<crate::model::ListMachinesResponse, gax::error::Error>
1512        {
1513            use std::clone::Clone;
1514            let token = self.0.request.page_token.clone();
1515            let execute = move |token: String| {
1516                let mut builder = self.clone();
1517                builder.0.request = builder.0.request.set_page_token(token);
1518                builder.send()
1519            };
1520            gax::paginator::internal::new_paginator(token, execute)
1521        }
1522
1523        /// Streams each item in the collection.
1524        pub fn by_item(
1525            self,
1526        ) -> impl gax::paginator::ItemPaginator<crate::model::ListMachinesResponse, gax::error::Error>
1527        {
1528            use gax::paginator::Paginator;
1529            self.by_page().items()
1530        }
1531
1532        /// Sets the value of [parent][crate::model::ListMachinesRequest::parent].
1533        ///
1534        /// This is a **required** field for requests.
1535        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1536            self.0.request.parent = v.into();
1537            self
1538        }
1539
1540        /// Sets the value of [page_size][crate::model::ListMachinesRequest::page_size].
1541        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1542            self.0.request.page_size = v.into();
1543            self
1544        }
1545
1546        /// Sets the value of [page_token][crate::model::ListMachinesRequest::page_token].
1547        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1548            self.0.request.page_token = v.into();
1549            self
1550        }
1551
1552        /// Sets the value of [filter][crate::model::ListMachinesRequest::filter].
1553        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1554            self.0.request.filter = v.into();
1555            self
1556        }
1557
1558        /// Sets the value of [order_by][crate::model::ListMachinesRequest::order_by].
1559        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1560            self.0.request.order_by = v.into();
1561            self
1562        }
1563    }
1564
1565    #[doc(hidden)]
1566    impl gax::options::internal::RequestBuilder for ListMachines {
1567        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1568            &mut self.0.options
1569        }
1570    }
1571
1572    /// The request builder for [EdgeContainer::get_machine][crate::client::EdgeContainer::get_machine] calls.
1573    ///
1574    /// # Example
1575    /// ```no_run
1576    /// # use google_cloud_edgecontainer_v1::builder;
1577    /// use builder::edge_container::GetMachine;
1578    /// # tokio_test::block_on(async {
1579    ///
1580    /// let builder = prepare_request_builder();
1581    /// let response = builder.send().await?;
1582    /// # gax::Result::<()>::Ok(()) });
1583    ///
1584    /// fn prepare_request_builder() -> GetMachine {
1585    ///   # panic!();
1586    ///   // ... details omitted ...
1587    /// }
1588    /// ```
1589    #[derive(Clone, Debug)]
1590    pub struct GetMachine(RequestBuilder<crate::model::GetMachineRequest>);
1591
1592    impl GetMachine {
1593        pub(crate) fn new(
1594            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1595        ) -> Self {
1596            Self(RequestBuilder::new(stub))
1597        }
1598
1599        /// Sets the full request, replacing any prior values.
1600        pub fn with_request<V: Into<crate::model::GetMachineRequest>>(mut self, v: V) -> Self {
1601            self.0.request = v.into();
1602            self
1603        }
1604
1605        /// Sets all the options, replacing any prior values.
1606        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1607            self.0.options = v.into();
1608            self
1609        }
1610
1611        /// Sends the request.
1612        pub async fn send(self) -> Result<crate::model::Machine> {
1613            (*self.0.stub)
1614                .get_machine(self.0.request, self.0.options)
1615                .await
1616                .map(gax::response::Response::into_body)
1617        }
1618
1619        /// Sets the value of [name][crate::model::GetMachineRequest::name].
1620        ///
1621        /// This is a **required** field for requests.
1622        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1623            self.0.request.name = v.into();
1624            self
1625        }
1626    }
1627
1628    #[doc(hidden)]
1629    impl gax::options::internal::RequestBuilder for GetMachine {
1630        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1631            &mut self.0.options
1632        }
1633    }
1634
1635    /// The request builder for [EdgeContainer::list_vpn_connections][crate::client::EdgeContainer::list_vpn_connections] calls.
1636    ///
1637    /// # Example
1638    /// ```no_run
1639    /// # use google_cloud_edgecontainer_v1::builder;
1640    /// use builder::edge_container::ListVpnConnections;
1641    /// # tokio_test::block_on(async {
1642    /// use gax::paginator::ItemPaginator;
1643    ///
1644    /// let builder = prepare_request_builder();
1645    /// let mut items = builder.by_item();
1646    /// while let Some(result) = items.next().await {
1647    ///   let item = result?;
1648    /// }
1649    /// # gax::Result::<()>::Ok(()) });
1650    ///
1651    /// fn prepare_request_builder() -> ListVpnConnections {
1652    ///   # panic!();
1653    ///   // ... details omitted ...
1654    /// }
1655    /// ```
1656    #[derive(Clone, Debug)]
1657    pub struct ListVpnConnections(RequestBuilder<crate::model::ListVpnConnectionsRequest>);
1658
1659    impl ListVpnConnections {
1660        pub(crate) fn new(
1661            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1662        ) -> Self {
1663            Self(RequestBuilder::new(stub))
1664        }
1665
1666        /// Sets the full request, replacing any prior values.
1667        pub fn with_request<V: Into<crate::model::ListVpnConnectionsRequest>>(
1668            mut self,
1669            v: V,
1670        ) -> Self {
1671            self.0.request = v.into();
1672            self
1673        }
1674
1675        /// Sets all the options, replacing any prior values.
1676        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1677            self.0.options = v.into();
1678            self
1679        }
1680
1681        /// Sends the request.
1682        pub async fn send(self) -> Result<crate::model::ListVpnConnectionsResponse> {
1683            (*self.0.stub)
1684                .list_vpn_connections(self.0.request, self.0.options)
1685                .await
1686                .map(gax::response::Response::into_body)
1687        }
1688
1689        /// Streams each page in the collection.
1690        pub fn by_page(
1691            self,
1692        ) -> impl gax::paginator::Paginator<crate::model::ListVpnConnectionsResponse, gax::error::Error>
1693        {
1694            use std::clone::Clone;
1695            let token = self.0.request.page_token.clone();
1696            let execute = move |token: String| {
1697                let mut builder = self.clone();
1698                builder.0.request = builder.0.request.set_page_token(token);
1699                builder.send()
1700            };
1701            gax::paginator::internal::new_paginator(token, execute)
1702        }
1703
1704        /// Streams each item in the collection.
1705        pub fn by_item(
1706            self,
1707        ) -> impl gax::paginator::ItemPaginator<
1708            crate::model::ListVpnConnectionsResponse,
1709            gax::error::Error,
1710        > {
1711            use gax::paginator::Paginator;
1712            self.by_page().items()
1713        }
1714
1715        /// Sets the value of [parent][crate::model::ListVpnConnectionsRequest::parent].
1716        ///
1717        /// This is a **required** field for requests.
1718        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1719            self.0.request.parent = v.into();
1720            self
1721        }
1722
1723        /// Sets the value of [page_size][crate::model::ListVpnConnectionsRequest::page_size].
1724        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1725            self.0.request.page_size = v.into();
1726            self
1727        }
1728
1729        /// Sets the value of [page_token][crate::model::ListVpnConnectionsRequest::page_token].
1730        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1731            self.0.request.page_token = v.into();
1732            self
1733        }
1734
1735        /// Sets the value of [filter][crate::model::ListVpnConnectionsRequest::filter].
1736        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1737            self.0.request.filter = v.into();
1738            self
1739        }
1740
1741        /// Sets the value of [order_by][crate::model::ListVpnConnectionsRequest::order_by].
1742        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1743            self.0.request.order_by = v.into();
1744            self
1745        }
1746    }
1747
1748    #[doc(hidden)]
1749    impl gax::options::internal::RequestBuilder for ListVpnConnections {
1750        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1751            &mut self.0.options
1752        }
1753    }
1754
1755    /// The request builder for [EdgeContainer::get_vpn_connection][crate::client::EdgeContainer::get_vpn_connection] calls.
1756    ///
1757    /// # Example
1758    /// ```no_run
1759    /// # use google_cloud_edgecontainer_v1::builder;
1760    /// use builder::edge_container::GetVpnConnection;
1761    /// # tokio_test::block_on(async {
1762    ///
1763    /// let builder = prepare_request_builder();
1764    /// let response = builder.send().await?;
1765    /// # gax::Result::<()>::Ok(()) });
1766    ///
1767    /// fn prepare_request_builder() -> GetVpnConnection {
1768    ///   # panic!();
1769    ///   // ... details omitted ...
1770    /// }
1771    /// ```
1772    #[derive(Clone, Debug)]
1773    pub struct GetVpnConnection(RequestBuilder<crate::model::GetVpnConnectionRequest>);
1774
1775    impl GetVpnConnection {
1776        pub(crate) fn new(
1777            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1778        ) -> Self {
1779            Self(RequestBuilder::new(stub))
1780        }
1781
1782        /// Sets the full request, replacing any prior values.
1783        pub fn with_request<V: Into<crate::model::GetVpnConnectionRequest>>(
1784            mut self,
1785            v: V,
1786        ) -> Self {
1787            self.0.request = v.into();
1788            self
1789        }
1790
1791        /// Sets all the options, replacing any prior values.
1792        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1793            self.0.options = v.into();
1794            self
1795        }
1796
1797        /// Sends the request.
1798        pub async fn send(self) -> Result<crate::model::VpnConnection> {
1799            (*self.0.stub)
1800                .get_vpn_connection(self.0.request, self.0.options)
1801                .await
1802                .map(gax::response::Response::into_body)
1803        }
1804
1805        /// Sets the value of [name][crate::model::GetVpnConnectionRequest::name].
1806        ///
1807        /// This is a **required** field for requests.
1808        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1809            self.0.request.name = v.into();
1810            self
1811        }
1812    }
1813
1814    #[doc(hidden)]
1815    impl gax::options::internal::RequestBuilder for GetVpnConnection {
1816        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1817            &mut self.0.options
1818        }
1819    }
1820
1821    /// The request builder for [EdgeContainer::create_vpn_connection][crate::client::EdgeContainer::create_vpn_connection] calls.
1822    ///
1823    /// # Example
1824    /// ```no_run
1825    /// # use google_cloud_edgecontainer_v1::builder;
1826    /// use builder::edge_container::CreateVpnConnection;
1827    /// # tokio_test::block_on(async {
1828    /// use lro::Poller;
1829    ///
1830    /// let builder = prepare_request_builder();
1831    /// let response = builder.poller().until_done().await?;
1832    /// # gax::Result::<()>::Ok(()) });
1833    ///
1834    /// fn prepare_request_builder() -> CreateVpnConnection {
1835    ///   # panic!();
1836    ///   // ... details omitted ...
1837    /// }
1838    /// ```
1839    #[derive(Clone, Debug)]
1840    pub struct CreateVpnConnection(RequestBuilder<crate::model::CreateVpnConnectionRequest>);
1841
1842    impl CreateVpnConnection {
1843        pub(crate) fn new(
1844            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1845        ) -> Self {
1846            Self(RequestBuilder::new(stub))
1847        }
1848
1849        /// Sets the full request, replacing any prior values.
1850        pub fn with_request<V: Into<crate::model::CreateVpnConnectionRequest>>(
1851            mut self,
1852            v: V,
1853        ) -> Self {
1854            self.0.request = v.into();
1855            self
1856        }
1857
1858        /// Sets all the options, replacing any prior values.
1859        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1860            self.0.options = v.into();
1861            self
1862        }
1863
1864        /// Sends the request.
1865        ///
1866        /// # Long running operations
1867        ///
1868        /// This starts, but does not poll, a longrunning operation. More information
1869        /// on [create_vpn_connection][crate::client::EdgeContainer::create_vpn_connection].
1870        pub async fn send(self) -> Result<longrunning::model::Operation> {
1871            (*self.0.stub)
1872                .create_vpn_connection(self.0.request, self.0.options)
1873                .await
1874                .map(gax::response::Response::into_body)
1875        }
1876
1877        /// Creates a [Poller][lro::Poller] to work with `create_vpn_connection`.
1878        pub fn poller(
1879            self,
1880        ) -> impl lro::Poller<crate::model::VpnConnection, crate::model::OperationMetadata>
1881        {
1882            type Operation = lro::internal::Operation<
1883                crate::model::VpnConnection,
1884                crate::model::OperationMetadata,
1885            >;
1886            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1887            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1888
1889            let stub = self.0.stub.clone();
1890            let mut options = self.0.options.clone();
1891            options.set_retry_policy(gax::retry_policy::NeverRetry);
1892            let query = move |name| {
1893                let stub = stub.clone();
1894                let options = options.clone();
1895                async {
1896                    let op = GetOperation::new(stub)
1897                        .set_name(name)
1898                        .with_options(options)
1899                        .send()
1900                        .await?;
1901                    Ok(Operation::new(op))
1902                }
1903            };
1904
1905            let start = move || async {
1906                let op = self.send().await?;
1907                Ok(Operation::new(op))
1908            };
1909
1910            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1911        }
1912
1913        /// Sets the value of [parent][crate::model::CreateVpnConnectionRequest::parent].
1914        ///
1915        /// This is a **required** field for requests.
1916        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1917            self.0.request.parent = v.into();
1918            self
1919        }
1920
1921        /// Sets the value of [vpn_connection_id][crate::model::CreateVpnConnectionRequest::vpn_connection_id].
1922        ///
1923        /// This is a **required** field for requests.
1924        pub fn set_vpn_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1925            self.0.request.vpn_connection_id = v.into();
1926            self
1927        }
1928
1929        /// Sets the value of [vpn_connection][crate::model::CreateVpnConnectionRequest::vpn_connection].
1930        ///
1931        /// This is a **required** field for requests.
1932        pub fn set_vpn_connection<T>(mut self, v: T) -> Self
1933        where
1934            T: std::convert::Into<crate::model::VpnConnection>,
1935        {
1936            self.0.request.vpn_connection = std::option::Option::Some(v.into());
1937            self
1938        }
1939
1940        /// Sets or clears the value of [vpn_connection][crate::model::CreateVpnConnectionRequest::vpn_connection].
1941        ///
1942        /// This is a **required** field for requests.
1943        pub fn set_or_clear_vpn_connection<T>(mut self, v: std::option::Option<T>) -> Self
1944        where
1945            T: std::convert::Into<crate::model::VpnConnection>,
1946        {
1947            self.0.request.vpn_connection = v.map(|x| x.into());
1948            self
1949        }
1950
1951        /// Sets the value of [request_id][crate::model::CreateVpnConnectionRequest::request_id].
1952        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1953            self.0.request.request_id = v.into();
1954            self
1955        }
1956    }
1957
1958    #[doc(hidden)]
1959    impl gax::options::internal::RequestBuilder for CreateVpnConnection {
1960        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1961            &mut self.0.options
1962        }
1963    }
1964
1965    /// The request builder for [EdgeContainer::delete_vpn_connection][crate::client::EdgeContainer::delete_vpn_connection] calls.
1966    ///
1967    /// # Example
1968    /// ```no_run
1969    /// # use google_cloud_edgecontainer_v1::builder;
1970    /// use builder::edge_container::DeleteVpnConnection;
1971    /// # tokio_test::block_on(async {
1972    /// use lro::Poller;
1973    ///
1974    /// let builder = prepare_request_builder();
1975    /// let response = builder.poller().until_done().await?;
1976    /// # gax::Result::<()>::Ok(()) });
1977    ///
1978    /// fn prepare_request_builder() -> DeleteVpnConnection {
1979    ///   # panic!();
1980    ///   // ... details omitted ...
1981    /// }
1982    /// ```
1983    #[derive(Clone, Debug)]
1984    pub struct DeleteVpnConnection(RequestBuilder<crate::model::DeleteVpnConnectionRequest>);
1985
1986    impl DeleteVpnConnection {
1987        pub(crate) fn new(
1988            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1989        ) -> Self {
1990            Self(RequestBuilder::new(stub))
1991        }
1992
1993        /// Sets the full request, replacing any prior values.
1994        pub fn with_request<V: Into<crate::model::DeleteVpnConnectionRequest>>(
1995            mut self,
1996            v: V,
1997        ) -> Self {
1998            self.0.request = v.into();
1999            self
2000        }
2001
2002        /// Sets all the options, replacing any prior values.
2003        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2004            self.0.options = v.into();
2005            self
2006        }
2007
2008        /// Sends the request.
2009        ///
2010        /// # Long running operations
2011        ///
2012        /// This starts, but does not poll, a longrunning operation. More information
2013        /// on [delete_vpn_connection][crate::client::EdgeContainer::delete_vpn_connection].
2014        pub async fn send(self) -> Result<longrunning::model::Operation> {
2015            (*self.0.stub)
2016                .delete_vpn_connection(self.0.request, self.0.options)
2017                .await
2018                .map(gax::response::Response::into_body)
2019        }
2020
2021        /// Creates a [Poller][lro::Poller] to work with `delete_vpn_connection`.
2022        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2023            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2024            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2025            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2026
2027            let stub = self.0.stub.clone();
2028            let mut options = self.0.options.clone();
2029            options.set_retry_policy(gax::retry_policy::NeverRetry);
2030            let query = move |name| {
2031                let stub = stub.clone();
2032                let options = options.clone();
2033                async {
2034                    let op = GetOperation::new(stub)
2035                        .set_name(name)
2036                        .with_options(options)
2037                        .send()
2038                        .await?;
2039                    Ok(Operation::new(op))
2040                }
2041            };
2042
2043            let start = move || async {
2044                let op = self.send().await?;
2045                Ok(Operation::new(op))
2046            };
2047
2048            lro::internal::new_unit_response_poller(
2049                polling_error_policy,
2050                polling_backoff_policy,
2051                start,
2052                query,
2053            )
2054        }
2055
2056        /// Sets the value of [name][crate::model::DeleteVpnConnectionRequest::name].
2057        ///
2058        /// This is a **required** field for requests.
2059        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2060            self.0.request.name = v.into();
2061            self
2062        }
2063
2064        /// Sets the value of [request_id][crate::model::DeleteVpnConnectionRequest::request_id].
2065        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2066            self.0.request.request_id = v.into();
2067            self
2068        }
2069    }
2070
2071    #[doc(hidden)]
2072    impl gax::options::internal::RequestBuilder for DeleteVpnConnection {
2073        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2074            &mut self.0.options
2075        }
2076    }
2077
2078    /// The request builder for [EdgeContainer::get_server_config][crate::client::EdgeContainer::get_server_config] calls.
2079    ///
2080    /// # Example
2081    /// ```no_run
2082    /// # use google_cloud_edgecontainer_v1::builder;
2083    /// use builder::edge_container::GetServerConfig;
2084    /// # tokio_test::block_on(async {
2085    ///
2086    /// let builder = prepare_request_builder();
2087    /// let response = builder.send().await?;
2088    /// # gax::Result::<()>::Ok(()) });
2089    ///
2090    /// fn prepare_request_builder() -> GetServerConfig {
2091    ///   # panic!();
2092    ///   // ... details omitted ...
2093    /// }
2094    /// ```
2095    #[derive(Clone, Debug)]
2096    pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
2097
2098    impl GetServerConfig {
2099        pub(crate) fn new(
2100            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2101        ) -> Self {
2102            Self(RequestBuilder::new(stub))
2103        }
2104
2105        /// Sets the full request, replacing any prior values.
2106        pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
2107            self.0.request = v.into();
2108            self
2109        }
2110
2111        /// Sets all the options, replacing any prior values.
2112        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2113            self.0.options = v.into();
2114            self
2115        }
2116
2117        /// Sends the request.
2118        pub async fn send(self) -> Result<crate::model::ServerConfig> {
2119            (*self.0.stub)
2120                .get_server_config(self.0.request, self.0.options)
2121                .await
2122                .map(gax::response::Response::into_body)
2123        }
2124
2125        /// Sets the value of [name][crate::model::GetServerConfigRequest::name].
2126        ///
2127        /// This is a **required** field for requests.
2128        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2129            self.0.request.name = v.into();
2130            self
2131        }
2132    }
2133
2134    #[doc(hidden)]
2135    impl gax::options::internal::RequestBuilder for GetServerConfig {
2136        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2137            &mut self.0.options
2138        }
2139    }
2140
2141    /// The request builder for [EdgeContainer::list_locations][crate::client::EdgeContainer::list_locations] calls.
2142    ///
2143    /// # Example
2144    /// ```no_run
2145    /// # use google_cloud_edgecontainer_v1::builder;
2146    /// use builder::edge_container::ListLocations;
2147    /// # tokio_test::block_on(async {
2148    /// use gax::paginator::ItemPaginator;
2149    ///
2150    /// let builder = prepare_request_builder();
2151    /// let mut items = builder.by_item();
2152    /// while let Some(result) = items.next().await {
2153    ///   let item = result?;
2154    /// }
2155    /// # gax::Result::<()>::Ok(()) });
2156    ///
2157    /// fn prepare_request_builder() -> ListLocations {
2158    ///   # panic!();
2159    ///   // ... details omitted ...
2160    /// }
2161    /// ```
2162    #[derive(Clone, Debug)]
2163    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2164
2165    impl ListLocations {
2166        pub(crate) fn new(
2167            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2168        ) -> Self {
2169            Self(RequestBuilder::new(stub))
2170        }
2171
2172        /// Sets the full request, replacing any prior values.
2173        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2174            mut self,
2175            v: V,
2176        ) -> Self {
2177            self.0.request = v.into();
2178            self
2179        }
2180
2181        /// Sets all the options, replacing any prior values.
2182        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2183            self.0.options = v.into();
2184            self
2185        }
2186
2187        /// Sends the request.
2188        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2189            (*self.0.stub)
2190                .list_locations(self.0.request, self.0.options)
2191                .await
2192                .map(gax::response::Response::into_body)
2193        }
2194
2195        /// Streams each page in the collection.
2196        pub fn by_page(
2197            self,
2198        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2199        {
2200            use std::clone::Clone;
2201            let token = self.0.request.page_token.clone();
2202            let execute = move |token: String| {
2203                let mut builder = self.clone();
2204                builder.0.request = builder.0.request.set_page_token(token);
2205                builder.send()
2206            };
2207            gax::paginator::internal::new_paginator(token, execute)
2208        }
2209
2210        /// Streams each item in the collection.
2211        pub fn by_item(
2212            self,
2213        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2214        {
2215            use gax::paginator::Paginator;
2216            self.by_page().items()
2217        }
2218
2219        /// Sets the value of [name][location::model::ListLocationsRequest::name].
2220        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2221            self.0.request.name = v.into();
2222            self
2223        }
2224
2225        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
2226        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2227            self.0.request.filter = v.into();
2228            self
2229        }
2230
2231        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
2232        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2233            self.0.request.page_size = v.into();
2234            self
2235        }
2236
2237        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
2238        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2239            self.0.request.page_token = v.into();
2240            self
2241        }
2242    }
2243
2244    #[doc(hidden)]
2245    impl gax::options::internal::RequestBuilder for ListLocations {
2246        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2247            &mut self.0.options
2248        }
2249    }
2250
2251    /// The request builder for [EdgeContainer::get_location][crate::client::EdgeContainer::get_location] calls.
2252    ///
2253    /// # Example
2254    /// ```no_run
2255    /// # use google_cloud_edgecontainer_v1::builder;
2256    /// use builder::edge_container::GetLocation;
2257    /// # tokio_test::block_on(async {
2258    ///
2259    /// let builder = prepare_request_builder();
2260    /// let response = builder.send().await?;
2261    /// # gax::Result::<()>::Ok(()) });
2262    ///
2263    /// fn prepare_request_builder() -> GetLocation {
2264    ///   # panic!();
2265    ///   // ... details omitted ...
2266    /// }
2267    /// ```
2268    #[derive(Clone, Debug)]
2269    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2270
2271    impl GetLocation {
2272        pub(crate) fn new(
2273            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2274        ) -> Self {
2275            Self(RequestBuilder::new(stub))
2276        }
2277
2278        /// Sets the full request, replacing any prior values.
2279        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2280            self.0.request = v.into();
2281            self
2282        }
2283
2284        /// Sets all the options, replacing any prior values.
2285        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2286            self.0.options = v.into();
2287            self
2288        }
2289
2290        /// Sends the request.
2291        pub async fn send(self) -> Result<location::model::Location> {
2292            (*self.0.stub)
2293                .get_location(self.0.request, self.0.options)
2294                .await
2295                .map(gax::response::Response::into_body)
2296        }
2297
2298        /// Sets the value of [name][location::model::GetLocationRequest::name].
2299        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2300            self.0.request.name = v.into();
2301            self
2302        }
2303    }
2304
2305    #[doc(hidden)]
2306    impl gax::options::internal::RequestBuilder for GetLocation {
2307        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2308            &mut self.0.options
2309        }
2310    }
2311
2312    /// The request builder for [EdgeContainer::list_operations][crate::client::EdgeContainer::list_operations] calls.
2313    ///
2314    /// # Example
2315    /// ```no_run
2316    /// # use google_cloud_edgecontainer_v1::builder;
2317    /// use builder::edge_container::ListOperations;
2318    /// # tokio_test::block_on(async {
2319    /// use gax::paginator::ItemPaginator;
2320    ///
2321    /// let builder = prepare_request_builder();
2322    /// let mut items = builder.by_item();
2323    /// while let Some(result) = items.next().await {
2324    ///   let item = result?;
2325    /// }
2326    /// # gax::Result::<()>::Ok(()) });
2327    ///
2328    /// fn prepare_request_builder() -> ListOperations {
2329    ///   # panic!();
2330    ///   // ... details omitted ...
2331    /// }
2332    /// ```
2333    #[derive(Clone, Debug)]
2334    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2335
2336    impl ListOperations {
2337        pub(crate) fn new(
2338            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2339        ) -> Self {
2340            Self(RequestBuilder::new(stub))
2341        }
2342
2343        /// Sets the full request, replacing any prior values.
2344        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2345            mut self,
2346            v: V,
2347        ) -> Self {
2348            self.0.request = v.into();
2349            self
2350        }
2351
2352        /// Sets all the options, replacing any prior values.
2353        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2354            self.0.options = v.into();
2355            self
2356        }
2357
2358        /// Sends the request.
2359        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2360            (*self.0.stub)
2361                .list_operations(self.0.request, self.0.options)
2362                .await
2363                .map(gax::response::Response::into_body)
2364        }
2365
2366        /// Streams each page in the collection.
2367        pub fn by_page(
2368            self,
2369        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2370        {
2371            use std::clone::Clone;
2372            let token = self.0.request.page_token.clone();
2373            let execute = move |token: String| {
2374                let mut builder = self.clone();
2375                builder.0.request = builder.0.request.set_page_token(token);
2376                builder.send()
2377            };
2378            gax::paginator::internal::new_paginator(token, execute)
2379        }
2380
2381        /// Streams each item in the collection.
2382        pub fn by_item(
2383            self,
2384        ) -> impl gax::paginator::ItemPaginator<
2385            longrunning::model::ListOperationsResponse,
2386            gax::error::Error,
2387        > {
2388            use gax::paginator::Paginator;
2389            self.by_page().items()
2390        }
2391
2392        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2393        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2394            self.0.request.name = v.into();
2395            self
2396        }
2397
2398        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2399        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2400            self.0.request.filter = v.into();
2401            self
2402        }
2403
2404        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2405        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2406            self.0.request.page_size = v.into();
2407            self
2408        }
2409
2410        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2411        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2412            self.0.request.page_token = v.into();
2413            self
2414        }
2415
2416        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
2417        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2418            self.0.request.return_partial_success = v.into();
2419            self
2420        }
2421    }
2422
2423    #[doc(hidden)]
2424    impl gax::options::internal::RequestBuilder for ListOperations {
2425        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2426            &mut self.0.options
2427        }
2428    }
2429
2430    /// The request builder for [EdgeContainer::get_operation][crate::client::EdgeContainer::get_operation] calls.
2431    ///
2432    /// # Example
2433    /// ```no_run
2434    /// # use google_cloud_edgecontainer_v1::builder;
2435    /// use builder::edge_container::GetOperation;
2436    /// # tokio_test::block_on(async {
2437    ///
2438    /// let builder = prepare_request_builder();
2439    /// let response = builder.send().await?;
2440    /// # gax::Result::<()>::Ok(()) });
2441    ///
2442    /// fn prepare_request_builder() -> GetOperation {
2443    ///   # panic!();
2444    ///   // ... details omitted ...
2445    /// }
2446    /// ```
2447    #[derive(Clone, Debug)]
2448    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2449
2450    impl GetOperation {
2451        pub(crate) fn new(
2452            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2453        ) -> Self {
2454            Self(RequestBuilder::new(stub))
2455        }
2456
2457        /// Sets the full request, replacing any prior values.
2458        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2459            mut self,
2460            v: V,
2461        ) -> Self {
2462            self.0.request = v.into();
2463            self
2464        }
2465
2466        /// Sets all the options, replacing any prior values.
2467        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2468            self.0.options = v.into();
2469            self
2470        }
2471
2472        /// Sends the request.
2473        pub async fn send(self) -> Result<longrunning::model::Operation> {
2474            (*self.0.stub)
2475                .get_operation(self.0.request, self.0.options)
2476                .await
2477                .map(gax::response::Response::into_body)
2478        }
2479
2480        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2481        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2482            self.0.request.name = v.into();
2483            self
2484        }
2485    }
2486
2487    #[doc(hidden)]
2488    impl gax::options::internal::RequestBuilder for GetOperation {
2489        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2490            &mut self.0.options
2491        }
2492    }
2493
2494    /// The request builder for [EdgeContainer::delete_operation][crate::client::EdgeContainer::delete_operation] calls.
2495    ///
2496    /// # Example
2497    /// ```no_run
2498    /// # use google_cloud_edgecontainer_v1::builder;
2499    /// use builder::edge_container::DeleteOperation;
2500    /// # tokio_test::block_on(async {
2501    ///
2502    /// let builder = prepare_request_builder();
2503    /// let response = builder.send().await?;
2504    /// # gax::Result::<()>::Ok(()) });
2505    ///
2506    /// fn prepare_request_builder() -> DeleteOperation {
2507    ///   # panic!();
2508    ///   // ... details omitted ...
2509    /// }
2510    /// ```
2511    #[derive(Clone, Debug)]
2512    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2513
2514    impl DeleteOperation {
2515        pub(crate) fn new(
2516            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2517        ) -> Self {
2518            Self(RequestBuilder::new(stub))
2519        }
2520
2521        /// Sets the full request, replacing any prior values.
2522        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2523            mut self,
2524            v: V,
2525        ) -> Self {
2526            self.0.request = v.into();
2527            self
2528        }
2529
2530        /// Sets all the options, replacing any prior values.
2531        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2532            self.0.options = v.into();
2533            self
2534        }
2535
2536        /// Sends the request.
2537        pub async fn send(self) -> Result<()> {
2538            (*self.0.stub)
2539                .delete_operation(self.0.request, self.0.options)
2540                .await
2541                .map(gax::response::Response::into_body)
2542        }
2543
2544        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
2545        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2546            self.0.request.name = v.into();
2547            self
2548        }
2549    }
2550
2551    #[doc(hidden)]
2552    impl gax::options::internal::RequestBuilder for DeleteOperation {
2553        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2554            &mut self.0.options
2555        }
2556    }
2557
2558    /// The request builder for [EdgeContainer::cancel_operation][crate::client::EdgeContainer::cancel_operation] calls.
2559    ///
2560    /// # Example
2561    /// ```no_run
2562    /// # use google_cloud_edgecontainer_v1::builder;
2563    /// use builder::edge_container::CancelOperation;
2564    /// # tokio_test::block_on(async {
2565    ///
2566    /// let builder = prepare_request_builder();
2567    /// let response = builder.send().await?;
2568    /// # gax::Result::<()>::Ok(()) });
2569    ///
2570    /// fn prepare_request_builder() -> CancelOperation {
2571    ///   # panic!();
2572    ///   // ... details omitted ...
2573    /// }
2574    /// ```
2575    #[derive(Clone, Debug)]
2576    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2577
2578    impl CancelOperation {
2579        pub(crate) fn new(
2580            stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2581        ) -> Self {
2582            Self(RequestBuilder::new(stub))
2583        }
2584
2585        /// Sets the full request, replacing any prior values.
2586        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2587            mut self,
2588            v: V,
2589        ) -> Self {
2590            self.0.request = v.into();
2591            self
2592        }
2593
2594        /// Sets all the options, replacing any prior values.
2595        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2596            self.0.options = v.into();
2597            self
2598        }
2599
2600        /// Sends the request.
2601        pub async fn send(self) -> Result<()> {
2602            (*self.0.stub)
2603                .cancel_operation(self.0.request, self.0.options)
2604                .await
2605                .map(gax::response::Response::into_body)
2606        }
2607
2608        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2609        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2610            self.0.request.name = v.into();
2611            self
2612        }
2613    }
2614
2615    #[doc(hidden)]
2616    impl gax::options::internal::RequestBuilder for CancelOperation {
2617        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2618            &mut self.0.options
2619        }
2620    }
2621}