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