1pub mod edge_container {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::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 gax::client_builder::internal::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 ) -> gax::client_builder::Result<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: gax::options::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: gax::options::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<gax::options::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(gax::response::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl gax::paginator::Paginator<crate::model::ListClustersResponse, gax::error::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 gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl gax::paginator::ItemPaginator<crate::model::ListClustersResponse, gax::error::Error>
143 {
144 use gax::paginator::Paginator;
145 self.by_page().items()
146 }
147
148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152 self.0.request.parent = v.into();
153 self
154 }
155
156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158 self.0.request.page_size = v.into();
159 self
160 }
161
162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.page_token = v.into();
165 self
166 }
167
168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.filter = v.into();
171 self
172 }
173
174 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.order_by = v.into();
177 self
178 }
179 }
180
181 #[doc(hidden)]
182 impl gax::options::internal::RequestBuilder for ListClusters {
183 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
184 &mut self.0.options
185 }
186 }
187
188 #[derive(Clone, Debug)]
205 pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
206
207 impl GetCluster {
208 pub(crate) fn new(
209 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
210 ) -> Self {
211 Self(RequestBuilder::new(stub))
212 }
213
214 pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
216 self.0.request = v.into();
217 self
218 }
219
220 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
222 self.0.options = v.into();
223 self
224 }
225
226 pub async fn send(self) -> Result<crate::model::Cluster> {
228 (*self.0.stub)
229 .get_cluster(self.0.request, self.0.options)
230 .await
231 .map(gax::response::Response::into_body)
232 }
233
234 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238 self.0.request.name = v.into();
239 self
240 }
241 }
242
243 #[doc(hidden)]
244 impl gax::options::internal::RequestBuilder for GetCluster {
245 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
246 &mut self.0.options
247 }
248 }
249
250 #[derive(Clone, Debug)]
268 pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
269
270 impl CreateCluster {
271 pub(crate) fn new(
272 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
273 ) -> Self {
274 Self(RequestBuilder::new(stub))
275 }
276
277 pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
279 self.0.request = v.into();
280 self
281 }
282
283 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
285 self.0.options = v.into();
286 self
287 }
288
289 pub async fn send(self) -> Result<longrunning::model::Operation> {
296 (*self.0.stub)
297 .create_cluster(self.0.request, self.0.options)
298 .await
299 .map(gax::response::Response::into_body)
300 }
301
302 pub fn poller(
304 self,
305 ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
306 type Operation =
307 lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
308 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
309 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
310
311 let stub = self.0.stub.clone();
312 let mut options = self.0.options.clone();
313 options.set_retry_policy(gax::retry_policy::NeverRetry);
314 let query = move |name| {
315 let stub = stub.clone();
316 let options = options.clone();
317 async {
318 let op = GetOperation::new(stub)
319 .set_name(name)
320 .with_options(options)
321 .send()
322 .await?;
323 Ok(Operation::new(op))
324 }
325 };
326
327 let start = move || async {
328 let op = self.send().await?;
329 Ok(Operation::new(op))
330 };
331
332 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
333 }
334
335 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
339 self.0.request.parent = v.into();
340 self
341 }
342
343 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
347 self.0.request.cluster_id = v.into();
348 self
349 }
350
351 pub fn set_cluster<T>(mut self, v: T) -> Self
355 where
356 T: std::convert::Into<crate::model::Cluster>,
357 {
358 self.0.request.cluster = std::option::Option::Some(v.into());
359 self
360 }
361
362 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
366 where
367 T: std::convert::Into<crate::model::Cluster>,
368 {
369 self.0.request.cluster = v.map(|x| x.into());
370 self
371 }
372
373 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
375 self.0.request.request_id = v.into();
376 self
377 }
378 }
379
380 #[doc(hidden)]
381 impl gax::options::internal::RequestBuilder for CreateCluster {
382 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
383 &mut self.0.options
384 }
385 }
386
387 #[derive(Clone, Debug)]
405 pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
406
407 impl UpdateCluster {
408 pub(crate) fn new(
409 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
410 ) -> Self {
411 Self(RequestBuilder::new(stub))
412 }
413
414 pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
416 self.0.request = v.into();
417 self
418 }
419
420 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
422 self.0.options = v.into();
423 self
424 }
425
426 pub async fn send(self) -> Result<longrunning::model::Operation> {
433 (*self.0.stub)
434 .update_cluster(self.0.request, self.0.options)
435 .await
436 .map(gax::response::Response::into_body)
437 }
438
439 pub fn poller(
441 self,
442 ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
443 type Operation =
444 lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
445 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
446 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
447
448 let stub = self.0.stub.clone();
449 let mut options = self.0.options.clone();
450 options.set_retry_policy(gax::retry_policy::NeverRetry);
451 let query = move |name| {
452 let stub = stub.clone();
453 let options = options.clone();
454 async {
455 let op = GetOperation::new(stub)
456 .set_name(name)
457 .with_options(options)
458 .send()
459 .await?;
460 Ok(Operation::new(op))
461 }
462 };
463
464 let start = move || async {
465 let op = self.send().await?;
466 Ok(Operation::new(op))
467 };
468
469 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
470 }
471
472 pub fn set_update_mask<T>(mut self, v: T) -> Self
474 where
475 T: std::convert::Into<wkt::FieldMask>,
476 {
477 self.0.request.update_mask = std::option::Option::Some(v.into());
478 self
479 }
480
481 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
483 where
484 T: std::convert::Into<wkt::FieldMask>,
485 {
486 self.0.request.update_mask = v.map(|x| x.into());
487 self
488 }
489
490 pub fn set_cluster<T>(mut self, v: T) -> Self
492 where
493 T: std::convert::Into<crate::model::Cluster>,
494 {
495 self.0.request.cluster = std::option::Option::Some(v.into());
496 self
497 }
498
499 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
501 where
502 T: std::convert::Into<crate::model::Cluster>,
503 {
504 self.0.request.cluster = v.map(|x| x.into());
505 self
506 }
507
508 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
510 self.0.request.request_id = v.into();
511 self
512 }
513 }
514
515 #[doc(hidden)]
516 impl gax::options::internal::RequestBuilder for UpdateCluster {
517 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
518 &mut self.0.options
519 }
520 }
521
522 #[derive(Clone, Debug)]
540 pub struct UpgradeCluster(RequestBuilder<crate::model::UpgradeClusterRequest>);
541
542 impl UpgradeCluster {
543 pub(crate) fn new(
544 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
545 ) -> Self {
546 Self(RequestBuilder::new(stub))
547 }
548
549 pub fn with_request<V: Into<crate::model::UpgradeClusterRequest>>(mut self, v: V) -> Self {
551 self.0.request = v.into();
552 self
553 }
554
555 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
557 self.0.options = v.into();
558 self
559 }
560
561 pub async fn send(self) -> Result<longrunning::model::Operation> {
568 (*self.0.stub)
569 .upgrade_cluster(self.0.request, self.0.options)
570 .await
571 .map(gax::response::Response::into_body)
572 }
573
574 pub fn poller(
576 self,
577 ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
578 type Operation =
579 lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
580 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
581 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
582
583 let stub = self.0.stub.clone();
584 let mut options = self.0.options.clone();
585 options.set_retry_policy(gax::retry_policy::NeverRetry);
586 let query = move |name| {
587 let stub = stub.clone();
588 let options = options.clone();
589 async {
590 let op = GetOperation::new(stub)
591 .set_name(name)
592 .with_options(options)
593 .send()
594 .await?;
595 Ok(Operation::new(op))
596 }
597 };
598
599 let start = move || async {
600 let op = self.send().await?;
601 Ok(Operation::new(op))
602 };
603
604 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
605 }
606
607 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
611 self.0.request.name = v.into();
612 self
613 }
614
615 pub fn set_target_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
619 self.0.request.target_version = v.into();
620 self
621 }
622
623 pub fn set_schedule<T: Into<crate::model::upgrade_cluster_request::Schedule>>(
625 mut self,
626 v: T,
627 ) -> Self {
628 self.0.request.schedule = v.into();
629 self
630 }
631
632 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
634 self.0.request.request_id = v.into();
635 self
636 }
637 }
638
639 #[doc(hidden)]
640 impl gax::options::internal::RequestBuilder for UpgradeCluster {
641 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
642 &mut self.0.options
643 }
644 }
645
646 #[derive(Clone, Debug)]
664 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
665
666 impl DeleteCluster {
667 pub(crate) fn new(
668 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
669 ) -> Self {
670 Self(RequestBuilder::new(stub))
671 }
672
673 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
675 self.0.request = v.into();
676 self
677 }
678
679 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
681 self.0.options = v.into();
682 self
683 }
684
685 pub async fn send(self) -> Result<longrunning::model::Operation> {
692 (*self.0.stub)
693 .delete_cluster(self.0.request, self.0.options)
694 .await
695 .map(gax::response::Response::into_body)
696 }
697
698 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
700 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
701 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
702 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
703
704 let stub = self.0.stub.clone();
705 let mut options = self.0.options.clone();
706 options.set_retry_policy(gax::retry_policy::NeverRetry);
707 let query = move |name| {
708 let stub = stub.clone();
709 let options = options.clone();
710 async {
711 let op = GetOperation::new(stub)
712 .set_name(name)
713 .with_options(options)
714 .send()
715 .await?;
716 Ok(Operation::new(op))
717 }
718 };
719
720 let start = move || async {
721 let op = self.send().await?;
722 Ok(Operation::new(op))
723 };
724
725 lro::internal::new_unit_response_poller(
726 polling_error_policy,
727 polling_backoff_policy,
728 start,
729 query,
730 )
731 }
732
733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
737 self.0.request.name = v.into();
738 self
739 }
740
741 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
743 self.0.request.request_id = v.into();
744 self
745 }
746 }
747
748 #[doc(hidden)]
749 impl gax::options::internal::RequestBuilder for DeleteCluster {
750 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
751 &mut self.0.options
752 }
753 }
754
755 #[derive(Clone, Debug)]
772 pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
773
774 impl GenerateAccessToken {
775 pub(crate) fn new(
776 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
777 ) -> Self {
778 Self(RequestBuilder::new(stub))
779 }
780
781 pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
783 mut self,
784 v: V,
785 ) -> Self {
786 self.0.request = v.into();
787 self
788 }
789
790 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
792 self.0.options = v.into();
793 self
794 }
795
796 pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
798 (*self.0.stub)
799 .generate_access_token(self.0.request, self.0.options)
800 .await
801 .map(gax::response::Response::into_body)
802 }
803
804 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
808 self.0.request.cluster = v.into();
809 self
810 }
811 }
812
813 #[doc(hidden)]
814 impl gax::options::internal::RequestBuilder for GenerateAccessToken {
815 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
816 &mut self.0.options
817 }
818 }
819
820 #[derive(Clone, Debug)]
837 pub struct GenerateOfflineCredential(
838 RequestBuilder<crate::model::GenerateOfflineCredentialRequest>,
839 );
840
841 impl GenerateOfflineCredential {
842 pub(crate) fn new(
843 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
844 ) -> Self {
845 Self(RequestBuilder::new(stub))
846 }
847
848 pub fn with_request<V: Into<crate::model::GenerateOfflineCredentialRequest>>(
850 mut self,
851 v: V,
852 ) -> Self {
853 self.0.request = v.into();
854 self
855 }
856
857 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
859 self.0.options = v.into();
860 self
861 }
862
863 pub async fn send(self) -> Result<crate::model::GenerateOfflineCredentialResponse> {
865 (*self.0.stub)
866 .generate_offline_credential(self.0.request, self.0.options)
867 .await
868 .map(gax::response::Response::into_body)
869 }
870
871 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
875 self.0.request.cluster = v.into();
876 self
877 }
878 }
879
880 #[doc(hidden)]
881 impl gax::options::internal::RequestBuilder for GenerateOfflineCredential {
882 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
883 &mut self.0.options
884 }
885 }
886
887 #[derive(Clone, Debug)]
908 pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
909
910 impl ListNodePools {
911 pub(crate) fn new(
912 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
913 ) -> Self {
914 Self(RequestBuilder::new(stub))
915 }
916
917 pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
919 self.0.request = v.into();
920 self
921 }
922
923 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
925 self.0.options = v.into();
926 self
927 }
928
929 pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
931 (*self.0.stub)
932 .list_node_pools(self.0.request, self.0.options)
933 .await
934 .map(gax::response::Response::into_body)
935 }
936
937 pub fn by_page(
939 self,
940 ) -> impl gax::paginator::Paginator<crate::model::ListNodePoolsResponse, gax::error::Error>
941 {
942 use std::clone::Clone;
943 let token = self.0.request.page_token.clone();
944 let execute = move |token: String| {
945 let mut builder = self.clone();
946 builder.0.request = builder.0.request.set_page_token(token);
947 builder.send()
948 };
949 gax::paginator::internal::new_paginator(token, execute)
950 }
951
952 pub fn by_item(
954 self,
955 ) -> impl gax::paginator::ItemPaginator<crate::model::ListNodePoolsResponse, gax::error::Error>
956 {
957 use gax::paginator::Paginator;
958 self.by_page().items()
959 }
960
961 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
965 self.0.request.parent = v.into();
966 self
967 }
968
969 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
971 self.0.request.page_size = v.into();
972 self
973 }
974
975 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
977 self.0.request.page_token = v.into();
978 self
979 }
980
981 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
983 self.0.request.filter = v.into();
984 self
985 }
986
987 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
989 self.0.request.order_by = v.into();
990 self
991 }
992 }
993
994 #[doc(hidden)]
995 impl gax::options::internal::RequestBuilder for ListNodePools {
996 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
997 &mut self.0.options
998 }
999 }
1000
1001 #[derive(Clone, Debug)]
1018 pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
1019
1020 impl GetNodePool {
1021 pub(crate) fn new(
1022 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1023 ) -> Self {
1024 Self(RequestBuilder::new(stub))
1025 }
1026
1027 pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
1029 self.0.request = v.into();
1030 self
1031 }
1032
1033 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1035 self.0.options = v.into();
1036 self
1037 }
1038
1039 pub async fn send(self) -> Result<crate::model::NodePool> {
1041 (*self.0.stub)
1042 .get_node_pool(self.0.request, self.0.options)
1043 .await
1044 .map(gax::response::Response::into_body)
1045 }
1046
1047 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1051 self.0.request.name = v.into();
1052 self
1053 }
1054 }
1055
1056 #[doc(hidden)]
1057 impl gax::options::internal::RequestBuilder for GetNodePool {
1058 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1059 &mut self.0.options
1060 }
1061 }
1062
1063 #[derive(Clone, Debug)]
1081 pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
1082
1083 impl CreateNodePool {
1084 pub(crate) fn new(
1085 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1086 ) -> Self {
1087 Self(RequestBuilder::new(stub))
1088 }
1089
1090 pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
1092 self.0.request = v.into();
1093 self
1094 }
1095
1096 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1098 self.0.options = v.into();
1099 self
1100 }
1101
1102 pub async fn send(self) -> Result<longrunning::model::Operation> {
1109 (*self.0.stub)
1110 .create_node_pool(self.0.request, self.0.options)
1111 .await
1112 .map(gax::response::Response::into_body)
1113 }
1114
1115 pub fn poller(
1117 self,
1118 ) -> impl lro::Poller<crate::model::NodePool, crate::model::OperationMetadata> {
1119 type Operation =
1120 lro::internal::Operation<crate::model::NodePool, crate::model::OperationMetadata>;
1121 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1122 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1123
1124 let stub = self.0.stub.clone();
1125 let mut options = self.0.options.clone();
1126 options.set_retry_policy(gax::retry_policy::NeverRetry);
1127 let query = move |name| {
1128 let stub = stub.clone();
1129 let options = options.clone();
1130 async {
1131 let op = GetOperation::new(stub)
1132 .set_name(name)
1133 .with_options(options)
1134 .send()
1135 .await?;
1136 Ok(Operation::new(op))
1137 }
1138 };
1139
1140 let start = move || async {
1141 let op = self.send().await?;
1142 Ok(Operation::new(op))
1143 };
1144
1145 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1146 }
1147
1148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1152 self.0.request.parent = v.into();
1153 self
1154 }
1155
1156 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1160 self.0.request.node_pool_id = v.into();
1161 self
1162 }
1163
1164 pub fn set_node_pool<T>(mut self, v: T) -> Self
1168 where
1169 T: std::convert::Into<crate::model::NodePool>,
1170 {
1171 self.0.request.node_pool = std::option::Option::Some(v.into());
1172 self
1173 }
1174
1175 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1179 where
1180 T: std::convert::Into<crate::model::NodePool>,
1181 {
1182 self.0.request.node_pool = v.map(|x| x.into());
1183 self
1184 }
1185
1186 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1188 self.0.request.request_id = v.into();
1189 self
1190 }
1191 }
1192
1193 #[doc(hidden)]
1194 impl gax::options::internal::RequestBuilder for CreateNodePool {
1195 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1196 &mut self.0.options
1197 }
1198 }
1199
1200 #[derive(Clone, Debug)]
1218 pub struct UpdateNodePool(RequestBuilder<crate::model::UpdateNodePoolRequest>);
1219
1220 impl UpdateNodePool {
1221 pub(crate) fn new(
1222 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1223 ) -> Self {
1224 Self(RequestBuilder::new(stub))
1225 }
1226
1227 pub fn with_request<V: Into<crate::model::UpdateNodePoolRequest>>(mut self, v: V) -> Self {
1229 self.0.request = v.into();
1230 self
1231 }
1232
1233 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1235 self.0.options = v.into();
1236 self
1237 }
1238
1239 pub async fn send(self) -> Result<longrunning::model::Operation> {
1246 (*self.0.stub)
1247 .update_node_pool(self.0.request, self.0.options)
1248 .await
1249 .map(gax::response::Response::into_body)
1250 }
1251
1252 pub fn poller(
1254 self,
1255 ) -> impl lro::Poller<crate::model::NodePool, crate::model::OperationMetadata> {
1256 type Operation =
1257 lro::internal::Operation<crate::model::NodePool, crate::model::OperationMetadata>;
1258 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1259 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1260
1261 let stub = self.0.stub.clone();
1262 let mut options = self.0.options.clone();
1263 options.set_retry_policy(gax::retry_policy::NeverRetry);
1264 let query = move |name| {
1265 let stub = stub.clone();
1266 let options = options.clone();
1267 async {
1268 let op = GetOperation::new(stub)
1269 .set_name(name)
1270 .with_options(options)
1271 .send()
1272 .await?;
1273 Ok(Operation::new(op))
1274 }
1275 };
1276
1277 let start = move || async {
1278 let op = self.send().await?;
1279 Ok(Operation::new(op))
1280 };
1281
1282 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1283 }
1284
1285 pub fn set_update_mask<T>(mut self, v: T) -> Self
1287 where
1288 T: std::convert::Into<wkt::FieldMask>,
1289 {
1290 self.0.request.update_mask = std::option::Option::Some(v.into());
1291 self
1292 }
1293
1294 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1296 where
1297 T: std::convert::Into<wkt::FieldMask>,
1298 {
1299 self.0.request.update_mask = v.map(|x| x.into());
1300 self
1301 }
1302
1303 pub fn set_node_pool<T>(mut self, v: T) -> Self
1305 where
1306 T: std::convert::Into<crate::model::NodePool>,
1307 {
1308 self.0.request.node_pool = std::option::Option::Some(v.into());
1309 self
1310 }
1311
1312 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1314 where
1315 T: std::convert::Into<crate::model::NodePool>,
1316 {
1317 self.0.request.node_pool = v.map(|x| x.into());
1318 self
1319 }
1320
1321 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1323 self.0.request.request_id = v.into();
1324 self
1325 }
1326 }
1327
1328 #[doc(hidden)]
1329 impl gax::options::internal::RequestBuilder for UpdateNodePool {
1330 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1331 &mut self.0.options
1332 }
1333 }
1334
1335 #[derive(Clone, Debug)]
1353 pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
1354
1355 impl DeleteNodePool {
1356 pub(crate) fn new(
1357 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1358 ) -> Self {
1359 Self(RequestBuilder::new(stub))
1360 }
1361
1362 pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
1364 self.0.request = v.into();
1365 self
1366 }
1367
1368 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1370 self.0.options = v.into();
1371 self
1372 }
1373
1374 pub async fn send(self) -> Result<longrunning::model::Operation> {
1381 (*self.0.stub)
1382 .delete_node_pool(self.0.request, self.0.options)
1383 .await
1384 .map(gax::response::Response::into_body)
1385 }
1386
1387 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1389 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1390 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1391 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1392
1393 let stub = self.0.stub.clone();
1394 let mut options = self.0.options.clone();
1395 options.set_retry_policy(gax::retry_policy::NeverRetry);
1396 let query = move |name| {
1397 let stub = stub.clone();
1398 let options = options.clone();
1399 async {
1400 let op = GetOperation::new(stub)
1401 .set_name(name)
1402 .with_options(options)
1403 .send()
1404 .await?;
1405 Ok(Operation::new(op))
1406 }
1407 };
1408
1409 let start = move || async {
1410 let op = self.send().await?;
1411 Ok(Operation::new(op))
1412 };
1413
1414 lro::internal::new_unit_response_poller(
1415 polling_error_policy,
1416 polling_backoff_policy,
1417 start,
1418 query,
1419 )
1420 }
1421
1422 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1426 self.0.request.name = v.into();
1427 self
1428 }
1429
1430 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1432 self.0.request.request_id = v.into();
1433 self
1434 }
1435 }
1436
1437 #[doc(hidden)]
1438 impl gax::options::internal::RequestBuilder for DeleteNodePool {
1439 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1440 &mut self.0.options
1441 }
1442 }
1443
1444 #[derive(Clone, Debug)]
1465 pub struct ListMachines(RequestBuilder<crate::model::ListMachinesRequest>);
1466
1467 impl ListMachines {
1468 pub(crate) fn new(
1469 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1470 ) -> Self {
1471 Self(RequestBuilder::new(stub))
1472 }
1473
1474 pub fn with_request<V: Into<crate::model::ListMachinesRequest>>(mut self, v: V) -> Self {
1476 self.0.request = v.into();
1477 self
1478 }
1479
1480 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1482 self.0.options = v.into();
1483 self
1484 }
1485
1486 pub async fn send(self) -> Result<crate::model::ListMachinesResponse> {
1488 (*self.0.stub)
1489 .list_machines(self.0.request, self.0.options)
1490 .await
1491 .map(gax::response::Response::into_body)
1492 }
1493
1494 pub fn by_page(
1496 self,
1497 ) -> impl gax::paginator::Paginator<crate::model::ListMachinesResponse, gax::error::Error>
1498 {
1499 use std::clone::Clone;
1500 let token = self.0.request.page_token.clone();
1501 let execute = move |token: String| {
1502 let mut builder = self.clone();
1503 builder.0.request = builder.0.request.set_page_token(token);
1504 builder.send()
1505 };
1506 gax::paginator::internal::new_paginator(token, execute)
1507 }
1508
1509 pub fn by_item(
1511 self,
1512 ) -> impl gax::paginator::ItemPaginator<crate::model::ListMachinesResponse, gax::error::Error>
1513 {
1514 use gax::paginator::Paginator;
1515 self.by_page().items()
1516 }
1517
1518 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1522 self.0.request.parent = v.into();
1523 self
1524 }
1525
1526 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1528 self.0.request.page_size = v.into();
1529 self
1530 }
1531
1532 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1534 self.0.request.page_token = v.into();
1535 self
1536 }
1537
1538 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1540 self.0.request.filter = v.into();
1541 self
1542 }
1543
1544 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.0.request.order_by = v.into();
1547 self
1548 }
1549 }
1550
1551 #[doc(hidden)]
1552 impl gax::options::internal::RequestBuilder for ListMachines {
1553 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1554 &mut self.0.options
1555 }
1556 }
1557
1558 #[derive(Clone, Debug)]
1575 pub struct GetMachine(RequestBuilder<crate::model::GetMachineRequest>);
1576
1577 impl GetMachine {
1578 pub(crate) fn new(
1579 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1580 ) -> Self {
1581 Self(RequestBuilder::new(stub))
1582 }
1583
1584 pub fn with_request<V: Into<crate::model::GetMachineRequest>>(mut self, v: V) -> Self {
1586 self.0.request = v.into();
1587 self
1588 }
1589
1590 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1592 self.0.options = v.into();
1593 self
1594 }
1595
1596 pub async fn send(self) -> Result<crate::model::Machine> {
1598 (*self.0.stub)
1599 .get_machine(self.0.request, self.0.options)
1600 .await
1601 .map(gax::response::Response::into_body)
1602 }
1603
1604 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1608 self.0.request.name = v.into();
1609 self
1610 }
1611 }
1612
1613 #[doc(hidden)]
1614 impl gax::options::internal::RequestBuilder for GetMachine {
1615 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1616 &mut self.0.options
1617 }
1618 }
1619
1620 #[derive(Clone, Debug)]
1641 pub struct ListVpnConnections(RequestBuilder<crate::model::ListVpnConnectionsRequest>);
1642
1643 impl ListVpnConnections {
1644 pub(crate) fn new(
1645 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1646 ) -> Self {
1647 Self(RequestBuilder::new(stub))
1648 }
1649
1650 pub fn with_request<V: Into<crate::model::ListVpnConnectionsRequest>>(
1652 mut self,
1653 v: V,
1654 ) -> Self {
1655 self.0.request = v.into();
1656 self
1657 }
1658
1659 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1661 self.0.options = v.into();
1662 self
1663 }
1664
1665 pub async fn send(self) -> Result<crate::model::ListVpnConnectionsResponse> {
1667 (*self.0.stub)
1668 .list_vpn_connections(self.0.request, self.0.options)
1669 .await
1670 .map(gax::response::Response::into_body)
1671 }
1672
1673 pub fn by_page(
1675 self,
1676 ) -> impl gax::paginator::Paginator<crate::model::ListVpnConnectionsResponse, gax::error::Error>
1677 {
1678 use std::clone::Clone;
1679 let token = self.0.request.page_token.clone();
1680 let execute = move |token: String| {
1681 let mut builder = self.clone();
1682 builder.0.request = builder.0.request.set_page_token(token);
1683 builder.send()
1684 };
1685 gax::paginator::internal::new_paginator(token, execute)
1686 }
1687
1688 pub fn by_item(
1690 self,
1691 ) -> impl gax::paginator::ItemPaginator<
1692 crate::model::ListVpnConnectionsResponse,
1693 gax::error::Error,
1694 > {
1695 use gax::paginator::Paginator;
1696 self.by_page().items()
1697 }
1698
1699 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1703 self.0.request.parent = v.into();
1704 self
1705 }
1706
1707 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1709 self.0.request.page_size = v.into();
1710 self
1711 }
1712
1713 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1715 self.0.request.page_token = v.into();
1716 self
1717 }
1718
1719 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1721 self.0.request.filter = v.into();
1722 self
1723 }
1724
1725 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1727 self.0.request.order_by = v.into();
1728 self
1729 }
1730 }
1731
1732 #[doc(hidden)]
1733 impl gax::options::internal::RequestBuilder for ListVpnConnections {
1734 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1735 &mut self.0.options
1736 }
1737 }
1738
1739 #[derive(Clone, Debug)]
1756 pub struct GetVpnConnection(RequestBuilder<crate::model::GetVpnConnectionRequest>);
1757
1758 impl GetVpnConnection {
1759 pub(crate) fn new(
1760 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1761 ) -> Self {
1762 Self(RequestBuilder::new(stub))
1763 }
1764
1765 pub fn with_request<V: Into<crate::model::GetVpnConnectionRequest>>(
1767 mut self,
1768 v: V,
1769 ) -> Self {
1770 self.0.request = v.into();
1771 self
1772 }
1773
1774 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1776 self.0.options = v.into();
1777 self
1778 }
1779
1780 pub async fn send(self) -> Result<crate::model::VpnConnection> {
1782 (*self.0.stub)
1783 .get_vpn_connection(self.0.request, self.0.options)
1784 .await
1785 .map(gax::response::Response::into_body)
1786 }
1787
1788 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1792 self.0.request.name = v.into();
1793 self
1794 }
1795 }
1796
1797 #[doc(hidden)]
1798 impl gax::options::internal::RequestBuilder for GetVpnConnection {
1799 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1800 &mut self.0.options
1801 }
1802 }
1803
1804 #[derive(Clone, Debug)]
1822 pub struct CreateVpnConnection(RequestBuilder<crate::model::CreateVpnConnectionRequest>);
1823
1824 impl CreateVpnConnection {
1825 pub(crate) fn new(
1826 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1827 ) -> Self {
1828 Self(RequestBuilder::new(stub))
1829 }
1830
1831 pub fn with_request<V: Into<crate::model::CreateVpnConnectionRequest>>(
1833 mut self,
1834 v: V,
1835 ) -> Self {
1836 self.0.request = v.into();
1837 self
1838 }
1839
1840 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1842 self.0.options = v.into();
1843 self
1844 }
1845
1846 pub async fn send(self) -> Result<longrunning::model::Operation> {
1853 (*self.0.stub)
1854 .create_vpn_connection(self.0.request, self.0.options)
1855 .await
1856 .map(gax::response::Response::into_body)
1857 }
1858
1859 pub fn poller(
1861 self,
1862 ) -> impl lro::Poller<crate::model::VpnConnection, crate::model::OperationMetadata>
1863 {
1864 type Operation = lro::internal::Operation<
1865 crate::model::VpnConnection,
1866 crate::model::OperationMetadata,
1867 >;
1868 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1869 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1870
1871 let stub = self.0.stub.clone();
1872 let mut options = self.0.options.clone();
1873 options.set_retry_policy(gax::retry_policy::NeverRetry);
1874 let query = move |name| {
1875 let stub = stub.clone();
1876 let options = options.clone();
1877 async {
1878 let op = GetOperation::new(stub)
1879 .set_name(name)
1880 .with_options(options)
1881 .send()
1882 .await?;
1883 Ok(Operation::new(op))
1884 }
1885 };
1886
1887 let start = move || async {
1888 let op = self.send().await?;
1889 Ok(Operation::new(op))
1890 };
1891
1892 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1893 }
1894
1895 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1899 self.0.request.parent = v.into();
1900 self
1901 }
1902
1903 pub fn set_vpn_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1907 self.0.request.vpn_connection_id = v.into();
1908 self
1909 }
1910
1911 pub fn set_vpn_connection<T>(mut self, v: T) -> Self
1915 where
1916 T: std::convert::Into<crate::model::VpnConnection>,
1917 {
1918 self.0.request.vpn_connection = std::option::Option::Some(v.into());
1919 self
1920 }
1921
1922 pub fn set_or_clear_vpn_connection<T>(mut self, v: std::option::Option<T>) -> Self
1926 where
1927 T: std::convert::Into<crate::model::VpnConnection>,
1928 {
1929 self.0.request.vpn_connection = v.map(|x| x.into());
1930 self
1931 }
1932
1933 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1935 self.0.request.request_id = v.into();
1936 self
1937 }
1938 }
1939
1940 #[doc(hidden)]
1941 impl gax::options::internal::RequestBuilder for CreateVpnConnection {
1942 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1943 &mut self.0.options
1944 }
1945 }
1946
1947 #[derive(Clone, Debug)]
1965 pub struct DeleteVpnConnection(RequestBuilder<crate::model::DeleteVpnConnectionRequest>);
1966
1967 impl DeleteVpnConnection {
1968 pub(crate) fn new(
1969 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1970 ) -> Self {
1971 Self(RequestBuilder::new(stub))
1972 }
1973
1974 pub fn with_request<V: Into<crate::model::DeleteVpnConnectionRequest>>(
1976 mut self,
1977 v: V,
1978 ) -> Self {
1979 self.0.request = v.into();
1980 self
1981 }
1982
1983 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1985 self.0.options = v.into();
1986 self
1987 }
1988
1989 pub async fn send(self) -> Result<longrunning::model::Operation> {
1996 (*self.0.stub)
1997 .delete_vpn_connection(self.0.request, self.0.options)
1998 .await
1999 .map(gax::response::Response::into_body)
2000 }
2001
2002 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2004 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2005 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2006 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2007
2008 let stub = self.0.stub.clone();
2009 let mut options = self.0.options.clone();
2010 options.set_retry_policy(gax::retry_policy::NeverRetry);
2011 let query = move |name| {
2012 let stub = stub.clone();
2013 let options = options.clone();
2014 async {
2015 let op = GetOperation::new(stub)
2016 .set_name(name)
2017 .with_options(options)
2018 .send()
2019 .await?;
2020 Ok(Operation::new(op))
2021 }
2022 };
2023
2024 let start = move || async {
2025 let op = self.send().await?;
2026 Ok(Operation::new(op))
2027 };
2028
2029 lro::internal::new_unit_response_poller(
2030 polling_error_policy,
2031 polling_backoff_policy,
2032 start,
2033 query,
2034 )
2035 }
2036
2037 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2041 self.0.request.name = v.into();
2042 self
2043 }
2044
2045 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2047 self.0.request.request_id = v.into();
2048 self
2049 }
2050 }
2051
2052 #[doc(hidden)]
2053 impl gax::options::internal::RequestBuilder for DeleteVpnConnection {
2054 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2055 &mut self.0.options
2056 }
2057 }
2058
2059 #[derive(Clone, Debug)]
2076 pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
2077
2078 impl GetServerConfig {
2079 pub(crate) fn new(
2080 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2081 ) -> Self {
2082 Self(RequestBuilder::new(stub))
2083 }
2084
2085 pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
2087 self.0.request = v.into();
2088 self
2089 }
2090
2091 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2093 self.0.options = v.into();
2094 self
2095 }
2096
2097 pub async fn send(self) -> Result<crate::model::ServerConfig> {
2099 (*self.0.stub)
2100 .get_server_config(self.0.request, self.0.options)
2101 .await
2102 .map(gax::response::Response::into_body)
2103 }
2104
2105 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2109 self.0.request.name = v.into();
2110 self
2111 }
2112 }
2113
2114 #[doc(hidden)]
2115 impl gax::options::internal::RequestBuilder for GetServerConfig {
2116 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2117 &mut self.0.options
2118 }
2119 }
2120
2121 #[derive(Clone, Debug)]
2142 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2143
2144 impl ListLocations {
2145 pub(crate) fn new(
2146 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2147 ) -> Self {
2148 Self(RequestBuilder::new(stub))
2149 }
2150
2151 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2153 mut self,
2154 v: V,
2155 ) -> Self {
2156 self.0.request = v.into();
2157 self
2158 }
2159
2160 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2162 self.0.options = v.into();
2163 self
2164 }
2165
2166 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2168 (*self.0.stub)
2169 .list_locations(self.0.request, self.0.options)
2170 .await
2171 .map(gax::response::Response::into_body)
2172 }
2173
2174 pub fn by_page(
2176 self,
2177 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2178 {
2179 use std::clone::Clone;
2180 let token = self.0.request.page_token.clone();
2181 let execute = move |token: String| {
2182 let mut builder = self.clone();
2183 builder.0.request = builder.0.request.set_page_token(token);
2184 builder.send()
2185 };
2186 gax::paginator::internal::new_paginator(token, execute)
2187 }
2188
2189 pub fn by_item(
2191 self,
2192 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2193 {
2194 use gax::paginator::Paginator;
2195 self.by_page().items()
2196 }
2197
2198 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2200 self.0.request.name = v.into();
2201 self
2202 }
2203
2204 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2206 self.0.request.filter = v.into();
2207 self
2208 }
2209
2210 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2212 self.0.request.page_size = v.into();
2213 self
2214 }
2215
2216 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2218 self.0.request.page_token = v.into();
2219 self
2220 }
2221 }
2222
2223 #[doc(hidden)]
2224 impl gax::options::internal::RequestBuilder for ListLocations {
2225 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2226 &mut self.0.options
2227 }
2228 }
2229
2230 #[derive(Clone, Debug)]
2247 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2248
2249 impl GetLocation {
2250 pub(crate) fn new(
2251 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2252 ) -> Self {
2253 Self(RequestBuilder::new(stub))
2254 }
2255
2256 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2258 self.0.request = v.into();
2259 self
2260 }
2261
2262 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2264 self.0.options = v.into();
2265 self
2266 }
2267
2268 pub async fn send(self) -> Result<location::model::Location> {
2270 (*self.0.stub)
2271 .get_location(self.0.request, self.0.options)
2272 .await
2273 .map(gax::response::Response::into_body)
2274 }
2275
2276 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2278 self.0.request.name = v.into();
2279 self
2280 }
2281 }
2282
2283 #[doc(hidden)]
2284 impl gax::options::internal::RequestBuilder for GetLocation {
2285 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2286 &mut self.0.options
2287 }
2288 }
2289
2290 #[derive(Clone, Debug)]
2311 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2312
2313 impl ListOperations {
2314 pub(crate) fn new(
2315 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2316 ) -> Self {
2317 Self(RequestBuilder::new(stub))
2318 }
2319
2320 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2322 mut self,
2323 v: V,
2324 ) -> Self {
2325 self.0.request = v.into();
2326 self
2327 }
2328
2329 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2331 self.0.options = v.into();
2332 self
2333 }
2334
2335 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2337 (*self.0.stub)
2338 .list_operations(self.0.request, self.0.options)
2339 .await
2340 .map(gax::response::Response::into_body)
2341 }
2342
2343 pub fn by_page(
2345 self,
2346 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2347 {
2348 use std::clone::Clone;
2349 let token = self.0.request.page_token.clone();
2350 let execute = move |token: String| {
2351 let mut builder = self.clone();
2352 builder.0.request = builder.0.request.set_page_token(token);
2353 builder.send()
2354 };
2355 gax::paginator::internal::new_paginator(token, execute)
2356 }
2357
2358 pub fn by_item(
2360 self,
2361 ) -> impl gax::paginator::ItemPaginator<
2362 longrunning::model::ListOperationsResponse,
2363 gax::error::Error,
2364 > {
2365 use gax::paginator::Paginator;
2366 self.by_page().items()
2367 }
2368
2369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2371 self.0.request.name = v.into();
2372 self
2373 }
2374
2375 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2377 self.0.request.filter = v.into();
2378 self
2379 }
2380
2381 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2383 self.0.request.page_size = v.into();
2384 self
2385 }
2386
2387 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2389 self.0.request.page_token = v.into();
2390 self
2391 }
2392
2393 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2395 self.0.request.return_partial_success = v.into();
2396 self
2397 }
2398 }
2399
2400 #[doc(hidden)]
2401 impl gax::options::internal::RequestBuilder for ListOperations {
2402 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2403 &mut self.0.options
2404 }
2405 }
2406
2407 #[derive(Clone, Debug)]
2424 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2425
2426 impl GetOperation {
2427 pub(crate) fn new(
2428 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2429 ) -> Self {
2430 Self(RequestBuilder::new(stub))
2431 }
2432
2433 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2435 mut self,
2436 v: V,
2437 ) -> Self {
2438 self.0.request = v.into();
2439 self
2440 }
2441
2442 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2444 self.0.options = v.into();
2445 self
2446 }
2447
2448 pub async fn send(self) -> Result<longrunning::model::Operation> {
2450 (*self.0.stub)
2451 .get_operation(self.0.request, self.0.options)
2452 .await
2453 .map(gax::response::Response::into_body)
2454 }
2455
2456 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2458 self.0.request.name = v.into();
2459 self
2460 }
2461 }
2462
2463 #[doc(hidden)]
2464 impl gax::options::internal::RequestBuilder for GetOperation {
2465 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2466 &mut self.0.options
2467 }
2468 }
2469
2470 #[derive(Clone, Debug)]
2487 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2488
2489 impl DeleteOperation {
2490 pub(crate) fn new(
2491 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2492 ) -> Self {
2493 Self(RequestBuilder::new(stub))
2494 }
2495
2496 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2498 mut self,
2499 v: V,
2500 ) -> Self {
2501 self.0.request = v.into();
2502 self
2503 }
2504
2505 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2507 self.0.options = v.into();
2508 self
2509 }
2510
2511 pub async fn send(self) -> Result<()> {
2513 (*self.0.stub)
2514 .delete_operation(self.0.request, self.0.options)
2515 .await
2516 .map(gax::response::Response::into_body)
2517 }
2518
2519 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2521 self.0.request.name = v.into();
2522 self
2523 }
2524 }
2525
2526 #[doc(hidden)]
2527 impl gax::options::internal::RequestBuilder for DeleteOperation {
2528 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2529 &mut self.0.options
2530 }
2531 }
2532
2533 #[derive(Clone, Debug)]
2550 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2551
2552 impl CancelOperation {
2553 pub(crate) fn new(
2554 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2555 ) -> Self {
2556 Self(RequestBuilder::new(stub))
2557 }
2558
2559 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2561 mut self,
2562 v: V,
2563 ) -> Self {
2564 self.0.request = v.into();
2565 self
2566 }
2567
2568 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2570 self.0.options = v.into();
2571 self
2572 }
2573
2574 pub async fn send(self) -> Result<()> {
2576 (*self.0.stub)
2577 .cancel_operation(self.0.request, self.0.options)
2578 .await
2579 .map(gax::response::Response::into_body)
2580 }
2581
2582 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2584 self.0.request.name = v.into();
2585 self
2586 }
2587 }
2588
2589 #[doc(hidden)]
2590 impl gax::options::internal::RequestBuilder for CancelOperation {
2591 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2592 &mut self.0.options
2593 }
2594 }
2595}