1pub mod edge_container {
18 use crate::Result;
19 use std::sync::Arc;
20
21 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 #[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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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 #[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 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 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 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 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}