1pub mod edge_container {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::EdgeContainer;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = EdgeContainer;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
96
97 impl ListClusters {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
118 (*self.0.stub)
119 .list_clusters(self.0.request, self.0.options)
120 .await
121 .map(crate::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListClustersResponse, crate::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 google_cloud_gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl google_cloud_gax::paginator::ItemPaginator<
143 crate::model::ListClustersResponse,
144 crate::Error,
145 > {
146 use google_cloud_gax::paginator::Paginator;
147 self.by_page().items()
148 }
149
150 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154 self.0.request.parent = v.into();
155 self
156 }
157
158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160 self.0.request.page_size = v.into();
161 self
162 }
163
164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
166 self.0.request.page_token = v.into();
167 self
168 }
169
170 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.filter = v.into();
173 self
174 }
175
176 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
178 self.0.request.order_by = v.into();
179 self
180 }
181 }
182
183 #[doc(hidden)]
184 impl crate::RequestBuilder for ListClusters {
185 fn request_options(&mut self) -> &mut crate::RequestOptions {
186 &mut self.0.options
187 }
188 }
189
190 #[derive(Clone, Debug)]
207 pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
208
209 impl GetCluster {
210 pub(crate) fn new(
211 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
212 ) -> Self {
213 Self(RequestBuilder::new(stub))
214 }
215
216 pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
218 self.0.request = v.into();
219 self
220 }
221
222 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
224 self.0.options = v.into();
225 self
226 }
227
228 pub async fn send(self) -> Result<crate::model::Cluster> {
230 (*self.0.stub)
231 .get_cluster(self.0.request, self.0.options)
232 .await
233 .map(crate::Response::into_body)
234 }
235
236 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240 self.0.request.name = v.into();
241 self
242 }
243 }
244
245 #[doc(hidden)]
246 impl crate::RequestBuilder for GetCluster {
247 fn request_options(&mut self) -> &mut crate::RequestOptions {
248 &mut self.0.options
249 }
250 }
251
252 #[derive(Clone, Debug)]
270 pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
271
272 impl CreateCluster {
273 pub(crate) fn new(
274 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
275 ) -> Self {
276 Self(RequestBuilder::new(stub))
277 }
278
279 pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
281 self.0.request = v.into();
282 self
283 }
284
285 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
287 self.0.options = v.into();
288 self
289 }
290
291 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
298 (*self.0.stub)
299 .create_cluster(self.0.request, self.0.options)
300 .await
301 .map(crate::Response::into_body)
302 }
303
304 pub fn poller(
306 self,
307 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::OperationMetadata>
308 {
309 type Operation = google_cloud_lro::internal::Operation<
310 crate::model::Cluster,
311 crate::model::OperationMetadata,
312 >;
313 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
314 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
315 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
316 if let Some(ref mut details) = poller_options.tracing {
317 details.method_name = "google_cloud_edgecontainer_v1::client::EdgeContainer::create_cluster::until_done";
318 }
319
320 let stub = self.0.stub.clone();
321 let mut options = self.0.options.clone();
322 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
323 let query = move |name| {
324 let stub = stub.clone();
325 let options = options.clone();
326 async {
327 let op = GetOperation::new(stub)
328 .set_name(name)
329 .with_options(options)
330 .send()
331 .await?;
332 Ok(Operation::new(op))
333 }
334 };
335
336 let start = move || async {
337 let op = self.send().await?;
338 Ok(Operation::new(op))
339 };
340
341 use google_cloud_lro::internal::PollerExt;
342 {
343 google_cloud_lro::internal::new_poller(
344 polling_error_policy,
345 polling_backoff_policy,
346 start,
347 query,
348 )
349 }
350 .with_options(poller_options)
351 }
352
353 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
357 self.0.request.parent = v.into();
358 self
359 }
360
361 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
365 self.0.request.cluster_id = v.into();
366 self
367 }
368
369 pub fn set_cluster<T>(mut self, v: T) -> Self
373 where
374 T: std::convert::Into<crate::model::Cluster>,
375 {
376 self.0.request.cluster = std::option::Option::Some(v.into());
377 self
378 }
379
380 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
384 where
385 T: std::convert::Into<crate::model::Cluster>,
386 {
387 self.0.request.cluster = v.map(|x| x.into());
388 self
389 }
390
391 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
393 self.0.request.request_id = v.into();
394 self
395 }
396 }
397
398 #[doc(hidden)]
399 impl crate::RequestBuilder for CreateCluster {
400 fn request_options(&mut self) -> &mut crate::RequestOptions {
401 &mut self.0.options
402 }
403 }
404
405 #[derive(Clone, Debug)]
423 pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
424
425 impl UpdateCluster {
426 pub(crate) fn new(
427 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
428 ) -> Self {
429 Self(RequestBuilder::new(stub))
430 }
431
432 pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
434 self.0.request = v.into();
435 self
436 }
437
438 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
440 self.0.options = v.into();
441 self
442 }
443
444 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
451 (*self.0.stub)
452 .update_cluster(self.0.request, self.0.options)
453 .await
454 .map(crate::Response::into_body)
455 }
456
457 pub fn poller(
459 self,
460 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::OperationMetadata>
461 {
462 type Operation = google_cloud_lro::internal::Operation<
463 crate::model::Cluster,
464 crate::model::OperationMetadata,
465 >;
466 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
467 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
468 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
469 if let Some(ref mut details) = poller_options.tracing {
470 details.method_name = "google_cloud_edgecontainer_v1::client::EdgeContainer::update_cluster::until_done";
471 }
472
473 let stub = self.0.stub.clone();
474 let mut options = self.0.options.clone();
475 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
476 let query = move |name| {
477 let stub = stub.clone();
478 let options = options.clone();
479 async {
480 let op = GetOperation::new(stub)
481 .set_name(name)
482 .with_options(options)
483 .send()
484 .await?;
485 Ok(Operation::new(op))
486 }
487 };
488
489 let start = move || async {
490 let op = self.send().await?;
491 Ok(Operation::new(op))
492 };
493
494 use google_cloud_lro::internal::PollerExt;
495 {
496 google_cloud_lro::internal::new_poller(
497 polling_error_policy,
498 polling_backoff_policy,
499 start,
500 query,
501 )
502 }
503 .with_options(poller_options)
504 }
505
506 pub fn set_update_mask<T>(mut self, v: T) -> Self
508 where
509 T: std::convert::Into<wkt::FieldMask>,
510 {
511 self.0.request.update_mask = std::option::Option::Some(v.into());
512 self
513 }
514
515 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
517 where
518 T: std::convert::Into<wkt::FieldMask>,
519 {
520 self.0.request.update_mask = v.map(|x| x.into());
521 self
522 }
523
524 pub fn set_cluster<T>(mut self, v: T) -> Self
526 where
527 T: std::convert::Into<crate::model::Cluster>,
528 {
529 self.0.request.cluster = std::option::Option::Some(v.into());
530 self
531 }
532
533 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
535 where
536 T: std::convert::Into<crate::model::Cluster>,
537 {
538 self.0.request.cluster = v.map(|x| x.into());
539 self
540 }
541
542 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
544 self.0.request.request_id = v.into();
545 self
546 }
547 }
548
549 #[doc(hidden)]
550 impl crate::RequestBuilder for UpdateCluster {
551 fn request_options(&mut self) -> &mut crate::RequestOptions {
552 &mut self.0.options
553 }
554 }
555
556 #[derive(Clone, Debug)]
574 pub struct UpgradeCluster(RequestBuilder<crate::model::UpgradeClusterRequest>);
575
576 impl UpgradeCluster {
577 pub(crate) fn new(
578 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
579 ) -> Self {
580 Self(RequestBuilder::new(stub))
581 }
582
583 pub fn with_request<V: Into<crate::model::UpgradeClusterRequest>>(mut self, v: V) -> Self {
585 self.0.request = v.into();
586 self
587 }
588
589 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
591 self.0.options = v.into();
592 self
593 }
594
595 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
602 (*self.0.stub)
603 .upgrade_cluster(self.0.request, self.0.options)
604 .await
605 .map(crate::Response::into_body)
606 }
607
608 pub fn poller(
610 self,
611 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::OperationMetadata>
612 {
613 type Operation = google_cloud_lro::internal::Operation<
614 crate::model::Cluster,
615 crate::model::OperationMetadata,
616 >;
617 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
618 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
619 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
620 if let Some(ref mut details) = poller_options.tracing {
621 details.method_name = "google_cloud_edgecontainer_v1::client::EdgeContainer::upgrade_cluster::until_done";
622 }
623
624 let stub = self.0.stub.clone();
625 let mut options = self.0.options.clone();
626 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
627 let query = move |name| {
628 let stub = stub.clone();
629 let options = options.clone();
630 async {
631 let op = GetOperation::new(stub)
632 .set_name(name)
633 .with_options(options)
634 .send()
635 .await?;
636 Ok(Operation::new(op))
637 }
638 };
639
640 let start = move || async {
641 let op = self.send().await?;
642 Ok(Operation::new(op))
643 };
644
645 use google_cloud_lro::internal::PollerExt;
646 {
647 google_cloud_lro::internal::new_poller(
648 polling_error_policy,
649 polling_backoff_policy,
650 start,
651 query,
652 )
653 }
654 .with_options(poller_options)
655 }
656
657 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
661 self.0.request.name = v.into();
662 self
663 }
664
665 pub fn set_target_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
669 self.0.request.target_version = v.into();
670 self
671 }
672
673 pub fn set_schedule<T: Into<crate::model::upgrade_cluster_request::Schedule>>(
675 mut self,
676 v: T,
677 ) -> Self {
678 self.0.request.schedule = v.into();
679 self
680 }
681
682 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
684 self.0.request.request_id = v.into();
685 self
686 }
687 }
688
689 #[doc(hidden)]
690 impl crate::RequestBuilder for UpgradeCluster {
691 fn request_options(&mut self) -> &mut crate::RequestOptions {
692 &mut self.0.options
693 }
694 }
695
696 #[derive(Clone, Debug)]
714 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
715
716 impl DeleteCluster {
717 pub(crate) fn new(
718 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
719 ) -> Self {
720 Self(RequestBuilder::new(stub))
721 }
722
723 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
725 self.0.request = v.into();
726 self
727 }
728
729 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
731 self.0.options = v.into();
732 self
733 }
734
735 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
742 (*self.0.stub)
743 .delete_cluster(self.0.request, self.0.options)
744 .await
745 .map(crate::Response::into_body)
746 }
747
748 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
750 type Operation =
751 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
752 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
753 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
754 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
755 if let Some(ref mut details) = poller_options.tracing {
756 details.method_name = "google_cloud_edgecontainer_v1::client::EdgeContainer::delete_cluster::until_done";
757 }
758
759 let stub = self.0.stub.clone();
760 let mut options = self.0.options.clone();
761 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
762 let query = move |name| {
763 let stub = stub.clone();
764 let options = options.clone();
765 async {
766 let op = GetOperation::new(stub)
767 .set_name(name)
768 .with_options(options)
769 .send()
770 .await?;
771 Ok(Operation::new(op))
772 }
773 };
774
775 let start = move || async {
776 let op = self.send().await?;
777 Ok(Operation::new(op))
778 };
779
780 use google_cloud_lro::internal::PollerExt;
781 {
782 google_cloud_lro::internal::new_unit_response_poller(
783 polling_error_policy,
784 polling_backoff_policy,
785 start,
786 query,
787 )
788 }
789 .with_options(poller_options)
790 }
791
792 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
796 self.0.request.name = v.into();
797 self
798 }
799
800 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
802 self.0.request.request_id = v.into();
803 self
804 }
805 }
806
807 #[doc(hidden)]
808 impl crate::RequestBuilder for DeleteCluster {
809 fn request_options(&mut self) -> &mut crate::RequestOptions {
810 &mut self.0.options
811 }
812 }
813
814 #[derive(Clone, Debug)]
831 pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
832
833 impl GenerateAccessToken {
834 pub(crate) fn new(
835 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
836 ) -> Self {
837 Self(RequestBuilder::new(stub))
838 }
839
840 pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
842 mut self,
843 v: V,
844 ) -> Self {
845 self.0.request = v.into();
846 self
847 }
848
849 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
851 self.0.options = v.into();
852 self
853 }
854
855 pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
857 (*self.0.stub)
858 .generate_access_token(self.0.request, self.0.options)
859 .await
860 .map(crate::Response::into_body)
861 }
862
863 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
867 self.0.request.cluster = v.into();
868 self
869 }
870 }
871
872 #[doc(hidden)]
873 impl crate::RequestBuilder for GenerateAccessToken {
874 fn request_options(&mut self) -> &mut crate::RequestOptions {
875 &mut self.0.options
876 }
877 }
878
879 #[derive(Clone, Debug)]
896 pub struct GenerateOfflineCredential(
897 RequestBuilder<crate::model::GenerateOfflineCredentialRequest>,
898 );
899
900 impl GenerateOfflineCredential {
901 pub(crate) fn new(
902 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
903 ) -> Self {
904 Self(RequestBuilder::new(stub))
905 }
906
907 pub fn with_request<V: Into<crate::model::GenerateOfflineCredentialRequest>>(
909 mut self,
910 v: V,
911 ) -> Self {
912 self.0.request = v.into();
913 self
914 }
915
916 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
918 self.0.options = v.into();
919 self
920 }
921
922 pub async fn send(self) -> Result<crate::model::GenerateOfflineCredentialResponse> {
924 (*self.0.stub)
925 .generate_offline_credential(self.0.request, self.0.options)
926 .await
927 .map(crate::Response::into_body)
928 }
929
930 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
934 self.0.request.cluster = v.into();
935 self
936 }
937 }
938
939 #[doc(hidden)]
940 impl crate::RequestBuilder for GenerateOfflineCredential {
941 fn request_options(&mut self) -> &mut crate::RequestOptions {
942 &mut self.0.options
943 }
944 }
945
946 #[derive(Clone, Debug)]
967 pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
968
969 impl ListNodePools {
970 pub(crate) fn new(
971 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
972 ) -> Self {
973 Self(RequestBuilder::new(stub))
974 }
975
976 pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
978 self.0.request = v.into();
979 self
980 }
981
982 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
984 self.0.options = v.into();
985 self
986 }
987
988 pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
990 (*self.0.stub)
991 .list_node_pools(self.0.request, self.0.options)
992 .await
993 .map(crate::Response::into_body)
994 }
995
996 pub fn by_page(
998 self,
999 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListNodePoolsResponse, crate::Error>
1000 {
1001 use std::clone::Clone;
1002 let token = self.0.request.page_token.clone();
1003 let execute = move |token: String| {
1004 let mut builder = self.clone();
1005 builder.0.request = builder.0.request.set_page_token(token);
1006 builder.send()
1007 };
1008 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1009 }
1010
1011 pub fn by_item(
1013 self,
1014 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1015 crate::model::ListNodePoolsResponse,
1016 crate::Error,
1017 > {
1018 use google_cloud_gax::paginator::Paginator;
1019 self.by_page().items()
1020 }
1021
1022 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1026 self.0.request.parent = v.into();
1027 self
1028 }
1029
1030 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1032 self.0.request.page_size = v.into();
1033 self
1034 }
1035
1036 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1038 self.0.request.page_token = v.into();
1039 self
1040 }
1041
1042 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1044 self.0.request.filter = v.into();
1045 self
1046 }
1047
1048 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1050 self.0.request.order_by = v.into();
1051 self
1052 }
1053 }
1054
1055 #[doc(hidden)]
1056 impl crate::RequestBuilder for ListNodePools {
1057 fn request_options(&mut self) -> &mut crate::RequestOptions {
1058 &mut self.0.options
1059 }
1060 }
1061
1062 #[derive(Clone, Debug)]
1079 pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
1080
1081 impl GetNodePool {
1082 pub(crate) fn new(
1083 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1084 ) -> Self {
1085 Self(RequestBuilder::new(stub))
1086 }
1087
1088 pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
1090 self.0.request = v.into();
1091 self
1092 }
1093
1094 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1096 self.0.options = v.into();
1097 self
1098 }
1099
1100 pub async fn send(self) -> Result<crate::model::NodePool> {
1102 (*self.0.stub)
1103 .get_node_pool(self.0.request, self.0.options)
1104 .await
1105 .map(crate::Response::into_body)
1106 }
1107
1108 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1112 self.0.request.name = v.into();
1113 self
1114 }
1115 }
1116
1117 #[doc(hidden)]
1118 impl crate::RequestBuilder for GetNodePool {
1119 fn request_options(&mut self) -> &mut crate::RequestOptions {
1120 &mut self.0.options
1121 }
1122 }
1123
1124 #[derive(Clone, Debug)]
1142 pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
1143
1144 impl CreateNodePool {
1145 pub(crate) fn new(
1146 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1147 ) -> Self {
1148 Self(RequestBuilder::new(stub))
1149 }
1150
1151 pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
1153 self.0.request = v.into();
1154 self
1155 }
1156
1157 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1159 self.0.options = v.into();
1160 self
1161 }
1162
1163 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1170 (*self.0.stub)
1171 .create_node_pool(self.0.request, self.0.options)
1172 .await
1173 .map(crate::Response::into_body)
1174 }
1175
1176 pub fn poller(
1178 self,
1179 ) -> impl google_cloud_lro::Poller<crate::model::NodePool, crate::model::OperationMetadata>
1180 {
1181 type Operation = google_cloud_lro::internal::Operation<
1182 crate::model::NodePool,
1183 crate::model::OperationMetadata,
1184 >;
1185 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1186 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1187 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1188 if let Some(ref mut details) = poller_options.tracing {
1189 details.method_name = "google_cloud_edgecontainer_v1::client::EdgeContainer::create_node_pool::until_done";
1190 }
1191
1192 let stub = self.0.stub.clone();
1193 let mut options = self.0.options.clone();
1194 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1195 let query = move |name| {
1196 let stub = stub.clone();
1197 let options = options.clone();
1198 async {
1199 let op = GetOperation::new(stub)
1200 .set_name(name)
1201 .with_options(options)
1202 .send()
1203 .await?;
1204 Ok(Operation::new(op))
1205 }
1206 };
1207
1208 let start = move || async {
1209 let op = self.send().await?;
1210 Ok(Operation::new(op))
1211 };
1212
1213 use google_cloud_lro::internal::PollerExt;
1214 {
1215 google_cloud_lro::internal::new_poller(
1216 polling_error_policy,
1217 polling_backoff_policy,
1218 start,
1219 query,
1220 )
1221 }
1222 .with_options(poller_options)
1223 }
1224
1225 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1229 self.0.request.parent = v.into();
1230 self
1231 }
1232
1233 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1237 self.0.request.node_pool_id = v.into();
1238 self
1239 }
1240
1241 pub fn set_node_pool<T>(mut self, v: T) -> Self
1245 where
1246 T: std::convert::Into<crate::model::NodePool>,
1247 {
1248 self.0.request.node_pool = std::option::Option::Some(v.into());
1249 self
1250 }
1251
1252 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1256 where
1257 T: std::convert::Into<crate::model::NodePool>,
1258 {
1259 self.0.request.node_pool = v.map(|x| x.into());
1260 self
1261 }
1262
1263 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1265 self.0.request.request_id = v.into();
1266 self
1267 }
1268 }
1269
1270 #[doc(hidden)]
1271 impl crate::RequestBuilder for CreateNodePool {
1272 fn request_options(&mut self) -> &mut crate::RequestOptions {
1273 &mut self.0.options
1274 }
1275 }
1276
1277 #[derive(Clone, Debug)]
1295 pub struct UpdateNodePool(RequestBuilder<crate::model::UpdateNodePoolRequest>);
1296
1297 impl UpdateNodePool {
1298 pub(crate) fn new(
1299 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1300 ) -> Self {
1301 Self(RequestBuilder::new(stub))
1302 }
1303
1304 pub fn with_request<V: Into<crate::model::UpdateNodePoolRequest>>(mut self, v: V) -> Self {
1306 self.0.request = v.into();
1307 self
1308 }
1309
1310 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1312 self.0.options = v.into();
1313 self
1314 }
1315
1316 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1323 (*self.0.stub)
1324 .update_node_pool(self.0.request, self.0.options)
1325 .await
1326 .map(crate::Response::into_body)
1327 }
1328
1329 pub fn poller(
1331 self,
1332 ) -> impl google_cloud_lro::Poller<crate::model::NodePool, crate::model::OperationMetadata>
1333 {
1334 type Operation = google_cloud_lro::internal::Operation<
1335 crate::model::NodePool,
1336 crate::model::OperationMetadata,
1337 >;
1338 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1339 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1340 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1341 if let Some(ref mut details) = poller_options.tracing {
1342 details.method_name = "google_cloud_edgecontainer_v1::client::EdgeContainer::update_node_pool::until_done";
1343 }
1344
1345 let stub = self.0.stub.clone();
1346 let mut options = self.0.options.clone();
1347 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1348 let query = move |name| {
1349 let stub = stub.clone();
1350 let options = options.clone();
1351 async {
1352 let op = GetOperation::new(stub)
1353 .set_name(name)
1354 .with_options(options)
1355 .send()
1356 .await?;
1357 Ok(Operation::new(op))
1358 }
1359 };
1360
1361 let start = move || async {
1362 let op = self.send().await?;
1363 Ok(Operation::new(op))
1364 };
1365
1366 use google_cloud_lro::internal::PollerExt;
1367 {
1368 google_cloud_lro::internal::new_poller(
1369 polling_error_policy,
1370 polling_backoff_policy,
1371 start,
1372 query,
1373 )
1374 }
1375 .with_options(poller_options)
1376 }
1377
1378 pub fn set_update_mask<T>(mut self, v: T) -> Self
1380 where
1381 T: std::convert::Into<wkt::FieldMask>,
1382 {
1383 self.0.request.update_mask = std::option::Option::Some(v.into());
1384 self
1385 }
1386
1387 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1389 where
1390 T: std::convert::Into<wkt::FieldMask>,
1391 {
1392 self.0.request.update_mask = v.map(|x| x.into());
1393 self
1394 }
1395
1396 pub fn set_node_pool<T>(mut self, v: T) -> Self
1398 where
1399 T: std::convert::Into<crate::model::NodePool>,
1400 {
1401 self.0.request.node_pool = std::option::Option::Some(v.into());
1402 self
1403 }
1404
1405 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1407 where
1408 T: std::convert::Into<crate::model::NodePool>,
1409 {
1410 self.0.request.node_pool = v.map(|x| x.into());
1411 self
1412 }
1413
1414 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1416 self.0.request.request_id = v.into();
1417 self
1418 }
1419 }
1420
1421 #[doc(hidden)]
1422 impl crate::RequestBuilder for UpdateNodePool {
1423 fn request_options(&mut self) -> &mut crate::RequestOptions {
1424 &mut self.0.options
1425 }
1426 }
1427
1428 #[derive(Clone, Debug)]
1446 pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
1447
1448 impl DeleteNodePool {
1449 pub(crate) fn new(
1450 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1451 ) -> Self {
1452 Self(RequestBuilder::new(stub))
1453 }
1454
1455 pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
1457 self.0.request = v.into();
1458 self
1459 }
1460
1461 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1463 self.0.options = v.into();
1464 self
1465 }
1466
1467 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1474 (*self.0.stub)
1475 .delete_node_pool(self.0.request, self.0.options)
1476 .await
1477 .map(crate::Response::into_body)
1478 }
1479
1480 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1482 type Operation =
1483 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1484 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1485 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1486 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1487 if let Some(ref mut details) = poller_options.tracing {
1488 details.method_name = "google_cloud_edgecontainer_v1::client::EdgeContainer::delete_node_pool::until_done";
1489 }
1490
1491 let stub = self.0.stub.clone();
1492 let mut options = self.0.options.clone();
1493 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1494 let query = move |name| {
1495 let stub = stub.clone();
1496 let options = options.clone();
1497 async {
1498 let op = GetOperation::new(stub)
1499 .set_name(name)
1500 .with_options(options)
1501 .send()
1502 .await?;
1503 Ok(Operation::new(op))
1504 }
1505 };
1506
1507 let start = move || async {
1508 let op = self.send().await?;
1509 Ok(Operation::new(op))
1510 };
1511
1512 use google_cloud_lro::internal::PollerExt;
1513 {
1514 google_cloud_lro::internal::new_unit_response_poller(
1515 polling_error_policy,
1516 polling_backoff_policy,
1517 start,
1518 query,
1519 )
1520 }
1521 .with_options(poller_options)
1522 }
1523
1524 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1528 self.0.request.name = v.into();
1529 self
1530 }
1531
1532 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1534 self.0.request.request_id = v.into();
1535 self
1536 }
1537 }
1538
1539 #[doc(hidden)]
1540 impl crate::RequestBuilder for DeleteNodePool {
1541 fn request_options(&mut self) -> &mut crate::RequestOptions {
1542 &mut self.0.options
1543 }
1544 }
1545
1546 #[derive(Clone, Debug)]
1567 pub struct ListMachines(RequestBuilder<crate::model::ListMachinesRequest>);
1568
1569 impl ListMachines {
1570 pub(crate) fn new(
1571 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1572 ) -> Self {
1573 Self(RequestBuilder::new(stub))
1574 }
1575
1576 pub fn with_request<V: Into<crate::model::ListMachinesRequest>>(mut self, v: V) -> Self {
1578 self.0.request = v.into();
1579 self
1580 }
1581
1582 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1584 self.0.options = v.into();
1585 self
1586 }
1587
1588 pub async fn send(self) -> Result<crate::model::ListMachinesResponse> {
1590 (*self.0.stub)
1591 .list_machines(self.0.request, self.0.options)
1592 .await
1593 .map(crate::Response::into_body)
1594 }
1595
1596 pub fn by_page(
1598 self,
1599 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListMachinesResponse, crate::Error>
1600 {
1601 use std::clone::Clone;
1602 let token = self.0.request.page_token.clone();
1603 let execute = move |token: String| {
1604 let mut builder = self.clone();
1605 builder.0.request = builder.0.request.set_page_token(token);
1606 builder.send()
1607 };
1608 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1609 }
1610
1611 pub fn by_item(
1613 self,
1614 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1615 crate::model::ListMachinesResponse,
1616 crate::Error,
1617 > {
1618 use google_cloud_gax::paginator::Paginator;
1619 self.by_page().items()
1620 }
1621
1622 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1626 self.0.request.parent = v.into();
1627 self
1628 }
1629
1630 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1632 self.0.request.page_size = v.into();
1633 self
1634 }
1635
1636 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1638 self.0.request.page_token = v.into();
1639 self
1640 }
1641
1642 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1644 self.0.request.filter = v.into();
1645 self
1646 }
1647
1648 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1650 self.0.request.order_by = v.into();
1651 self
1652 }
1653 }
1654
1655 #[doc(hidden)]
1656 impl crate::RequestBuilder for ListMachines {
1657 fn request_options(&mut self) -> &mut crate::RequestOptions {
1658 &mut self.0.options
1659 }
1660 }
1661
1662 #[derive(Clone, Debug)]
1679 pub struct GetMachine(RequestBuilder<crate::model::GetMachineRequest>);
1680
1681 impl GetMachine {
1682 pub(crate) fn new(
1683 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1684 ) -> Self {
1685 Self(RequestBuilder::new(stub))
1686 }
1687
1688 pub fn with_request<V: Into<crate::model::GetMachineRequest>>(mut self, v: V) -> Self {
1690 self.0.request = v.into();
1691 self
1692 }
1693
1694 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1696 self.0.options = v.into();
1697 self
1698 }
1699
1700 pub async fn send(self) -> Result<crate::model::Machine> {
1702 (*self.0.stub)
1703 .get_machine(self.0.request, self.0.options)
1704 .await
1705 .map(crate::Response::into_body)
1706 }
1707
1708 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1712 self.0.request.name = v.into();
1713 self
1714 }
1715 }
1716
1717 #[doc(hidden)]
1718 impl crate::RequestBuilder for GetMachine {
1719 fn request_options(&mut self) -> &mut crate::RequestOptions {
1720 &mut self.0.options
1721 }
1722 }
1723
1724 #[derive(Clone, Debug)]
1745 pub struct ListVpnConnections(RequestBuilder<crate::model::ListVpnConnectionsRequest>);
1746
1747 impl ListVpnConnections {
1748 pub(crate) fn new(
1749 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1750 ) -> Self {
1751 Self(RequestBuilder::new(stub))
1752 }
1753
1754 pub fn with_request<V: Into<crate::model::ListVpnConnectionsRequest>>(
1756 mut self,
1757 v: V,
1758 ) -> Self {
1759 self.0.request = v.into();
1760 self
1761 }
1762
1763 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1765 self.0.options = v.into();
1766 self
1767 }
1768
1769 pub async fn send(self) -> Result<crate::model::ListVpnConnectionsResponse> {
1771 (*self.0.stub)
1772 .list_vpn_connections(self.0.request, self.0.options)
1773 .await
1774 .map(crate::Response::into_body)
1775 }
1776
1777 pub fn by_page(
1779 self,
1780 ) -> impl google_cloud_gax::paginator::Paginator<
1781 crate::model::ListVpnConnectionsResponse,
1782 crate::Error,
1783 > {
1784 use std::clone::Clone;
1785 let token = self.0.request.page_token.clone();
1786 let execute = move |token: String| {
1787 let mut builder = self.clone();
1788 builder.0.request = builder.0.request.set_page_token(token);
1789 builder.send()
1790 };
1791 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1792 }
1793
1794 pub fn by_item(
1796 self,
1797 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1798 crate::model::ListVpnConnectionsResponse,
1799 crate::Error,
1800 > {
1801 use google_cloud_gax::paginator::Paginator;
1802 self.by_page().items()
1803 }
1804
1805 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1809 self.0.request.parent = v.into();
1810 self
1811 }
1812
1813 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1815 self.0.request.page_size = v.into();
1816 self
1817 }
1818
1819 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1821 self.0.request.page_token = v.into();
1822 self
1823 }
1824
1825 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1827 self.0.request.filter = v.into();
1828 self
1829 }
1830
1831 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1833 self.0.request.order_by = v.into();
1834 self
1835 }
1836 }
1837
1838 #[doc(hidden)]
1839 impl crate::RequestBuilder for ListVpnConnections {
1840 fn request_options(&mut self) -> &mut crate::RequestOptions {
1841 &mut self.0.options
1842 }
1843 }
1844
1845 #[derive(Clone, Debug)]
1862 pub struct GetVpnConnection(RequestBuilder<crate::model::GetVpnConnectionRequest>);
1863
1864 impl GetVpnConnection {
1865 pub(crate) fn new(
1866 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1867 ) -> Self {
1868 Self(RequestBuilder::new(stub))
1869 }
1870
1871 pub fn with_request<V: Into<crate::model::GetVpnConnectionRequest>>(
1873 mut self,
1874 v: V,
1875 ) -> Self {
1876 self.0.request = v.into();
1877 self
1878 }
1879
1880 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1882 self.0.options = v.into();
1883 self
1884 }
1885
1886 pub async fn send(self) -> Result<crate::model::VpnConnection> {
1888 (*self.0.stub)
1889 .get_vpn_connection(self.0.request, self.0.options)
1890 .await
1891 .map(crate::Response::into_body)
1892 }
1893
1894 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1898 self.0.request.name = v.into();
1899 self
1900 }
1901 }
1902
1903 #[doc(hidden)]
1904 impl crate::RequestBuilder for GetVpnConnection {
1905 fn request_options(&mut self) -> &mut crate::RequestOptions {
1906 &mut self.0.options
1907 }
1908 }
1909
1910 #[derive(Clone, Debug)]
1928 pub struct CreateVpnConnection(RequestBuilder<crate::model::CreateVpnConnectionRequest>);
1929
1930 impl CreateVpnConnection {
1931 pub(crate) fn new(
1932 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1933 ) -> Self {
1934 Self(RequestBuilder::new(stub))
1935 }
1936
1937 pub fn with_request<V: Into<crate::model::CreateVpnConnectionRequest>>(
1939 mut self,
1940 v: V,
1941 ) -> Self {
1942 self.0.request = v.into();
1943 self
1944 }
1945
1946 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1948 self.0.options = v.into();
1949 self
1950 }
1951
1952 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1959 (*self.0.stub)
1960 .create_vpn_connection(self.0.request, self.0.options)
1961 .await
1962 .map(crate::Response::into_body)
1963 }
1964
1965 pub fn poller(
1967 self,
1968 ) -> impl google_cloud_lro::Poller<crate::model::VpnConnection, crate::model::OperationMetadata>
1969 {
1970 type Operation = google_cloud_lro::internal::Operation<
1971 crate::model::VpnConnection,
1972 crate::model::OperationMetadata,
1973 >;
1974 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1975 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1976 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1977 if let Some(ref mut details) = poller_options.tracing {
1978 details.method_name = "google_cloud_edgecontainer_v1::client::EdgeContainer::create_vpn_connection::until_done";
1979 }
1980
1981 let stub = self.0.stub.clone();
1982 let mut options = self.0.options.clone();
1983 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1984 let query = move |name| {
1985 let stub = stub.clone();
1986 let options = options.clone();
1987 async {
1988 let op = GetOperation::new(stub)
1989 .set_name(name)
1990 .with_options(options)
1991 .send()
1992 .await?;
1993 Ok(Operation::new(op))
1994 }
1995 };
1996
1997 let start = move || async {
1998 let op = self.send().await?;
1999 Ok(Operation::new(op))
2000 };
2001
2002 use google_cloud_lro::internal::PollerExt;
2003 {
2004 google_cloud_lro::internal::new_poller(
2005 polling_error_policy,
2006 polling_backoff_policy,
2007 start,
2008 query,
2009 )
2010 }
2011 .with_options(poller_options)
2012 }
2013
2014 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2018 self.0.request.parent = v.into();
2019 self
2020 }
2021
2022 pub fn set_vpn_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2026 self.0.request.vpn_connection_id = v.into();
2027 self
2028 }
2029
2030 pub fn set_vpn_connection<T>(mut self, v: T) -> Self
2034 where
2035 T: std::convert::Into<crate::model::VpnConnection>,
2036 {
2037 self.0.request.vpn_connection = std::option::Option::Some(v.into());
2038 self
2039 }
2040
2041 pub fn set_or_clear_vpn_connection<T>(mut self, v: std::option::Option<T>) -> Self
2045 where
2046 T: std::convert::Into<crate::model::VpnConnection>,
2047 {
2048 self.0.request.vpn_connection = v.map(|x| x.into());
2049 self
2050 }
2051
2052 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2054 self.0.request.request_id = v.into();
2055 self
2056 }
2057 }
2058
2059 #[doc(hidden)]
2060 impl crate::RequestBuilder for CreateVpnConnection {
2061 fn request_options(&mut self) -> &mut crate::RequestOptions {
2062 &mut self.0.options
2063 }
2064 }
2065
2066 #[derive(Clone, Debug)]
2084 pub struct DeleteVpnConnection(RequestBuilder<crate::model::DeleteVpnConnectionRequest>);
2085
2086 impl DeleteVpnConnection {
2087 pub(crate) fn new(
2088 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2089 ) -> Self {
2090 Self(RequestBuilder::new(stub))
2091 }
2092
2093 pub fn with_request<V: Into<crate::model::DeleteVpnConnectionRequest>>(
2095 mut self,
2096 v: V,
2097 ) -> Self {
2098 self.0.request = v.into();
2099 self
2100 }
2101
2102 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2104 self.0.options = v.into();
2105 self
2106 }
2107
2108 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2115 (*self.0.stub)
2116 .delete_vpn_connection(self.0.request, self.0.options)
2117 .await
2118 .map(crate::Response::into_body)
2119 }
2120
2121 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2123 type Operation =
2124 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2125 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2126 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2127 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2128 if let Some(ref mut details) = poller_options.tracing {
2129 details.method_name = "google_cloud_edgecontainer_v1::client::EdgeContainer::delete_vpn_connection::until_done";
2130 }
2131
2132 let stub = self.0.stub.clone();
2133 let mut options = self.0.options.clone();
2134 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2135 let query = move |name| {
2136 let stub = stub.clone();
2137 let options = options.clone();
2138 async {
2139 let op = GetOperation::new(stub)
2140 .set_name(name)
2141 .with_options(options)
2142 .send()
2143 .await?;
2144 Ok(Operation::new(op))
2145 }
2146 };
2147
2148 let start = move || async {
2149 let op = self.send().await?;
2150 Ok(Operation::new(op))
2151 };
2152
2153 use google_cloud_lro::internal::PollerExt;
2154 {
2155 google_cloud_lro::internal::new_unit_response_poller(
2156 polling_error_policy,
2157 polling_backoff_policy,
2158 start,
2159 query,
2160 )
2161 }
2162 .with_options(poller_options)
2163 }
2164
2165 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2169 self.0.request.name = v.into();
2170 self
2171 }
2172
2173 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2175 self.0.request.request_id = v.into();
2176 self
2177 }
2178 }
2179
2180 #[doc(hidden)]
2181 impl crate::RequestBuilder for DeleteVpnConnection {
2182 fn request_options(&mut self) -> &mut crate::RequestOptions {
2183 &mut self.0.options
2184 }
2185 }
2186
2187 #[derive(Clone, Debug)]
2204 pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
2205
2206 impl GetServerConfig {
2207 pub(crate) fn new(
2208 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2209 ) -> Self {
2210 Self(RequestBuilder::new(stub))
2211 }
2212
2213 pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
2215 self.0.request = v.into();
2216 self
2217 }
2218
2219 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2221 self.0.options = v.into();
2222 self
2223 }
2224
2225 pub async fn send(self) -> Result<crate::model::ServerConfig> {
2227 (*self.0.stub)
2228 .get_server_config(self.0.request, self.0.options)
2229 .await
2230 .map(crate::Response::into_body)
2231 }
2232
2233 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2237 self.0.request.name = v.into();
2238 self
2239 }
2240 }
2241
2242 #[doc(hidden)]
2243 impl crate::RequestBuilder for GetServerConfig {
2244 fn request_options(&mut self) -> &mut crate::RequestOptions {
2245 &mut self.0.options
2246 }
2247 }
2248
2249 #[derive(Clone, Debug)]
2270 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2271
2272 impl ListLocations {
2273 pub(crate) fn new(
2274 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2275 ) -> Self {
2276 Self(RequestBuilder::new(stub))
2277 }
2278
2279 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2281 mut self,
2282 v: V,
2283 ) -> Self {
2284 self.0.request = v.into();
2285 self
2286 }
2287
2288 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2290 self.0.options = v.into();
2291 self
2292 }
2293
2294 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2296 (*self.0.stub)
2297 .list_locations(self.0.request, self.0.options)
2298 .await
2299 .map(crate::Response::into_body)
2300 }
2301
2302 pub fn by_page(
2304 self,
2305 ) -> impl google_cloud_gax::paginator::Paginator<
2306 google_cloud_location::model::ListLocationsResponse,
2307 crate::Error,
2308 > {
2309 use std::clone::Clone;
2310 let token = self.0.request.page_token.clone();
2311 let execute = move |token: String| {
2312 let mut builder = self.clone();
2313 builder.0.request = builder.0.request.set_page_token(token);
2314 builder.send()
2315 };
2316 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2317 }
2318
2319 pub fn by_item(
2321 self,
2322 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2323 google_cloud_location::model::ListLocationsResponse,
2324 crate::Error,
2325 > {
2326 use google_cloud_gax::paginator::Paginator;
2327 self.by_page().items()
2328 }
2329
2330 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2332 self.0.request.name = v.into();
2333 self
2334 }
2335
2336 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2338 self.0.request.filter = v.into();
2339 self
2340 }
2341
2342 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2344 self.0.request.page_size = v.into();
2345 self
2346 }
2347
2348 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2350 self.0.request.page_token = v.into();
2351 self
2352 }
2353 }
2354
2355 #[doc(hidden)]
2356 impl crate::RequestBuilder for ListLocations {
2357 fn request_options(&mut self) -> &mut crate::RequestOptions {
2358 &mut self.0.options
2359 }
2360 }
2361
2362 #[derive(Clone, Debug)]
2379 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2380
2381 impl GetLocation {
2382 pub(crate) fn new(
2383 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2384 ) -> Self {
2385 Self(RequestBuilder::new(stub))
2386 }
2387
2388 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2390 mut self,
2391 v: V,
2392 ) -> Self {
2393 self.0.request = v.into();
2394 self
2395 }
2396
2397 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2399 self.0.options = v.into();
2400 self
2401 }
2402
2403 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2405 (*self.0.stub)
2406 .get_location(self.0.request, self.0.options)
2407 .await
2408 .map(crate::Response::into_body)
2409 }
2410
2411 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2413 self.0.request.name = v.into();
2414 self
2415 }
2416 }
2417
2418 #[doc(hidden)]
2419 impl crate::RequestBuilder for GetLocation {
2420 fn request_options(&mut self) -> &mut crate::RequestOptions {
2421 &mut self.0.options
2422 }
2423 }
2424
2425 #[derive(Clone, Debug)]
2446 pub struct ListOperations(
2447 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2448 );
2449
2450 impl ListOperations {
2451 pub(crate) fn new(
2452 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2453 ) -> Self {
2454 Self(RequestBuilder::new(stub))
2455 }
2456
2457 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2459 mut self,
2460 v: V,
2461 ) -> Self {
2462 self.0.request = v.into();
2463 self
2464 }
2465
2466 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2468 self.0.options = v.into();
2469 self
2470 }
2471
2472 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2474 (*self.0.stub)
2475 .list_operations(self.0.request, self.0.options)
2476 .await
2477 .map(crate::Response::into_body)
2478 }
2479
2480 pub fn by_page(
2482 self,
2483 ) -> impl google_cloud_gax::paginator::Paginator<
2484 google_cloud_longrunning::model::ListOperationsResponse,
2485 crate::Error,
2486 > {
2487 use std::clone::Clone;
2488 let token = self.0.request.page_token.clone();
2489 let execute = move |token: String| {
2490 let mut builder = self.clone();
2491 builder.0.request = builder.0.request.set_page_token(token);
2492 builder.send()
2493 };
2494 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2495 }
2496
2497 pub fn by_item(
2499 self,
2500 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2501 google_cloud_longrunning::model::ListOperationsResponse,
2502 crate::Error,
2503 > {
2504 use google_cloud_gax::paginator::Paginator;
2505 self.by_page().items()
2506 }
2507
2508 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2510 self.0.request.name = v.into();
2511 self
2512 }
2513
2514 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2516 self.0.request.filter = v.into();
2517 self
2518 }
2519
2520 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2522 self.0.request.page_size = v.into();
2523 self
2524 }
2525
2526 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2528 self.0.request.page_token = v.into();
2529 self
2530 }
2531
2532 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2534 self.0.request.return_partial_success = v.into();
2535 self
2536 }
2537 }
2538
2539 #[doc(hidden)]
2540 impl crate::RequestBuilder for ListOperations {
2541 fn request_options(&mut self) -> &mut crate::RequestOptions {
2542 &mut self.0.options
2543 }
2544 }
2545
2546 #[derive(Clone, Debug)]
2563 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2564
2565 impl GetOperation {
2566 pub(crate) fn new(
2567 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2568 ) -> Self {
2569 Self(RequestBuilder::new(stub))
2570 }
2571
2572 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2574 mut self,
2575 v: V,
2576 ) -> Self {
2577 self.0.request = v.into();
2578 self
2579 }
2580
2581 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2583 self.0.options = v.into();
2584 self
2585 }
2586
2587 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2589 (*self.0.stub)
2590 .get_operation(self.0.request, self.0.options)
2591 .await
2592 .map(crate::Response::into_body)
2593 }
2594
2595 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2597 self.0.request.name = v.into();
2598 self
2599 }
2600 }
2601
2602 #[doc(hidden)]
2603 impl crate::RequestBuilder for GetOperation {
2604 fn request_options(&mut self) -> &mut crate::RequestOptions {
2605 &mut self.0.options
2606 }
2607 }
2608
2609 #[derive(Clone, Debug)]
2626 pub struct DeleteOperation(
2627 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2628 );
2629
2630 impl DeleteOperation {
2631 pub(crate) fn new(
2632 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2633 ) -> Self {
2634 Self(RequestBuilder::new(stub))
2635 }
2636
2637 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2639 mut self,
2640 v: V,
2641 ) -> Self {
2642 self.0.request = v.into();
2643 self
2644 }
2645
2646 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2648 self.0.options = v.into();
2649 self
2650 }
2651
2652 pub async fn send(self) -> Result<()> {
2654 (*self.0.stub)
2655 .delete_operation(self.0.request, self.0.options)
2656 .await
2657 .map(crate::Response::into_body)
2658 }
2659
2660 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2662 self.0.request.name = v.into();
2663 self
2664 }
2665 }
2666
2667 #[doc(hidden)]
2668 impl crate::RequestBuilder for DeleteOperation {
2669 fn request_options(&mut self) -> &mut crate::RequestOptions {
2670 &mut self.0.options
2671 }
2672 }
2673
2674 #[derive(Clone, Debug)]
2691 pub struct CancelOperation(
2692 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2693 );
2694
2695 impl CancelOperation {
2696 pub(crate) fn new(
2697 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2698 ) -> Self {
2699 Self(RequestBuilder::new(stub))
2700 }
2701
2702 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2704 mut self,
2705 v: V,
2706 ) -> Self {
2707 self.0.request = v.into();
2708 self
2709 }
2710
2711 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2713 self.0.options = v.into();
2714 self
2715 }
2716
2717 pub async fn send(self) -> Result<()> {
2719 (*self.0.stub)
2720 .cancel_operation(self.0.request, self.0.options)
2721 .await
2722 .map(crate::Response::into_body)
2723 }
2724
2725 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2727 self.0.request.name = v.into();
2728 self
2729 }
2730 }
2731
2732 #[doc(hidden)]
2733 impl crate::RequestBuilder for CancelOperation {
2734 fn request_options(&mut self) -> &mut crate::RequestOptions {
2735 &mut self.0.options
2736 }
2737 }
2738}