Skip to main content

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