1pub mod edge_container {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::EdgeContainer;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = EdgeContainer;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
95
96 impl ListClusters {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
117 (*self.0.stub)
118 .list_clusters(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 pub fn by_page(
125 self,
126 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListClustersResponse, crate::Error>
127 {
128 use std::clone::Clone;
129 let token = self.0.request.page_token.clone();
130 let execute = move |token: String| {
131 let mut builder = self.clone();
132 builder.0.request = builder.0.request.set_page_token(token);
133 builder.send()
134 };
135 google_cloud_gax::paginator::internal::new_paginator(token, execute)
136 }
137
138 pub fn by_item(
140 self,
141 ) -> impl google_cloud_gax::paginator::ItemPaginator<
142 crate::model::ListClustersResponse,
143 crate::Error,
144 > {
145 use google_cloud_gax::paginator::Paginator;
146 self.by_page().items()
147 }
148
149 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153 self.0.request.parent = v.into();
154 self
155 }
156
157 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159 self.0.request.page_size = v.into();
160 self
161 }
162
163 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165 self.0.request.page_token = v.into();
166 self
167 }
168
169 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.filter = v.into();
172 self
173 }
174
175 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.order_by = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl crate::RequestBuilder for ListClusters {
184 fn request_options(&mut self) -> &mut crate::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[derive(Clone, Debug)]
206 pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
207
208 impl GetCluster {
209 pub(crate) fn new(
210 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
211 ) -> Self {
212 Self(RequestBuilder::new(stub))
213 }
214
215 pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
217 self.0.request = v.into();
218 self
219 }
220
221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
223 self.0.options = v.into();
224 self
225 }
226
227 pub async fn send(self) -> Result<crate::model::Cluster> {
229 (*self.0.stub)
230 .get_cluster(self.0.request, self.0.options)
231 .await
232 .map(crate::Response::into_body)
233 }
234
235 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
239 self.0.request.name = v.into();
240 self
241 }
242 }
243
244 #[doc(hidden)]
245 impl crate::RequestBuilder for GetCluster {
246 fn request_options(&mut self) -> &mut crate::RequestOptions {
247 &mut self.0.options
248 }
249 }
250
251 #[derive(Clone, Debug)]
269 pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
270
271 impl CreateCluster {
272 pub(crate) fn new(
273 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
274 ) -> Self {
275 Self(RequestBuilder::new(stub))
276 }
277
278 pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
280 self.0.request = v.into();
281 self
282 }
283
284 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
286 self.0.options = v.into();
287 self
288 }
289
290 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
297 (*self.0.stub)
298 .create_cluster(self.0.request, self.0.options)
299 .await
300 .map(crate::Response::into_body)
301 }
302
303 pub fn poller(
305 self,
306 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::OperationMetadata>
307 {
308 type Operation = google_cloud_lro::internal::Operation<
309 crate::model::Cluster,
310 crate::model::OperationMetadata,
311 >;
312 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
313 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
314
315 let stub = self.0.stub.clone();
316 let mut options = self.0.options.clone();
317 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
318 let query = move |name| {
319 let stub = stub.clone();
320 let options = options.clone();
321 async {
322 let op = GetOperation::new(stub)
323 .set_name(name)
324 .with_options(options)
325 .send()
326 .await?;
327 Ok(Operation::new(op))
328 }
329 };
330
331 let start = move || async {
332 let op = self.send().await?;
333 Ok(Operation::new(op))
334 };
335
336 google_cloud_lro::internal::new_poller(
337 polling_error_policy,
338 polling_backoff_policy,
339 start,
340 query,
341 )
342 }
343
344 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
348 self.0.request.parent = v.into();
349 self
350 }
351
352 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
356 self.0.request.cluster_id = v.into();
357 self
358 }
359
360 pub fn set_cluster<T>(mut self, v: T) -> Self
364 where
365 T: std::convert::Into<crate::model::Cluster>,
366 {
367 self.0.request.cluster = std::option::Option::Some(v.into());
368 self
369 }
370
371 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
375 where
376 T: std::convert::Into<crate::model::Cluster>,
377 {
378 self.0.request.cluster = v.map(|x| x.into());
379 self
380 }
381
382 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
384 self.0.request.request_id = v.into();
385 self
386 }
387 }
388
389 #[doc(hidden)]
390 impl crate::RequestBuilder for CreateCluster {
391 fn request_options(&mut self) -> &mut crate::RequestOptions {
392 &mut self.0.options
393 }
394 }
395
396 #[derive(Clone, Debug)]
414 pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
415
416 impl UpdateCluster {
417 pub(crate) fn new(
418 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
419 ) -> Self {
420 Self(RequestBuilder::new(stub))
421 }
422
423 pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
425 self.0.request = v.into();
426 self
427 }
428
429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
431 self.0.options = v.into();
432 self
433 }
434
435 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
442 (*self.0.stub)
443 .update_cluster(self.0.request, self.0.options)
444 .await
445 .map(crate::Response::into_body)
446 }
447
448 pub fn poller(
450 self,
451 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::OperationMetadata>
452 {
453 type Operation = google_cloud_lro::internal::Operation<
454 crate::model::Cluster,
455 crate::model::OperationMetadata,
456 >;
457 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
458 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
459
460 let stub = self.0.stub.clone();
461 let mut options = self.0.options.clone();
462 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
463 let query = move |name| {
464 let stub = stub.clone();
465 let options = options.clone();
466 async {
467 let op = GetOperation::new(stub)
468 .set_name(name)
469 .with_options(options)
470 .send()
471 .await?;
472 Ok(Operation::new(op))
473 }
474 };
475
476 let start = move || async {
477 let op = self.send().await?;
478 Ok(Operation::new(op))
479 };
480
481 google_cloud_lro::internal::new_poller(
482 polling_error_policy,
483 polling_backoff_policy,
484 start,
485 query,
486 )
487 }
488
489 pub fn set_update_mask<T>(mut self, v: T) -> Self
491 where
492 T: std::convert::Into<wkt::FieldMask>,
493 {
494 self.0.request.update_mask = std::option::Option::Some(v.into());
495 self
496 }
497
498 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
500 where
501 T: std::convert::Into<wkt::FieldMask>,
502 {
503 self.0.request.update_mask = v.map(|x| x.into());
504 self
505 }
506
507 pub fn set_cluster<T>(mut self, v: T) -> Self
509 where
510 T: std::convert::Into<crate::model::Cluster>,
511 {
512 self.0.request.cluster = std::option::Option::Some(v.into());
513 self
514 }
515
516 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
518 where
519 T: std::convert::Into<crate::model::Cluster>,
520 {
521 self.0.request.cluster = v.map(|x| x.into());
522 self
523 }
524
525 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
527 self.0.request.request_id = v.into();
528 self
529 }
530 }
531
532 #[doc(hidden)]
533 impl crate::RequestBuilder for UpdateCluster {
534 fn request_options(&mut self) -> &mut crate::RequestOptions {
535 &mut self.0.options
536 }
537 }
538
539 #[derive(Clone, Debug)]
557 pub struct UpgradeCluster(RequestBuilder<crate::model::UpgradeClusterRequest>);
558
559 impl UpgradeCluster {
560 pub(crate) fn new(
561 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
562 ) -> Self {
563 Self(RequestBuilder::new(stub))
564 }
565
566 pub fn with_request<V: Into<crate::model::UpgradeClusterRequest>>(mut self, v: V) -> Self {
568 self.0.request = v.into();
569 self
570 }
571
572 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
574 self.0.options = v.into();
575 self
576 }
577
578 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
585 (*self.0.stub)
586 .upgrade_cluster(self.0.request, self.0.options)
587 .await
588 .map(crate::Response::into_body)
589 }
590
591 pub fn poller(
593 self,
594 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::OperationMetadata>
595 {
596 type Operation = google_cloud_lro::internal::Operation<
597 crate::model::Cluster,
598 crate::model::OperationMetadata,
599 >;
600 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
601 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
602
603 let stub = self.0.stub.clone();
604 let mut options = self.0.options.clone();
605 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
606 let query = move |name| {
607 let stub = stub.clone();
608 let options = options.clone();
609 async {
610 let op = GetOperation::new(stub)
611 .set_name(name)
612 .with_options(options)
613 .send()
614 .await?;
615 Ok(Operation::new(op))
616 }
617 };
618
619 let start = move || async {
620 let op = self.send().await?;
621 Ok(Operation::new(op))
622 };
623
624 google_cloud_lro::internal::new_poller(
625 polling_error_policy,
626 polling_backoff_policy,
627 start,
628 query,
629 )
630 }
631
632 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
636 self.0.request.name = v.into();
637 self
638 }
639
640 pub fn set_target_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
644 self.0.request.target_version = v.into();
645 self
646 }
647
648 pub fn set_schedule<T: Into<crate::model::upgrade_cluster_request::Schedule>>(
650 mut self,
651 v: T,
652 ) -> Self {
653 self.0.request.schedule = v.into();
654 self
655 }
656
657 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
659 self.0.request.request_id = v.into();
660 self
661 }
662 }
663
664 #[doc(hidden)]
665 impl crate::RequestBuilder for UpgradeCluster {
666 fn request_options(&mut self) -> &mut crate::RequestOptions {
667 &mut self.0.options
668 }
669 }
670
671 #[derive(Clone, Debug)]
689 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
690
691 impl DeleteCluster {
692 pub(crate) fn new(
693 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
694 ) -> Self {
695 Self(RequestBuilder::new(stub))
696 }
697
698 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
700 self.0.request = v.into();
701 self
702 }
703
704 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
706 self.0.options = v.into();
707 self
708 }
709
710 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
717 (*self.0.stub)
718 .delete_cluster(self.0.request, self.0.options)
719 .await
720 .map(crate::Response::into_body)
721 }
722
723 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
725 type Operation =
726 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
727 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
728 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
729
730 let stub = self.0.stub.clone();
731 let mut options = self.0.options.clone();
732 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
733 let query = move |name| {
734 let stub = stub.clone();
735 let options = options.clone();
736 async {
737 let op = GetOperation::new(stub)
738 .set_name(name)
739 .with_options(options)
740 .send()
741 .await?;
742 Ok(Operation::new(op))
743 }
744 };
745
746 let start = move || async {
747 let op = self.send().await?;
748 Ok(Operation::new(op))
749 };
750
751 google_cloud_lro::internal::new_unit_response_poller(
752 polling_error_policy,
753 polling_backoff_policy,
754 start,
755 query,
756 )
757 }
758
759 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
763 self.0.request.name = v.into();
764 self
765 }
766
767 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
769 self.0.request.request_id = v.into();
770 self
771 }
772 }
773
774 #[doc(hidden)]
775 impl crate::RequestBuilder for DeleteCluster {
776 fn request_options(&mut self) -> &mut crate::RequestOptions {
777 &mut self.0.options
778 }
779 }
780
781 #[derive(Clone, Debug)]
798 pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
799
800 impl GenerateAccessToken {
801 pub(crate) fn new(
802 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
803 ) -> Self {
804 Self(RequestBuilder::new(stub))
805 }
806
807 pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
809 mut self,
810 v: V,
811 ) -> Self {
812 self.0.request = v.into();
813 self
814 }
815
816 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
818 self.0.options = v.into();
819 self
820 }
821
822 pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
824 (*self.0.stub)
825 .generate_access_token(self.0.request, self.0.options)
826 .await
827 .map(crate::Response::into_body)
828 }
829
830 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
834 self.0.request.cluster = v.into();
835 self
836 }
837 }
838
839 #[doc(hidden)]
840 impl crate::RequestBuilder for GenerateAccessToken {
841 fn request_options(&mut self) -> &mut crate::RequestOptions {
842 &mut self.0.options
843 }
844 }
845
846 #[derive(Clone, Debug)]
863 pub struct GenerateOfflineCredential(
864 RequestBuilder<crate::model::GenerateOfflineCredentialRequest>,
865 );
866
867 impl GenerateOfflineCredential {
868 pub(crate) fn new(
869 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
870 ) -> Self {
871 Self(RequestBuilder::new(stub))
872 }
873
874 pub fn with_request<V: Into<crate::model::GenerateOfflineCredentialRequest>>(
876 mut self,
877 v: V,
878 ) -> Self {
879 self.0.request = v.into();
880 self
881 }
882
883 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
885 self.0.options = v.into();
886 self
887 }
888
889 pub async fn send(self) -> Result<crate::model::GenerateOfflineCredentialResponse> {
891 (*self.0.stub)
892 .generate_offline_credential(self.0.request, self.0.options)
893 .await
894 .map(crate::Response::into_body)
895 }
896
897 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
901 self.0.request.cluster = v.into();
902 self
903 }
904 }
905
906 #[doc(hidden)]
907 impl crate::RequestBuilder for GenerateOfflineCredential {
908 fn request_options(&mut self) -> &mut crate::RequestOptions {
909 &mut self.0.options
910 }
911 }
912
913 #[derive(Clone, Debug)]
934 pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
935
936 impl ListNodePools {
937 pub(crate) fn new(
938 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
939 ) -> Self {
940 Self(RequestBuilder::new(stub))
941 }
942
943 pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
945 self.0.request = v.into();
946 self
947 }
948
949 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
951 self.0.options = v.into();
952 self
953 }
954
955 pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
957 (*self.0.stub)
958 .list_node_pools(self.0.request, self.0.options)
959 .await
960 .map(crate::Response::into_body)
961 }
962
963 pub fn by_page(
965 self,
966 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListNodePoolsResponse, crate::Error>
967 {
968 use std::clone::Clone;
969 let token = self.0.request.page_token.clone();
970 let execute = move |token: String| {
971 let mut builder = self.clone();
972 builder.0.request = builder.0.request.set_page_token(token);
973 builder.send()
974 };
975 google_cloud_gax::paginator::internal::new_paginator(token, execute)
976 }
977
978 pub fn by_item(
980 self,
981 ) -> impl google_cloud_gax::paginator::ItemPaginator<
982 crate::model::ListNodePoolsResponse,
983 crate::Error,
984 > {
985 use google_cloud_gax::paginator::Paginator;
986 self.by_page().items()
987 }
988
989 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
993 self.0.request.parent = v.into();
994 self
995 }
996
997 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
999 self.0.request.page_size = v.into();
1000 self
1001 }
1002
1003 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1005 self.0.request.page_token = v.into();
1006 self
1007 }
1008
1009 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1011 self.0.request.filter = v.into();
1012 self
1013 }
1014
1015 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1017 self.0.request.order_by = v.into();
1018 self
1019 }
1020 }
1021
1022 #[doc(hidden)]
1023 impl crate::RequestBuilder for ListNodePools {
1024 fn request_options(&mut self) -> &mut crate::RequestOptions {
1025 &mut self.0.options
1026 }
1027 }
1028
1029 #[derive(Clone, Debug)]
1046 pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
1047
1048 impl GetNodePool {
1049 pub(crate) fn new(
1050 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1051 ) -> Self {
1052 Self(RequestBuilder::new(stub))
1053 }
1054
1055 pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
1057 self.0.request = v.into();
1058 self
1059 }
1060
1061 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1063 self.0.options = v.into();
1064 self
1065 }
1066
1067 pub async fn send(self) -> Result<crate::model::NodePool> {
1069 (*self.0.stub)
1070 .get_node_pool(self.0.request, self.0.options)
1071 .await
1072 .map(crate::Response::into_body)
1073 }
1074
1075 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1079 self.0.request.name = v.into();
1080 self
1081 }
1082 }
1083
1084 #[doc(hidden)]
1085 impl crate::RequestBuilder for GetNodePool {
1086 fn request_options(&mut self) -> &mut crate::RequestOptions {
1087 &mut self.0.options
1088 }
1089 }
1090
1091 #[derive(Clone, Debug)]
1109 pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
1110
1111 impl CreateNodePool {
1112 pub(crate) fn new(
1113 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1114 ) -> Self {
1115 Self(RequestBuilder::new(stub))
1116 }
1117
1118 pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
1120 self.0.request = v.into();
1121 self
1122 }
1123
1124 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1126 self.0.options = v.into();
1127 self
1128 }
1129
1130 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1137 (*self.0.stub)
1138 .create_node_pool(self.0.request, self.0.options)
1139 .await
1140 .map(crate::Response::into_body)
1141 }
1142
1143 pub fn poller(
1145 self,
1146 ) -> impl google_cloud_lro::Poller<crate::model::NodePool, crate::model::OperationMetadata>
1147 {
1148 type Operation = google_cloud_lro::internal::Operation<
1149 crate::model::NodePool,
1150 crate::model::OperationMetadata,
1151 >;
1152 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1153 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1154
1155 let stub = self.0.stub.clone();
1156 let mut options = self.0.options.clone();
1157 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1158 let query = move |name| {
1159 let stub = stub.clone();
1160 let options = options.clone();
1161 async {
1162 let op = GetOperation::new(stub)
1163 .set_name(name)
1164 .with_options(options)
1165 .send()
1166 .await?;
1167 Ok(Operation::new(op))
1168 }
1169 };
1170
1171 let start = move || async {
1172 let op = self.send().await?;
1173 Ok(Operation::new(op))
1174 };
1175
1176 google_cloud_lro::internal::new_poller(
1177 polling_error_policy,
1178 polling_backoff_policy,
1179 start,
1180 query,
1181 )
1182 }
1183
1184 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1188 self.0.request.parent = v.into();
1189 self
1190 }
1191
1192 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1196 self.0.request.node_pool_id = v.into();
1197 self
1198 }
1199
1200 pub fn set_node_pool<T>(mut self, v: T) -> Self
1204 where
1205 T: std::convert::Into<crate::model::NodePool>,
1206 {
1207 self.0.request.node_pool = std::option::Option::Some(v.into());
1208 self
1209 }
1210
1211 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1215 where
1216 T: std::convert::Into<crate::model::NodePool>,
1217 {
1218 self.0.request.node_pool = v.map(|x| x.into());
1219 self
1220 }
1221
1222 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1224 self.0.request.request_id = v.into();
1225 self
1226 }
1227 }
1228
1229 #[doc(hidden)]
1230 impl crate::RequestBuilder for CreateNodePool {
1231 fn request_options(&mut self) -> &mut crate::RequestOptions {
1232 &mut self.0.options
1233 }
1234 }
1235
1236 #[derive(Clone, Debug)]
1254 pub struct UpdateNodePool(RequestBuilder<crate::model::UpdateNodePoolRequest>);
1255
1256 impl UpdateNodePool {
1257 pub(crate) fn new(
1258 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1259 ) -> Self {
1260 Self(RequestBuilder::new(stub))
1261 }
1262
1263 pub fn with_request<V: Into<crate::model::UpdateNodePoolRequest>>(mut self, v: V) -> Self {
1265 self.0.request = v.into();
1266 self
1267 }
1268
1269 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1271 self.0.options = v.into();
1272 self
1273 }
1274
1275 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1282 (*self.0.stub)
1283 .update_node_pool(self.0.request, self.0.options)
1284 .await
1285 .map(crate::Response::into_body)
1286 }
1287
1288 pub fn poller(
1290 self,
1291 ) -> impl google_cloud_lro::Poller<crate::model::NodePool, crate::model::OperationMetadata>
1292 {
1293 type Operation = google_cloud_lro::internal::Operation<
1294 crate::model::NodePool,
1295 crate::model::OperationMetadata,
1296 >;
1297 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1298 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1299
1300 let stub = self.0.stub.clone();
1301 let mut options = self.0.options.clone();
1302 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1303 let query = move |name| {
1304 let stub = stub.clone();
1305 let options = options.clone();
1306 async {
1307 let op = GetOperation::new(stub)
1308 .set_name(name)
1309 .with_options(options)
1310 .send()
1311 .await?;
1312 Ok(Operation::new(op))
1313 }
1314 };
1315
1316 let start = move || async {
1317 let op = self.send().await?;
1318 Ok(Operation::new(op))
1319 };
1320
1321 google_cloud_lro::internal::new_poller(
1322 polling_error_policy,
1323 polling_backoff_policy,
1324 start,
1325 query,
1326 )
1327 }
1328
1329 pub fn set_update_mask<T>(mut self, v: T) -> Self
1331 where
1332 T: std::convert::Into<wkt::FieldMask>,
1333 {
1334 self.0.request.update_mask = std::option::Option::Some(v.into());
1335 self
1336 }
1337
1338 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1340 where
1341 T: std::convert::Into<wkt::FieldMask>,
1342 {
1343 self.0.request.update_mask = v.map(|x| x.into());
1344 self
1345 }
1346
1347 pub fn set_node_pool<T>(mut self, v: T) -> Self
1349 where
1350 T: std::convert::Into<crate::model::NodePool>,
1351 {
1352 self.0.request.node_pool = std::option::Option::Some(v.into());
1353 self
1354 }
1355
1356 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1358 where
1359 T: std::convert::Into<crate::model::NodePool>,
1360 {
1361 self.0.request.node_pool = v.map(|x| x.into());
1362 self
1363 }
1364
1365 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1367 self.0.request.request_id = v.into();
1368 self
1369 }
1370 }
1371
1372 #[doc(hidden)]
1373 impl crate::RequestBuilder for UpdateNodePool {
1374 fn request_options(&mut self) -> &mut crate::RequestOptions {
1375 &mut self.0.options
1376 }
1377 }
1378
1379 #[derive(Clone, Debug)]
1397 pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
1398
1399 impl DeleteNodePool {
1400 pub(crate) fn new(
1401 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1402 ) -> Self {
1403 Self(RequestBuilder::new(stub))
1404 }
1405
1406 pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
1408 self.0.request = v.into();
1409 self
1410 }
1411
1412 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1414 self.0.options = v.into();
1415 self
1416 }
1417
1418 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1425 (*self.0.stub)
1426 .delete_node_pool(self.0.request, self.0.options)
1427 .await
1428 .map(crate::Response::into_body)
1429 }
1430
1431 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1433 type Operation =
1434 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1435 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1436 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1437
1438 let stub = self.0.stub.clone();
1439 let mut options = self.0.options.clone();
1440 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1441 let query = move |name| {
1442 let stub = stub.clone();
1443 let options = options.clone();
1444 async {
1445 let op = GetOperation::new(stub)
1446 .set_name(name)
1447 .with_options(options)
1448 .send()
1449 .await?;
1450 Ok(Operation::new(op))
1451 }
1452 };
1453
1454 let start = move || async {
1455 let op = self.send().await?;
1456 Ok(Operation::new(op))
1457 };
1458
1459 google_cloud_lro::internal::new_unit_response_poller(
1460 polling_error_policy,
1461 polling_backoff_policy,
1462 start,
1463 query,
1464 )
1465 }
1466
1467 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1471 self.0.request.name = v.into();
1472 self
1473 }
1474
1475 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1477 self.0.request.request_id = v.into();
1478 self
1479 }
1480 }
1481
1482 #[doc(hidden)]
1483 impl crate::RequestBuilder for DeleteNodePool {
1484 fn request_options(&mut self) -> &mut crate::RequestOptions {
1485 &mut self.0.options
1486 }
1487 }
1488
1489 #[derive(Clone, Debug)]
1510 pub struct ListMachines(RequestBuilder<crate::model::ListMachinesRequest>);
1511
1512 impl ListMachines {
1513 pub(crate) fn new(
1514 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1515 ) -> Self {
1516 Self(RequestBuilder::new(stub))
1517 }
1518
1519 pub fn with_request<V: Into<crate::model::ListMachinesRequest>>(mut self, v: V) -> Self {
1521 self.0.request = v.into();
1522 self
1523 }
1524
1525 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1527 self.0.options = v.into();
1528 self
1529 }
1530
1531 pub async fn send(self) -> Result<crate::model::ListMachinesResponse> {
1533 (*self.0.stub)
1534 .list_machines(self.0.request, self.0.options)
1535 .await
1536 .map(crate::Response::into_body)
1537 }
1538
1539 pub fn by_page(
1541 self,
1542 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListMachinesResponse, crate::Error>
1543 {
1544 use std::clone::Clone;
1545 let token = self.0.request.page_token.clone();
1546 let execute = move |token: String| {
1547 let mut builder = self.clone();
1548 builder.0.request = builder.0.request.set_page_token(token);
1549 builder.send()
1550 };
1551 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1552 }
1553
1554 pub fn by_item(
1556 self,
1557 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1558 crate::model::ListMachinesResponse,
1559 crate::Error,
1560 > {
1561 use google_cloud_gax::paginator::Paginator;
1562 self.by_page().items()
1563 }
1564
1565 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1569 self.0.request.parent = v.into();
1570 self
1571 }
1572
1573 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1575 self.0.request.page_size = v.into();
1576 self
1577 }
1578
1579 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1581 self.0.request.page_token = v.into();
1582 self
1583 }
1584
1585 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1587 self.0.request.filter = v.into();
1588 self
1589 }
1590
1591 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1593 self.0.request.order_by = v.into();
1594 self
1595 }
1596 }
1597
1598 #[doc(hidden)]
1599 impl crate::RequestBuilder for ListMachines {
1600 fn request_options(&mut self) -> &mut crate::RequestOptions {
1601 &mut self.0.options
1602 }
1603 }
1604
1605 #[derive(Clone, Debug)]
1622 pub struct GetMachine(RequestBuilder<crate::model::GetMachineRequest>);
1623
1624 impl GetMachine {
1625 pub(crate) fn new(
1626 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1627 ) -> Self {
1628 Self(RequestBuilder::new(stub))
1629 }
1630
1631 pub fn with_request<V: Into<crate::model::GetMachineRequest>>(mut self, v: V) -> Self {
1633 self.0.request = v.into();
1634 self
1635 }
1636
1637 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1639 self.0.options = v.into();
1640 self
1641 }
1642
1643 pub async fn send(self) -> Result<crate::model::Machine> {
1645 (*self.0.stub)
1646 .get_machine(self.0.request, self.0.options)
1647 .await
1648 .map(crate::Response::into_body)
1649 }
1650
1651 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1655 self.0.request.name = v.into();
1656 self
1657 }
1658 }
1659
1660 #[doc(hidden)]
1661 impl crate::RequestBuilder for GetMachine {
1662 fn request_options(&mut self) -> &mut crate::RequestOptions {
1663 &mut self.0.options
1664 }
1665 }
1666
1667 #[derive(Clone, Debug)]
1688 pub struct ListVpnConnections(RequestBuilder<crate::model::ListVpnConnectionsRequest>);
1689
1690 impl ListVpnConnections {
1691 pub(crate) fn new(
1692 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1693 ) -> Self {
1694 Self(RequestBuilder::new(stub))
1695 }
1696
1697 pub fn with_request<V: Into<crate::model::ListVpnConnectionsRequest>>(
1699 mut self,
1700 v: V,
1701 ) -> Self {
1702 self.0.request = v.into();
1703 self
1704 }
1705
1706 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1708 self.0.options = v.into();
1709 self
1710 }
1711
1712 pub async fn send(self) -> Result<crate::model::ListVpnConnectionsResponse> {
1714 (*self.0.stub)
1715 .list_vpn_connections(self.0.request, self.0.options)
1716 .await
1717 .map(crate::Response::into_body)
1718 }
1719
1720 pub fn by_page(
1722 self,
1723 ) -> impl google_cloud_gax::paginator::Paginator<
1724 crate::model::ListVpnConnectionsResponse,
1725 crate::Error,
1726 > {
1727 use std::clone::Clone;
1728 let token = self.0.request.page_token.clone();
1729 let execute = move |token: String| {
1730 let mut builder = self.clone();
1731 builder.0.request = builder.0.request.set_page_token(token);
1732 builder.send()
1733 };
1734 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1735 }
1736
1737 pub fn by_item(
1739 self,
1740 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1741 crate::model::ListVpnConnectionsResponse,
1742 crate::Error,
1743 > {
1744 use google_cloud_gax::paginator::Paginator;
1745 self.by_page().items()
1746 }
1747
1748 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1752 self.0.request.parent = v.into();
1753 self
1754 }
1755
1756 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1758 self.0.request.page_size = v.into();
1759 self
1760 }
1761
1762 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1764 self.0.request.page_token = v.into();
1765 self
1766 }
1767
1768 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1770 self.0.request.filter = v.into();
1771 self
1772 }
1773
1774 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1776 self.0.request.order_by = v.into();
1777 self
1778 }
1779 }
1780
1781 #[doc(hidden)]
1782 impl crate::RequestBuilder for ListVpnConnections {
1783 fn request_options(&mut self) -> &mut crate::RequestOptions {
1784 &mut self.0.options
1785 }
1786 }
1787
1788 #[derive(Clone, Debug)]
1805 pub struct GetVpnConnection(RequestBuilder<crate::model::GetVpnConnectionRequest>);
1806
1807 impl GetVpnConnection {
1808 pub(crate) fn new(
1809 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1810 ) -> Self {
1811 Self(RequestBuilder::new(stub))
1812 }
1813
1814 pub fn with_request<V: Into<crate::model::GetVpnConnectionRequest>>(
1816 mut self,
1817 v: V,
1818 ) -> Self {
1819 self.0.request = v.into();
1820 self
1821 }
1822
1823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1825 self.0.options = v.into();
1826 self
1827 }
1828
1829 pub async fn send(self) -> Result<crate::model::VpnConnection> {
1831 (*self.0.stub)
1832 .get_vpn_connection(self.0.request, self.0.options)
1833 .await
1834 .map(crate::Response::into_body)
1835 }
1836
1837 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1841 self.0.request.name = v.into();
1842 self
1843 }
1844 }
1845
1846 #[doc(hidden)]
1847 impl crate::RequestBuilder for GetVpnConnection {
1848 fn request_options(&mut self) -> &mut crate::RequestOptions {
1849 &mut self.0.options
1850 }
1851 }
1852
1853 #[derive(Clone, Debug)]
1871 pub struct CreateVpnConnection(RequestBuilder<crate::model::CreateVpnConnectionRequest>);
1872
1873 impl CreateVpnConnection {
1874 pub(crate) fn new(
1875 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1876 ) -> Self {
1877 Self(RequestBuilder::new(stub))
1878 }
1879
1880 pub fn with_request<V: Into<crate::model::CreateVpnConnectionRequest>>(
1882 mut self,
1883 v: V,
1884 ) -> Self {
1885 self.0.request = v.into();
1886 self
1887 }
1888
1889 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1891 self.0.options = v.into();
1892 self
1893 }
1894
1895 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1902 (*self.0.stub)
1903 .create_vpn_connection(self.0.request, self.0.options)
1904 .await
1905 .map(crate::Response::into_body)
1906 }
1907
1908 pub fn poller(
1910 self,
1911 ) -> impl google_cloud_lro::Poller<crate::model::VpnConnection, crate::model::OperationMetadata>
1912 {
1913 type Operation = google_cloud_lro::internal::Operation<
1914 crate::model::VpnConnection,
1915 crate::model::OperationMetadata,
1916 >;
1917 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1918 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1919
1920 let stub = self.0.stub.clone();
1921 let mut options = self.0.options.clone();
1922 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1923 let query = move |name| {
1924 let stub = stub.clone();
1925 let options = options.clone();
1926 async {
1927 let op = GetOperation::new(stub)
1928 .set_name(name)
1929 .with_options(options)
1930 .send()
1931 .await?;
1932 Ok(Operation::new(op))
1933 }
1934 };
1935
1936 let start = move || async {
1937 let op = self.send().await?;
1938 Ok(Operation::new(op))
1939 };
1940
1941 google_cloud_lro::internal::new_poller(
1942 polling_error_policy,
1943 polling_backoff_policy,
1944 start,
1945 query,
1946 )
1947 }
1948
1949 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1953 self.0.request.parent = v.into();
1954 self
1955 }
1956
1957 pub fn set_vpn_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1961 self.0.request.vpn_connection_id = v.into();
1962 self
1963 }
1964
1965 pub fn set_vpn_connection<T>(mut self, v: T) -> Self
1969 where
1970 T: std::convert::Into<crate::model::VpnConnection>,
1971 {
1972 self.0.request.vpn_connection = std::option::Option::Some(v.into());
1973 self
1974 }
1975
1976 pub fn set_or_clear_vpn_connection<T>(mut self, v: std::option::Option<T>) -> Self
1980 where
1981 T: std::convert::Into<crate::model::VpnConnection>,
1982 {
1983 self.0.request.vpn_connection = v.map(|x| x.into());
1984 self
1985 }
1986
1987 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1989 self.0.request.request_id = v.into();
1990 self
1991 }
1992 }
1993
1994 #[doc(hidden)]
1995 impl crate::RequestBuilder for CreateVpnConnection {
1996 fn request_options(&mut self) -> &mut crate::RequestOptions {
1997 &mut self.0.options
1998 }
1999 }
2000
2001 #[derive(Clone, Debug)]
2019 pub struct DeleteVpnConnection(RequestBuilder<crate::model::DeleteVpnConnectionRequest>);
2020
2021 impl DeleteVpnConnection {
2022 pub(crate) fn new(
2023 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2024 ) -> Self {
2025 Self(RequestBuilder::new(stub))
2026 }
2027
2028 pub fn with_request<V: Into<crate::model::DeleteVpnConnectionRequest>>(
2030 mut self,
2031 v: V,
2032 ) -> Self {
2033 self.0.request = v.into();
2034 self
2035 }
2036
2037 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2039 self.0.options = v.into();
2040 self
2041 }
2042
2043 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2050 (*self.0.stub)
2051 .delete_vpn_connection(self.0.request, self.0.options)
2052 .await
2053 .map(crate::Response::into_body)
2054 }
2055
2056 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2058 type Operation =
2059 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2060 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2061 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2062
2063 let stub = self.0.stub.clone();
2064 let mut options = self.0.options.clone();
2065 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2066 let query = move |name| {
2067 let stub = stub.clone();
2068 let options = options.clone();
2069 async {
2070 let op = GetOperation::new(stub)
2071 .set_name(name)
2072 .with_options(options)
2073 .send()
2074 .await?;
2075 Ok(Operation::new(op))
2076 }
2077 };
2078
2079 let start = move || async {
2080 let op = self.send().await?;
2081 Ok(Operation::new(op))
2082 };
2083
2084 google_cloud_lro::internal::new_unit_response_poller(
2085 polling_error_policy,
2086 polling_backoff_policy,
2087 start,
2088 query,
2089 )
2090 }
2091
2092 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2096 self.0.request.name = v.into();
2097 self
2098 }
2099
2100 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2102 self.0.request.request_id = v.into();
2103 self
2104 }
2105 }
2106
2107 #[doc(hidden)]
2108 impl crate::RequestBuilder for DeleteVpnConnection {
2109 fn request_options(&mut self) -> &mut crate::RequestOptions {
2110 &mut self.0.options
2111 }
2112 }
2113
2114 #[derive(Clone, Debug)]
2131 pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
2132
2133 impl GetServerConfig {
2134 pub(crate) fn new(
2135 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2136 ) -> Self {
2137 Self(RequestBuilder::new(stub))
2138 }
2139
2140 pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
2142 self.0.request = v.into();
2143 self
2144 }
2145
2146 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2148 self.0.options = v.into();
2149 self
2150 }
2151
2152 pub async fn send(self) -> Result<crate::model::ServerConfig> {
2154 (*self.0.stub)
2155 .get_server_config(self.0.request, self.0.options)
2156 .await
2157 .map(crate::Response::into_body)
2158 }
2159
2160 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2164 self.0.request.name = v.into();
2165 self
2166 }
2167 }
2168
2169 #[doc(hidden)]
2170 impl crate::RequestBuilder for GetServerConfig {
2171 fn request_options(&mut self) -> &mut crate::RequestOptions {
2172 &mut self.0.options
2173 }
2174 }
2175
2176 #[derive(Clone, Debug)]
2197 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2198
2199 impl ListLocations {
2200 pub(crate) fn new(
2201 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2202 ) -> Self {
2203 Self(RequestBuilder::new(stub))
2204 }
2205
2206 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2208 mut self,
2209 v: V,
2210 ) -> Self {
2211 self.0.request = v.into();
2212 self
2213 }
2214
2215 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2217 self.0.options = v.into();
2218 self
2219 }
2220
2221 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2223 (*self.0.stub)
2224 .list_locations(self.0.request, self.0.options)
2225 .await
2226 .map(crate::Response::into_body)
2227 }
2228
2229 pub fn by_page(
2231 self,
2232 ) -> impl google_cloud_gax::paginator::Paginator<
2233 google_cloud_location::model::ListLocationsResponse,
2234 crate::Error,
2235 > {
2236 use std::clone::Clone;
2237 let token = self.0.request.page_token.clone();
2238 let execute = move |token: String| {
2239 let mut builder = self.clone();
2240 builder.0.request = builder.0.request.set_page_token(token);
2241 builder.send()
2242 };
2243 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2244 }
2245
2246 pub fn by_item(
2248 self,
2249 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2250 google_cloud_location::model::ListLocationsResponse,
2251 crate::Error,
2252 > {
2253 use google_cloud_gax::paginator::Paginator;
2254 self.by_page().items()
2255 }
2256
2257 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2259 self.0.request.name = v.into();
2260 self
2261 }
2262
2263 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2265 self.0.request.filter = v.into();
2266 self
2267 }
2268
2269 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2271 self.0.request.page_size = v.into();
2272 self
2273 }
2274
2275 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2277 self.0.request.page_token = v.into();
2278 self
2279 }
2280 }
2281
2282 #[doc(hidden)]
2283 impl crate::RequestBuilder for ListLocations {
2284 fn request_options(&mut self) -> &mut crate::RequestOptions {
2285 &mut self.0.options
2286 }
2287 }
2288
2289 #[derive(Clone, Debug)]
2306 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2307
2308 impl GetLocation {
2309 pub(crate) fn new(
2310 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2311 ) -> Self {
2312 Self(RequestBuilder::new(stub))
2313 }
2314
2315 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2317 mut self,
2318 v: V,
2319 ) -> Self {
2320 self.0.request = v.into();
2321 self
2322 }
2323
2324 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2326 self.0.options = v.into();
2327 self
2328 }
2329
2330 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2332 (*self.0.stub)
2333 .get_location(self.0.request, self.0.options)
2334 .await
2335 .map(crate::Response::into_body)
2336 }
2337
2338 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2340 self.0.request.name = v.into();
2341 self
2342 }
2343 }
2344
2345 #[doc(hidden)]
2346 impl crate::RequestBuilder for GetLocation {
2347 fn request_options(&mut self) -> &mut crate::RequestOptions {
2348 &mut self.0.options
2349 }
2350 }
2351
2352 #[derive(Clone, Debug)]
2373 pub struct ListOperations(
2374 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2375 );
2376
2377 impl ListOperations {
2378 pub(crate) fn new(
2379 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2380 ) -> Self {
2381 Self(RequestBuilder::new(stub))
2382 }
2383
2384 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2386 mut self,
2387 v: V,
2388 ) -> Self {
2389 self.0.request = v.into();
2390 self
2391 }
2392
2393 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2395 self.0.options = v.into();
2396 self
2397 }
2398
2399 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2401 (*self.0.stub)
2402 .list_operations(self.0.request, self.0.options)
2403 .await
2404 .map(crate::Response::into_body)
2405 }
2406
2407 pub fn by_page(
2409 self,
2410 ) -> impl google_cloud_gax::paginator::Paginator<
2411 google_cloud_longrunning::model::ListOperationsResponse,
2412 crate::Error,
2413 > {
2414 use std::clone::Clone;
2415 let token = self.0.request.page_token.clone();
2416 let execute = move |token: String| {
2417 let mut builder = self.clone();
2418 builder.0.request = builder.0.request.set_page_token(token);
2419 builder.send()
2420 };
2421 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2422 }
2423
2424 pub fn by_item(
2426 self,
2427 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2428 google_cloud_longrunning::model::ListOperationsResponse,
2429 crate::Error,
2430 > {
2431 use google_cloud_gax::paginator::Paginator;
2432 self.by_page().items()
2433 }
2434
2435 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2437 self.0.request.name = v.into();
2438 self
2439 }
2440
2441 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2443 self.0.request.filter = v.into();
2444 self
2445 }
2446
2447 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2449 self.0.request.page_size = v.into();
2450 self
2451 }
2452
2453 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2455 self.0.request.page_token = v.into();
2456 self
2457 }
2458
2459 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2461 self.0.request.return_partial_success = v.into();
2462 self
2463 }
2464 }
2465
2466 #[doc(hidden)]
2467 impl crate::RequestBuilder for ListOperations {
2468 fn request_options(&mut self) -> &mut crate::RequestOptions {
2469 &mut self.0.options
2470 }
2471 }
2472
2473 #[derive(Clone, Debug)]
2490 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2491
2492 impl GetOperation {
2493 pub(crate) fn new(
2494 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2495 ) -> Self {
2496 Self(RequestBuilder::new(stub))
2497 }
2498
2499 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2501 mut self,
2502 v: V,
2503 ) -> Self {
2504 self.0.request = v.into();
2505 self
2506 }
2507
2508 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2510 self.0.options = v.into();
2511 self
2512 }
2513
2514 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2516 (*self.0.stub)
2517 .get_operation(self.0.request, self.0.options)
2518 .await
2519 .map(crate::Response::into_body)
2520 }
2521
2522 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2524 self.0.request.name = v.into();
2525 self
2526 }
2527 }
2528
2529 #[doc(hidden)]
2530 impl crate::RequestBuilder for GetOperation {
2531 fn request_options(&mut self) -> &mut crate::RequestOptions {
2532 &mut self.0.options
2533 }
2534 }
2535
2536 #[derive(Clone, Debug)]
2553 pub struct DeleteOperation(
2554 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2555 );
2556
2557 impl DeleteOperation {
2558 pub(crate) fn new(
2559 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2560 ) -> Self {
2561 Self(RequestBuilder::new(stub))
2562 }
2563
2564 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2566 mut self,
2567 v: V,
2568 ) -> Self {
2569 self.0.request = v.into();
2570 self
2571 }
2572
2573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2575 self.0.options = v.into();
2576 self
2577 }
2578
2579 pub async fn send(self) -> Result<()> {
2581 (*self.0.stub)
2582 .delete_operation(self.0.request, self.0.options)
2583 .await
2584 .map(crate::Response::into_body)
2585 }
2586
2587 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2589 self.0.request.name = v.into();
2590 self
2591 }
2592 }
2593
2594 #[doc(hidden)]
2595 impl crate::RequestBuilder for DeleteOperation {
2596 fn request_options(&mut self) -> &mut crate::RequestOptions {
2597 &mut self.0.options
2598 }
2599 }
2600
2601 #[derive(Clone, Debug)]
2618 pub struct CancelOperation(
2619 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2620 );
2621
2622 impl CancelOperation {
2623 pub(crate) fn new(
2624 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2625 ) -> Self {
2626 Self(RequestBuilder::new(stub))
2627 }
2628
2629 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2631 mut self,
2632 v: V,
2633 ) -> Self {
2634 self.0.request = v.into();
2635 self
2636 }
2637
2638 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2640 self.0.options = v.into();
2641 self
2642 }
2643
2644 pub async fn send(self) -> Result<()> {
2646 (*self.0.stub)
2647 .cancel_operation(self.0.request, self.0.options)
2648 .await
2649 .map(crate::Response::into_body)
2650 }
2651
2652 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2654 self.0.request.name = v.into();
2655 self
2656 }
2657 }
2658
2659 #[doc(hidden)]
2660 impl crate::RequestBuilder for CancelOperation {
2661 fn request_options(&mut self) -> &mut crate::RequestOptions {
2662 &mut self.0.options
2663 }
2664 }
2665}