google_cloud_edgecontainer_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod edge_container {
18    use crate::Result;
19    use std::sync::Arc;
20
21    /// A builder for [EdgeContainer][super::super::client::EdgeContainer].
22    ///
23    /// ```
24    /// # tokio_test::block_on(async {
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    /// # gax::Result::<()>::Ok(()) });
33    /// ```
34    pub type ClientBuilder =
35        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
36
37    pub(crate) mod client {
38        use super::super::super::client::EdgeContainer;
39        pub struct Factory;
40        impl gax::client_builder::internal::ClientFactory for Factory {
41            type Client = EdgeContainer;
42            type Credentials = gaxi::options::Credentials;
43            async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
44                Self::Client::new(config).await
45            }
46        }
47    }
48
49    /// Common implementation for [super::super::client::EdgeContainer] request builders.
50    #[derive(Clone, Debug)]
51    pub(crate) struct RequestBuilder<R: std::default::Default> {
52        stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>,
53        request: R,
54        options: gax::options::RequestOptions,
55    }
56
57    impl<R> RequestBuilder<R>
58    where
59        R: std::default::Default,
60    {
61        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
62            Self {
63                stub,
64                request: R::default(),
65                options: gax::options::RequestOptions::default(),
66            }
67        }
68    }
69
70    /// The request builder for [EdgeContainer::list_clusters][super::super::client::EdgeContainer::list_clusters] calls.
71    #[derive(Clone, Debug)]
72    pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
73
74    impl ListClusters {
75        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
76            Self(RequestBuilder::new(stub))
77        }
78
79        /// Sets the full request, replacing any prior values.
80        pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
81            self.0.request = v.into();
82            self
83        }
84
85        /// Sets all the options, replacing any prior values.
86        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
87            self.0.options = v.into();
88            self
89        }
90
91        /// Sends the request.
92        pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
93            (*self.0.stub)
94                .list_clusters(self.0.request, self.0.options)
95                .await
96                .map(gax::response::Response::into_body)
97        }
98
99        /// Streams the responses back.
100        pub async fn paginator(
101            self,
102        ) -> impl gax::paginator::Paginator<crate::model::ListClustersResponse, gax::error::Error>
103        {
104            use std::clone::Clone;
105            let token = self.0.request.page_token.clone();
106            let execute = move |token: String| {
107                let mut builder = self.clone();
108                builder.0.request = builder.0.request.set_page_token(token);
109                builder.send()
110            };
111            gax::paginator::internal::new_paginator(token, execute)
112        }
113
114        /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
115        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
116            self.0.request.parent = v.into();
117            self
118        }
119
120        /// Sets the value of [page_size][crate::model::ListClustersRequest::page_size].
121        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
122            self.0.request.page_size = v.into();
123            self
124        }
125
126        /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
127        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
128            self.0.request.page_token = v.into();
129            self
130        }
131
132        /// Sets the value of [filter][crate::model::ListClustersRequest::filter].
133        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
134            self.0.request.filter = v.into();
135            self
136        }
137
138        /// Sets the value of [order_by][crate::model::ListClustersRequest::order_by].
139        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
140            self.0.request.order_by = v.into();
141            self
142        }
143    }
144
145    #[doc(hidden)]
146    impl gax::options::internal::RequestBuilder for ListClusters {
147        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
148            &mut self.0.options
149        }
150    }
151
152    /// The request builder for [EdgeContainer::get_cluster][super::super::client::EdgeContainer::get_cluster] calls.
153    #[derive(Clone, Debug)]
154    pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
155
156    impl GetCluster {
157        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
158            Self(RequestBuilder::new(stub))
159        }
160
161        /// Sets the full request, replacing any prior values.
162        pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
163            self.0.request = v.into();
164            self
165        }
166
167        /// Sets all the options, replacing any prior values.
168        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
169            self.0.options = v.into();
170            self
171        }
172
173        /// Sends the request.
174        pub async fn send(self) -> Result<crate::model::Cluster> {
175            (*self.0.stub)
176                .get_cluster(self.0.request, self.0.options)
177                .await
178                .map(gax::response::Response::into_body)
179        }
180
181        /// Sets the value of [name][crate::model::GetClusterRequest::name].
182        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
183            self.0.request.name = v.into();
184            self
185        }
186    }
187
188    #[doc(hidden)]
189    impl gax::options::internal::RequestBuilder for GetCluster {
190        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
191            &mut self.0.options
192        }
193    }
194
195    /// The request builder for [EdgeContainer::create_cluster][super::super::client::EdgeContainer::create_cluster] calls.
196    #[derive(Clone, Debug)]
197    pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
198
199    impl CreateCluster {
200        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
201            Self(RequestBuilder::new(stub))
202        }
203
204        /// Sets the full request, replacing any prior values.
205        pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
206            self.0.request = v.into();
207            self
208        }
209
210        /// Sets all the options, replacing any prior values.
211        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
212            self.0.options = v.into();
213            self
214        }
215
216        /// Sends the request.
217        ///
218        /// # Long running operations
219        ///
220        /// This starts, but does not poll, a longrunning operation. More information
221        /// on [create_cluster][super::super::client::EdgeContainer::create_cluster].
222        pub async fn send(self) -> Result<longrunning::model::Operation> {
223            (*self.0.stub)
224                .create_cluster(self.0.request, self.0.options)
225                .await
226                .map(gax::response::Response::into_body)
227        }
228
229        /// Creates a [Poller][lro::Poller] to work with `create_cluster`.
230        pub fn poller(
231            self,
232        ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
233            type Operation = lro::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
234            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
235            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
236
237            let stub = self.0.stub.clone();
238            let mut options = self.0.options.clone();
239            options.set_retry_policy(gax::retry_policy::NeverRetry);
240            let query = move |name| {
241                let stub = stub.clone();
242                let options = options.clone();
243                async {
244                    let op = GetOperation::new(stub)
245                        .set_name(name)
246                        .with_options(options)
247                        .send()
248                        .await?;
249                    Ok(Operation::new(op))
250                }
251            };
252
253            let start = move || async {
254                let op = self.send().await?;
255                Ok(Operation::new(op))
256            };
257
258            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
259        }
260
261        /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
262        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
263            self.0.request.parent = v.into();
264            self
265        }
266
267        /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
268        pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
269            self.0.request.cluster_id = v.into();
270            self
271        }
272
273        /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
274        pub fn set_cluster<T: Into<std::option::Option<crate::model::Cluster>>>(
275            mut self,
276            v: T,
277        ) -> Self {
278            self.0.request.cluster = v.into();
279            self
280        }
281
282        /// Sets the value of [request_id][crate::model::CreateClusterRequest::request_id].
283        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
284            self.0.request.request_id = v.into();
285            self
286        }
287    }
288
289    #[doc(hidden)]
290    impl gax::options::internal::RequestBuilder for CreateCluster {
291        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
292            &mut self.0.options
293        }
294    }
295
296    /// The request builder for [EdgeContainer::update_cluster][super::super::client::EdgeContainer::update_cluster] calls.
297    #[derive(Clone, Debug)]
298    pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
299
300    impl UpdateCluster {
301        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
302            Self(RequestBuilder::new(stub))
303        }
304
305        /// Sets the full request, replacing any prior values.
306        pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
307            self.0.request = v.into();
308            self
309        }
310
311        /// Sets all the options, replacing any prior values.
312        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
313            self.0.options = v.into();
314            self
315        }
316
317        /// Sends the request.
318        ///
319        /// # Long running operations
320        ///
321        /// This starts, but does not poll, a longrunning operation. More information
322        /// on [update_cluster][super::super::client::EdgeContainer::update_cluster].
323        pub async fn send(self) -> Result<longrunning::model::Operation> {
324            (*self.0.stub)
325                .update_cluster(self.0.request, self.0.options)
326                .await
327                .map(gax::response::Response::into_body)
328        }
329
330        /// Creates a [Poller][lro::Poller] to work with `update_cluster`.
331        pub fn poller(
332            self,
333        ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
334            type Operation = lro::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
335            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
336            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
337
338            let stub = self.0.stub.clone();
339            let mut options = self.0.options.clone();
340            options.set_retry_policy(gax::retry_policy::NeverRetry);
341            let query = move |name| {
342                let stub = stub.clone();
343                let options = options.clone();
344                async {
345                    let op = GetOperation::new(stub)
346                        .set_name(name)
347                        .with_options(options)
348                        .send()
349                        .await?;
350                    Ok(Operation::new(op))
351                }
352            };
353
354            let start = move || async {
355                let op = self.send().await?;
356                Ok(Operation::new(op))
357            };
358
359            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
360        }
361
362        /// Sets the value of [update_mask][crate::model::UpdateClusterRequest::update_mask].
363        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
364            mut self,
365            v: T,
366        ) -> Self {
367            self.0.request.update_mask = v.into();
368            self
369        }
370
371        /// Sets the value of [cluster][crate::model::UpdateClusterRequest::cluster].
372        pub fn set_cluster<T: Into<std::option::Option<crate::model::Cluster>>>(
373            mut self,
374            v: T,
375        ) -> Self {
376            self.0.request.cluster = v.into();
377            self
378        }
379
380        /// Sets the value of [request_id][crate::model::UpdateClusterRequest::request_id].
381        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
382            self.0.request.request_id = v.into();
383            self
384        }
385    }
386
387    #[doc(hidden)]
388    impl gax::options::internal::RequestBuilder for UpdateCluster {
389        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
390            &mut self.0.options
391        }
392    }
393
394    /// The request builder for [EdgeContainer::upgrade_cluster][super::super::client::EdgeContainer::upgrade_cluster] calls.
395    #[derive(Clone, Debug)]
396    pub struct UpgradeCluster(RequestBuilder<crate::model::UpgradeClusterRequest>);
397
398    impl UpgradeCluster {
399        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
400            Self(RequestBuilder::new(stub))
401        }
402
403        /// Sets the full request, replacing any prior values.
404        pub fn with_request<V: Into<crate::model::UpgradeClusterRequest>>(mut self, v: V) -> Self {
405            self.0.request = v.into();
406            self
407        }
408
409        /// Sets all the options, replacing any prior values.
410        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
411            self.0.options = v.into();
412            self
413        }
414
415        /// Sends the request.
416        ///
417        /// # Long running operations
418        ///
419        /// This starts, but does not poll, a longrunning operation. More information
420        /// on [upgrade_cluster][super::super::client::EdgeContainer::upgrade_cluster].
421        pub async fn send(self) -> Result<longrunning::model::Operation> {
422            (*self.0.stub)
423                .upgrade_cluster(self.0.request, self.0.options)
424                .await
425                .map(gax::response::Response::into_body)
426        }
427
428        /// Creates a [Poller][lro::Poller] to work with `upgrade_cluster`.
429        pub fn poller(
430            self,
431        ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
432            type Operation = lro::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
433            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
434            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
435
436            let stub = self.0.stub.clone();
437            let mut options = self.0.options.clone();
438            options.set_retry_policy(gax::retry_policy::NeverRetry);
439            let query = move |name| {
440                let stub = stub.clone();
441                let options = options.clone();
442                async {
443                    let op = GetOperation::new(stub)
444                        .set_name(name)
445                        .with_options(options)
446                        .send()
447                        .await?;
448                    Ok(Operation::new(op))
449                }
450            };
451
452            let start = move || async {
453                let op = self.send().await?;
454                Ok(Operation::new(op))
455            };
456
457            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
458        }
459
460        /// Sets the value of [name][crate::model::UpgradeClusterRequest::name].
461        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
462            self.0.request.name = v.into();
463            self
464        }
465
466        /// Sets the value of [target_version][crate::model::UpgradeClusterRequest::target_version].
467        pub fn set_target_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
468            self.0.request.target_version = v.into();
469            self
470        }
471
472        /// Sets the value of [schedule][crate::model::UpgradeClusterRequest::schedule].
473        pub fn set_schedule<T: Into<crate::model::upgrade_cluster_request::Schedule>>(
474            mut self,
475            v: T,
476        ) -> Self {
477            self.0.request.schedule = v.into();
478            self
479        }
480
481        /// Sets the value of [request_id][crate::model::UpgradeClusterRequest::request_id].
482        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
483            self.0.request.request_id = v.into();
484            self
485        }
486    }
487
488    #[doc(hidden)]
489    impl gax::options::internal::RequestBuilder for UpgradeCluster {
490        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
491            &mut self.0.options
492        }
493    }
494
495    /// The request builder for [EdgeContainer::delete_cluster][super::super::client::EdgeContainer::delete_cluster] calls.
496    #[derive(Clone, Debug)]
497    pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
498
499    impl DeleteCluster {
500        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
501            Self(RequestBuilder::new(stub))
502        }
503
504        /// Sets the full request, replacing any prior values.
505        pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
506            self.0.request = v.into();
507            self
508        }
509
510        /// Sets all the options, replacing any prior values.
511        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
512            self.0.options = v.into();
513            self
514        }
515
516        /// Sends the request.
517        ///
518        /// # Long running operations
519        ///
520        /// This starts, but does not poll, a longrunning operation. More information
521        /// on [delete_cluster][super::super::client::EdgeContainer::delete_cluster].
522        pub async fn send(self) -> Result<longrunning::model::Operation> {
523            (*self.0.stub)
524                .delete_cluster(self.0.request, self.0.options)
525                .await
526                .map(gax::response::Response::into_body)
527        }
528
529        /// Creates a [Poller][lro::Poller] to work with `delete_cluster`.
530        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
531            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
532            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
533            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
534
535            let stub = self.0.stub.clone();
536            let mut options = self.0.options.clone();
537            options.set_retry_policy(gax::retry_policy::NeverRetry);
538            let query = move |name| {
539                let stub = stub.clone();
540                let options = options.clone();
541                async {
542                    let op = GetOperation::new(stub)
543                        .set_name(name)
544                        .with_options(options)
545                        .send()
546                        .await?;
547                    Ok(Operation::new(op))
548                }
549            };
550
551            let start = move || async {
552                let op = self.send().await?;
553                Ok(Operation::new(op))
554            };
555
556            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
557        }
558
559        /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
560        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
561            self.0.request.name = v.into();
562            self
563        }
564
565        /// Sets the value of [request_id][crate::model::DeleteClusterRequest::request_id].
566        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
567            self.0.request.request_id = v.into();
568            self
569        }
570    }
571
572    #[doc(hidden)]
573    impl gax::options::internal::RequestBuilder for DeleteCluster {
574        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
575            &mut self.0.options
576        }
577    }
578
579    /// The request builder for [EdgeContainer::generate_access_token][super::super::client::EdgeContainer::generate_access_token] calls.
580    #[derive(Clone, Debug)]
581    pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
582
583    impl GenerateAccessToken {
584        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
585            Self(RequestBuilder::new(stub))
586        }
587
588        /// Sets the full request, replacing any prior values.
589        pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
590            mut self,
591            v: V,
592        ) -> Self {
593            self.0.request = v.into();
594            self
595        }
596
597        /// Sets all the options, replacing any prior values.
598        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
599            self.0.options = v.into();
600            self
601        }
602
603        /// Sends the request.
604        pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
605            (*self.0.stub)
606                .generate_access_token(self.0.request, self.0.options)
607                .await
608                .map(gax::response::Response::into_body)
609        }
610
611        /// Sets the value of [cluster][crate::model::GenerateAccessTokenRequest::cluster].
612        pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
613            self.0.request.cluster = v.into();
614            self
615        }
616    }
617
618    #[doc(hidden)]
619    impl gax::options::internal::RequestBuilder for GenerateAccessToken {
620        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
621            &mut self.0.options
622        }
623    }
624
625    /// The request builder for [EdgeContainer::generate_offline_credential][super::super::client::EdgeContainer::generate_offline_credential] calls.
626    #[derive(Clone, Debug)]
627    pub struct GenerateOfflineCredential(
628        RequestBuilder<crate::model::GenerateOfflineCredentialRequest>,
629    );
630
631    impl GenerateOfflineCredential {
632        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
633            Self(RequestBuilder::new(stub))
634        }
635
636        /// Sets the full request, replacing any prior values.
637        pub fn with_request<V: Into<crate::model::GenerateOfflineCredentialRequest>>(
638            mut self,
639            v: V,
640        ) -> Self {
641            self.0.request = v.into();
642            self
643        }
644
645        /// Sets all the options, replacing any prior values.
646        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
647            self.0.options = v.into();
648            self
649        }
650
651        /// Sends the request.
652        pub async fn send(self) -> Result<crate::model::GenerateOfflineCredentialResponse> {
653            (*self.0.stub)
654                .generate_offline_credential(self.0.request, self.0.options)
655                .await
656                .map(gax::response::Response::into_body)
657        }
658
659        /// Sets the value of [cluster][crate::model::GenerateOfflineCredentialRequest::cluster].
660        pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
661            self.0.request.cluster = v.into();
662            self
663        }
664    }
665
666    #[doc(hidden)]
667    impl gax::options::internal::RequestBuilder for GenerateOfflineCredential {
668        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
669            &mut self.0.options
670        }
671    }
672
673    /// The request builder for [EdgeContainer::list_node_pools][super::super::client::EdgeContainer::list_node_pools] calls.
674    #[derive(Clone, Debug)]
675    pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
676
677    impl ListNodePools {
678        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
679            Self(RequestBuilder::new(stub))
680        }
681
682        /// Sets the full request, replacing any prior values.
683        pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
684            self.0.request = v.into();
685            self
686        }
687
688        /// Sets all the options, replacing any prior values.
689        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
690            self.0.options = v.into();
691            self
692        }
693
694        /// Sends the request.
695        pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
696            (*self.0.stub)
697                .list_node_pools(self.0.request, self.0.options)
698                .await
699                .map(gax::response::Response::into_body)
700        }
701
702        /// Streams the responses back.
703        pub async fn paginator(
704            self,
705        ) -> impl gax::paginator::Paginator<crate::model::ListNodePoolsResponse, gax::error::Error>
706        {
707            use std::clone::Clone;
708            let token = self.0.request.page_token.clone();
709            let execute = move |token: String| {
710                let mut builder = self.clone();
711                builder.0.request = builder.0.request.set_page_token(token);
712                builder.send()
713            };
714            gax::paginator::internal::new_paginator(token, execute)
715        }
716
717        /// Sets the value of [parent][crate::model::ListNodePoolsRequest::parent].
718        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
719            self.0.request.parent = v.into();
720            self
721        }
722
723        /// Sets the value of [page_size][crate::model::ListNodePoolsRequest::page_size].
724        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
725            self.0.request.page_size = v.into();
726            self
727        }
728
729        /// Sets the value of [page_token][crate::model::ListNodePoolsRequest::page_token].
730        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
731            self.0.request.page_token = v.into();
732            self
733        }
734
735        /// Sets the value of [filter][crate::model::ListNodePoolsRequest::filter].
736        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
737            self.0.request.filter = v.into();
738            self
739        }
740
741        /// Sets the value of [order_by][crate::model::ListNodePoolsRequest::order_by].
742        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
743            self.0.request.order_by = v.into();
744            self
745        }
746    }
747
748    #[doc(hidden)]
749    impl gax::options::internal::RequestBuilder for ListNodePools {
750        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
751            &mut self.0.options
752        }
753    }
754
755    /// The request builder for [EdgeContainer::get_node_pool][super::super::client::EdgeContainer::get_node_pool] calls.
756    #[derive(Clone, Debug)]
757    pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
758
759    impl GetNodePool {
760        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
761            Self(RequestBuilder::new(stub))
762        }
763
764        /// Sets the full request, replacing any prior values.
765        pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
766            self.0.request = v.into();
767            self
768        }
769
770        /// Sets all the options, replacing any prior values.
771        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
772            self.0.options = v.into();
773            self
774        }
775
776        /// Sends the request.
777        pub async fn send(self) -> Result<crate::model::NodePool> {
778            (*self.0.stub)
779                .get_node_pool(self.0.request, self.0.options)
780                .await
781                .map(gax::response::Response::into_body)
782        }
783
784        /// Sets the value of [name][crate::model::GetNodePoolRequest::name].
785        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
786            self.0.request.name = v.into();
787            self
788        }
789    }
790
791    #[doc(hidden)]
792    impl gax::options::internal::RequestBuilder for GetNodePool {
793        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
794            &mut self.0.options
795        }
796    }
797
798    /// The request builder for [EdgeContainer::create_node_pool][super::super::client::EdgeContainer::create_node_pool] calls.
799    #[derive(Clone, Debug)]
800    pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
801
802    impl CreateNodePool {
803        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
804            Self(RequestBuilder::new(stub))
805        }
806
807        /// Sets the full request, replacing any prior values.
808        pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
809            self.0.request = v.into();
810            self
811        }
812
813        /// Sets all the options, replacing any prior values.
814        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
815            self.0.options = v.into();
816            self
817        }
818
819        /// Sends the request.
820        ///
821        /// # Long running operations
822        ///
823        /// This starts, but does not poll, a longrunning operation. More information
824        /// on [create_node_pool][super::super::client::EdgeContainer::create_node_pool].
825        pub async fn send(self) -> Result<longrunning::model::Operation> {
826            (*self.0.stub)
827                .create_node_pool(self.0.request, self.0.options)
828                .await
829                .map(gax::response::Response::into_body)
830        }
831
832        /// Creates a [Poller][lro::Poller] to work with `create_node_pool`.
833        pub fn poller(
834            self,
835        ) -> impl lro::Poller<crate::model::NodePool, crate::model::OperationMetadata> {
836            type Operation =
837                lro::Operation<crate::model::NodePool, crate::model::OperationMetadata>;
838            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
839            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
840
841            let stub = self.0.stub.clone();
842            let mut options = self.0.options.clone();
843            options.set_retry_policy(gax::retry_policy::NeverRetry);
844            let query = move |name| {
845                let stub = stub.clone();
846                let options = options.clone();
847                async {
848                    let op = GetOperation::new(stub)
849                        .set_name(name)
850                        .with_options(options)
851                        .send()
852                        .await?;
853                    Ok(Operation::new(op))
854                }
855            };
856
857            let start = move || async {
858                let op = self.send().await?;
859                Ok(Operation::new(op))
860            };
861
862            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
863        }
864
865        /// Sets the value of [parent][crate::model::CreateNodePoolRequest::parent].
866        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
867            self.0.request.parent = v.into();
868            self
869        }
870
871        /// Sets the value of [node_pool_id][crate::model::CreateNodePoolRequest::node_pool_id].
872        pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
873            self.0.request.node_pool_id = v.into();
874            self
875        }
876
877        /// Sets the value of [node_pool][crate::model::CreateNodePoolRequest::node_pool].
878        pub fn set_node_pool<T: Into<std::option::Option<crate::model::NodePool>>>(
879            mut self,
880            v: T,
881        ) -> Self {
882            self.0.request.node_pool = v.into();
883            self
884        }
885
886        /// Sets the value of [request_id][crate::model::CreateNodePoolRequest::request_id].
887        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
888            self.0.request.request_id = v.into();
889            self
890        }
891    }
892
893    #[doc(hidden)]
894    impl gax::options::internal::RequestBuilder for CreateNodePool {
895        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
896            &mut self.0.options
897        }
898    }
899
900    /// The request builder for [EdgeContainer::update_node_pool][super::super::client::EdgeContainer::update_node_pool] calls.
901    #[derive(Clone, Debug)]
902    pub struct UpdateNodePool(RequestBuilder<crate::model::UpdateNodePoolRequest>);
903
904    impl UpdateNodePool {
905        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
906            Self(RequestBuilder::new(stub))
907        }
908
909        /// Sets the full request, replacing any prior values.
910        pub fn with_request<V: Into<crate::model::UpdateNodePoolRequest>>(mut self, v: V) -> Self {
911            self.0.request = v.into();
912            self
913        }
914
915        /// Sets all the options, replacing any prior values.
916        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
917            self.0.options = v.into();
918            self
919        }
920
921        /// Sends the request.
922        ///
923        /// # Long running operations
924        ///
925        /// This starts, but does not poll, a longrunning operation. More information
926        /// on [update_node_pool][super::super::client::EdgeContainer::update_node_pool].
927        pub async fn send(self) -> Result<longrunning::model::Operation> {
928            (*self.0.stub)
929                .update_node_pool(self.0.request, self.0.options)
930                .await
931                .map(gax::response::Response::into_body)
932        }
933
934        /// Creates a [Poller][lro::Poller] to work with `update_node_pool`.
935        pub fn poller(
936            self,
937        ) -> impl lro::Poller<crate::model::NodePool, crate::model::OperationMetadata> {
938            type Operation =
939                lro::Operation<crate::model::NodePool, crate::model::OperationMetadata>;
940            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
941            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
942
943            let stub = self.0.stub.clone();
944            let mut options = self.0.options.clone();
945            options.set_retry_policy(gax::retry_policy::NeverRetry);
946            let query = move |name| {
947                let stub = stub.clone();
948                let options = options.clone();
949                async {
950                    let op = GetOperation::new(stub)
951                        .set_name(name)
952                        .with_options(options)
953                        .send()
954                        .await?;
955                    Ok(Operation::new(op))
956                }
957            };
958
959            let start = move || async {
960                let op = self.send().await?;
961                Ok(Operation::new(op))
962            };
963
964            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
965        }
966
967        /// Sets the value of [update_mask][crate::model::UpdateNodePoolRequest::update_mask].
968        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
969            mut self,
970            v: T,
971        ) -> Self {
972            self.0.request.update_mask = v.into();
973            self
974        }
975
976        /// Sets the value of [node_pool][crate::model::UpdateNodePoolRequest::node_pool].
977        pub fn set_node_pool<T: Into<std::option::Option<crate::model::NodePool>>>(
978            mut self,
979            v: T,
980        ) -> Self {
981            self.0.request.node_pool = v.into();
982            self
983        }
984
985        /// Sets the value of [request_id][crate::model::UpdateNodePoolRequest::request_id].
986        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
987            self.0.request.request_id = v.into();
988            self
989        }
990    }
991
992    #[doc(hidden)]
993    impl gax::options::internal::RequestBuilder for UpdateNodePool {
994        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
995            &mut self.0.options
996        }
997    }
998
999    /// The request builder for [EdgeContainer::delete_node_pool][super::super::client::EdgeContainer::delete_node_pool] calls.
1000    #[derive(Clone, Debug)]
1001    pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
1002
1003    impl DeleteNodePool {
1004        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1005            Self(RequestBuilder::new(stub))
1006        }
1007
1008        /// Sets the full request, replacing any prior values.
1009        pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
1010            self.0.request = v.into();
1011            self
1012        }
1013
1014        /// Sets all the options, replacing any prior values.
1015        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1016            self.0.options = v.into();
1017            self
1018        }
1019
1020        /// Sends the request.
1021        ///
1022        /// # Long running operations
1023        ///
1024        /// This starts, but does not poll, a longrunning operation. More information
1025        /// on [delete_node_pool][super::super::client::EdgeContainer::delete_node_pool].
1026        pub async fn send(self) -> Result<longrunning::model::Operation> {
1027            (*self.0.stub)
1028                .delete_node_pool(self.0.request, self.0.options)
1029                .await
1030                .map(gax::response::Response::into_body)
1031        }
1032
1033        /// Creates a [Poller][lro::Poller] to work with `delete_node_pool`.
1034        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
1035            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
1036            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1037            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1038
1039            let stub = self.0.stub.clone();
1040            let mut options = self.0.options.clone();
1041            options.set_retry_policy(gax::retry_policy::NeverRetry);
1042            let query = move |name| {
1043                let stub = stub.clone();
1044                let options = options.clone();
1045                async {
1046                    let op = GetOperation::new(stub)
1047                        .set_name(name)
1048                        .with_options(options)
1049                        .send()
1050                        .await?;
1051                    Ok(Operation::new(op))
1052                }
1053            };
1054
1055            let start = move || async {
1056                let op = self.send().await?;
1057                Ok(Operation::new(op))
1058            };
1059
1060            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1061        }
1062
1063        /// Sets the value of [name][crate::model::DeleteNodePoolRequest::name].
1064        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1065            self.0.request.name = v.into();
1066            self
1067        }
1068
1069        /// Sets the value of [request_id][crate::model::DeleteNodePoolRequest::request_id].
1070        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1071            self.0.request.request_id = v.into();
1072            self
1073        }
1074    }
1075
1076    #[doc(hidden)]
1077    impl gax::options::internal::RequestBuilder for DeleteNodePool {
1078        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1079            &mut self.0.options
1080        }
1081    }
1082
1083    /// The request builder for [EdgeContainer::list_machines][super::super::client::EdgeContainer::list_machines] calls.
1084    #[derive(Clone, Debug)]
1085    pub struct ListMachines(RequestBuilder<crate::model::ListMachinesRequest>);
1086
1087    impl ListMachines {
1088        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1089            Self(RequestBuilder::new(stub))
1090        }
1091
1092        /// Sets the full request, replacing any prior values.
1093        pub fn with_request<V: Into<crate::model::ListMachinesRequest>>(mut self, v: V) -> Self {
1094            self.0.request = v.into();
1095            self
1096        }
1097
1098        /// Sets all the options, replacing any prior values.
1099        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1100            self.0.options = v.into();
1101            self
1102        }
1103
1104        /// Sends the request.
1105        pub async fn send(self) -> Result<crate::model::ListMachinesResponse> {
1106            (*self.0.stub)
1107                .list_machines(self.0.request, self.0.options)
1108                .await
1109                .map(gax::response::Response::into_body)
1110        }
1111
1112        /// Streams the responses back.
1113        pub async fn paginator(
1114            self,
1115        ) -> impl gax::paginator::Paginator<crate::model::ListMachinesResponse, gax::error::Error>
1116        {
1117            use std::clone::Clone;
1118            let token = self.0.request.page_token.clone();
1119            let execute = move |token: String| {
1120                let mut builder = self.clone();
1121                builder.0.request = builder.0.request.set_page_token(token);
1122                builder.send()
1123            };
1124            gax::paginator::internal::new_paginator(token, execute)
1125        }
1126
1127        /// Sets the value of [parent][crate::model::ListMachinesRequest::parent].
1128        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1129            self.0.request.parent = v.into();
1130            self
1131        }
1132
1133        /// Sets the value of [page_size][crate::model::ListMachinesRequest::page_size].
1134        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1135            self.0.request.page_size = v.into();
1136            self
1137        }
1138
1139        /// Sets the value of [page_token][crate::model::ListMachinesRequest::page_token].
1140        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1141            self.0.request.page_token = v.into();
1142            self
1143        }
1144
1145        /// Sets the value of [filter][crate::model::ListMachinesRequest::filter].
1146        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1147            self.0.request.filter = v.into();
1148            self
1149        }
1150
1151        /// Sets the value of [order_by][crate::model::ListMachinesRequest::order_by].
1152        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1153            self.0.request.order_by = v.into();
1154            self
1155        }
1156    }
1157
1158    #[doc(hidden)]
1159    impl gax::options::internal::RequestBuilder for ListMachines {
1160        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1161            &mut self.0.options
1162        }
1163    }
1164
1165    /// The request builder for [EdgeContainer::get_machine][super::super::client::EdgeContainer::get_machine] calls.
1166    #[derive(Clone, Debug)]
1167    pub struct GetMachine(RequestBuilder<crate::model::GetMachineRequest>);
1168
1169    impl GetMachine {
1170        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1171            Self(RequestBuilder::new(stub))
1172        }
1173
1174        /// Sets the full request, replacing any prior values.
1175        pub fn with_request<V: Into<crate::model::GetMachineRequest>>(mut self, v: V) -> Self {
1176            self.0.request = v.into();
1177            self
1178        }
1179
1180        /// Sets all the options, replacing any prior values.
1181        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1182            self.0.options = v.into();
1183            self
1184        }
1185
1186        /// Sends the request.
1187        pub async fn send(self) -> Result<crate::model::Machine> {
1188            (*self.0.stub)
1189                .get_machine(self.0.request, self.0.options)
1190                .await
1191                .map(gax::response::Response::into_body)
1192        }
1193
1194        /// Sets the value of [name][crate::model::GetMachineRequest::name].
1195        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1196            self.0.request.name = v.into();
1197            self
1198        }
1199    }
1200
1201    #[doc(hidden)]
1202    impl gax::options::internal::RequestBuilder for GetMachine {
1203        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1204            &mut self.0.options
1205        }
1206    }
1207
1208    /// The request builder for [EdgeContainer::list_vpn_connections][super::super::client::EdgeContainer::list_vpn_connections] calls.
1209    #[derive(Clone, Debug)]
1210    pub struct ListVpnConnections(RequestBuilder<crate::model::ListVpnConnectionsRequest>);
1211
1212    impl ListVpnConnections {
1213        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1214            Self(RequestBuilder::new(stub))
1215        }
1216
1217        /// Sets the full request, replacing any prior values.
1218        pub fn with_request<V: Into<crate::model::ListVpnConnectionsRequest>>(
1219            mut self,
1220            v: V,
1221        ) -> Self {
1222            self.0.request = v.into();
1223            self
1224        }
1225
1226        /// Sets all the options, replacing any prior values.
1227        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1228            self.0.options = v.into();
1229            self
1230        }
1231
1232        /// Sends the request.
1233        pub async fn send(self) -> Result<crate::model::ListVpnConnectionsResponse> {
1234            (*self.0.stub)
1235                .list_vpn_connections(self.0.request, self.0.options)
1236                .await
1237                .map(gax::response::Response::into_body)
1238        }
1239
1240        /// Streams the responses back.
1241        pub async fn paginator(
1242            self,
1243        ) -> impl gax::paginator::Paginator<crate::model::ListVpnConnectionsResponse, gax::error::Error>
1244        {
1245            use std::clone::Clone;
1246            let token = self.0.request.page_token.clone();
1247            let execute = move |token: String| {
1248                let mut builder = self.clone();
1249                builder.0.request = builder.0.request.set_page_token(token);
1250                builder.send()
1251            };
1252            gax::paginator::internal::new_paginator(token, execute)
1253        }
1254
1255        /// Sets the value of [parent][crate::model::ListVpnConnectionsRequest::parent].
1256        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1257            self.0.request.parent = v.into();
1258            self
1259        }
1260
1261        /// Sets the value of [page_size][crate::model::ListVpnConnectionsRequest::page_size].
1262        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1263            self.0.request.page_size = v.into();
1264            self
1265        }
1266
1267        /// Sets the value of [page_token][crate::model::ListVpnConnectionsRequest::page_token].
1268        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1269            self.0.request.page_token = v.into();
1270            self
1271        }
1272
1273        /// Sets the value of [filter][crate::model::ListVpnConnectionsRequest::filter].
1274        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1275            self.0.request.filter = v.into();
1276            self
1277        }
1278
1279        /// Sets the value of [order_by][crate::model::ListVpnConnectionsRequest::order_by].
1280        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1281            self.0.request.order_by = v.into();
1282            self
1283        }
1284    }
1285
1286    #[doc(hidden)]
1287    impl gax::options::internal::RequestBuilder for ListVpnConnections {
1288        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1289            &mut self.0.options
1290        }
1291    }
1292
1293    /// The request builder for [EdgeContainer::get_vpn_connection][super::super::client::EdgeContainer::get_vpn_connection] calls.
1294    #[derive(Clone, Debug)]
1295    pub struct GetVpnConnection(RequestBuilder<crate::model::GetVpnConnectionRequest>);
1296
1297    impl GetVpnConnection {
1298        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1299            Self(RequestBuilder::new(stub))
1300        }
1301
1302        /// Sets the full request, replacing any prior values.
1303        pub fn with_request<V: Into<crate::model::GetVpnConnectionRequest>>(
1304            mut self,
1305            v: V,
1306        ) -> Self {
1307            self.0.request = v.into();
1308            self
1309        }
1310
1311        /// Sets all the options, replacing any prior values.
1312        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1313            self.0.options = v.into();
1314            self
1315        }
1316
1317        /// Sends the request.
1318        pub async fn send(self) -> Result<crate::model::VpnConnection> {
1319            (*self.0.stub)
1320                .get_vpn_connection(self.0.request, self.0.options)
1321                .await
1322                .map(gax::response::Response::into_body)
1323        }
1324
1325        /// Sets the value of [name][crate::model::GetVpnConnectionRequest::name].
1326        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1327            self.0.request.name = v.into();
1328            self
1329        }
1330    }
1331
1332    #[doc(hidden)]
1333    impl gax::options::internal::RequestBuilder for GetVpnConnection {
1334        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1335            &mut self.0.options
1336        }
1337    }
1338
1339    /// The request builder for [EdgeContainer::create_vpn_connection][super::super::client::EdgeContainer::create_vpn_connection] calls.
1340    #[derive(Clone, Debug)]
1341    pub struct CreateVpnConnection(RequestBuilder<crate::model::CreateVpnConnectionRequest>);
1342
1343    impl CreateVpnConnection {
1344        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1345            Self(RequestBuilder::new(stub))
1346        }
1347
1348        /// Sets the full request, replacing any prior values.
1349        pub fn with_request<V: Into<crate::model::CreateVpnConnectionRequest>>(
1350            mut self,
1351            v: V,
1352        ) -> Self {
1353            self.0.request = v.into();
1354            self
1355        }
1356
1357        /// Sets all the options, replacing any prior values.
1358        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1359            self.0.options = v.into();
1360            self
1361        }
1362
1363        /// Sends the request.
1364        ///
1365        /// # Long running operations
1366        ///
1367        /// This starts, but does not poll, a longrunning operation. More information
1368        /// on [create_vpn_connection][super::super::client::EdgeContainer::create_vpn_connection].
1369        pub async fn send(self) -> Result<longrunning::model::Operation> {
1370            (*self.0.stub)
1371                .create_vpn_connection(self.0.request, self.0.options)
1372                .await
1373                .map(gax::response::Response::into_body)
1374        }
1375
1376        /// Creates a [Poller][lro::Poller] to work with `create_vpn_connection`.
1377        pub fn poller(
1378            self,
1379        ) -> impl lro::Poller<crate::model::VpnConnection, crate::model::OperationMetadata>
1380        {
1381            type Operation =
1382                lro::Operation<crate::model::VpnConnection, crate::model::OperationMetadata>;
1383            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1384            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1385
1386            let stub = self.0.stub.clone();
1387            let mut options = self.0.options.clone();
1388            options.set_retry_policy(gax::retry_policy::NeverRetry);
1389            let query = move |name| {
1390                let stub = stub.clone();
1391                let options = options.clone();
1392                async {
1393                    let op = GetOperation::new(stub)
1394                        .set_name(name)
1395                        .with_options(options)
1396                        .send()
1397                        .await?;
1398                    Ok(Operation::new(op))
1399                }
1400            };
1401
1402            let start = move || async {
1403                let op = self.send().await?;
1404                Ok(Operation::new(op))
1405            };
1406
1407            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1408        }
1409
1410        /// Sets the value of [parent][crate::model::CreateVpnConnectionRequest::parent].
1411        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1412            self.0.request.parent = v.into();
1413            self
1414        }
1415
1416        /// Sets the value of [vpn_connection_id][crate::model::CreateVpnConnectionRequest::vpn_connection_id].
1417        pub fn set_vpn_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1418            self.0.request.vpn_connection_id = v.into();
1419            self
1420        }
1421
1422        /// Sets the value of [vpn_connection][crate::model::CreateVpnConnectionRequest::vpn_connection].
1423        pub fn set_vpn_connection<T: Into<std::option::Option<crate::model::VpnConnection>>>(
1424            mut self,
1425            v: T,
1426        ) -> Self {
1427            self.0.request.vpn_connection = v.into();
1428            self
1429        }
1430
1431        /// Sets the value of [request_id][crate::model::CreateVpnConnectionRequest::request_id].
1432        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433            self.0.request.request_id = v.into();
1434            self
1435        }
1436    }
1437
1438    #[doc(hidden)]
1439    impl gax::options::internal::RequestBuilder for CreateVpnConnection {
1440        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1441            &mut self.0.options
1442        }
1443    }
1444
1445    /// The request builder for [EdgeContainer::delete_vpn_connection][super::super::client::EdgeContainer::delete_vpn_connection] calls.
1446    #[derive(Clone, Debug)]
1447    pub struct DeleteVpnConnection(RequestBuilder<crate::model::DeleteVpnConnectionRequest>);
1448
1449    impl DeleteVpnConnection {
1450        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1451            Self(RequestBuilder::new(stub))
1452        }
1453
1454        /// Sets the full request, replacing any prior values.
1455        pub fn with_request<V: Into<crate::model::DeleteVpnConnectionRequest>>(
1456            mut self,
1457            v: V,
1458        ) -> Self {
1459            self.0.request = v.into();
1460            self
1461        }
1462
1463        /// Sets all the options, replacing any prior values.
1464        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1465            self.0.options = v.into();
1466            self
1467        }
1468
1469        /// Sends the request.
1470        ///
1471        /// # Long running operations
1472        ///
1473        /// This starts, but does not poll, a longrunning operation. More information
1474        /// on [delete_vpn_connection][super::super::client::EdgeContainer::delete_vpn_connection].
1475        pub async fn send(self) -> Result<longrunning::model::Operation> {
1476            (*self.0.stub)
1477                .delete_vpn_connection(self.0.request, self.0.options)
1478                .await
1479                .map(gax::response::Response::into_body)
1480        }
1481
1482        /// Creates a [Poller][lro::Poller] to work with `delete_vpn_connection`.
1483        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
1484            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
1485            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1486            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1487
1488            let stub = self.0.stub.clone();
1489            let mut options = self.0.options.clone();
1490            options.set_retry_policy(gax::retry_policy::NeverRetry);
1491            let query = move |name| {
1492                let stub = stub.clone();
1493                let options = options.clone();
1494                async {
1495                    let op = GetOperation::new(stub)
1496                        .set_name(name)
1497                        .with_options(options)
1498                        .send()
1499                        .await?;
1500                    Ok(Operation::new(op))
1501                }
1502            };
1503
1504            let start = move || async {
1505                let op = self.send().await?;
1506                Ok(Operation::new(op))
1507            };
1508
1509            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1510        }
1511
1512        /// Sets the value of [name][crate::model::DeleteVpnConnectionRequest::name].
1513        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1514            self.0.request.name = v.into();
1515            self
1516        }
1517
1518        /// Sets the value of [request_id][crate::model::DeleteVpnConnectionRequest::request_id].
1519        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1520            self.0.request.request_id = v.into();
1521            self
1522        }
1523    }
1524
1525    #[doc(hidden)]
1526    impl gax::options::internal::RequestBuilder for DeleteVpnConnection {
1527        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1528            &mut self.0.options
1529        }
1530    }
1531
1532    /// The request builder for [EdgeContainer::get_server_config][super::super::client::EdgeContainer::get_server_config] calls.
1533    #[derive(Clone, Debug)]
1534    pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
1535
1536    impl GetServerConfig {
1537        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1538            Self(RequestBuilder::new(stub))
1539        }
1540
1541        /// Sets the full request, replacing any prior values.
1542        pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
1543            self.0.request = v.into();
1544            self
1545        }
1546
1547        /// Sets all the options, replacing any prior values.
1548        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1549            self.0.options = v.into();
1550            self
1551        }
1552
1553        /// Sends the request.
1554        pub async fn send(self) -> Result<crate::model::ServerConfig> {
1555            (*self.0.stub)
1556                .get_server_config(self.0.request, self.0.options)
1557                .await
1558                .map(gax::response::Response::into_body)
1559        }
1560
1561        /// Sets the value of [name][crate::model::GetServerConfigRequest::name].
1562        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1563            self.0.request.name = v.into();
1564            self
1565        }
1566    }
1567
1568    #[doc(hidden)]
1569    impl gax::options::internal::RequestBuilder for GetServerConfig {
1570        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1571            &mut self.0.options
1572        }
1573    }
1574
1575    /// The request builder for [EdgeContainer::list_locations][super::super::client::EdgeContainer::list_locations] calls.
1576    #[derive(Clone, Debug)]
1577    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1578
1579    impl ListLocations {
1580        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1581            Self(RequestBuilder::new(stub))
1582        }
1583
1584        /// Sets the full request, replacing any prior values.
1585        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1586            mut self,
1587            v: V,
1588        ) -> Self {
1589            self.0.request = v.into();
1590            self
1591        }
1592
1593        /// Sets all the options, replacing any prior values.
1594        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1595            self.0.options = v.into();
1596            self
1597        }
1598
1599        /// Sends the request.
1600        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1601            (*self.0.stub)
1602                .list_locations(self.0.request, self.0.options)
1603                .await
1604                .map(gax::response::Response::into_body)
1605        }
1606
1607        /// Streams the responses back.
1608        pub async fn paginator(
1609            self,
1610        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1611        {
1612            use std::clone::Clone;
1613            let token = self.0.request.page_token.clone();
1614            let execute = move |token: String| {
1615                let mut builder = self.clone();
1616                builder.0.request = builder.0.request.set_page_token(token);
1617                builder.send()
1618            };
1619            gax::paginator::internal::new_paginator(token, execute)
1620        }
1621
1622        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1623        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1624            self.0.request.name = v.into();
1625            self
1626        }
1627
1628        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1629        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1630            self.0.request.filter = v.into();
1631            self
1632        }
1633
1634        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1635        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1636            self.0.request.page_size = v.into();
1637            self
1638        }
1639
1640        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1641        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1642            self.0.request.page_token = v.into();
1643            self
1644        }
1645    }
1646
1647    #[doc(hidden)]
1648    impl gax::options::internal::RequestBuilder for ListLocations {
1649        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1650            &mut self.0.options
1651        }
1652    }
1653
1654    /// The request builder for [EdgeContainer::get_location][super::super::client::EdgeContainer::get_location] calls.
1655    #[derive(Clone, Debug)]
1656    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1657
1658    impl GetLocation {
1659        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1660            Self(RequestBuilder::new(stub))
1661        }
1662
1663        /// Sets the full request, replacing any prior values.
1664        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1665            self.0.request = v.into();
1666            self
1667        }
1668
1669        /// Sets all the options, replacing any prior values.
1670        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1671            self.0.options = v.into();
1672            self
1673        }
1674
1675        /// Sends the request.
1676        pub async fn send(self) -> Result<location::model::Location> {
1677            (*self.0.stub)
1678                .get_location(self.0.request, self.0.options)
1679                .await
1680                .map(gax::response::Response::into_body)
1681        }
1682
1683        /// Sets the value of [name][location::model::GetLocationRequest::name].
1684        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1685            self.0.request.name = v.into();
1686            self
1687        }
1688    }
1689
1690    #[doc(hidden)]
1691    impl gax::options::internal::RequestBuilder for GetLocation {
1692        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1693            &mut self.0.options
1694        }
1695    }
1696
1697    /// The request builder for [EdgeContainer::list_operations][super::super::client::EdgeContainer::list_operations] calls.
1698    #[derive(Clone, Debug)]
1699    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1700
1701    impl ListOperations {
1702        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1703            Self(RequestBuilder::new(stub))
1704        }
1705
1706        /// Sets the full request, replacing any prior values.
1707        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1708            mut self,
1709            v: V,
1710        ) -> Self {
1711            self.0.request = v.into();
1712            self
1713        }
1714
1715        /// Sets all the options, replacing any prior values.
1716        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1717            self.0.options = v.into();
1718            self
1719        }
1720
1721        /// Sends the request.
1722        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1723            (*self.0.stub)
1724                .list_operations(self.0.request, self.0.options)
1725                .await
1726                .map(gax::response::Response::into_body)
1727        }
1728
1729        /// Streams the responses back.
1730        pub async fn paginator(
1731            self,
1732        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1733        {
1734            use std::clone::Clone;
1735            let token = self.0.request.page_token.clone();
1736            let execute = move |token: String| {
1737                let mut builder = self.clone();
1738                builder.0.request = builder.0.request.set_page_token(token);
1739                builder.send()
1740            };
1741            gax::paginator::internal::new_paginator(token, execute)
1742        }
1743
1744        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1745        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1746            self.0.request.name = v.into();
1747            self
1748        }
1749
1750        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1751        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1752            self.0.request.filter = v.into();
1753            self
1754        }
1755
1756        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1757        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1758            self.0.request.page_size = v.into();
1759            self
1760        }
1761
1762        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1763        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1764            self.0.request.page_token = v.into();
1765            self
1766        }
1767    }
1768
1769    #[doc(hidden)]
1770    impl gax::options::internal::RequestBuilder for ListOperations {
1771        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1772            &mut self.0.options
1773        }
1774    }
1775
1776    /// The request builder for [EdgeContainer::get_operation][super::super::client::EdgeContainer::get_operation] calls.
1777    #[derive(Clone, Debug)]
1778    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1779
1780    impl GetOperation {
1781        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1782            Self(RequestBuilder::new(stub))
1783        }
1784
1785        /// Sets the full request, replacing any prior values.
1786        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1787            mut self,
1788            v: V,
1789        ) -> Self {
1790            self.0.request = v.into();
1791            self
1792        }
1793
1794        /// Sets all the options, replacing any prior values.
1795        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1796            self.0.options = v.into();
1797            self
1798        }
1799
1800        /// Sends the request.
1801        pub async fn send(self) -> Result<longrunning::model::Operation> {
1802            (*self.0.stub)
1803                .get_operation(self.0.request, self.0.options)
1804                .await
1805                .map(gax::response::Response::into_body)
1806        }
1807
1808        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1809        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1810            self.0.request.name = v.into();
1811            self
1812        }
1813    }
1814
1815    #[doc(hidden)]
1816    impl gax::options::internal::RequestBuilder for GetOperation {
1817        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1818            &mut self.0.options
1819        }
1820    }
1821
1822    /// The request builder for [EdgeContainer::delete_operation][super::super::client::EdgeContainer::delete_operation] calls.
1823    #[derive(Clone, Debug)]
1824    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1825
1826    impl DeleteOperation {
1827        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1828            Self(RequestBuilder::new(stub))
1829        }
1830
1831        /// Sets the full request, replacing any prior values.
1832        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1833            mut self,
1834            v: V,
1835        ) -> Self {
1836            self.0.request = v.into();
1837            self
1838        }
1839
1840        /// Sets all the options, replacing any prior values.
1841        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1842            self.0.options = v.into();
1843            self
1844        }
1845
1846        /// Sends the request.
1847        pub async fn send(self) -> Result<()> {
1848            (*self.0.stub)
1849                .delete_operation(self.0.request, self.0.options)
1850                .await
1851                .map(gax::response::Response::into_body)
1852        }
1853
1854        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
1855        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1856            self.0.request.name = v.into();
1857            self
1858        }
1859    }
1860
1861    #[doc(hidden)]
1862    impl gax::options::internal::RequestBuilder for DeleteOperation {
1863        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1864            &mut self.0.options
1865        }
1866    }
1867
1868    /// The request builder for [EdgeContainer::cancel_operation][super::super::client::EdgeContainer::cancel_operation] calls.
1869    #[derive(Clone, Debug)]
1870    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1871
1872    impl CancelOperation {
1873        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::EdgeContainer>) -> Self {
1874            Self(RequestBuilder::new(stub))
1875        }
1876
1877        /// Sets the full request, replacing any prior values.
1878        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1879            mut self,
1880            v: V,
1881        ) -> Self {
1882            self.0.request = v.into();
1883            self
1884        }
1885
1886        /// Sets all the options, replacing any prior values.
1887        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1888            self.0.options = v.into();
1889            self
1890        }
1891
1892        /// Sends the request.
1893        pub async fn send(self) -> Result<()> {
1894            (*self.0.stub)
1895                .cancel_operation(self.0.request, self.0.options)
1896                .await
1897                .map(gax::response::Response::into_body)
1898        }
1899
1900        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
1901        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1902            self.0.request.name = v.into();
1903            self
1904        }
1905    }
1906
1907    #[doc(hidden)]
1908    impl gax::options::internal::RequestBuilder for CancelOperation {
1909        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1910            &mut self.0.options
1911        }
1912    }
1913}