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