Skip to main content

google_cloud_edgecontainer_v1/
builder.rs

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