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
316 let stub = self.0.stub.clone();
317 let mut options = self.0.options.clone();
318 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
319 let query = move |name| {
320 let stub = stub.clone();
321 let options = options.clone();
322 async {
323 let op = GetOperation::new(stub)
324 .set_name(name)
325 .with_options(options)
326 .send()
327 .await?;
328 Ok(Operation::new(op))
329 }
330 };
331
332 let start = move || async {
333 let op = self.send().await?;
334 Ok(Operation::new(op))
335 };
336
337 google_cloud_lro::internal::new_poller(
338 polling_error_policy,
339 polling_backoff_policy,
340 start,
341 query,
342 )
343 }
344
345 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
349 self.0.request.parent = v.into();
350 self
351 }
352
353 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
357 self.0.request.cluster_id = v.into();
358 self
359 }
360
361 pub fn set_cluster<T>(mut self, v: T) -> Self
365 where
366 T: std::convert::Into<crate::model::Cluster>,
367 {
368 self.0.request.cluster = std::option::Option::Some(v.into());
369 self
370 }
371
372 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
376 where
377 T: std::convert::Into<crate::model::Cluster>,
378 {
379 self.0.request.cluster = v.map(|x| x.into());
380 self
381 }
382
383 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
385 self.0.request.request_id = v.into();
386 self
387 }
388 }
389
390 #[doc(hidden)]
391 impl crate::RequestBuilder for CreateCluster {
392 fn request_options(&mut self) -> &mut crate::RequestOptions {
393 &mut self.0.options
394 }
395 }
396
397 #[derive(Clone, Debug)]
415 pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
416
417 impl UpdateCluster {
418 pub(crate) fn new(
419 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
420 ) -> Self {
421 Self(RequestBuilder::new(stub))
422 }
423
424 pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
426 self.0.request = v.into();
427 self
428 }
429
430 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
432 self.0.options = v.into();
433 self
434 }
435
436 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
443 (*self.0.stub)
444 .update_cluster(self.0.request, self.0.options)
445 .await
446 .map(crate::Response::into_body)
447 }
448
449 pub fn poller(
451 self,
452 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::OperationMetadata>
453 {
454 type Operation = google_cloud_lro::internal::Operation<
455 crate::model::Cluster,
456 crate::model::OperationMetadata,
457 >;
458 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
459 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
460
461 let stub = self.0.stub.clone();
462 let mut options = self.0.options.clone();
463 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
464 let query = move |name| {
465 let stub = stub.clone();
466 let options = options.clone();
467 async {
468 let op = GetOperation::new(stub)
469 .set_name(name)
470 .with_options(options)
471 .send()
472 .await?;
473 Ok(Operation::new(op))
474 }
475 };
476
477 let start = move || async {
478 let op = self.send().await?;
479 Ok(Operation::new(op))
480 };
481
482 google_cloud_lro::internal::new_poller(
483 polling_error_policy,
484 polling_backoff_policy,
485 start,
486 query,
487 )
488 }
489
490 pub fn set_update_mask<T>(mut self, v: T) -> Self
492 where
493 T: std::convert::Into<wkt::FieldMask>,
494 {
495 self.0.request.update_mask = std::option::Option::Some(v.into());
496 self
497 }
498
499 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
501 where
502 T: std::convert::Into<wkt::FieldMask>,
503 {
504 self.0.request.update_mask = v.map(|x| x.into());
505 self
506 }
507
508 pub fn set_cluster<T>(mut self, v: T) -> Self
510 where
511 T: std::convert::Into<crate::model::Cluster>,
512 {
513 self.0.request.cluster = std::option::Option::Some(v.into());
514 self
515 }
516
517 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
519 where
520 T: std::convert::Into<crate::model::Cluster>,
521 {
522 self.0.request.cluster = v.map(|x| x.into());
523 self
524 }
525
526 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
528 self.0.request.request_id = v.into();
529 self
530 }
531 }
532
533 #[doc(hidden)]
534 impl crate::RequestBuilder for UpdateCluster {
535 fn request_options(&mut self) -> &mut crate::RequestOptions {
536 &mut self.0.options
537 }
538 }
539
540 #[derive(Clone, Debug)]
558 pub struct UpgradeCluster(RequestBuilder<crate::model::UpgradeClusterRequest>);
559
560 impl UpgradeCluster {
561 pub(crate) fn new(
562 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
563 ) -> Self {
564 Self(RequestBuilder::new(stub))
565 }
566
567 pub fn with_request<V: Into<crate::model::UpgradeClusterRequest>>(mut self, v: V) -> Self {
569 self.0.request = v.into();
570 self
571 }
572
573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
575 self.0.options = v.into();
576 self
577 }
578
579 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
586 (*self.0.stub)
587 .upgrade_cluster(self.0.request, self.0.options)
588 .await
589 .map(crate::Response::into_body)
590 }
591
592 pub fn poller(
594 self,
595 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::OperationMetadata>
596 {
597 type Operation = google_cloud_lro::internal::Operation<
598 crate::model::Cluster,
599 crate::model::OperationMetadata,
600 >;
601 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
602 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
603
604 let stub = self.0.stub.clone();
605 let mut options = self.0.options.clone();
606 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
607 let query = move |name| {
608 let stub = stub.clone();
609 let options = options.clone();
610 async {
611 let op = GetOperation::new(stub)
612 .set_name(name)
613 .with_options(options)
614 .send()
615 .await?;
616 Ok(Operation::new(op))
617 }
618 };
619
620 let start = move || async {
621 let op = self.send().await?;
622 Ok(Operation::new(op))
623 };
624
625 google_cloud_lro::internal::new_poller(
626 polling_error_policy,
627 polling_backoff_policy,
628 start,
629 query,
630 )
631 }
632
633 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
637 self.0.request.name = v.into();
638 self
639 }
640
641 pub fn set_target_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
645 self.0.request.target_version = v.into();
646 self
647 }
648
649 pub fn set_schedule<T: Into<crate::model::upgrade_cluster_request::Schedule>>(
651 mut self,
652 v: T,
653 ) -> Self {
654 self.0.request.schedule = v.into();
655 self
656 }
657
658 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
660 self.0.request.request_id = v.into();
661 self
662 }
663 }
664
665 #[doc(hidden)]
666 impl crate::RequestBuilder for UpgradeCluster {
667 fn request_options(&mut self) -> &mut crate::RequestOptions {
668 &mut self.0.options
669 }
670 }
671
672 #[derive(Clone, Debug)]
690 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
691
692 impl DeleteCluster {
693 pub(crate) fn new(
694 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
695 ) -> Self {
696 Self(RequestBuilder::new(stub))
697 }
698
699 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
701 self.0.request = v.into();
702 self
703 }
704
705 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
707 self.0.options = v.into();
708 self
709 }
710
711 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
718 (*self.0.stub)
719 .delete_cluster(self.0.request, self.0.options)
720 .await
721 .map(crate::Response::into_body)
722 }
723
724 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
726 type Operation =
727 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
728 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
729 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
730
731 let stub = self.0.stub.clone();
732 let mut options = self.0.options.clone();
733 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
734 let query = move |name| {
735 let stub = stub.clone();
736 let options = options.clone();
737 async {
738 let op = GetOperation::new(stub)
739 .set_name(name)
740 .with_options(options)
741 .send()
742 .await?;
743 Ok(Operation::new(op))
744 }
745 };
746
747 let start = move || async {
748 let op = self.send().await?;
749 Ok(Operation::new(op))
750 };
751
752 google_cloud_lro::internal::new_unit_response_poller(
753 polling_error_policy,
754 polling_backoff_policy,
755 start,
756 query,
757 )
758 }
759
760 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
764 self.0.request.name = v.into();
765 self
766 }
767
768 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
770 self.0.request.request_id = v.into();
771 self
772 }
773 }
774
775 #[doc(hidden)]
776 impl crate::RequestBuilder for DeleteCluster {
777 fn request_options(&mut self) -> &mut crate::RequestOptions {
778 &mut self.0.options
779 }
780 }
781
782 #[derive(Clone, Debug)]
799 pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
800
801 impl GenerateAccessToken {
802 pub(crate) fn new(
803 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
804 ) -> Self {
805 Self(RequestBuilder::new(stub))
806 }
807
808 pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
810 mut self,
811 v: V,
812 ) -> Self {
813 self.0.request = v.into();
814 self
815 }
816
817 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
819 self.0.options = v.into();
820 self
821 }
822
823 pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
825 (*self.0.stub)
826 .generate_access_token(self.0.request, self.0.options)
827 .await
828 .map(crate::Response::into_body)
829 }
830
831 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
835 self.0.request.cluster = v.into();
836 self
837 }
838 }
839
840 #[doc(hidden)]
841 impl crate::RequestBuilder for GenerateAccessToken {
842 fn request_options(&mut self) -> &mut crate::RequestOptions {
843 &mut self.0.options
844 }
845 }
846
847 #[derive(Clone, Debug)]
864 pub struct GenerateOfflineCredential(
865 RequestBuilder<crate::model::GenerateOfflineCredentialRequest>,
866 );
867
868 impl GenerateOfflineCredential {
869 pub(crate) fn new(
870 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
871 ) -> Self {
872 Self(RequestBuilder::new(stub))
873 }
874
875 pub fn with_request<V: Into<crate::model::GenerateOfflineCredentialRequest>>(
877 mut self,
878 v: V,
879 ) -> Self {
880 self.0.request = v.into();
881 self
882 }
883
884 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
886 self.0.options = v.into();
887 self
888 }
889
890 pub async fn send(self) -> Result<crate::model::GenerateOfflineCredentialResponse> {
892 (*self.0.stub)
893 .generate_offline_credential(self.0.request, self.0.options)
894 .await
895 .map(crate::Response::into_body)
896 }
897
898 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
902 self.0.request.cluster = v.into();
903 self
904 }
905 }
906
907 #[doc(hidden)]
908 impl crate::RequestBuilder for GenerateOfflineCredential {
909 fn request_options(&mut self) -> &mut crate::RequestOptions {
910 &mut self.0.options
911 }
912 }
913
914 #[derive(Clone, Debug)]
935 pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
936
937 impl ListNodePools {
938 pub(crate) fn new(
939 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
940 ) -> Self {
941 Self(RequestBuilder::new(stub))
942 }
943
944 pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
946 self.0.request = v.into();
947 self
948 }
949
950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
952 self.0.options = v.into();
953 self
954 }
955
956 pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
958 (*self.0.stub)
959 .list_node_pools(self.0.request, self.0.options)
960 .await
961 .map(crate::Response::into_body)
962 }
963
964 pub fn by_page(
966 self,
967 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListNodePoolsResponse, crate::Error>
968 {
969 use std::clone::Clone;
970 let token = self.0.request.page_token.clone();
971 let execute = move |token: String| {
972 let mut builder = self.clone();
973 builder.0.request = builder.0.request.set_page_token(token);
974 builder.send()
975 };
976 google_cloud_gax::paginator::internal::new_paginator(token, execute)
977 }
978
979 pub fn by_item(
981 self,
982 ) -> impl google_cloud_gax::paginator::ItemPaginator<
983 crate::model::ListNodePoolsResponse,
984 crate::Error,
985 > {
986 use google_cloud_gax::paginator::Paginator;
987 self.by_page().items()
988 }
989
990 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
994 self.0.request.parent = v.into();
995 self
996 }
997
998 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1000 self.0.request.page_size = v.into();
1001 self
1002 }
1003
1004 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1006 self.0.request.page_token = v.into();
1007 self
1008 }
1009
1010 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1012 self.0.request.filter = v.into();
1013 self
1014 }
1015
1016 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1018 self.0.request.order_by = v.into();
1019 self
1020 }
1021 }
1022
1023 #[doc(hidden)]
1024 impl crate::RequestBuilder for ListNodePools {
1025 fn request_options(&mut self) -> &mut crate::RequestOptions {
1026 &mut self.0.options
1027 }
1028 }
1029
1030 #[derive(Clone, Debug)]
1047 pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
1048
1049 impl GetNodePool {
1050 pub(crate) fn new(
1051 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1052 ) -> Self {
1053 Self(RequestBuilder::new(stub))
1054 }
1055
1056 pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
1058 self.0.request = v.into();
1059 self
1060 }
1061
1062 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1064 self.0.options = v.into();
1065 self
1066 }
1067
1068 pub async fn send(self) -> Result<crate::model::NodePool> {
1070 (*self.0.stub)
1071 .get_node_pool(self.0.request, self.0.options)
1072 .await
1073 .map(crate::Response::into_body)
1074 }
1075
1076 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1080 self.0.request.name = v.into();
1081 self
1082 }
1083 }
1084
1085 #[doc(hidden)]
1086 impl crate::RequestBuilder for GetNodePool {
1087 fn request_options(&mut self) -> &mut crate::RequestOptions {
1088 &mut self.0.options
1089 }
1090 }
1091
1092 #[derive(Clone, Debug)]
1110 pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
1111
1112 impl CreateNodePool {
1113 pub(crate) fn new(
1114 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1115 ) -> Self {
1116 Self(RequestBuilder::new(stub))
1117 }
1118
1119 pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
1121 self.0.request = v.into();
1122 self
1123 }
1124
1125 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1127 self.0.options = v.into();
1128 self
1129 }
1130
1131 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1138 (*self.0.stub)
1139 .create_node_pool(self.0.request, self.0.options)
1140 .await
1141 .map(crate::Response::into_body)
1142 }
1143
1144 pub fn poller(
1146 self,
1147 ) -> impl google_cloud_lro::Poller<crate::model::NodePool, crate::model::OperationMetadata>
1148 {
1149 type Operation = google_cloud_lro::internal::Operation<
1150 crate::model::NodePool,
1151 crate::model::OperationMetadata,
1152 >;
1153 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1154 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1155
1156 let stub = self.0.stub.clone();
1157 let mut options = self.0.options.clone();
1158 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1159 let query = move |name| {
1160 let stub = stub.clone();
1161 let options = options.clone();
1162 async {
1163 let op = GetOperation::new(stub)
1164 .set_name(name)
1165 .with_options(options)
1166 .send()
1167 .await?;
1168 Ok(Operation::new(op))
1169 }
1170 };
1171
1172 let start = move || async {
1173 let op = self.send().await?;
1174 Ok(Operation::new(op))
1175 };
1176
1177 google_cloud_lro::internal::new_poller(
1178 polling_error_policy,
1179 polling_backoff_policy,
1180 start,
1181 query,
1182 )
1183 }
1184
1185 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1189 self.0.request.parent = v.into();
1190 self
1191 }
1192
1193 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1197 self.0.request.node_pool_id = v.into();
1198 self
1199 }
1200
1201 pub fn set_node_pool<T>(mut self, v: T) -> Self
1205 where
1206 T: std::convert::Into<crate::model::NodePool>,
1207 {
1208 self.0.request.node_pool = std::option::Option::Some(v.into());
1209 self
1210 }
1211
1212 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1216 where
1217 T: std::convert::Into<crate::model::NodePool>,
1218 {
1219 self.0.request.node_pool = v.map(|x| x.into());
1220 self
1221 }
1222
1223 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1225 self.0.request.request_id = v.into();
1226 self
1227 }
1228 }
1229
1230 #[doc(hidden)]
1231 impl crate::RequestBuilder for CreateNodePool {
1232 fn request_options(&mut self) -> &mut crate::RequestOptions {
1233 &mut self.0.options
1234 }
1235 }
1236
1237 #[derive(Clone, Debug)]
1255 pub struct UpdateNodePool(RequestBuilder<crate::model::UpdateNodePoolRequest>);
1256
1257 impl UpdateNodePool {
1258 pub(crate) fn new(
1259 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1260 ) -> Self {
1261 Self(RequestBuilder::new(stub))
1262 }
1263
1264 pub fn with_request<V: Into<crate::model::UpdateNodePoolRequest>>(mut self, v: V) -> Self {
1266 self.0.request = v.into();
1267 self
1268 }
1269
1270 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1272 self.0.options = v.into();
1273 self
1274 }
1275
1276 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1283 (*self.0.stub)
1284 .update_node_pool(self.0.request, self.0.options)
1285 .await
1286 .map(crate::Response::into_body)
1287 }
1288
1289 pub fn poller(
1291 self,
1292 ) -> impl google_cloud_lro::Poller<crate::model::NodePool, crate::model::OperationMetadata>
1293 {
1294 type Operation = google_cloud_lro::internal::Operation<
1295 crate::model::NodePool,
1296 crate::model::OperationMetadata,
1297 >;
1298 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1299 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1300
1301 let stub = self.0.stub.clone();
1302 let mut options = self.0.options.clone();
1303 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1304 let query = move |name| {
1305 let stub = stub.clone();
1306 let options = options.clone();
1307 async {
1308 let op = GetOperation::new(stub)
1309 .set_name(name)
1310 .with_options(options)
1311 .send()
1312 .await?;
1313 Ok(Operation::new(op))
1314 }
1315 };
1316
1317 let start = move || async {
1318 let op = self.send().await?;
1319 Ok(Operation::new(op))
1320 };
1321
1322 google_cloud_lro::internal::new_poller(
1323 polling_error_policy,
1324 polling_backoff_policy,
1325 start,
1326 query,
1327 )
1328 }
1329
1330 pub fn set_update_mask<T>(mut self, v: T) -> Self
1332 where
1333 T: std::convert::Into<wkt::FieldMask>,
1334 {
1335 self.0.request.update_mask = std::option::Option::Some(v.into());
1336 self
1337 }
1338
1339 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1341 where
1342 T: std::convert::Into<wkt::FieldMask>,
1343 {
1344 self.0.request.update_mask = v.map(|x| x.into());
1345 self
1346 }
1347
1348 pub fn set_node_pool<T>(mut self, v: T) -> Self
1350 where
1351 T: std::convert::Into<crate::model::NodePool>,
1352 {
1353 self.0.request.node_pool = std::option::Option::Some(v.into());
1354 self
1355 }
1356
1357 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1359 where
1360 T: std::convert::Into<crate::model::NodePool>,
1361 {
1362 self.0.request.node_pool = v.map(|x| x.into());
1363 self
1364 }
1365
1366 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1368 self.0.request.request_id = v.into();
1369 self
1370 }
1371 }
1372
1373 #[doc(hidden)]
1374 impl crate::RequestBuilder for UpdateNodePool {
1375 fn request_options(&mut self) -> &mut crate::RequestOptions {
1376 &mut self.0.options
1377 }
1378 }
1379
1380 #[derive(Clone, Debug)]
1398 pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
1399
1400 impl DeleteNodePool {
1401 pub(crate) fn new(
1402 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1403 ) -> Self {
1404 Self(RequestBuilder::new(stub))
1405 }
1406
1407 pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
1409 self.0.request = v.into();
1410 self
1411 }
1412
1413 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1415 self.0.options = v.into();
1416 self
1417 }
1418
1419 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1426 (*self.0.stub)
1427 .delete_node_pool(self.0.request, self.0.options)
1428 .await
1429 .map(crate::Response::into_body)
1430 }
1431
1432 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1434 type Operation =
1435 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1436 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1437 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1438
1439 let stub = self.0.stub.clone();
1440 let mut options = self.0.options.clone();
1441 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1442 let query = move |name| {
1443 let stub = stub.clone();
1444 let options = options.clone();
1445 async {
1446 let op = GetOperation::new(stub)
1447 .set_name(name)
1448 .with_options(options)
1449 .send()
1450 .await?;
1451 Ok(Operation::new(op))
1452 }
1453 };
1454
1455 let start = move || async {
1456 let op = self.send().await?;
1457 Ok(Operation::new(op))
1458 };
1459
1460 google_cloud_lro::internal::new_unit_response_poller(
1461 polling_error_policy,
1462 polling_backoff_policy,
1463 start,
1464 query,
1465 )
1466 }
1467
1468 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1472 self.0.request.name = v.into();
1473 self
1474 }
1475
1476 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1478 self.0.request.request_id = v.into();
1479 self
1480 }
1481 }
1482
1483 #[doc(hidden)]
1484 impl crate::RequestBuilder for DeleteNodePool {
1485 fn request_options(&mut self) -> &mut crate::RequestOptions {
1486 &mut self.0.options
1487 }
1488 }
1489
1490 #[derive(Clone, Debug)]
1511 pub struct ListMachines(RequestBuilder<crate::model::ListMachinesRequest>);
1512
1513 impl ListMachines {
1514 pub(crate) fn new(
1515 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1516 ) -> Self {
1517 Self(RequestBuilder::new(stub))
1518 }
1519
1520 pub fn with_request<V: Into<crate::model::ListMachinesRequest>>(mut self, v: V) -> Self {
1522 self.0.request = v.into();
1523 self
1524 }
1525
1526 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1528 self.0.options = v.into();
1529 self
1530 }
1531
1532 pub async fn send(self) -> Result<crate::model::ListMachinesResponse> {
1534 (*self.0.stub)
1535 .list_machines(self.0.request, self.0.options)
1536 .await
1537 .map(crate::Response::into_body)
1538 }
1539
1540 pub fn by_page(
1542 self,
1543 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListMachinesResponse, crate::Error>
1544 {
1545 use std::clone::Clone;
1546 let token = self.0.request.page_token.clone();
1547 let execute = move |token: String| {
1548 let mut builder = self.clone();
1549 builder.0.request = builder.0.request.set_page_token(token);
1550 builder.send()
1551 };
1552 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1553 }
1554
1555 pub fn by_item(
1557 self,
1558 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1559 crate::model::ListMachinesResponse,
1560 crate::Error,
1561 > {
1562 use google_cloud_gax::paginator::Paginator;
1563 self.by_page().items()
1564 }
1565
1566 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1570 self.0.request.parent = v.into();
1571 self
1572 }
1573
1574 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1576 self.0.request.page_size = v.into();
1577 self
1578 }
1579
1580 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1582 self.0.request.page_token = v.into();
1583 self
1584 }
1585
1586 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1588 self.0.request.filter = v.into();
1589 self
1590 }
1591
1592 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1594 self.0.request.order_by = v.into();
1595 self
1596 }
1597 }
1598
1599 #[doc(hidden)]
1600 impl crate::RequestBuilder for ListMachines {
1601 fn request_options(&mut self) -> &mut crate::RequestOptions {
1602 &mut self.0.options
1603 }
1604 }
1605
1606 #[derive(Clone, Debug)]
1623 pub struct GetMachine(RequestBuilder<crate::model::GetMachineRequest>);
1624
1625 impl GetMachine {
1626 pub(crate) fn new(
1627 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1628 ) -> Self {
1629 Self(RequestBuilder::new(stub))
1630 }
1631
1632 pub fn with_request<V: Into<crate::model::GetMachineRequest>>(mut self, v: V) -> Self {
1634 self.0.request = v.into();
1635 self
1636 }
1637
1638 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1640 self.0.options = v.into();
1641 self
1642 }
1643
1644 pub async fn send(self) -> Result<crate::model::Machine> {
1646 (*self.0.stub)
1647 .get_machine(self.0.request, self.0.options)
1648 .await
1649 .map(crate::Response::into_body)
1650 }
1651
1652 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1656 self.0.request.name = v.into();
1657 self
1658 }
1659 }
1660
1661 #[doc(hidden)]
1662 impl crate::RequestBuilder for GetMachine {
1663 fn request_options(&mut self) -> &mut crate::RequestOptions {
1664 &mut self.0.options
1665 }
1666 }
1667
1668 #[derive(Clone, Debug)]
1689 pub struct ListVpnConnections(RequestBuilder<crate::model::ListVpnConnectionsRequest>);
1690
1691 impl ListVpnConnections {
1692 pub(crate) fn new(
1693 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1694 ) -> Self {
1695 Self(RequestBuilder::new(stub))
1696 }
1697
1698 pub fn with_request<V: Into<crate::model::ListVpnConnectionsRequest>>(
1700 mut self,
1701 v: V,
1702 ) -> Self {
1703 self.0.request = v.into();
1704 self
1705 }
1706
1707 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1709 self.0.options = v.into();
1710 self
1711 }
1712
1713 pub async fn send(self) -> Result<crate::model::ListVpnConnectionsResponse> {
1715 (*self.0.stub)
1716 .list_vpn_connections(self.0.request, self.0.options)
1717 .await
1718 .map(crate::Response::into_body)
1719 }
1720
1721 pub fn by_page(
1723 self,
1724 ) -> impl google_cloud_gax::paginator::Paginator<
1725 crate::model::ListVpnConnectionsResponse,
1726 crate::Error,
1727 > {
1728 use std::clone::Clone;
1729 let token = self.0.request.page_token.clone();
1730 let execute = move |token: String| {
1731 let mut builder = self.clone();
1732 builder.0.request = builder.0.request.set_page_token(token);
1733 builder.send()
1734 };
1735 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1736 }
1737
1738 pub fn by_item(
1740 self,
1741 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1742 crate::model::ListVpnConnectionsResponse,
1743 crate::Error,
1744 > {
1745 use google_cloud_gax::paginator::Paginator;
1746 self.by_page().items()
1747 }
1748
1749 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1753 self.0.request.parent = v.into();
1754 self
1755 }
1756
1757 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1759 self.0.request.page_size = v.into();
1760 self
1761 }
1762
1763 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1765 self.0.request.page_token = v.into();
1766 self
1767 }
1768
1769 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1771 self.0.request.filter = v.into();
1772 self
1773 }
1774
1775 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1777 self.0.request.order_by = v.into();
1778 self
1779 }
1780 }
1781
1782 #[doc(hidden)]
1783 impl crate::RequestBuilder for ListVpnConnections {
1784 fn request_options(&mut self) -> &mut crate::RequestOptions {
1785 &mut self.0.options
1786 }
1787 }
1788
1789 #[derive(Clone, Debug)]
1806 pub struct GetVpnConnection(RequestBuilder<crate::model::GetVpnConnectionRequest>);
1807
1808 impl GetVpnConnection {
1809 pub(crate) fn new(
1810 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1811 ) -> Self {
1812 Self(RequestBuilder::new(stub))
1813 }
1814
1815 pub fn with_request<V: Into<crate::model::GetVpnConnectionRequest>>(
1817 mut self,
1818 v: V,
1819 ) -> Self {
1820 self.0.request = v.into();
1821 self
1822 }
1823
1824 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1826 self.0.options = v.into();
1827 self
1828 }
1829
1830 pub async fn send(self) -> Result<crate::model::VpnConnection> {
1832 (*self.0.stub)
1833 .get_vpn_connection(self.0.request, self.0.options)
1834 .await
1835 .map(crate::Response::into_body)
1836 }
1837
1838 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1842 self.0.request.name = v.into();
1843 self
1844 }
1845 }
1846
1847 #[doc(hidden)]
1848 impl crate::RequestBuilder for GetVpnConnection {
1849 fn request_options(&mut self) -> &mut crate::RequestOptions {
1850 &mut self.0.options
1851 }
1852 }
1853
1854 #[derive(Clone, Debug)]
1872 pub struct CreateVpnConnection(RequestBuilder<crate::model::CreateVpnConnectionRequest>);
1873
1874 impl CreateVpnConnection {
1875 pub(crate) fn new(
1876 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1877 ) -> Self {
1878 Self(RequestBuilder::new(stub))
1879 }
1880
1881 pub fn with_request<V: Into<crate::model::CreateVpnConnectionRequest>>(
1883 mut self,
1884 v: V,
1885 ) -> Self {
1886 self.0.request = v.into();
1887 self
1888 }
1889
1890 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1892 self.0.options = v.into();
1893 self
1894 }
1895
1896 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1903 (*self.0.stub)
1904 .create_vpn_connection(self.0.request, self.0.options)
1905 .await
1906 .map(crate::Response::into_body)
1907 }
1908
1909 pub fn poller(
1911 self,
1912 ) -> impl google_cloud_lro::Poller<crate::model::VpnConnection, crate::model::OperationMetadata>
1913 {
1914 type Operation = google_cloud_lro::internal::Operation<
1915 crate::model::VpnConnection,
1916 crate::model::OperationMetadata,
1917 >;
1918 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1919 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1920
1921 let stub = self.0.stub.clone();
1922 let mut options = self.0.options.clone();
1923 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1924 let query = move |name| {
1925 let stub = stub.clone();
1926 let options = options.clone();
1927 async {
1928 let op = GetOperation::new(stub)
1929 .set_name(name)
1930 .with_options(options)
1931 .send()
1932 .await?;
1933 Ok(Operation::new(op))
1934 }
1935 };
1936
1937 let start = move || async {
1938 let op = self.send().await?;
1939 Ok(Operation::new(op))
1940 };
1941
1942 google_cloud_lro::internal::new_poller(
1943 polling_error_policy,
1944 polling_backoff_policy,
1945 start,
1946 query,
1947 )
1948 }
1949
1950 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1954 self.0.request.parent = v.into();
1955 self
1956 }
1957
1958 pub fn set_vpn_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1962 self.0.request.vpn_connection_id = v.into();
1963 self
1964 }
1965
1966 pub fn set_vpn_connection<T>(mut self, v: T) -> Self
1970 where
1971 T: std::convert::Into<crate::model::VpnConnection>,
1972 {
1973 self.0.request.vpn_connection = std::option::Option::Some(v.into());
1974 self
1975 }
1976
1977 pub fn set_or_clear_vpn_connection<T>(mut self, v: std::option::Option<T>) -> Self
1981 where
1982 T: std::convert::Into<crate::model::VpnConnection>,
1983 {
1984 self.0.request.vpn_connection = v.map(|x| x.into());
1985 self
1986 }
1987
1988 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1990 self.0.request.request_id = v.into();
1991 self
1992 }
1993 }
1994
1995 #[doc(hidden)]
1996 impl crate::RequestBuilder for CreateVpnConnection {
1997 fn request_options(&mut self) -> &mut crate::RequestOptions {
1998 &mut self.0.options
1999 }
2000 }
2001
2002 #[derive(Clone, Debug)]
2020 pub struct DeleteVpnConnection(RequestBuilder<crate::model::DeleteVpnConnectionRequest>);
2021
2022 impl DeleteVpnConnection {
2023 pub(crate) fn new(
2024 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2025 ) -> Self {
2026 Self(RequestBuilder::new(stub))
2027 }
2028
2029 pub fn with_request<V: Into<crate::model::DeleteVpnConnectionRequest>>(
2031 mut self,
2032 v: V,
2033 ) -> Self {
2034 self.0.request = v.into();
2035 self
2036 }
2037
2038 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2040 self.0.options = v.into();
2041 self
2042 }
2043
2044 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2051 (*self.0.stub)
2052 .delete_vpn_connection(self.0.request, self.0.options)
2053 .await
2054 .map(crate::Response::into_body)
2055 }
2056
2057 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2059 type Operation =
2060 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2061 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2062 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2063
2064 let stub = self.0.stub.clone();
2065 let mut options = self.0.options.clone();
2066 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2067 let query = move |name| {
2068 let stub = stub.clone();
2069 let options = options.clone();
2070 async {
2071 let op = GetOperation::new(stub)
2072 .set_name(name)
2073 .with_options(options)
2074 .send()
2075 .await?;
2076 Ok(Operation::new(op))
2077 }
2078 };
2079
2080 let start = move || async {
2081 let op = self.send().await?;
2082 Ok(Operation::new(op))
2083 };
2084
2085 google_cloud_lro::internal::new_unit_response_poller(
2086 polling_error_policy,
2087 polling_backoff_policy,
2088 start,
2089 query,
2090 )
2091 }
2092
2093 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2097 self.0.request.name = v.into();
2098 self
2099 }
2100
2101 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2103 self.0.request.request_id = v.into();
2104 self
2105 }
2106 }
2107
2108 #[doc(hidden)]
2109 impl crate::RequestBuilder for DeleteVpnConnection {
2110 fn request_options(&mut self) -> &mut crate::RequestOptions {
2111 &mut self.0.options
2112 }
2113 }
2114
2115 #[derive(Clone, Debug)]
2132 pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
2133
2134 impl GetServerConfig {
2135 pub(crate) fn new(
2136 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2137 ) -> Self {
2138 Self(RequestBuilder::new(stub))
2139 }
2140
2141 pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
2143 self.0.request = v.into();
2144 self
2145 }
2146
2147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2149 self.0.options = v.into();
2150 self
2151 }
2152
2153 pub async fn send(self) -> Result<crate::model::ServerConfig> {
2155 (*self.0.stub)
2156 .get_server_config(self.0.request, self.0.options)
2157 .await
2158 .map(crate::Response::into_body)
2159 }
2160
2161 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2165 self.0.request.name = v.into();
2166 self
2167 }
2168 }
2169
2170 #[doc(hidden)]
2171 impl crate::RequestBuilder for GetServerConfig {
2172 fn request_options(&mut self) -> &mut crate::RequestOptions {
2173 &mut self.0.options
2174 }
2175 }
2176
2177 #[derive(Clone, Debug)]
2198 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2199
2200 impl ListLocations {
2201 pub(crate) fn new(
2202 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2203 ) -> Self {
2204 Self(RequestBuilder::new(stub))
2205 }
2206
2207 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2209 mut self,
2210 v: V,
2211 ) -> Self {
2212 self.0.request = v.into();
2213 self
2214 }
2215
2216 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2218 self.0.options = v.into();
2219 self
2220 }
2221
2222 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2224 (*self.0.stub)
2225 .list_locations(self.0.request, self.0.options)
2226 .await
2227 .map(crate::Response::into_body)
2228 }
2229
2230 pub fn by_page(
2232 self,
2233 ) -> impl google_cloud_gax::paginator::Paginator<
2234 google_cloud_location::model::ListLocationsResponse,
2235 crate::Error,
2236 > {
2237 use std::clone::Clone;
2238 let token = self.0.request.page_token.clone();
2239 let execute = move |token: String| {
2240 let mut builder = self.clone();
2241 builder.0.request = builder.0.request.set_page_token(token);
2242 builder.send()
2243 };
2244 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2245 }
2246
2247 pub fn by_item(
2249 self,
2250 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2251 google_cloud_location::model::ListLocationsResponse,
2252 crate::Error,
2253 > {
2254 use google_cloud_gax::paginator::Paginator;
2255 self.by_page().items()
2256 }
2257
2258 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2260 self.0.request.name = v.into();
2261 self
2262 }
2263
2264 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2266 self.0.request.filter = v.into();
2267 self
2268 }
2269
2270 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2272 self.0.request.page_size = v.into();
2273 self
2274 }
2275
2276 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2278 self.0.request.page_token = v.into();
2279 self
2280 }
2281 }
2282
2283 #[doc(hidden)]
2284 impl crate::RequestBuilder for ListLocations {
2285 fn request_options(&mut self) -> &mut crate::RequestOptions {
2286 &mut self.0.options
2287 }
2288 }
2289
2290 #[derive(Clone, Debug)]
2307 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2308
2309 impl GetLocation {
2310 pub(crate) fn new(
2311 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2312 ) -> Self {
2313 Self(RequestBuilder::new(stub))
2314 }
2315
2316 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2318 mut self,
2319 v: V,
2320 ) -> Self {
2321 self.0.request = v.into();
2322 self
2323 }
2324
2325 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2327 self.0.options = v.into();
2328 self
2329 }
2330
2331 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2333 (*self.0.stub)
2334 .get_location(self.0.request, self.0.options)
2335 .await
2336 .map(crate::Response::into_body)
2337 }
2338
2339 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2341 self.0.request.name = v.into();
2342 self
2343 }
2344 }
2345
2346 #[doc(hidden)]
2347 impl crate::RequestBuilder for GetLocation {
2348 fn request_options(&mut self) -> &mut crate::RequestOptions {
2349 &mut self.0.options
2350 }
2351 }
2352
2353 #[derive(Clone, Debug)]
2374 pub struct ListOperations(
2375 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2376 );
2377
2378 impl ListOperations {
2379 pub(crate) fn new(
2380 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2381 ) -> Self {
2382 Self(RequestBuilder::new(stub))
2383 }
2384
2385 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2387 mut self,
2388 v: V,
2389 ) -> Self {
2390 self.0.request = v.into();
2391 self
2392 }
2393
2394 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2396 self.0.options = v.into();
2397 self
2398 }
2399
2400 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2402 (*self.0.stub)
2403 .list_operations(self.0.request, self.0.options)
2404 .await
2405 .map(crate::Response::into_body)
2406 }
2407
2408 pub fn by_page(
2410 self,
2411 ) -> impl google_cloud_gax::paginator::Paginator<
2412 google_cloud_longrunning::model::ListOperationsResponse,
2413 crate::Error,
2414 > {
2415 use std::clone::Clone;
2416 let token = self.0.request.page_token.clone();
2417 let execute = move |token: String| {
2418 let mut builder = self.clone();
2419 builder.0.request = builder.0.request.set_page_token(token);
2420 builder.send()
2421 };
2422 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2423 }
2424
2425 pub fn by_item(
2427 self,
2428 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2429 google_cloud_longrunning::model::ListOperationsResponse,
2430 crate::Error,
2431 > {
2432 use google_cloud_gax::paginator::Paginator;
2433 self.by_page().items()
2434 }
2435
2436 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2438 self.0.request.name = v.into();
2439 self
2440 }
2441
2442 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2444 self.0.request.filter = v.into();
2445 self
2446 }
2447
2448 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2450 self.0.request.page_size = v.into();
2451 self
2452 }
2453
2454 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2456 self.0.request.page_token = v.into();
2457 self
2458 }
2459
2460 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2462 self.0.request.return_partial_success = v.into();
2463 self
2464 }
2465 }
2466
2467 #[doc(hidden)]
2468 impl crate::RequestBuilder for ListOperations {
2469 fn request_options(&mut self) -> &mut crate::RequestOptions {
2470 &mut self.0.options
2471 }
2472 }
2473
2474 #[derive(Clone, Debug)]
2491 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2492
2493 impl GetOperation {
2494 pub(crate) fn new(
2495 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2496 ) -> Self {
2497 Self(RequestBuilder::new(stub))
2498 }
2499
2500 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2502 mut self,
2503 v: V,
2504 ) -> Self {
2505 self.0.request = v.into();
2506 self
2507 }
2508
2509 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2511 self.0.options = v.into();
2512 self
2513 }
2514
2515 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2517 (*self.0.stub)
2518 .get_operation(self.0.request, self.0.options)
2519 .await
2520 .map(crate::Response::into_body)
2521 }
2522
2523 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2525 self.0.request.name = v.into();
2526 self
2527 }
2528 }
2529
2530 #[doc(hidden)]
2531 impl crate::RequestBuilder for GetOperation {
2532 fn request_options(&mut self) -> &mut crate::RequestOptions {
2533 &mut self.0.options
2534 }
2535 }
2536
2537 #[derive(Clone, Debug)]
2554 pub struct DeleteOperation(
2555 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2556 );
2557
2558 impl DeleteOperation {
2559 pub(crate) fn new(
2560 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2561 ) -> Self {
2562 Self(RequestBuilder::new(stub))
2563 }
2564
2565 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2567 mut self,
2568 v: V,
2569 ) -> Self {
2570 self.0.request = v.into();
2571 self
2572 }
2573
2574 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2576 self.0.options = v.into();
2577 self
2578 }
2579
2580 pub async fn send(self) -> Result<()> {
2582 (*self.0.stub)
2583 .delete_operation(self.0.request, self.0.options)
2584 .await
2585 .map(crate::Response::into_body)
2586 }
2587
2588 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2590 self.0.request.name = v.into();
2591 self
2592 }
2593 }
2594
2595 #[doc(hidden)]
2596 impl crate::RequestBuilder for DeleteOperation {
2597 fn request_options(&mut self) -> &mut crate::RequestOptions {
2598 &mut self.0.options
2599 }
2600 }
2601
2602 #[derive(Clone, Debug)]
2619 pub struct CancelOperation(
2620 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2621 );
2622
2623 impl CancelOperation {
2624 pub(crate) fn new(
2625 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2626 ) -> Self {
2627 Self(RequestBuilder::new(stub))
2628 }
2629
2630 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2632 mut self,
2633 v: V,
2634 ) -> Self {
2635 self.0.request = v.into();
2636 self
2637 }
2638
2639 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2641 self.0.options = v.into();
2642 self
2643 }
2644
2645 pub async fn send(self) -> Result<()> {
2647 (*self.0.stub)
2648 .cancel_operation(self.0.request, self.0.options)
2649 .await
2650 .map(crate::Response::into_body)
2651 }
2652
2653 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2655 self.0.request.name = v.into();
2656 self
2657 }
2658 }
2659
2660 #[doc(hidden)]
2661 impl crate::RequestBuilder for CancelOperation {
2662 fn request_options(&mut self) -> &mut crate::RequestOptions {
2663 &mut self.0.options
2664 }
2665 }
2666}