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(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
43 Self::Client::new(config).await
44 }
45 }
46 }
47
48 #[derive(Clone, Debug)]
50 pub(crate) struct RequestBuilder<R: std::default::Default> {
51 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
52 request: R,
53 options: gax::options::RequestOptions,
54 }
55
56 impl<R> RequestBuilder<R>
57 where
58 R: std::default::Default,
59 {
60 pub(crate) fn new(
61 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
62 ) -> Self {
63 Self {
64 stub,
65 request: R::default(),
66 options: gax::options::RequestOptions::default(),
67 }
68 }
69 }
70
71 #[derive(Clone, Debug)]
92 pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
93
94 impl ListClusters {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
115 (*self.0.stub)
116 .list_clusters(self.0.request, self.0.options)
117 .await
118 .map(gax::response::Response::into_body)
119 }
120
121 pub fn by_page(
123 self,
124 ) -> impl gax::paginator::Paginator<crate::model::ListClustersResponse, gax::error::Error>
125 {
126 use std::clone::Clone;
127 let token = self.0.request.page_token.clone();
128 let execute = move |token: String| {
129 let mut builder = self.clone();
130 builder.0.request = builder.0.request.set_page_token(token);
131 builder.send()
132 };
133 gax::paginator::internal::new_paginator(token, execute)
134 }
135
136 pub fn by_item(
138 self,
139 ) -> impl gax::paginator::ItemPaginator<crate::model::ListClustersResponse, gax::error::Error>
140 {
141 use gax::paginator::Paginator;
142 self.by_page().items()
143 }
144
145 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
149 self.0.request.parent = v.into();
150 self
151 }
152
153 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
155 self.0.request.page_size = v.into();
156 self
157 }
158
159 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
161 self.0.request.page_token = v.into();
162 self
163 }
164
165 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
167 self.0.request.filter = v.into();
168 self
169 }
170
171 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
173 self.0.request.order_by = v.into();
174 self
175 }
176 }
177
178 #[doc(hidden)]
179 impl gax::options::internal::RequestBuilder for ListClusters {
180 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
181 &mut self.0.options
182 }
183 }
184
185 #[derive(Clone, Debug)]
202 pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
203
204 impl GetCluster {
205 pub(crate) fn new(
206 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
207 ) -> Self {
208 Self(RequestBuilder::new(stub))
209 }
210
211 pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
213 self.0.request = v.into();
214 self
215 }
216
217 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
219 self.0.options = v.into();
220 self
221 }
222
223 pub async fn send(self) -> Result<crate::model::Cluster> {
225 (*self.0.stub)
226 .get_cluster(self.0.request, self.0.options)
227 .await
228 .map(gax::response::Response::into_body)
229 }
230
231 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
235 self.0.request.name = v.into();
236 self
237 }
238 }
239
240 #[doc(hidden)]
241 impl gax::options::internal::RequestBuilder for GetCluster {
242 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
243 &mut self.0.options
244 }
245 }
246
247 #[derive(Clone, Debug)]
265 pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
266
267 impl CreateCluster {
268 pub(crate) fn new(
269 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
270 ) -> Self {
271 Self(RequestBuilder::new(stub))
272 }
273
274 pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
276 self.0.request = v.into();
277 self
278 }
279
280 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
282 self.0.options = v.into();
283 self
284 }
285
286 pub async fn send(self) -> Result<longrunning::model::Operation> {
293 (*self.0.stub)
294 .create_cluster(self.0.request, self.0.options)
295 .await
296 .map(gax::response::Response::into_body)
297 }
298
299 pub fn poller(
301 self,
302 ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
303 type Operation =
304 lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
305 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
306 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
307
308 let stub = self.0.stub.clone();
309 let mut options = self.0.options.clone();
310 options.set_retry_policy(gax::retry_policy::NeverRetry);
311 let query = move |name| {
312 let stub = stub.clone();
313 let options = options.clone();
314 async {
315 let op = GetOperation::new(stub)
316 .set_name(name)
317 .with_options(options)
318 .send()
319 .await?;
320 Ok(Operation::new(op))
321 }
322 };
323
324 let start = move || async {
325 let op = self.send().await?;
326 Ok(Operation::new(op))
327 };
328
329 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
330 }
331
332 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
336 self.0.request.parent = v.into();
337 self
338 }
339
340 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
344 self.0.request.cluster_id = v.into();
345 self
346 }
347
348 pub fn set_cluster<T: Into<std::option::Option<crate::model::Cluster>>>(
352 mut self,
353 v: T,
354 ) -> Self {
355 self.0.request.cluster = v.into();
356 self
357 }
358
359 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
361 self.0.request.request_id = v.into();
362 self
363 }
364 }
365
366 #[doc(hidden)]
367 impl gax::options::internal::RequestBuilder for CreateCluster {
368 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
369 &mut self.0.options
370 }
371 }
372
373 #[derive(Clone, Debug)]
391 pub struct UpdateCluster(RequestBuilder<crate::model::UpdateClusterRequest>);
392
393 impl UpdateCluster {
394 pub(crate) fn new(
395 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
396 ) -> Self {
397 Self(RequestBuilder::new(stub))
398 }
399
400 pub fn with_request<V: Into<crate::model::UpdateClusterRequest>>(mut self, v: V) -> Self {
402 self.0.request = v.into();
403 self
404 }
405
406 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
408 self.0.options = v.into();
409 self
410 }
411
412 pub async fn send(self) -> Result<longrunning::model::Operation> {
419 (*self.0.stub)
420 .update_cluster(self.0.request, self.0.options)
421 .await
422 .map(gax::response::Response::into_body)
423 }
424
425 pub fn poller(
427 self,
428 ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
429 type Operation =
430 lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
431 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
432 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
433
434 let stub = self.0.stub.clone();
435 let mut options = self.0.options.clone();
436 options.set_retry_policy(gax::retry_policy::NeverRetry);
437 let query = move |name| {
438 let stub = stub.clone();
439 let options = options.clone();
440 async {
441 let op = GetOperation::new(stub)
442 .set_name(name)
443 .with_options(options)
444 .send()
445 .await?;
446 Ok(Operation::new(op))
447 }
448 };
449
450 let start = move || async {
451 let op = self.send().await?;
452 Ok(Operation::new(op))
453 };
454
455 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
456 }
457
458 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
460 mut self,
461 v: T,
462 ) -> Self {
463 self.0.request.update_mask = v.into();
464 self
465 }
466
467 pub fn set_cluster<T: Into<std::option::Option<crate::model::Cluster>>>(
469 mut self,
470 v: T,
471 ) -> Self {
472 self.0.request.cluster = v.into();
473 self
474 }
475
476 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
478 self.0.request.request_id = v.into();
479 self
480 }
481 }
482
483 #[doc(hidden)]
484 impl gax::options::internal::RequestBuilder for UpdateCluster {
485 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
486 &mut self.0.options
487 }
488 }
489
490 #[derive(Clone, Debug)]
508 pub struct UpgradeCluster(RequestBuilder<crate::model::UpgradeClusterRequest>);
509
510 impl UpgradeCluster {
511 pub(crate) fn new(
512 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
513 ) -> Self {
514 Self(RequestBuilder::new(stub))
515 }
516
517 pub fn with_request<V: Into<crate::model::UpgradeClusterRequest>>(mut self, v: V) -> Self {
519 self.0.request = v.into();
520 self
521 }
522
523 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
525 self.0.options = v.into();
526 self
527 }
528
529 pub async fn send(self) -> Result<longrunning::model::Operation> {
536 (*self.0.stub)
537 .upgrade_cluster(self.0.request, self.0.options)
538 .await
539 .map(gax::response::Response::into_body)
540 }
541
542 pub fn poller(
544 self,
545 ) -> impl lro::Poller<crate::model::Cluster, crate::model::OperationMetadata> {
546 type Operation =
547 lro::internal::Operation<crate::model::Cluster, crate::model::OperationMetadata>;
548 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
549 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
550
551 let stub = self.0.stub.clone();
552 let mut options = self.0.options.clone();
553 options.set_retry_policy(gax::retry_policy::NeverRetry);
554 let query = move |name| {
555 let stub = stub.clone();
556 let options = options.clone();
557 async {
558 let op = GetOperation::new(stub)
559 .set_name(name)
560 .with_options(options)
561 .send()
562 .await?;
563 Ok(Operation::new(op))
564 }
565 };
566
567 let start = move || async {
568 let op = self.send().await?;
569 Ok(Operation::new(op))
570 };
571
572 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
573 }
574
575 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
579 self.0.request.name = v.into();
580 self
581 }
582
583 pub fn set_target_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
587 self.0.request.target_version = v.into();
588 self
589 }
590
591 pub fn set_schedule<T: Into<crate::model::upgrade_cluster_request::Schedule>>(
593 mut self,
594 v: T,
595 ) -> Self {
596 self.0.request.schedule = v.into();
597 self
598 }
599
600 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
602 self.0.request.request_id = v.into();
603 self
604 }
605 }
606
607 #[doc(hidden)]
608 impl gax::options::internal::RequestBuilder for UpgradeCluster {
609 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
610 &mut self.0.options
611 }
612 }
613
614 #[derive(Clone, Debug)]
632 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
633
634 impl DeleteCluster {
635 pub(crate) fn new(
636 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
637 ) -> Self {
638 Self(RequestBuilder::new(stub))
639 }
640
641 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
643 self.0.request = v.into();
644 self
645 }
646
647 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
649 self.0.options = v.into();
650 self
651 }
652
653 pub async fn send(self) -> Result<longrunning::model::Operation> {
660 (*self.0.stub)
661 .delete_cluster(self.0.request, self.0.options)
662 .await
663 .map(gax::response::Response::into_body)
664 }
665
666 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
668 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
669 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
670 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
671
672 let stub = self.0.stub.clone();
673 let mut options = self.0.options.clone();
674 options.set_retry_policy(gax::retry_policy::NeverRetry);
675 let query = move |name| {
676 let stub = stub.clone();
677 let options = options.clone();
678 async {
679 let op = GetOperation::new(stub)
680 .set_name(name)
681 .with_options(options)
682 .send()
683 .await?;
684 Ok(Operation::new(op))
685 }
686 };
687
688 let start = move || async {
689 let op = self.send().await?;
690 Ok(Operation::new(op))
691 };
692
693 lro::internal::new_unit_response_poller(
694 polling_error_policy,
695 polling_backoff_policy,
696 start,
697 query,
698 )
699 }
700
701 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
705 self.0.request.name = v.into();
706 self
707 }
708
709 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
711 self.0.request.request_id = v.into();
712 self
713 }
714 }
715
716 #[doc(hidden)]
717 impl gax::options::internal::RequestBuilder for DeleteCluster {
718 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
719 &mut self.0.options
720 }
721 }
722
723 #[derive(Clone, Debug)]
740 pub struct GenerateAccessToken(RequestBuilder<crate::model::GenerateAccessTokenRequest>);
741
742 impl GenerateAccessToken {
743 pub(crate) fn new(
744 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
745 ) -> Self {
746 Self(RequestBuilder::new(stub))
747 }
748
749 pub fn with_request<V: Into<crate::model::GenerateAccessTokenRequest>>(
751 mut self,
752 v: V,
753 ) -> Self {
754 self.0.request = v.into();
755 self
756 }
757
758 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
760 self.0.options = v.into();
761 self
762 }
763
764 pub async fn send(self) -> Result<crate::model::GenerateAccessTokenResponse> {
766 (*self.0.stub)
767 .generate_access_token(self.0.request, self.0.options)
768 .await
769 .map(gax::response::Response::into_body)
770 }
771
772 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
776 self.0.request.cluster = v.into();
777 self
778 }
779 }
780
781 #[doc(hidden)]
782 impl gax::options::internal::RequestBuilder for GenerateAccessToken {
783 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
784 &mut self.0.options
785 }
786 }
787
788 #[derive(Clone, Debug)]
805 pub struct GenerateOfflineCredential(
806 RequestBuilder<crate::model::GenerateOfflineCredentialRequest>,
807 );
808
809 impl GenerateOfflineCredential {
810 pub(crate) fn new(
811 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
812 ) -> Self {
813 Self(RequestBuilder::new(stub))
814 }
815
816 pub fn with_request<V: Into<crate::model::GenerateOfflineCredentialRequest>>(
818 mut self,
819 v: V,
820 ) -> Self {
821 self.0.request = v.into();
822 self
823 }
824
825 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
827 self.0.options = v.into();
828 self
829 }
830
831 pub async fn send(self) -> Result<crate::model::GenerateOfflineCredentialResponse> {
833 (*self.0.stub)
834 .generate_offline_credential(self.0.request, self.0.options)
835 .await
836 .map(gax::response::Response::into_body)
837 }
838
839 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
843 self.0.request.cluster = v.into();
844 self
845 }
846 }
847
848 #[doc(hidden)]
849 impl gax::options::internal::RequestBuilder for GenerateOfflineCredential {
850 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
851 &mut self.0.options
852 }
853 }
854
855 #[derive(Clone, Debug)]
876 pub struct ListNodePools(RequestBuilder<crate::model::ListNodePoolsRequest>);
877
878 impl ListNodePools {
879 pub(crate) fn new(
880 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
881 ) -> Self {
882 Self(RequestBuilder::new(stub))
883 }
884
885 pub fn with_request<V: Into<crate::model::ListNodePoolsRequest>>(mut self, v: V) -> Self {
887 self.0.request = v.into();
888 self
889 }
890
891 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
893 self.0.options = v.into();
894 self
895 }
896
897 pub async fn send(self) -> Result<crate::model::ListNodePoolsResponse> {
899 (*self.0.stub)
900 .list_node_pools(self.0.request, self.0.options)
901 .await
902 .map(gax::response::Response::into_body)
903 }
904
905 pub fn by_page(
907 self,
908 ) -> impl gax::paginator::Paginator<crate::model::ListNodePoolsResponse, gax::error::Error>
909 {
910 use std::clone::Clone;
911 let token = self.0.request.page_token.clone();
912 let execute = move |token: String| {
913 let mut builder = self.clone();
914 builder.0.request = builder.0.request.set_page_token(token);
915 builder.send()
916 };
917 gax::paginator::internal::new_paginator(token, execute)
918 }
919
920 pub fn by_item(
922 self,
923 ) -> impl gax::paginator::ItemPaginator<crate::model::ListNodePoolsResponse, gax::error::Error>
924 {
925 use gax::paginator::Paginator;
926 self.by_page().items()
927 }
928
929 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
933 self.0.request.parent = v.into();
934 self
935 }
936
937 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
939 self.0.request.page_size = v.into();
940 self
941 }
942
943 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
945 self.0.request.page_token = v.into();
946 self
947 }
948
949 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
951 self.0.request.filter = v.into();
952 self
953 }
954
955 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
957 self.0.request.order_by = v.into();
958 self
959 }
960 }
961
962 #[doc(hidden)]
963 impl gax::options::internal::RequestBuilder for ListNodePools {
964 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
965 &mut self.0.options
966 }
967 }
968
969 #[derive(Clone, Debug)]
986 pub struct GetNodePool(RequestBuilder<crate::model::GetNodePoolRequest>);
987
988 impl GetNodePool {
989 pub(crate) fn new(
990 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
991 ) -> Self {
992 Self(RequestBuilder::new(stub))
993 }
994
995 pub fn with_request<V: Into<crate::model::GetNodePoolRequest>>(mut self, v: V) -> Self {
997 self.0.request = v.into();
998 self
999 }
1000
1001 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1003 self.0.options = v.into();
1004 self
1005 }
1006
1007 pub async fn send(self) -> Result<crate::model::NodePool> {
1009 (*self.0.stub)
1010 .get_node_pool(self.0.request, self.0.options)
1011 .await
1012 .map(gax::response::Response::into_body)
1013 }
1014
1015 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1019 self.0.request.name = v.into();
1020 self
1021 }
1022 }
1023
1024 #[doc(hidden)]
1025 impl gax::options::internal::RequestBuilder for GetNodePool {
1026 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1027 &mut self.0.options
1028 }
1029 }
1030
1031 #[derive(Clone, Debug)]
1049 pub struct CreateNodePool(RequestBuilder<crate::model::CreateNodePoolRequest>);
1050
1051 impl CreateNodePool {
1052 pub(crate) fn new(
1053 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1054 ) -> Self {
1055 Self(RequestBuilder::new(stub))
1056 }
1057
1058 pub fn with_request<V: Into<crate::model::CreateNodePoolRequest>>(mut self, v: V) -> Self {
1060 self.0.request = v.into();
1061 self
1062 }
1063
1064 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1066 self.0.options = v.into();
1067 self
1068 }
1069
1070 pub async fn send(self) -> Result<longrunning::model::Operation> {
1077 (*self.0.stub)
1078 .create_node_pool(self.0.request, self.0.options)
1079 .await
1080 .map(gax::response::Response::into_body)
1081 }
1082
1083 pub fn poller(
1085 self,
1086 ) -> impl lro::Poller<crate::model::NodePool, crate::model::OperationMetadata> {
1087 type Operation =
1088 lro::internal::Operation<crate::model::NodePool, crate::model::OperationMetadata>;
1089 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1090 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1091
1092 let stub = self.0.stub.clone();
1093 let mut options = self.0.options.clone();
1094 options.set_retry_policy(gax::retry_policy::NeverRetry);
1095 let query = move |name| {
1096 let stub = stub.clone();
1097 let options = options.clone();
1098 async {
1099 let op = GetOperation::new(stub)
1100 .set_name(name)
1101 .with_options(options)
1102 .send()
1103 .await?;
1104 Ok(Operation::new(op))
1105 }
1106 };
1107
1108 let start = move || async {
1109 let op = self.send().await?;
1110 Ok(Operation::new(op))
1111 };
1112
1113 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1114 }
1115
1116 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1120 self.0.request.parent = v.into();
1121 self
1122 }
1123
1124 pub fn set_node_pool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1128 self.0.request.node_pool_id = v.into();
1129 self
1130 }
1131
1132 pub fn set_node_pool<T: Into<std::option::Option<crate::model::NodePool>>>(
1136 mut self,
1137 v: T,
1138 ) -> Self {
1139 self.0.request.node_pool = v.into();
1140 self
1141 }
1142
1143 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1145 self.0.request.request_id = v.into();
1146 self
1147 }
1148 }
1149
1150 #[doc(hidden)]
1151 impl gax::options::internal::RequestBuilder for CreateNodePool {
1152 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1153 &mut self.0.options
1154 }
1155 }
1156
1157 #[derive(Clone, Debug)]
1175 pub struct UpdateNodePool(RequestBuilder<crate::model::UpdateNodePoolRequest>);
1176
1177 impl UpdateNodePool {
1178 pub(crate) fn new(
1179 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1180 ) -> Self {
1181 Self(RequestBuilder::new(stub))
1182 }
1183
1184 pub fn with_request<V: Into<crate::model::UpdateNodePoolRequest>>(mut self, v: V) -> Self {
1186 self.0.request = v.into();
1187 self
1188 }
1189
1190 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1192 self.0.options = v.into();
1193 self
1194 }
1195
1196 pub async fn send(self) -> Result<longrunning::model::Operation> {
1203 (*self.0.stub)
1204 .update_node_pool(self.0.request, self.0.options)
1205 .await
1206 .map(gax::response::Response::into_body)
1207 }
1208
1209 pub fn poller(
1211 self,
1212 ) -> impl lro::Poller<crate::model::NodePool, crate::model::OperationMetadata> {
1213 type Operation =
1214 lro::internal::Operation<crate::model::NodePool, crate::model::OperationMetadata>;
1215 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1216 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1217
1218 let stub = self.0.stub.clone();
1219 let mut options = self.0.options.clone();
1220 options.set_retry_policy(gax::retry_policy::NeverRetry);
1221 let query = move |name| {
1222 let stub = stub.clone();
1223 let options = options.clone();
1224 async {
1225 let op = GetOperation::new(stub)
1226 .set_name(name)
1227 .with_options(options)
1228 .send()
1229 .await?;
1230 Ok(Operation::new(op))
1231 }
1232 };
1233
1234 let start = move || async {
1235 let op = self.send().await?;
1236 Ok(Operation::new(op))
1237 };
1238
1239 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1240 }
1241
1242 pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1244 mut self,
1245 v: T,
1246 ) -> Self {
1247 self.0.request.update_mask = v.into();
1248 self
1249 }
1250
1251 pub fn set_node_pool<T: Into<std::option::Option<crate::model::NodePool>>>(
1253 mut self,
1254 v: T,
1255 ) -> Self {
1256 self.0.request.node_pool = v.into();
1257 self
1258 }
1259
1260 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1262 self.0.request.request_id = v.into();
1263 self
1264 }
1265 }
1266
1267 #[doc(hidden)]
1268 impl gax::options::internal::RequestBuilder for UpdateNodePool {
1269 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1270 &mut self.0.options
1271 }
1272 }
1273
1274 #[derive(Clone, Debug)]
1292 pub struct DeleteNodePool(RequestBuilder<crate::model::DeleteNodePoolRequest>);
1293
1294 impl DeleteNodePool {
1295 pub(crate) fn new(
1296 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1297 ) -> Self {
1298 Self(RequestBuilder::new(stub))
1299 }
1300
1301 pub fn with_request<V: Into<crate::model::DeleteNodePoolRequest>>(mut self, v: V) -> Self {
1303 self.0.request = v.into();
1304 self
1305 }
1306
1307 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1309 self.0.options = v.into();
1310 self
1311 }
1312
1313 pub async fn send(self) -> Result<longrunning::model::Operation> {
1320 (*self.0.stub)
1321 .delete_node_pool(self.0.request, self.0.options)
1322 .await
1323 .map(gax::response::Response::into_body)
1324 }
1325
1326 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1328 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1329 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1330 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1331
1332 let stub = self.0.stub.clone();
1333 let mut options = self.0.options.clone();
1334 options.set_retry_policy(gax::retry_policy::NeverRetry);
1335 let query = move |name| {
1336 let stub = stub.clone();
1337 let options = options.clone();
1338 async {
1339 let op = GetOperation::new(stub)
1340 .set_name(name)
1341 .with_options(options)
1342 .send()
1343 .await?;
1344 Ok(Operation::new(op))
1345 }
1346 };
1347
1348 let start = move || async {
1349 let op = self.send().await?;
1350 Ok(Operation::new(op))
1351 };
1352
1353 lro::internal::new_unit_response_poller(
1354 polling_error_policy,
1355 polling_backoff_policy,
1356 start,
1357 query,
1358 )
1359 }
1360
1361 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1365 self.0.request.name = v.into();
1366 self
1367 }
1368
1369 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1371 self.0.request.request_id = v.into();
1372 self
1373 }
1374 }
1375
1376 #[doc(hidden)]
1377 impl gax::options::internal::RequestBuilder for DeleteNodePool {
1378 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1379 &mut self.0.options
1380 }
1381 }
1382
1383 #[derive(Clone, Debug)]
1404 pub struct ListMachines(RequestBuilder<crate::model::ListMachinesRequest>);
1405
1406 impl ListMachines {
1407 pub(crate) fn new(
1408 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1409 ) -> Self {
1410 Self(RequestBuilder::new(stub))
1411 }
1412
1413 pub fn with_request<V: Into<crate::model::ListMachinesRequest>>(mut self, v: V) -> Self {
1415 self.0.request = v.into();
1416 self
1417 }
1418
1419 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1421 self.0.options = v.into();
1422 self
1423 }
1424
1425 pub async fn send(self) -> Result<crate::model::ListMachinesResponse> {
1427 (*self.0.stub)
1428 .list_machines(self.0.request, self.0.options)
1429 .await
1430 .map(gax::response::Response::into_body)
1431 }
1432
1433 pub fn by_page(
1435 self,
1436 ) -> impl gax::paginator::Paginator<crate::model::ListMachinesResponse, gax::error::Error>
1437 {
1438 use std::clone::Clone;
1439 let token = self.0.request.page_token.clone();
1440 let execute = move |token: String| {
1441 let mut builder = self.clone();
1442 builder.0.request = builder.0.request.set_page_token(token);
1443 builder.send()
1444 };
1445 gax::paginator::internal::new_paginator(token, execute)
1446 }
1447
1448 pub fn by_item(
1450 self,
1451 ) -> impl gax::paginator::ItemPaginator<crate::model::ListMachinesResponse, gax::error::Error>
1452 {
1453 use gax::paginator::Paginator;
1454 self.by_page().items()
1455 }
1456
1457 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1461 self.0.request.parent = v.into();
1462 self
1463 }
1464
1465 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1467 self.0.request.page_size = v.into();
1468 self
1469 }
1470
1471 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1473 self.0.request.page_token = v.into();
1474 self
1475 }
1476
1477 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1479 self.0.request.filter = v.into();
1480 self
1481 }
1482
1483 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1485 self.0.request.order_by = v.into();
1486 self
1487 }
1488 }
1489
1490 #[doc(hidden)]
1491 impl gax::options::internal::RequestBuilder for ListMachines {
1492 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1493 &mut self.0.options
1494 }
1495 }
1496
1497 #[derive(Clone, Debug)]
1514 pub struct GetMachine(RequestBuilder<crate::model::GetMachineRequest>);
1515
1516 impl GetMachine {
1517 pub(crate) fn new(
1518 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1519 ) -> Self {
1520 Self(RequestBuilder::new(stub))
1521 }
1522
1523 pub fn with_request<V: Into<crate::model::GetMachineRequest>>(mut self, v: V) -> Self {
1525 self.0.request = v.into();
1526 self
1527 }
1528
1529 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1531 self.0.options = v.into();
1532 self
1533 }
1534
1535 pub async fn send(self) -> Result<crate::model::Machine> {
1537 (*self.0.stub)
1538 .get_machine(self.0.request, self.0.options)
1539 .await
1540 .map(gax::response::Response::into_body)
1541 }
1542
1543 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1547 self.0.request.name = v.into();
1548 self
1549 }
1550 }
1551
1552 #[doc(hidden)]
1553 impl gax::options::internal::RequestBuilder for GetMachine {
1554 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1555 &mut self.0.options
1556 }
1557 }
1558
1559 #[derive(Clone, Debug)]
1580 pub struct ListVpnConnections(RequestBuilder<crate::model::ListVpnConnectionsRequest>);
1581
1582 impl ListVpnConnections {
1583 pub(crate) fn new(
1584 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1585 ) -> Self {
1586 Self(RequestBuilder::new(stub))
1587 }
1588
1589 pub fn with_request<V: Into<crate::model::ListVpnConnectionsRequest>>(
1591 mut self,
1592 v: V,
1593 ) -> Self {
1594 self.0.request = v.into();
1595 self
1596 }
1597
1598 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1600 self.0.options = v.into();
1601 self
1602 }
1603
1604 pub async fn send(self) -> Result<crate::model::ListVpnConnectionsResponse> {
1606 (*self.0.stub)
1607 .list_vpn_connections(self.0.request, self.0.options)
1608 .await
1609 .map(gax::response::Response::into_body)
1610 }
1611
1612 pub fn by_page(
1614 self,
1615 ) -> impl gax::paginator::Paginator<crate::model::ListVpnConnectionsResponse, gax::error::Error>
1616 {
1617 use std::clone::Clone;
1618 let token = self.0.request.page_token.clone();
1619 let execute = move |token: String| {
1620 let mut builder = self.clone();
1621 builder.0.request = builder.0.request.set_page_token(token);
1622 builder.send()
1623 };
1624 gax::paginator::internal::new_paginator(token, execute)
1625 }
1626
1627 pub fn by_item(
1629 self,
1630 ) -> impl gax::paginator::ItemPaginator<
1631 crate::model::ListVpnConnectionsResponse,
1632 gax::error::Error,
1633 > {
1634 use gax::paginator::Paginator;
1635 self.by_page().items()
1636 }
1637
1638 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1642 self.0.request.parent = v.into();
1643 self
1644 }
1645
1646 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1648 self.0.request.page_size = v.into();
1649 self
1650 }
1651
1652 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1654 self.0.request.page_token = v.into();
1655 self
1656 }
1657
1658 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1660 self.0.request.filter = v.into();
1661 self
1662 }
1663
1664 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1666 self.0.request.order_by = v.into();
1667 self
1668 }
1669 }
1670
1671 #[doc(hidden)]
1672 impl gax::options::internal::RequestBuilder for ListVpnConnections {
1673 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1674 &mut self.0.options
1675 }
1676 }
1677
1678 #[derive(Clone, Debug)]
1695 pub struct GetVpnConnection(RequestBuilder<crate::model::GetVpnConnectionRequest>);
1696
1697 impl GetVpnConnection {
1698 pub(crate) fn new(
1699 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1700 ) -> Self {
1701 Self(RequestBuilder::new(stub))
1702 }
1703
1704 pub fn with_request<V: Into<crate::model::GetVpnConnectionRequest>>(
1706 mut self,
1707 v: V,
1708 ) -> Self {
1709 self.0.request = v.into();
1710 self
1711 }
1712
1713 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1715 self.0.options = v.into();
1716 self
1717 }
1718
1719 pub async fn send(self) -> Result<crate::model::VpnConnection> {
1721 (*self.0.stub)
1722 .get_vpn_connection(self.0.request, self.0.options)
1723 .await
1724 .map(gax::response::Response::into_body)
1725 }
1726
1727 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1731 self.0.request.name = v.into();
1732 self
1733 }
1734 }
1735
1736 #[doc(hidden)]
1737 impl gax::options::internal::RequestBuilder for GetVpnConnection {
1738 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1739 &mut self.0.options
1740 }
1741 }
1742
1743 #[derive(Clone, Debug)]
1761 pub struct CreateVpnConnection(RequestBuilder<crate::model::CreateVpnConnectionRequest>);
1762
1763 impl CreateVpnConnection {
1764 pub(crate) fn new(
1765 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1766 ) -> Self {
1767 Self(RequestBuilder::new(stub))
1768 }
1769
1770 pub fn with_request<V: Into<crate::model::CreateVpnConnectionRequest>>(
1772 mut self,
1773 v: V,
1774 ) -> Self {
1775 self.0.request = v.into();
1776 self
1777 }
1778
1779 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1781 self.0.options = v.into();
1782 self
1783 }
1784
1785 pub async fn send(self) -> Result<longrunning::model::Operation> {
1792 (*self.0.stub)
1793 .create_vpn_connection(self.0.request, self.0.options)
1794 .await
1795 .map(gax::response::Response::into_body)
1796 }
1797
1798 pub fn poller(
1800 self,
1801 ) -> impl lro::Poller<crate::model::VpnConnection, crate::model::OperationMetadata>
1802 {
1803 type Operation = lro::internal::Operation<
1804 crate::model::VpnConnection,
1805 crate::model::OperationMetadata,
1806 >;
1807 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1808 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1809
1810 let stub = self.0.stub.clone();
1811 let mut options = self.0.options.clone();
1812 options.set_retry_policy(gax::retry_policy::NeverRetry);
1813 let query = move |name| {
1814 let stub = stub.clone();
1815 let options = options.clone();
1816 async {
1817 let op = GetOperation::new(stub)
1818 .set_name(name)
1819 .with_options(options)
1820 .send()
1821 .await?;
1822 Ok(Operation::new(op))
1823 }
1824 };
1825
1826 let start = move || async {
1827 let op = self.send().await?;
1828 Ok(Operation::new(op))
1829 };
1830
1831 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1832 }
1833
1834 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1838 self.0.request.parent = v.into();
1839 self
1840 }
1841
1842 pub fn set_vpn_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1846 self.0.request.vpn_connection_id = v.into();
1847 self
1848 }
1849
1850 pub fn set_vpn_connection<T: Into<std::option::Option<crate::model::VpnConnection>>>(
1854 mut self,
1855 v: T,
1856 ) -> Self {
1857 self.0.request.vpn_connection = v.into();
1858 self
1859 }
1860
1861 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1863 self.0.request.request_id = v.into();
1864 self
1865 }
1866 }
1867
1868 #[doc(hidden)]
1869 impl gax::options::internal::RequestBuilder for CreateVpnConnection {
1870 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1871 &mut self.0.options
1872 }
1873 }
1874
1875 #[derive(Clone, Debug)]
1893 pub struct DeleteVpnConnection(RequestBuilder<crate::model::DeleteVpnConnectionRequest>);
1894
1895 impl DeleteVpnConnection {
1896 pub(crate) fn new(
1897 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
1898 ) -> Self {
1899 Self(RequestBuilder::new(stub))
1900 }
1901
1902 pub fn with_request<V: Into<crate::model::DeleteVpnConnectionRequest>>(
1904 mut self,
1905 v: V,
1906 ) -> Self {
1907 self.0.request = v.into();
1908 self
1909 }
1910
1911 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1913 self.0.options = v.into();
1914 self
1915 }
1916
1917 pub async fn send(self) -> Result<longrunning::model::Operation> {
1924 (*self.0.stub)
1925 .delete_vpn_connection(self.0.request, self.0.options)
1926 .await
1927 .map(gax::response::Response::into_body)
1928 }
1929
1930 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1932 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1933 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1934 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1935
1936 let stub = self.0.stub.clone();
1937 let mut options = self.0.options.clone();
1938 options.set_retry_policy(gax::retry_policy::NeverRetry);
1939 let query = move |name| {
1940 let stub = stub.clone();
1941 let options = options.clone();
1942 async {
1943 let op = GetOperation::new(stub)
1944 .set_name(name)
1945 .with_options(options)
1946 .send()
1947 .await?;
1948 Ok(Operation::new(op))
1949 }
1950 };
1951
1952 let start = move || async {
1953 let op = self.send().await?;
1954 Ok(Operation::new(op))
1955 };
1956
1957 lro::internal::new_unit_response_poller(
1958 polling_error_policy,
1959 polling_backoff_policy,
1960 start,
1961 query,
1962 )
1963 }
1964
1965 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1969 self.0.request.name = v.into();
1970 self
1971 }
1972
1973 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1975 self.0.request.request_id = v.into();
1976 self
1977 }
1978 }
1979
1980 #[doc(hidden)]
1981 impl gax::options::internal::RequestBuilder for DeleteVpnConnection {
1982 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1983 &mut self.0.options
1984 }
1985 }
1986
1987 #[derive(Clone, Debug)]
2004 pub struct GetServerConfig(RequestBuilder<crate::model::GetServerConfigRequest>);
2005
2006 impl GetServerConfig {
2007 pub(crate) fn new(
2008 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2009 ) -> Self {
2010 Self(RequestBuilder::new(stub))
2011 }
2012
2013 pub fn with_request<V: Into<crate::model::GetServerConfigRequest>>(mut self, v: V) -> Self {
2015 self.0.request = v.into();
2016 self
2017 }
2018
2019 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2021 self.0.options = v.into();
2022 self
2023 }
2024
2025 pub async fn send(self) -> Result<crate::model::ServerConfig> {
2027 (*self.0.stub)
2028 .get_server_config(self.0.request, self.0.options)
2029 .await
2030 .map(gax::response::Response::into_body)
2031 }
2032
2033 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2037 self.0.request.name = v.into();
2038 self
2039 }
2040 }
2041
2042 #[doc(hidden)]
2043 impl gax::options::internal::RequestBuilder for GetServerConfig {
2044 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2045 &mut self.0.options
2046 }
2047 }
2048
2049 #[derive(Clone, Debug)]
2070 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2071
2072 impl ListLocations {
2073 pub(crate) fn new(
2074 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2075 ) -> Self {
2076 Self(RequestBuilder::new(stub))
2077 }
2078
2079 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2081 mut self,
2082 v: V,
2083 ) -> Self {
2084 self.0.request = v.into();
2085 self
2086 }
2087
2088 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2090 self.0.options = v.into();
2091 self
2092 }
2093
2094 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2096 (*self.0.stub)
2097 .list_locations(self.0.request, self.0.options)
2098 .await
2099 .map(gax::response::Response::into_body)
2100 }
2101
2102 pub fn by_page(
2104 self,
2105 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2106 {
2107 use std::clone::Clone;
2108 let token = self.0.request.page_token.clone();
2109 let execute = move |token: String| {
2110 let mut builder = self.clone();
2111 builder.0.request = builder.0.request.set_page_token(token);
2112 builder.send()
2113 };
2114 gax::paginator::internal::new_paginator(token, execute)
2115 }
2116
2117 pub fn by_item(
2119 self,
2120 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2121 {
2122 use gax::paginator::Paginator;
2123 self.by_page().items()
2124 }
2125
2126 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2128 self.0.request.name = v.into();
2129 self
2130 }
2131
2132 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2134 self.0.request.filter = v.into();
2135 self
2136 }
2137
2138 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2140 self.0.request.page_size = v.into();
2141 self
2142 }
2143
2144 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2146 self.0.request.page_token = v.into();
2147 self
2148 }
2149 }
2150
2151 #[doc(hidden)]
2152 impl gax::options::internal::RequestBuilder for ListLocations {
2153 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2154 &mut self.0.options
2155 }
2156 }
2157
2158 #[derive(Clone, Debug)]
2175 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2176
2177 impl GetLocation {
2178 pub(crate) fn new(
2179 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2180 ) -> Self {
2181 Self(RequestBuilder::new(stub))
2182 }
2183
2184 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2186 self.0.request = v.into();
2187 self
2188 }
2189
2190 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2192 self.0.options = v.into();
2193 self
2194 }
2195
2196 pub async fn send(self) -> Result<location::model::Location> {
2198 (*self.0.stub)
2199 .get_location(self.0.request, self.0.options)
2200 .await
2201 .map(gax::response::Response::into_body)
2202 }
2203
2204 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2206 self.0.request.name = v.into();
2207 self
2208 }
2209 }
2210
2211 #[doc(hidden)]
2212 impl gax::options::internal::RequestBuilder for GetLocation {
2213 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2214 &mut self.0.options
2215 }
2216 }
2217
2218 #[derive(Clone, Debug)]
2239 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2240
2241 impl ListOperations {
2242 pub(crate) fn new(
2243 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2244 ) -> Self {
2245 Self(RequestBuilder::new(stub))
2246 }
2247
2248 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2250 mut self,
2251 v: V,
2252 ) -> Self {
2253 self.0.request = v.into();
2254 self
2255 }
2256
2257 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2259 self.0.options = v.into();
2260 self
2261 }
2262
2263 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2265 (*self.0.stub)
2266 .list_operations(self.0.request, self.0.options)
2267 .await
2268 .map(gax::response::Response::into_body)
2269 }
2270
2271 pub fn by_page(
2273 self,
2274 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2275 {
2276 use std::clone::Clone;
2277 let token = self.0.request.page_token.clone();
2278 let execute = move |token: String| {
2279 let mut builder = self.clone();
2280 builder.0.request = builder.0.request.set_page_token(token);
2281 builder.send()
2282 };
2283 gax::paginator::internal::new_paginator(token, execute)
2284 }
2285
2286 pub fn by_item(
2288 self,
2289 ) -> impl gax::paginator::ItemPaginator<
2290 longrunning::model::ListOperationsResponse,
2291 gax::error::Error,
2292 > {
2293 use gax::paginator::Paginator;
2294 self.by_page().items()
2295 }
2296
2297 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2299 self.0.request.name = v.into();
2300 self
2301 }
2302
2303 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2305 self.0.request.filter = v.into();
2306 self
2307 }
2308
2309 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2311 self.0.request.page_size = v.into();
2312 self
2313 }
2314
2315 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2317 self.0.request.page_token = v.into();
2318 self
2319 }
2320 }
2321
2322 #[doc(hidden)]
2323 impl gax::options::internal::RequestBuilder for ListOperations {
2324 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2325 &mut self.0.options
2326 }
2327 }
2328
2329 #[derive(Clone, Debug)]
2346 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2347
2348 impl GetOperation {
2349 pub(crate) fn new(
2350 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2351 ) -> Self {
2352 Self(RequestBuilder::new(stub))
2353 }
2354
2355 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2357 mut self,
2358 v: V,
2359 ) -> Self {
2360 self.0.request = v.into();
2361 self
2362 }
2363
2364 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2366 self.0.options = v.into();
2367 self
2368 }
2369
2370 pub async fn send(self) -> Result<longrunning::model::Operation> {
2372 (*self.0.stub)
2373 .get_operation(self.0.request, self.0.options)
2374 .await
2375 .map(gax::response::Response::into_body)
2376 }
2377
2378 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2380 self.0.request.name = v.into();
2381 self
2382 }
2383 }
2384
2385 #[doc(hidden)]
2386 impl gax::options::internal::RequestBuilder for GetOperation {
2387 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2388 &mut self.0.options
2389 }
2390 }
2391
2392 #[derive(Clone, Debug)]
2409 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2410
2411 impl DeleteOperation {
2412 pub(crate) fn new(
2413 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2414 ) -> Self {
2415 Self(RequestBuilder::new(stub))
2416 }
2417
2418 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2420 mut self,
2421 v: V,
2422 ) -> Self {
2423 self.0.request = v.into();
2424 self
2425 }
2426
2427 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2429 self.0.options = v.into();
2430 self
2431 }
2432
2433 pub async fn send(self) -> Result<()> {
2435 (*self.0.stub)
2436 .delete_operation(self.0.request, self.0.options)
2437 .await
2438 .map(gax::response::Response::into_body)
2439 }
2440
2441 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2443 self.0.request.name = v.into();
2444 self
2445 }
2446 }
2447
2448 #[doc(hidden)]
2449 impl gax::options::internal::RequestBuilder for DeleteOperation {
2450 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2451 &mut self.0.options
2452 }
2453 }
2454
2455 #[derive(Clone, Debug)]
2472 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2473
2474 impl CancelOperation {
2475 pub(crate) fn new(
2476 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeContainer>,
2477 ) -> Self {
2478 Self(RequestBuilder::new(stub))
2479 }
2480
2481 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2483 mut self,
2484 v: V,
2485 ) -> Self {
2486 self.0.request = v.into();
2487 self
2488 }
2489
2490 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2492 self.0.options = v.into();
2493 self
2494 }
2495
2496 pub async fn send(self) -> Result<()> {
2498 (*self.0.stub)
2499 .cancel_operation(self.0.request, self.0.options)
2500 .await
2501 .map(gax::response::Response::into_body)
2502 }
2503
2504 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2506 self.0.request.name = v.into();
2507 self
2508 }
2509 }
2510
2511 #[doc(hidden)]
2512 impl gax::options::internal::RequestBuilder for CancelOperation {
2513 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2514 &mut self.0.options
2515 }
2516 }
2517}