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