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