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)]
96 pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
97
98 impl ListClusters {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
107 self.0.request = v.into();
108 self
109 }
110
111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113 self.0.options = v.into();
114 self
115 }
116
117 pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
119 (*self.0.stub)
120 .list_clusters(self.0.request, self.0.options)
121 .await
122 .map(gax::response::Response::into_body)
123 }
124
125 pub fn by_page(
127 self,
128 ) -> impl gax::paginator::Paginator<crate::model::ListClustersResponse, gax::error::Error>
129 {
130 use std::clone::Clone;
131 let token = self.0.request.page_token.clone();
132 let execute = move |token: String| {
133 let mut builder = self.clone();
134 builder.0.request = builder.0.request.set_page_token(token);
135 builder.send()
136 };
137 gax::paginator::internal::new_paginator(token, execute)
138 }
139
140 pub fn by_item(
142 self,
143 ) -> impl gax::paginator::ItemPaginator<crate::model::ListClustersResponse, gax::error::Error>
144 {
145 use gax::paginator::Paginator;
146 self.by_page().items()
147 }
148
149 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153 self.0.request.parent = v.into();
154 self
155 }
156
157 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159 self.0.request.page_size = v.into();
160 self
161 }
162
163 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165 self.0.request.page_token = v.into();
166 self
167 }
168
169 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.filter = v.into();
172 self
173 }
174
175 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.order_by = v.into();
178 self
179 }
180 }
181
182 #[doc(hidden)]
183 impl gax::options::internal::RequestBuilder for ListClusters {
184 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
185 &mut self.0.options
186 }
187 }
188
189 #[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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for GetCluster {
247 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
248 &mut self.0.options
249 }
250 }
251
252 #[derive(Clone, Debug)]
271 pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
272
273 impl CreateCluster {
274 pub(crate) fn new(
275 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
276 ) -> Self {
277 Self(RequestBuilder::new(stub))
278 }
279
280 pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
282 self.0.request = v.into();
283 self
284 }
285
286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
288 self.0.options = v.into();
289 self
290 }
291
292 pub async fn send(self) -> Result<longrunning::model::Operation> {
299 (*self.0.stub)
300 .create_cluster(self.0.request, self.0.options)
301 .await
302 .map(gax::response::Response::into_body)
303 }
304
305 pub fn poller(
307 self,
308 ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
309 type Operation =
310 lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
311 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
312 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
313
314 let stub = self.0.stub.clone();
315 let mut options = self.0.options.clone();
316 options.set_retry_policy(gax::retry_policy::NeverRetry);
317 let query = move |name| {
318 let stub = stub.clone();
319 let options = options.clone();
320 async {
321 let op = GetOperation::new(stub)
322 .set_name(name)
323 .with_options(options)
324 .send()
325 .await?;
326 Ok(Operation::new(op))
327 }
328 };
329
330 let start = move || async {
331 let op = self.send().await?;
332 Ok(Operation::new(op))
333 };
334
335 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
336 }
337
338 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
342 self.0.request.parent = v.into();
343 self
344 }
345
346 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
350 self.0.request.cluster_id = v.into();
351 self
352 }
353
354 pub fn set_cluster<T>(mut self, v: T) -> Self
358 where
359 T: std::convert::Into<crate::model::Cluster>,
360 {
361 self.0.request.cluster = std::option::Option::Some(v.into());
362 self
363 }
364
365 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
369 where
370 T: std::convert::Into<crate::model::Cluster>,
371 {
372 self.0.request.cluster = v.map(|x| x.into());
373 self
374 }
375
376 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
378 self.0.request.request_id = v.into();
379 self
380 }
381 }
382
383 #[doc(hidden)]
384 impl gax::options::internal::RequestBuilder for CreateCluster {
385 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
386 &mut self.0.options
387 }
388 }
389
390 #[derive(Clone, Debug)]
409 pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
410
411 impl UpdateCluster {
412 pub(crate) fn new(
413 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
414 ) -> Self {
415 Self(RequestBuilder::new(stub))
416 }
417
418 pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
420 self.0.request = v.into();
421 self
422 }
423
424 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
426 self.0.options = v.into();
427 self
428 }
429
430 pub async fn send(self) -> Result<longrunning::model::Operation> {
437 (*self.0.stub)
438 .update_cluster(self.0.request, self.0.options)
439 .await
440 .map(gax::response::Response::into_body)
441 }
442
443 pub fn poller(
445 self,
446 ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
447 type Operation =
448 lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
449 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
450 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
451
452 let stub = self.0.stub.clone();
453 let mut options = self.0.options.clone();
454 options.set_retry_policy(gax::retry_policy::NeverRetry);
455 let query = move |name| {
456 let stub = stub.clone();
457 let options = options.clone();
458 async {
459 let op = GetOperation::new(stub)
460 .set_name(name)
461 .with_options(options)
462 .send()
463 .await?;
464 Ok(Operation::new(op))
465 }
466 };
467
468 let start = move || async {
469 let op = self.send().await?;
470 Ok(Operation::new(op))
471 };
472
473 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
474 }
475
476 pub fn set_update_mask<T>(mut self, v: T) -> Self
478 where
479 T: std::convert::Into<wkt::FieldMask>,
480 {
481 self.0.request.update_mask = std::option::Option::Some(v.into());
482 self
483 }
484
485 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
487 where
488 T: std::convert::Into<wkt::FieldMask>,
489 {
490 self.0.request.update_mask = v.map(|x| x.into());
491 self
492 }
493
494 pub fn set_cluster<T>(mut self, v: T) -> Self
496 where
497 T: std::convert::Into<crate::model::Cluster>,
498 {
499 self.0.request.cluster = std::option::Option::Some(v.into());
500 self
501 }
502
503 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
505 where
506 T: std::convert::Into<crate::model::Cluster>,
507 {
508 self.0.request.cluster = v.map(|x| x.into());
509 self
510 }
511
512 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
514 self.0.request.request_id = v.into();
515 self
516 }
517 }
518
519 #[doc(hidden)]
520 impl gax::options::internal::RequestBuilder for UpdateCluster {
521 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
522 &mut self.0.options
523 }
524 }
525
526 #[derive(Clone, Debug)]
545 pub struct UpgradeCluster(RequestBuilder<crate::model::UpgradeClusterRequest>);
546
547 impl UpgradeCluster {
548 pub(crate) fn new(
549 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
550 ) -> Self {
551 Self(RequestBuilder::new(stub))
552 }
553
554 pub fn with_request<V: Into<crate::model::UpgradeClusterRequest>>(mut self, v: V) -> Self {
556 self.0.request = v.into();
557 self
558 }
559
560 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
562 self.0.options = v.into();
563 self
564 }
565
566 pub async fn send(self) -> Result<longrunning::model::Operation> {
573 (*self.0.stub)
574 .upgrade_cluster(self.0.request, self.0.options)
575 .await
576 .map(gax::response::Response::into_body)
577 }
578
579 pub fn poller(
581 self,
582 ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
583 type Operation =
584 lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
585 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
586 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
587
588 let stub = self.0.stub.clone();
589 let mut options = self.0.options.clone();
590 options.set_retry_policy(gax::retry_policy::NeverRetry);
591 let query = move |name| {
592 let stub = stub.clone();
593 let options = options.clone();
594 async {
595 let op = GetOperation::new(stub)
596 .set_name(name)
597 .with_options(options)
598 .send()
599 .await?;
600 Ok(Operation::new(op))
601 }
602 };
603
604 let start = move || async {
605 let op = self.send().await?;
606 Ok(Operation::new(op))
607 };
608
609 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
610 }
611
612 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
616 self.0.request.name = v.into();
617 self
618 }
619
620 pub fn set_target_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
624 self.0.request.target_version = v.into();
625 self
626 }
627
628 pub fn set_schedule<T: Into<crate::model::upgrade_cluster_request::Schedule>>(
630 mut self,
631 v: T,
632 ) -> Self {
633 self.0.request.schedule = v.into();
634 self
635 }
636
637 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
639 self.0.request.request_id = v.into();
640 self
641 }
642 }
643
644 #[doc(hidden)]
645 impl gax::options::internal::RequestBuilder for UpgradeCluster {
646 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
647 &mut self.0.options
648 }
649 }
650
651 #[derive(Clone, Debug)]
670 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
671
672 impl DeleteCluster {
673 pub(crate) fn new(
674 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
675 ) -> Self {
676 Self(RequestBuilder::new(stub))
677 }
678
679 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
681 self.0.request = v.into();
682 self
683 }
684
685 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
687 self.0.options = v.into();
688 self
689 }
690
691 pub async fn send(self) -> Result<longrunning::model::Operation> {
698 (*self.0.stub)
699 .delete_cluster(self.0.request, self.0.options)
700 .await
701 .map(gax::response::Response::into_body)
702 }
703
704 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
706 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
707 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
708 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
709
710 let stub = self.0.stub.clone();
711 let mut options = self.0.options.clone();
712 options.set_retry_policy(gax::retry_policy::NeverRetry);
713 let query = move |name| {
714 let stub = stub.clone();
715 let options = options.clone();
716 async {
717 let op = GetOperation::new(stub)
718 .set_name(name)
719 .with_options(options)
720 .send()
721 .await?;
722 Ok(Operation::new(op))
723 }
724 };
725
726 let start = move || async {
727 let op = self.send().await?;
728 Ok(Operation::new(op))
729 };
730
731 lro::internal::new_unit_response_poller(
732 polling_error_policy,
733 polling_backoff_policy,
734 start,
735 query,
736 )
737 }
738
739 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
743 self.0.request.name = v.into();
744 self
745 }
746
747 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
749 self.0.request.request_id = v.into();
750 self
751 }
752 }
753
754 #[doc(hidden)]
755 impl gax::options::internal::RequestBuilder for DeleteCluster {
756 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
757 &mut self.0.options
758 }
759 }
760
761 #[derive(Clone, Debug)]
779 pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
780
781 impl GenerateAccessToken {
782 pub(crate) fn new(
783 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
784 ) -> Self {
785 Self(RequestBuilder::new(stub))
786 }
787
788 pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
790 mut self,
791 v: V,
792 ) -> Self {
793 self.0.request = v.into();
794 self
795 }
796
797 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
799 self.0.options = v.into();
800 self
801 }
802
803 pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
805 (*self.0.stub)
806 .generate_access_token(self.0.request, self.0.options)
807 .await
808 .map(gax::response::Response::into_body)
809 }
810
811 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
815 self.0.request.cluster = v.into();
816 self
817 }
818 }
819
820 #[doc(hidden)]
821 impl gax::options::internal::RequestBuilder for GenerateAccessToken {
822 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
823 &mut self.0.options
824 }
825 }
826
827 #[derive(Clone, Debug)]
845 pub struct GenerateOfflineCredential(
846 RequestBuilder<crate::model::GenerateOfflineCredentialRequest>,
847 );
848
849 impl GenerateOfflineCredential {
850 pub(crate) fn new(
851 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
852 ) -> Self {
853 Self(RequestBuilder::new(stub))
854 }
855
856 pub fn with_request<V: Into<crate::model::GenerateOfflineCredentialRequest>>(
858 mut self,
859 v: V,
860 ) -> Self {
861 self.0.request = v.into();
862 self
863 }
864
865 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
867 self.0.options = v.into();
868 self
869 }
870
871 pub async fn send(self) -> Result<crate::model::GenerateOfflineCredentialResponse> {
873 (*self.0.stub)
874 .generate_offline_credential(self.0.request, self.0.options)
875 .await
876 .map(gax::response::Response::into_body)
877 }
878
879 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
883 self.0.request.cluster = v.into();
884 self
885 }
886 }
887
888 #[doc(hidden)]
889 impl gax::options::internal::RequestBuilder for GenerateOfflineCredential {
890 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
891 &mut self.0.options
892 }
893 }
894
895 #[derive(Clone, Debug)]
917 pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
918
919 impl ListNodePools {
920 pub(crate) fn new(
921 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
922 ) -> Self {
923 Self(RequestBuilder::new(stub))
924 }
925
926 pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
928 self.0.request = v.into();
929 self
930 }
931
932 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
934 self.0.options = v.into();
935 self
936 }
937
938 pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
940 (*self.0.stub)
941 .list_node_pools(self.0.request, self.0.options)
942 .await
943 .map(gax::response::Response::into_body)
944 }
945
946 pub fn by_page(
948 self,
949 ) -> impl gax::paginator::Paginator<crate::model::ListNodePoolsResponse, gax::error::Error>
950 {
951 use std::clone::Clone;
952 let token = self.0.request.page_token.clone();
953 let execute = move |token: String| {
954 let mut builder = self.clone();
955 builder.0.request = builder.0.request.set_page_token(token);
956 builder.send()
957 };
958 gax::paginator::internal::new_paginator(token, execute)
959 }
960
961 pub fn by_item(
963 self,
964 ) -> impl gax::paginator::ItemPaginator<crate::model::ListNodePoolsResponse, gax::error::Error>
965 {
966 use gax::paginator::Paginator;
967 self.by_page().items()
968 }
969
970 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
974 self.0.request.parent = v.into();
975 self
976 }
977
978 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
980 self.0.request.page_size = v.into();
981 self
982 }
983
984 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
986 self.0.request.page_token = v.into();
987 self
988 }
989
990 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
992 self.0.request.filter = v.into();
993 self
994 }
995
996 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
998 self.0.request.order_by = v.into();
999 self
1000 }
1001 }
1002
1003 #[doc(hidden)]
1004 impl gax::options::internal::RequestBuilder for ListNodePools {
1005 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1006 &mut self.0.options
1007 }
1008 }
1009
1010 #[derive(Clone, Debug)]
1028 pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
1029
1030 impl GetNodePool {
1031 pub(crate) fn new(
1032 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1033 ) -> Self {
1034 Self(RequestBuilder::new(stub))
1035 }
1036
1037 pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
1039 self.0.request = v.into();
1040 self
1041 }
1042
1043 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1045 self.0.options = v.into();
1046 self
1047 }
1048
1049 pub async fn send(self) -> Result<crate::model::NodePool> {
1051 (*self.0.stub)
1052 .get_node_pool(self.0.request, self.0.options)
1053 .await
1054 .map(gax::response::Response::into_body)
1055 }
1056
1057 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1061 self.0.request.name = v.into();
1062 self
1063 }
1064 }
1065
1066 #[doc(hidden)]
1067 impl gax::options::internal::RequestBuilder for GetNodePool {
1068 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1069 &mut self.0.options
1070 }
1071 }
1072
1073 #[derive(Clone, Debug)]
1092 pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
1093
1094 impl CreateNodePool {
1095 pub(crate) fn new(
1096 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1097 ) -> Self {
1098 Self(RequestBuilder::new(stub))
1099 }
1100
1101 pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
1103 self.0.request = v.into();
1104 self
1105 }
1106
1107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1109 self.0.options = v.into();
1110 self
1111 }
1112
1113 pub async fn send(self) -> Result<longrunning::model::Operation> {
1120 (*self.0.stub)
1121 .create_node_pool(self.0.request, self.0.options)
1122 .await
1123 .map(gax::response::Response::into_body)
1124 }
1125
1126 pub fn poller(
1128 self,
1129 ) -> impl lro::Poller<crate::model::NodePool, crate::model::OperationMetadata> {
1130 type Operation =
1131 lro::internal::Operation<crate::model::NodePool, crate::model::OperationMetadata>;
1132 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1133 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1134
1135 let stub = self.0.stub.clone();
1136 let mut options = self.0.options.clone();
1137 options.set_retry_policy(gax::retry_policy::NeverRetry);
1138 let query = move |name| {
1139 let stub = stub.clone();
1140 let options = options.clone();
1141 async {
1142 let op = GetOperation::new(stub)
1143 .set_name(name)
1144 .with_options(options)
1145 .send()
1146 .await?;
1147 Ok(Operation::new(op))
1148 }
1149 };
1150
1151 let start = move || async {
1152 let op = self.send().await?;
1153 Ok(Operation::new(op))
1154 };
1155
1156 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1157 }
1158
1159 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1163 self.0.request.parent = v.into();
1164 self
1165 }
1166
1167 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1171 self.0.request.node_pool_id = v.into();
1172 self
1173 }
1174
1175 pub fn set_node_pool<T>(mut self, v: T) -> Self
1179 where
1180 T: std::convert::Into<crate::model::NodePool>,
1181 {
1182 self.0.request.node_pool = std::option::Option::Some(v.into());
1183 self
1184 }
1185
1186 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1190 where
1191 T: std::convert::Into<crate::model::NodePool>,
1192 {
1193 self.0.request.node_pool = v.map(|x| x.into());
1194 self
1195 }
1196
1197 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1199 self.0.request.request_id = v.into();
1200 self
1201 }
1202 }
1203
1204 #[doc(hidden)]
1205 impl gax::options::internal::RequestBuilder for CreateNodePool {
1206 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1207 &mut self.0.options
1208 }
1209 }
1210
1211 #[derive(Clone, Debug)]
1230 pub struct UpdateNodePool(RequestBuilder<crate::model::UpdateNodePoolRequest>);
1231
1232 impl UpdateNodePool {
1233 pub(crate) fn new(
1234 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1235 ) -> Self {
1236 Self(RequestBuilder::new(stub))
1237 }
1238
1239 pub fn with_request<V: Into<crate::model::UpdateNodePoolRequest>>(mut self, v: V) -> Self {
1241 self.0.request = v.into();
1242 self
1243 }
1244
1245 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1247 self.0.options = v.into();
1248 self
1249 }
1250
1251 pub async fn send(self) -> Result<longrunning::model::Operation> {
1258 (*self.0.stub)
1259 .update_node_pool(self.0.request, self.0.options)
1260 .await
1261 .map(gax::response::Response::into_body)
1262 }
1263
1264 pub fn poller(
1266 self,
1267 ) -> impl lro::Poller<crate::model::NodePool, crate::model::OperationMetadata> {
1268 type Operation =
1269 lro::internal::Operation<crate::model::NodePool, crate::model::OperationMetadata>;
1270 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1271 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1272
1273 let stub = self.0.stub.clone();
1274 let mut options = self.0.options.clone();
1275 options.set_retry_policy(gax::retry_policy::NeverRetry);
1276 let query = move |name| {
1277 let stub = stub.clone();
1278 let options = options.clone();
1279 async {
1280 let op = GetOperation::new(stub)
1281 .set_name(name)
1282 .with_options(options)
1283 .send()
1284 .await?;
1285 Ok(Operation::new(op))
1286 }
1287 };
1288
1289 let start = move || async {
1290 let op = self.send().await?;
1291 Ok(Operation::new(op))
1292 };
1293
1294 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1295 }
1296
1297 pub fn set_update_mask<T>(mut self, v: T) -> Self
1299 where
1300 T: std::convert::Into<wkt::FieldMask>,
1301 {
1302 self.0.request.update_mask = std::option::Option::Some(v.into());
1303 self
1304 }
1305
1306 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1308 where
1309 T: std::convert::Into<wkt::FieldMask>,
1310 {
1311 self.0.request.update_mask = v.map(|x| x.into());
1312 self
1313 }
1314
1315 pub fn set_node_pool<T>(mut self, v: T) -> Self
1317 where
1318 T: std::convert::Into<crate::model::NodePool>,
1319 {
1320 self.0.request.node_pool = std::option::Option::Some(v.into());
1321 self
1322 }
1323
1324 pub fn set_or_clear_node_pool<T>(mut self, v: std::option::Option<T>) -> Self
1326 where
1327 T: std::convert::Into<crate::model::NodePool>,
1328 {
1329 self.0.request.node_pool = v.map(|x| x.into());
1330 self
1331 }
1332
1333 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1335 self.0.request.request_id = v.into();
1336 self
1337 }
1338 }
1339
1340 #[doc(hidden)]
1341 impl gax::options::internal::RequestBuilder for UpdateNodePool {
1342 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1343 &mut self.0.options
1344 }
1345 }
1346
1347 #[derive(Clone, Debug)]
1366 pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
1367
1368 impl DeleteNodePool {
1369 pub(crate) fn new(
1370 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1371 ) -> Self {
1372 Self(RequestBuilder::new(stub))
1373 }
1374
1375 pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
1377 self.0.request = v.into();
1378 self
1379 }
1380
1381 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1383 self.0.options = v.into();
1384 self
1385 }
1386
1387 pub async fn send(self) -> Result<longrunning::model::Operation> {
1394 (*self.0.stub)
1395 .delete_node_pool(self.0.request, self.0.options)
1396 .await
1397 .map(gax::response::Response::into_body)
1398 }
1399
1400 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1402 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1403 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1404 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1405
1406 let stub = self.0.stub.clone();
1407 let mut options = self.0.options.clone();
1408 options.set_retry_policy(gax::retry_policy::NeverRetry);
1409 let query = move |name| {
1410 let stub = stub.clone();
1411 let options = options.clone();
1412 async {
1413 let op = GetOperation::new(stub)
1414 .set_name(name)
1415 .with_options(options)
1416 .send()
1417 .await?;
1418 Ok(Operation::new(op))
1419 }
1420 };
1421
1422 let start = move || async {
1423 let op = self.send().await?;
1424 Ok(Operation::new(op))
1425 };
1426
1427 lro::internal::new_unit_response_poller(
1428 polling_error_policy,
1429 polling_backoff_policy,
1430 start,
1431 query,
1432 )
1433 }
1434
1435 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1439 self.0.request.name = v.into();
1440 self
1441 }
1442
1443 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1445 self.0.request.request_id = v.into();
1446 self
1447 }
1448 }
1449
1450 #[doc(hidden)]
1451 impl gax::options::internal::RequestBuilder for DeleteNodePool {
1452 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1453 &mut self.0.options
1454 }
1455 }
1456
1457 #[derive(Clone, Debug)]
1479 pub struct ListMachines(RequestBuilder<crate::model::ListMachinesRequest>);
1480
1481 impl ListMachines {
1482 pub(crate) fn new(
1483 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1484 ) -> Self {
1485 Self(RequestBuilder::new(stub))
1486 }
1487
1488 pub fn with_request<V: Into<crate::model::ListMachinesRequest>>(mut self, v: V) -> Self {
1490 self.0.request = v.into();
1491 self
1492 }
1493
1494 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1496 self.0.options = v.into();
1497 self
1498 }
1499
1500 pub async fn send(self) -> Result<crate::model::ListMachinesResponse> {
1502 (*self.0.stub)
1503 .list_machines(self.0.request, self.0.options)
1504 .await
1505 .map(gax::response::Response::into_body)
1506 }
1507
1508 pub fn by_page(
1510 self,
1511 ) -> impl gax::paginator::Paginator<crate::model::ListMachinesResponse, gax::error::Error>
1512 {
1513 use std::clone::Clone;
1514 let token = self.0.request.page_token.clone();
1515 let execute = move |token: String| {
1516 let mut builder = self.clone();
1517 builder.0.request = builder.0.request.set_page_token(token);
1518 builder.send()
1519 };
1520 gax::paginator::internal::new_paginator(token, execute)
1521 }
1522
1523 pub fn by_item(
1525 self,
1526 ) -> impl gax::paginator::ItemPaginator<crate::model::ListMachinesResponse, gax::error::Error>
1527 {
1528 use gax::paginator::Paginator;
1529 self.by_page().items()
1530 }
1531
1532 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1536 self.0.request.parent = v.into();
1537 self
1538 }
1539
1540 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1542 self.0.request.page_size = v.into();
1543 self
1544 }
1545
1546 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1548 self.0.request.page_token = v.into();
1549 self
1550 }
1551
1552 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1554 self.0.request.filter = v.into();
1555 self
1556 }
1557
1558 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1560 self.0.request.order_by = v.into();
1561 self
1562 }
1563 }
1564
1565 #[doc(hidden)]
1566 impl gax::options::internal::RequestBuilder for ListMachines {
1567 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1568 &mut self.0.options
1569 }
1570 }
1571
1572 #[derive(Clone, Debug)]
1590 pub struct GetMachine(RequestBuilder<crate::model::GetMachineRequest>);
1591
1592 impl GetMachine {
1593 pub(crate) fn new(
1594 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1595 ) -> Self {
1596 Self(RequestBuilder::new(stub))
1597 }
1598
1599 pub fn with_request<V: Into<crate::model::GetMachineRequest>>(mut self, v: V) -> Self {
1601 self.0.request = v.into();
1602 self
1603 }
1604
1605 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1607 self.0.options = v.into();
1608 self
1609 }
1610
1611 pub async fn send(self) -> Result<crate::model::Machine> {
1613 (*self.0.stub)
1614 .get_machine(self.0.request, self.0.options)
1615 .await
1616 .map(gax::response::Response::into_body)
1617 }
1618
1619 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1623 self.0.request.name = v.into();
1624 self
1625 }
1626 }
1627
1628 #[doc(hidden)]
1629 impl gax::options::internal::RequestBuilder for GetMachine {
1630 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1631 &mut self.0.options
1632 }
1633 }
1634
1635 #[derive(Clone, Debug)]
1657 pub struct ListVpnConnections(RequestBuilder<crate::model::ListVpnConnectionsRequest>);
1658
1659 impl ListVpnConnections {
1660 pub(crate) fn new(
1661 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1662 ) -> Self {
1663 Self(RequestBuilder::new(stub))
1664 }
1665
1666 pub fn with_request<V: Into<crate::model::ListVpnConnectionsRequest>>(
1668 mut self,
1669 v: V,
1670 ) -> Self {
1671 self.0.request = v.into();
1672 self
1673 }
1674
1675 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1677 self.0.options = v.into();
1678 self
1679 }
1680
1681 pub async fn send(self) -> Result<crate::model::ListVpnConnectionsResponse> {
1683 (*self.0.stub)
1684 .list_vpn_connections(self.0.request, self.0.options)
1685 .await
1686 .map(gax::response::Response::into_body)
1687 }
1688
1689 pub fn by_page(
1691 self,
1692 ) -> impl gax::paginator::Paginator<crate::model::ListVpnConnectionsResponse, gax::error::Error>
1693 {
1694 use std::clone::Clone;
1695 let token = self.0.request.page_token.clone();
1696 let execute = move |token: String| {
1697 let mut builder = self.clone();
1698 builder.0.request = builder.0.request.set_page_token(token);
1699 builder.send()
1700 };
1701 gax::paginator::internal::new_paginator(token, execute)
1702 }
1703
1704 pub fn by_item(
1706 self,
1707 ) -> impl gax::paginator::ItemPaginator<
1708 crate::model::ListVpnConnectionsResponse,
1709 gax::error::Error,
1710 > {
1711 use gax::paginator::Paginator;
1712 self.by_page().items()
1713 }
1714
1715 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1719 self.0.request.parent = v.into();
1720 self
1721 }
1722
1723 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1725 self.0.request.page_size = v.into();
1726 self
1727 }
1728
1729 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1731 self.0.request.page_token = v.into();
1732 self
1733 }
1734
1735 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1737 self.0.request.filter = v.into();
1738 self
1739 }
1740
1741 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1743 self.0.request.order_by = v.into();
1744 self
1745 }
1746 }
1747
1748 #[doc(hidden)]
1749 impl gax::options::internal::RequestBuilder for ListVpnConnections {
1750 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1751 &mut self.0.options
1752 }
1753 }
1754
1755 #[derive(Clone, Debug)]
1773 pub struct GetVpnConnection(RequestBuilder<crate::model::GetVpnConnectionRequest>);
1774
1775 impl GetVpnConnection {
1776 pub(crate) fn new(
1777 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1778 ) -> Self {
1779 Self(RequestBuilder::new(stub))
1780 }
1781
1782 pub fn with_request<V: Into<crate::model::GetVpnConnectionRequest>>(
1784 mut self,
1785 v: V,
1786 ) -> Self {
1787 self.0.request = v.into();
1788 self
1789 }
1790
1791 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1793 self.0.options = v.into();
1794 self
1795 }
1796
1797 pub async fn send(self) -> Result<crate::model::VpnConnection> {
1799 (*self.0.stub)
1800 .get_vpn_connection(self.0.request, self.0.options)
1801 .await
1802 .map(gax::response::Response::into_body)
1803 }
1804
1805 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1809 self.0.request.name = v.into();
1810 self
1811 }
1812 }
1813
1814 #[doc(hidden)]
1815 impl gax::options::internal::RequestBuilder for GetVpnConnection {
1816 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1817 &mut self.0.options
1818 }
1819 }
1820
1821 #[derive(Clone, Debug)]
1840 pub struct CreateVpnConnection(RequestBuilder<crate::model::CreateVpnConnectionRequest>);
1841
1842 impl CreateVpnConnection {
1843 pub(crate) fn new(
1844 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1845 ) -> Self {
1846 Self(RequestBuilder::new(stub))
1847 }
1848
1849 pub fn with_request<V: Into<crate::model::CreateVpnConnectionRequest>>(
1851 mut self,
1852 v: V,
1853 ) -> Self {
1854 self.0.request = v.into();
1855 self
1856 }
1857
1858 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1860 self.0.options = v.into();
1861 self
1862 }
1863
1864 pub async fn send(self) -> Result<longrunning::model::Operation> {
1871 (*self.0.stub)
1872 .create_vpn_connection(self.0.request, self.0.options)
1873 .await
1874 .map(gax::response::Response::into_body)
1875 }
1876
1877 pub fn poller(
1879 self,
1880 ) -> impl lro::Poller<crate::model::VpnConnection, crate::model::OperationMetadata>
1881 {
1882 type Operation = lro::internal::Operation<
1883 crate::model::VpnConnection,
1884 crate::model::OperationMetadata,
1885 >;
1886 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1887 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1888
1889 let stub = self.0.stub.clone();
1890 let mut options = self.0.options.clone();
1891 options.set_retry_policy(gax::retry_policy::NeverRetry);
1892 let query = move |name| {
1893 let stub = stub.clone();
1894 let options = options.clone();
1895 async {
1896 let op = GetOperation::new(stub)
1897 .set_name(name)
1898 .with_options(options)
1899 .send()
1900 .await?;
1901 Ok(Operation::new(op))
1902 }
1903 };
1904
1905 let start = move || async {
1906 let op = self.send().await?;
1907 Ok(Operation::new(op))
1908 };
1909
1910 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1911 }
1912
1913 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1917 self.0.request.parent = v.into();
1918 self
1919 }
1920
1921 pub fn set_vpn_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1925 self.0.request.vpn_connection_id = v.into();
1926 self
1927 }
1928
1929 pub fn set_vpn_connection<T>(mut self, v: T) -> Self
1933 where
1934 T: std::convert::Into<crate::model::VpnConnection>,
1935 {
1936 self.0.request.vpn_connection = std::option::Option::Some(v.into());
1937 self
1938 }
1939
1940 pub fn set_or_clear_vpn_connection<T>(mut self, v: std::option::Option<T>) -> Self
1944 where
1945 T: std::convert::Into<crate::model::VpnConnection>,
1946 {
1947 self.0.request.vpn_connection = v.map(|x| x.into());
1948 self
1949 }
1950
1951 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1953 self.0.request.request_id = v.into();
1954 self
1955 }
1956 }
1957
1958 #[doc(hidden)]
1959 impl gax::options::internal::RequestBuilder for CreateVpnConnection {
1960 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1961 &mut self.0.options
1962 }
1963 }
1964
1965 #[derive(Clone, Debug)]
1984 pub struct DeleteVpnConnection(RequestBuilder<crate::model::DeleteVpnConnectionRequest>);
1985
1986 impl DeleteVpnConnection {
1987 pub(crate) fn new(
1988 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1989 ) -> Self {
1990 Self(RequestBuilder::new(stub))
1991 }
1992
1993 pub fn with_request<V: Into<crate::model::DeleteVpnConnectionRequest>>(
1995 mut self,
1996 v: V,
1997 ) -> Self {
1998 self.0.request = v.into();
1999 self
2000 }
2001
2002 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2004 self.0.options = v.into();
2005 self
2006 }
2007
2008 pub async fn send(self) -> Result<longrunning::model::Operation> {
2015 (*self.0.stub)
2016 .delete_vpn_connection(self.0.request, self.0.options)
2017 .await
2018 .map(gax::response::Response::into_body)
2019 }
2020
2021 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2023 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2024 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2025 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2026
2027 let stub = self.0.stub.clone();
2028 let mut options = self.0.options.clone();
2029 options.set_retry_policy(gax::retry_policy::NeverRetry);
2030 let query = move |name| {
2031 let stub = stub.clone();
2032 let options = options.clone();
2033 async {
2034 let op = GetOperation::new(stub)
2035 .set_name(name)
2036 .with_options(options)
2037 .send()
2038 .await?;
2039 Ok(Operation::new(op))
2040 }
2041 };
2042
2043 let start = move || async {
2044 let op = self.send().await?;
2045 Ok(Operation::new(op))
2046 };
2047
2048 lro::internal::new_unit_response_poller(
2049 polling_error_policy,
2050 polling_backoff_policy,
2051 start,
2052 query,
2053 )
2054 }
2055
2056 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2060 self.0.request.name = v.into();
2061 self
2062 }
2063
2064 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2066 self.0.request.request_id = v.into();
2067 self
2068 }
2069 }
2070
2071 #[doc(hidden)]
2072 impl gax::options::internal::RequestBuilder for DeleteVpnConnection {
2073 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2074 &mut self.0.options
2075 }
2076 }
2077
2078 #[derive(Clone, Debug)]
2096 pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
2097
2098 impl GetServerConfig {
2099 pub(crate) fn new(
2100 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2101 ) -> Self {
2102 Self(RequestBuilder::new(stub))
2103 }
2104
2105 pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
2107 self.0.request = v.into();
2108 self
2109 }
2110
2111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2113 self.0.options = v.into();
2114 self
2115 }
2116
2117 pub async fn send(self) -> Result<crate::model::ServerConfig> {
2119 (*self.0.stub)
2120 .get_server_config(self.0.request, self.0.options)
2121 .await
2122 .map(gax::response::Response::into_body)
2123 }
2124
2125 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2129 self.0.request.name = v.into();
2130 self
2131 }
2132 }
2133
2134 #[doc(hidden)]
2135 impl gax::options::internal::RequestBuilder for GetServerConfig {
2136 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2137 &mut self.0.options
2138 }
2139 }
2140
2141 #[derive(Clone, Debug)]
2163 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2164
2165 impl ListLocations {
2166 pub(crate) fn new(
2167 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2168 ) -> Self {
2169 Self(RequestBuilder::new(stub))
2170 }
2171
2172 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2174 mut self,
2175 v: V,
2176 ) -> Self {
2177 self.0.request = v.into();
2178 self
2179 }
2180
2181 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2183 self.0.options = v.into();
2184 self
2185 }
2186
2187 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2189 (*self.0.stub)
2190 .list_locations(self.0.request, self.0.options)
2191 .await
2192 .map(gax::response::Response::into_body)
2193 }
2194
2195 pub fn by_page(
2197 self,
2198 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2199 {
2200 use std::clone::Clone;
2201 let token = self.0.request.page_token.clone();
2202 let execute = move |token: String| {
2203 let mut builder = self.clone();
2204 builder.0.request = builder.0.request.set_page_token(token);
2205 builder.send()
2206 };
2207 gax::paginator::internal::new_paginator(token, execute)
2208 }
2209
2210 pub fn by_item(
2212 self,
2213 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2214 {
2215 use gax::paginator::Paginator;
2216 self.by_page().items()
2217 }
2218
2219 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2221 self.0.request.name = v.into();
2222 self
2223 }
2224
2225 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2227 self.0.request.filter = v.into();
2228 self
2229 }
2230
2231 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2233 self.0.request.page_size = v.into();
2234 self
2235 }
2236
2237 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2239 self.0.request.page_token = v.into();
2240 self
2241 }
2242 }
2243
2244 #[doc(hidden)]
2245 impl gax::options::internal::RequestBuilder for ListLocations {
2246 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2247 &mut self.0.options
2248 }
2249 }
2250
2251 #[derive(Clone, Debug)]
2269 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2270
2271 impl GetLocation {
2272 pub(crate) fn new(
2273 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2274 ) -> Self {
2275 Self(RequestBuilder::new(stub))
2276 }
2277
2278 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2280 self.0.request = v.into();
2281 self
2282 }
2283
2284 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2286 self.0.options = v.into();
2287 self
2288 }
2289
2290 pub async fn send(self) -> Result<location::model::Location> {
2292 (*self.0.stub)
2293 .get_location(self.0.request, self.0.options)
2294 .await
2295 .map(gax::response::Response::into_body)
2296 }
2297
2298 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2300 self.0.request.name = v.into();
2301 self
2302 }
2303 }
2304
2305 #[doc(hidden)]
2306 impl gax::options::internal::RequestBuilder for GetLocation {
2307 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2308 &mut self.0.options
2309 }
2310 }
2311
2312 #[derive(Clone, Debug)]
2334 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2335
2336 impl ListOperations {
2337 pub(crate) fn new(
2338 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2339 ) -> Self {
2340 Self(RequestBuilder::new(stub))
2341 }
2342
2343 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2345 mut self,
2346 v: V,
2347 ) -> Self {
2348 self.0.request = v.into();
2349 self
2350 }
2351
2352 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2354 self.0.options = v.into();
2355 self
2356 }
2357
2358 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2360 (*self.0.stub)
2361 .list_operations(self.0.request, self.0.options)
2362 .await
2363 .map(gax::response::Response::into_body)
2364 }
2365
2366 pub fn by_page(
2368 self,
2369 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2370 {
2371 use std::clone::Clone;
2372 let token = self.0.request.page_token.clone();
2373 let execute = move |token: String| {
2374 let mut builder = self.clone();
2375 builder.0.request = builder.0.request.set_page_token(token);
2376 builder.send()
2377 };
2378 gax::paginator::internal::new_paginator(token, execute)
2379 }
2380
2381 pub fn by_item(
2383 self,
2384 ) -> impl gax::paginator::ItemPaginator<
2385 longrunning::model::ListOperationsResponse,
2386 gax::error::Error,
2387 > {
2388 use gax::paginator::Paginator;
2389 self.by_page().items()
2390 }
2391
2392 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2394 self.0.request.name = v.into();
2395 self
2396 }
2397
2398 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2400 self.0.request.filter = v.into();
2401 self
2402 }
2403
2404 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2406 self.0.request.page_size = v.into();
2407 self
2408 }
2409
2410 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2412 self.0.request.page_token = v.into();
2413 self
2414 }
2415 }
2416
2417 #[doc(hidden)]
2418 impl gax::options::internal::RequestBuilder for ListOperations {
2419 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2420 &mut self.0.options
2421 }
2422 }
2423
2424 #[derive(Clone, Debug)]
2442 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2443
2444 impl GetOperation {
2445 pub(crate) fn new(
2446 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2447 ) -> Self {
2448 Self(RequestBuilder::new(stub))
2449 }
2450
2451 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2453 mut self,
2454 v: V,
2455 ) -> Self {
2456 self.0.request = v.into();
2457 self
2458 }
2459
2460 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2462 self.0.options = v.into();
2463 self
2464 }
2465
2466 pub async fn send(self) -> Result<longrunning::model::Operation> {
2468 (*self.0.stub)
2469 .get_operation(self.0.request, self.0.options)
2470 .await
2471 .map(gax::response::Response::into_body)
2472 }
2473
2474 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2476 self.0.request.name = v.into();
2477 self
2478 }
2479 }
2480
2481 #[doc(hidden)]
2482 impl gax::options::internal::RequestBuilder for GetOperation {
2483 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2484 &mut self.0.options
2485 }
2486 }
2487
2488 #[derive(Clone, Debug)]
2506 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2507
2508 impl DeleteOperation {
2509 pub(crate) fn new(
2510 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2511 ) -> Self {
2512 Self(RequestBuilder::new(stub))
2513 }
2514
2515 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2517 mut self,
2518 v: V,
2519 ) -> Self {
2520 self.0.request = v.into();
2521 self
2522 }
2523
2524 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2526 self.0.options = v.into();
2527 self
2528 }
2529
2530 pub async fn send(self) -> Result<()> {
2532 (*self.0.stub)
2533 .delete_operation(self.0.request, self.0.options)
2534 .await
2535 .map(gax::response::Response::into_body)
2536 }
2537
2538 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2540 self.0.request.name = v.into();
2541 self
2542 }
2543 }
2544
2545 #[doc(hidden)]
2546 impl gax::options::internal::RequestBuilder for DeleteOperation {
2547 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2548 &mut self.0.options
2549 }
2550 }
2551
2552 #[derive(Clone, Debug)]
2570 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2571
2572 impl CancelOperation {
2573 pub(crate) fn new(
2574 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2575 ) -> Self {
2576 Self(RequestBuilder::new(stub))
2577 }
2578
2579 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2581 mut self,
2582 v: V,
2583 ) -> Self {
2584 self.0.request = v.into();
2585 self
2586 }
2587
2588 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2590 self.0.options = v.into();
2591 self
2592 }
2593
2594 pub async fn send(self) -> Result<()> {
2596 (*self.0.stub)
2597 .cancel_operation(self.0.request, self.0.options)
2598 .await
2599 .map(gax::response::Response::into_body)
2600 }
2601
2602 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2604 self.0.request.name = v.into();
2605 self
2606 }
2607 }
2608
2609 #[doc(hidden)]
2610 impl gax::options::internal::RequestBuilder for CancelOperation {
2611 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2612 &mut self.0.options
2613 }
2614 }
2615}