1pub mod edge_network {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::EdgeNetwork;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = EdgeNetwork;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
90 pub struct InitializeZone(RequestBuilder<crate::model::InitializeZoneRequest>);
91
92 impl InitializeZone {
93 pub(crate) fn new(
94 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
95 ) -> Self {
96 Self(RequestBuilder::new(stub))
97 }
98
99 pub fn with_request<V: Into<crate::model::InitializeZoneRequest>>(mut self, v: V) -> Self {
101 self.0.request = v.into();
102 self
103 }
104
105 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
107 self.0.options = v.into();
108 self
109 }
110
111 pub async fn send(self) -> Result<crate::model::InitializeZoneResponse> {
113 (*self.0.stub)
114 .initialize_zone(self.0.request, self.0.options)
115 .await
116 .map(crate::Response::into_body)
117 }
118
119 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
123 self.0.request.name = v.into();
124 self
125 }
126 }
127
128 #[doc(hidden)]
129 impl crate::RequestBuilder for InitializeZone {
130 fn request_options(&mut self) -> &mut crate::RequestOptions {
131 &mut self.0.options
132 }
133 }
134
135 #[derive(Clone, Debug)]
156 pub struct ListZones(RequestBuilder<crate::model::ListZonesRequest>);
157
158 impl ListZones {
159 pub(crate) fn new(
160 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
161 ) -> Self {
162 Self(RequestBuilder::new(stub))
163 }
164
165 pub fn with_request<V: Into<crate::model::ListZonesRequest>>(mut self, v: V) -> Self {
167 self.0.request = v.into();
168 self
169 }
170
171 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
173 self.0.options = v.into();
174 self
175 }
176
177 pub async fn send(self) -> Result<crate::model::ListZonesResponse> {
179 (*self.0.stub)
180 .list_zones(self.0.request, self.0.options)
181 .await
182 .map(crate::Response::into_body)
183 }
184
185 pub fn by_page(
187 self,
188 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListZonesResponse, crate::Error>
189 {
190 use std::clone::Clone;
191 let token = self.0.request.page_token.clone();
192 let execute = move |token: String| {
193 let mut builder = self.clone();
194 builder.0.request = builder.0.request.set_page_token(token);
195 builder.send()
196 };
197 google_cloud_gax::paginator::internal::new_paginator(token, execute)
198 }
199
200 pub fn by_item(
202 self,
203 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListZonesResponse, crate::Error>
204 {
205 use google_cloud_gax::paginator::Paginator;
206 self.by_page().items()
207 }
208
209 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
213 self.0.request.parent = v.into();
214 self
215 }
216
217 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
219 self.0.request.page_size = v.into();
220 self
221 }
222
223 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
225 self.0.request.page_token = v.into();
226 self
227 }
228
229 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
231 self.0.request.filter = v.into();
232 self
233 }
234
235 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
237 self.0.request.order_by = v.into();
238 self
239 }
240 }
241
242 #[doc(hidden)]
243 impl crate::RequestBuilder for ListZones {
244 fn request_options(&mut self) -> &mut crate::RequestOptions {
245 &mut self.0.options
246 }
247 }
248
249 #[derive(Clone, Debug)]
266 pub struct GetZone(RequestBuilder<crate::model::GetZoneRequest>);
267
268 impl GetZone {
269 pub(crate) fn new(
270 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
271 ) -> Self {
272 Self(RequestBuilder::new(stub))
273 }
274
275 pub fn with_request<V: Into<crate::model::GetZoneRequest>>(mut self, v: V) -> Self {
277 self.0.request = v.into();
278 self
279 }
280
281 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
283 self.0.options = v.into();
284 self
285 }
286
287 pub async fn send(self) -> Result<crate::model::Zone> {
289 (*self.0.stub)
290 .get_zone(self.0.request, self.0.options)
291 .await
292 .map(crate::Response::into_body)
293 }
294
295 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
299 self.0.request.name = v.into();
300 self
301 }
302 }
303
304 #[doc(hidden)]
305 impl crate::RequestBuilder for GetZone {
306 fn request_options(&mut self) -> &mut crate::RequestOptions {
307 &mut self.0.options
308 }
309 }
310
311 #[derive(Clone, Debug)]
332 pub struct ListNetworks(RequestBuilder<crate::model::ListNetworksRequest>);
333
334 impl ListNetworks {
335 pub(crate) fn new(
336 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
337 ) -> Self {
338 Self(RequestBuilder::new(stub))
339 }
340
341 pub fn with_request<V: Into<crate::model::ListNetworksRequest>>(mut self, v: V) -> Self {
343 self.0.request = v.into();
344 self
345 }
346
347 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
349 self.0.options = v.into();
350 self
351 }
352
353 pub async fn send(self) -> Result<crate::model::ListNetworksResponse> {
355 (*self.0.stub)
356 .list_networks(self.0.request, self.0.options)
357 .await
358 .map(crate::Response::into_body)
359 }
360
361 pub fn by_page(
363 self,
364 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListNetworksResponse, crate::Error>
365 {
366 use std::clone::Clone;
367 let token = self.0.request.page_token.clone();
368 let execute = move |token: String| {
369 let mut builder = self.clone();
370 builder.0.request = builder.0.request.set_page_token(token);
371 builder.send()
372 };
373 google_cloud_gax::paginator::internal::new_paginator(token, execute)
374 }
375
376 pub fn by_item(
378 self,
379 ) -> impl google_cloud_gax::paginator::ItemPaginator<
380 crate::model::ListNetworksResponse,
381 crate::Error,
382 > {
383 use google_cloud_gax::paginator::Paginator;
384 self.by_page().items()
385 }
386
387 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
391 self.0.request.parent = v.into();
392 self
393 }
394
395 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
397 self.0.request.page_size = v.into();
398 self
399 }
400
401 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
403 self.0.request.page_token = v.into();
404 self
405 }
406
407 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
409 self.0.request.filter = v.into();
410 self
411 }
412
413 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
415 self.0.request.order_by = v.into();
416 self
417 }
418 }
419
420 #[doc(hidden)]
421 impl crate::RequestBuilder for ListNetworks {
422 fn request_options(&mut self) -> &mut crate::RequestOptions {
423 &mut self.0.options
424 }
425 }
426
427 #[derive(Clone, Debug)]
444 pub struct GetNetwork(RequestBuilder<crate::model::GetNetworkRequest>);
445
446 impl GetNetwork {
447 pub(crate) fn new(
448 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
449 ) -> Self {
450 Self(RequestBuilder::new(stub))
451 }
452
453 pub fn with_request<V: Into<crate::model::GetNetworkRequest>>(mut self, v: V) -> Self {
455 self.0.request = v.into();
456 self
457 }
458
459 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
461 self.0.options = v.into();
462 self
463 }
464
465 pub async fn send(self) -> Result<crate::model::Network> {
467 (*self.0.stub)
468 .get_network(self.0.request, self.0.options)
469 .await
470 .map(crate::Response::into_body)
471 }
472
473 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
477 self.0.request.name = v.into();
478 self
479 }
480 }
481
482 #[doc(hidden)]
483 impl crate::RequestBuilder for GetNetwork {
484 fn request_options(&mut self) -> &mut crate::RequestOptions {
485 &mut self.0.options
486 }
487 }
488
489 #[derive(Clone, Debug)]
506 pub struct DiagnoseNetwork(RequestBuilder<crate::model::DiagnoseNetworkRequest>);
507
508 impl DiagnoseNetwork {
509 pub(crate) fn new(
510 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
511 ) -> Self {
512 Self(RequestBuilder::new(stub))
513 }
514
515 pub fn with_request<V: Into<crate::model::DiagnoseNetworkRequest>>(mut self, v: V) -> Self {
517 self.0.request = v.into();
518 self
519 }
520
521 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
523 self.0.options = v.into();
524 self
525 }
526
527 pub async fn send(self) -> Result<crate::model::DiagnoseNetworkResponse> {
529 (*self.0.stub)
530 .diagnose_network(self.0.request, self.0.options)
531 .await
532 .map(crate::Response::into_body)
533 }
534
535 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
539 self.0.request.name = v.into();
540 self
541 }
542 }
543
544 #[doc(hidden)]
545 impl crate::RequestBuilder for DiagnoseNetwork {
546 fn request_options(&mut self) -> &mut crate::RequestOptions {
547 &mut self.0.options
548 }
549 }
550
551 #[derive(Clone, Debug)]
569 pub struct CreateNetwork(RequestBuilder<crate::model::CreateNetworkRequest>);
570
571 impl CreateNetwork {
572 pub(crate) fn new(
573 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
574 ) -> Self {
575 Self(RequestBuilder::new(stub))
576 }
577
578 pub fn with_request<V: Into<crate::model::CreateNetworkRequest>>(mut self, v: V) -> Self {
580 self.0.request = v.into();
581 self
582 }
583
584 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
586 self.0.options = v.into();
587 self
588 }
589
590 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
597 (*self.0.stub)
598 .create_network(self.0.request, self.0.options)
599 .await
600 .map(crate::Response::into_body)
601 }
602
603 pub fn poller(
605 self,
606 ) -> impl google_cloud_lro::Poller<crate::model::Network, crate::model::OperationMetadata>
607 {
608 type Operation = google_cloud_lro::internal::Operation<
609 crate::model::Network,
610 crate::model::OperationMetadata,
611 >;
612 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
613 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
614
615 let stub = self.0.stub.clone();
616 let mut options = self.0.options.clone();
617 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
618 let query = move |name| {
619 let stub = stub.clone();
620 let options = options.clone();
621 async {
622 let op = GetOperation::new(stub)
623 .set_name(name)
624 .with_options(options)
625 .send()
626 .await?;
627 Ok(Operation::new(op))
628 }
629 };
630
631 let start = move || async {
632 let op = self.send().await?;
633 Ok(Operation::new(op))
634 };
635
636 google_cloud_lro::internal::new_poller(
637 polling_error_policy,
638 polling_backoff_policy,
639 start,
640 query,
641 )
642 }
643
644 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
648 self.0.request.parent = v.into();
649 self
650 }
651
652 pub fn set_network_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
656 self.0.request.network_id = v.into();
657 self
658 }
659
660 pub fn set_network<T>(mut self, v: T) -> Self
664 where
665 T: std::convert::Into<crate::model::Network>,
666 {
667 self.0.request.network = std::option::Option::Some(v.into());
668 self
669 }
670
671 pub fn set_or_clear_network<T>(mut self, v: std::option::Option<T>) -> Self
675 where
676 T: std::convert::Into<crate::model::Network>,
677 {
678 self.0.request.network = v.map(|x| x.into());
679 self
680 }
681
682 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
684 self.0.request.request_id = v.into();
685 self
686 }
687 }
688
689 #[doc(hidden)]
690 impl crate::RequestBuilder for CreateNetwork {
691 fn request_options(&mut self) -> &mut crate::RequestOptions {
692 &mut self.0.options
693 }
694 }
695
696 #[derive(Clone, Debug)]
714 pub struct DeleteNetwork(RequestBuilder<crate::model::DeleteNetworkRequest>);
715
716 impl DeleteNetwork {
717 pub(crate) fn new(
718 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
719 ) -> Self {
720 Self(RequestBuilder::new(stub))
721 }
722
723 pub fn with_request<V: Into<crate::model::DeleteNetworkRequest>>(mut self, v: V) -> Self {
725 self.0.request = v.into();
726 self
727 }
728
729 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
731 self.0.options = v.into();
732 self
733 }
734
735 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
742 (*self.0.stub)
743 .delete_network(self.0.request, self.0.options)
744 .await
745 .map(crate::Response::into_body)
746 }
747
748 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
750 type Operation =
751 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
752 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
753 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
754
755 let stub = self.0.stub.clone();
756 let mut options = self.0.options.clone();
757 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
758 let query = move |name| {
759 let stub = stub.clone();
760 let options = options.clone();
761 async {
762 let op = GetOperation::new(stub)
763 .set_name(name)
764 .with_options(options)
765 .send()
766 .await?;
767 Ok(Operation::new(op))
768 }
769 };
770
771 let start = move || async {
772 let op = self.send().await?;
773 Ok(Operation::new(op))
774 };
775
776 google_cloud_lro::internal::new_unit_response_poller(
777 polling_error_policy,
778 polling_backoff_policy,
779 start,
780 query,
781 )
782 }
783
784 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
788 self.0.request.name = v.into();
789 self
790 }
791
792 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
794 self.0.request.request_id = v.into();
795 self
796 }
797 }
798
799 #[doc(hidden)]
800 impl crate::RequestBuilder for DeleteNetwork {
801 fn request_options(&mut self) -> &mut crate::RequestOptions {
802 &mut self.0.options
803 }
804 }
805
806 #[derive(Clone, Debug)]
827 pub struct ListSubnets(RequestBuilder<crate::model::ListSubnetsRequest>);
828
829 impl ListSubnets {
830 pub(crate) fn new(
831 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
832 ) -> Self {
833 Self(RequestBuilder::new(stub))
834 }
835
836 pub fn with_request<V: Into<crate::model::ListSubnetsRequest>>(mut self, v: V) -> Self {
838 self.0.request = v.into();
839 self
840 }
841
842 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
844 self.0.options = v.into();
845 self
846 }
847
848 pub async fn send(self) -> Result<crate::model::ListSubnetsResponse> {
850 (*self.0.stub)
851 .list_subnets(self.0.request, self.0.options)
852 .await
853 .map(crate::Response::into_body)
854 }
855
856 pub fn by_page(
858 self,
859 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSubnetsResponse, crate::Error>
860 {
861 use std::clone::Clone;
862 let token = self.0.request.page_token.clone();
863 let execute = move |token: String| {
864 let mut builder = self.clone();
865 builder.0.request = builder.0.request.set_page_token(token);
866 builder.send()
867 };
868 google_cloud_gax::paginator::internal::new_paginator(token, execute)
869 }
870
871 pub fn by_item(
873 self,
874 ) -> impl google_cloud_gax::paginator::ItemPaginator<
875 crate::model::ListSubnetsResponse,
876 crate::Error,
877 > {
878 use google_cloud_gax::paginator::Paginator;
879 self.by_page().items()
880 }
881
882 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
886 self.0.request.parent = v.into();
887 self
888 }
889
890 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
892 self.0.request.page_size = v.into();
893 self
894 }
895
896 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
898 self.0.request.page_token = v.into();
899 self
900 }
901
902 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
904 self.0.request.filter = v.into();
905 self
906 }
907
908 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
910 self.0.request.order_by = v.into();
911 self
912 }
913 }
914
915 #[doc(hidden)]
916 impl crate::RequestBuilder for ListSubnets {
917 fn request_options(&mut self) -> &mut crate::RequestOptions {
918 &mut self.0.options
919 }
920 }
921
922 #[derive(Clone, Debug)]
939 pub struct GetSubnet(RequestBuilder<crate::model::GetSubnetRequest>);
940
941 impl GetSubnet {
942 pub(crate) fn new(
943 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
944 ) -> Self {
945 Self(RequestBuilder::new(stub))
946 }
947
948 pub fn with_request<V: Into<crate::model::GetSubnetRequest>>(mut self, v: V) -> Self {
950 self.0.request = v.into();
951 self
952 }
953
954 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
956 self.0.options = v.into();
957 self
958 }
959
960 pub async fn send(self) -> Result<crate::model::Subnet> {
962 (*self.0.stub)
963 .get_subnet(self.0.request, self.0.options)
964 .await
965 .map(crate::Response::into_body)
966 }
967
968 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
972 self.0.request.name = v.into();
973 self
974 }
975 }
976
977 #[doc(hidden)]
978 impl crate::RequestBuilder for GetSubnet {
979 fn request_options(&mut self) -> &mut crate::RequestOptions {
980 &mut self.0.options
981 }
982 }
983
984 #[derive(Clone, Debug)]
1002 pub struct CreateSubnet(RequestBuilder<crate::model::CreateSubnetRequest>);
1003
1004 impl CreateSubnet {
1005 pub(crate) fn new(
1006 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1007 ) -> Self {
1008 Self(RequestBuilder::new(stub))
1009 }
1010
1011 pub fn with_request<V: Into<crate::model::CreateSubnetRequest>>(mut self, v: V) -> Self {
1013 self.0.request = v.into();
1014 self
1015 }
1016
1017 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1019 self.0.options = v.into();
1020 self
1021 }
1022
1023 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1030 (*self.0.stub)
1031 .create_subnet(self.0.request, self.0.options)
1032 .await
1033 .map(crate::Response::into_body)
1034 }
1035
1036 pub fn poller(
1038 self,
1039 ) -> impl google_cloud_lro::Poller<crate::model::Subnet, crate::model::OperationMetadata>
1040 {
1041 type Operation = google_cloud_lro::internal::Operation<
1042 crate::model::Subnet,
1043 crate::model::OperationMetadata,
1044 >;
1045 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1046 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1047
1048 let stub = self.0.stub.clone();
1049 let mut options = self.0.options.clone();
1050 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1051 let query = move |name| {
1052 let stub = stub.clone();
1053 let options = options.clone();
1054 async {
1055 let op = GetOperation::new(stub)
1056 .set_name(name)
1057 .with_options(options)
1058 .send()
1059 .await?;
1060 Ok(Operation::new(op))
1061 }
1062 };
1063
1064 let start = move || async {
1065 let op = self.send().await?;
1066 Ok(Operation::new(op))
1067 };
1068
1069 google_cloud_lro::internal::new_poller(
1070 polling_error_policy,
1071 polling_backoff_policy,
1072 start,
1073 query,
1074 )
1075 }
1076
1077 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1081 self.0.request.parent = v.into();
1082 self
1083 }
1084
1085 pub fn set_subnet_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1089 self.0.request.subnet_id = v.into();
1090 self
1091 }
1092
1093 pub fn set_subnet<T>(mut self, v: T) -> Self
1097 where
1098 T: std::convert::Into<crate::model::Subnet>,
1099 {
1100 self.0.request.subnet = std::option::Option::Some(v.into());
1101 self
1102 }
1103
1104 pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
1108 where
1109 T: std::convert::Into<crate::model::Subnet>,
1110 {
1111 self.0.request.subnet = v.map(|x| x.into());
1112 self
1113 }
1114
1115 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1117 self.0.request.request_id = v.into();
1118 self
1119 }
1120 }
1121
1122 #[doc(hidden)]
1123 impl crate::RequestBuilder for CreateSubnet {
1124 fn request_options(&mut self) -> &mut crate::RequestOptions {
1125 &mut self.0.options
1126 }
1127 }
1128
1129 #[derive(Clone, Debug)]
1147 pub struct UpdateSubnet(RequestBuilder<crate::model::UpdateSubnetRequest>);
1148
1149 impl UpdateSubnet {
1150 pub(crate) fn new(
1151 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1152 ) -> Self {
1153 Self(RequestBuilder::new(stub))
1154 }
1155
1156 pub fn with_request<V: Into<crate::model::UpdateSubnetRequest>>(mut self, v: V) -> Self {
1158 self.0.request = v.into();
1159 self
1160 }
1161
1162 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1164 self.0.options = v.into();
1165 self
1166 }
1167
1168 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1175 (*self.0.stub)
1176 .update_subnet(self.0.request, self.0.options)
1177 .await
1178 .map(crate::Response::into_body)
1179 }
1180
1181 pub fn poller(
1183 self,
1184 ) -> impl google_cloud_lro::Poller<crate::model::Subnet, crate::model::OperationMetadata>
1185 {
1186 type Operation = google_cloud_lro::internal::Operation<
1187 crate::model::Subnet,
1188 crate::model::OperationMetadata,
1189 >;
1190 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1191 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1192
1193 let stub = self.0.stub.clone();
1194 let mut options = self.0.options.clone();
1195 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1196 let query = move |name| {
1197 let stub = stub.clone();
1198 let options = options.clone();
1199 async {
1200 let op = GetOperation::new(stub)
1201 .set_name(name)
1202 .with_options(options)
1203 .send()
1204 .await?;
1205 Ok(Operation::new(op))
1206 }
1207 };
1208
1209 let start = move || async {
1210 let op = self.send().await?;
1211 Ok(Operation::new(op))
1212 };
1213
1214 google_cloud_lro::internal::new_poller(
1215 polling_error_policy,
1216 polling_backoff_policy,
1217 start,
1218 query,
1219 )
1220 }
1221
1222 pub fn set_update_mask<T>(mut self, v: T) -> Self
1226 where
1227 T: std::convert::Into<wkt::FieldMask>,
1228 {
1229 self.0.request.update_mask = std::option::Option::Some(v.into());
1230 self
1231 }
1232
1233 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1237 where
1238 T: std::convert::Into<wkt::FieldMask>,
1239 {
1240 self.0.request.update_mask = v.map(|x| x.into());
1241 self
1242 }
1243
1244 pub fn set_subnet<T>(mut self, v: T) -> Self
1248 where
1249 T: std::convert::Into<crate::model::Subnet>,
1250 {
1251 self.0.request.subnet = std::option::Option::Some(v.into());
1252 self
1253 }
1254
1255 pub fn set_or_clear_subnet<T>(mut self, v: std::option::Option<T>) -> Self
1259 where
1260 T: std::convert::Into<crate::model::Subnet>,
1261 {
1262 self.0.request.subnet = v.map(|x| x.into());
1263 self
1264 }
1265
1266 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1268 self.0.request.request_id = v.into();
1269 self
1270 }
1271 }
1272
1273 #[doc(hidden)]
1274 impl crate::RequestBuilder for UpdateSubnet {
1275 fn request_options(&mut self) -> &mut crate::RequestOptions {
1276 &mut self.0.options
1277 }
1278 }
1279
1280 #[derive(Clone, Debug)]
1298 pub struct DeleteSubnet(RequestBuilder<crate::model::DeleteSubnetRequest>);
1299
1300 impl DeleteSubnet {
1301 pub(crate) fn new(
1302 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1303 ) -> Self {
1304 Self(RequestBuilder::new(stub))
1305 }
1306
1307 pub fn with_request<V: Into<crate::model::DeleteSubnetRequest>>(mut self, v: V) -> Self {
1309 self.0.request = v.into();
1310 self
1311 }
1312
1313 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1315 self.0.options = v.into();
1316 self
1317 }
1318
1319 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1326 (*self.0.stub)
1327 .delete_subnet(self.0.request, self.0.options)
1328 .await
1329 .map(crate::Response::into_body)
1330 }
1331
1332 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1334 type Operation =
1335 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1336 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1337 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1338
1339 let stub = self.0.stub.clone();
1340 let mut options = self.0.options.clone();
1341 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1342 let query = move |name| {
1343 let stub = stub.clone();
1344 let options = options.clone();
1345 async {
1346 let op = GetOperation::new(stub)
1347 .set_name(name)
1348 .with_options(options)
1349 .send()
1350 .await?;
1351 Ok(Operation::new(op))
1352 }
1353 };
1354
1355 let start = move || async {
1356 let op = self.send().await?;
1357 Ok(Operation::new(op))
1358 };
1359
1360 google_cloud_lro::internal::new_unit_response_poller(
1361 polling_error_policy,
1362 polling_backoff_policy,
1363 start,
1364 query,
1365 )
1366 }
1367
1368 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1372 self.0.request.name = v.into();
1373 self
1374 }
1375
1376 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1378 self.0.request.request_id = v.into();
1379 self
1380 }
1381 }
1382
1383 #[doc(hidden)]
1384 impl crate::RequestBuilder for DeleteSubnet {
1385 fn request_options(&mut self) -> &mut crate::RequestOptions {
1386 &mut self.0.options
1387 }
1388 }
1389
1390 #[derive(Clone, Debug)]
1411 pub struct ListInterconnects(RequestBuilder<crate::model::ListInterconnectsRequest>);
1412
1413 impl ListInterconnects {
1414 pub(crate) fn new(
1415 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1416 ) -> Self {
1417 Self(RequestBuilder::new(stub))
1418 }
1419
1420 pub fn with_request<V: Into<crate::model::ListInterconnectsRequest>>(
1422 mut self,
1423 v: V,
1424 ) -> Self {
1425 self.0.request = v.into();
1426 self
1427 }
1428
1429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1431 self.0.options = v.into();
1432 self
1433 }
1434
1435 pub async fn send(self) -> Result<crate::model::ListInterconnectsResponse> {
1437 (*self.0.stub)
1438 .list_interconnects(self.0.request, self.0.options)
1439 .await
1440 .map(crate::Response::into_body)
1441 }
1442
1443 pub fn by_page(
1445 self,
1446 ) -> impl google_cloud_gax::paginator::Paginator<
1447 crate::model::ListInterconnectsResponse,
1448 crate::Error,
1449 > {
1450 use std::clone::Clone;
1451 let token = self.0.request.page_token.clone();
1452 let execute = move |token: String| {
1453 let mut builder = self.clone();
1454 builder.0.request = builder.0.request.set_page_token(token);
1455 builder.send()
1456 };
1457 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1458 }
1459
1460 pub fn by_item(
1462 self,
1463 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1464 crate::model::ListInterconnectsResponse,
1465 crate::Error,
1466 > {
1467 use google_cloud_gax::paginator::Paginator;
1468 self.by_page().items()
1469 }
1470
1471 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1475 self.0.request.parent = v.into();
1476 self
1477 }
1478
1479 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1481 self.0.request.page_size = v.into();
1482 self
1483 }
1484
1485 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1487 self.0.request.page_token = v.into();
1488 self
1489 }
1490
1491 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1493 self.0.request.filter = v.into();
1494 self
1495 }
1496
1497 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1499 self.0.request.order_by = v.into();
1500 self
1501 }
1502 }
1503
1504 #[doc(hidden)]
1505 impl crate::RequestBuilder for ListInterconnects {
1506 fn request_options(&mut self) -> &mut crate::RequestOptions {
1507 &mut self.0.options
1508 }
1509 }
1510
1511 #[derive(Clone, Debug)]
1528 pub struct GetInterconnect(RequestBuilder<crate::model::GetInterconnectRequest>);
1529
1530 impl GetInterconnect {
1531 pub(crate) fn new(
1532 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1533 ) -> Self {
1534 Self(RequestBuilder::new(stub))
1535 }
1536
1537 pub fn with_request<V: Into<crate::model::GetInterconnectRequest>>(mut self, v: V) -> Self {
1539 self.0.request = v.into();
1540 self
1541 }
1542
1543 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1545 self.0.options = v.into();
1546 self
1547 }
1548
1549 pub async fn send(self) -> Result<crate::model::Interconnect> {
1551 (*self.0.stub)
1552 .get_interconnect(self.0.request, self.0.options)
1553 .await
1554 .map(crate::Response::into_body)
1555 }
1556
1557 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1561 self.0.request.name = v.into();
1562 self
1563 }
1564 }
1565
1566 #[doc(hidden)]
1567 impl crate::RequestBuilder for GetInterconnect {
1568 fn request_options(&mut self) -> &mut crate::RequestOptions {
1569 &mut self.0.options
1570 }
1571 }
1572
1573 #[derive(Clone, Debug)]
1590 pub struct DiagnoseInterconnect(RequestBuilder<crate::model::DiagnoseInterconnectRequest>);
1591
1592 impl DiagnoseInterconnect {
1593 pub(crate) fn new(
1594 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1595 ) -> Self {
1596 Self(RequestBuilder::new(stub))
1597 }
1598
1599 pub fn with_request<V: Into<crate::model::DiagnoseInterconnectRequest>>(
1601 mut self,
1602 v: V,
1603 ) -> Self {
1604 self.0.request = v.into();
1605 self
1606 }
1607
1608 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1610 self.0.options = v.into();
1611 self
1612 }
1613
1614 pub async fn send(self) -> Result<crate::model::DiagnoseInterconnectResponse> {
1616 (*self.0.stub)
1617 .diagnose_interconnect(self.0.request, self.0.options)
1618 .await
1619 .map(crate::Response::into_body)
1620 }
1621
1622 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1626 self.0.request.name = v.into();
1627 self
1628 }
1629 }
1630
1631 #[doc(hidden)]
1632 impl crate::RequestBuilder for DiagnoseInterconnect {
1633 fn request_options(&mut self) -> &mut crate::RequestOptions {
1634 &mut self.0.options
1635 }
1636 }
1637
1638 #[derive(Clone, Debug)]
1659 pub struct ListInterconnectAttachments(
1660 RequestBuilder<crate::model::ListInterconnectAttachmentsRequest>,
1661 );
1662
1663 impl ListInterconnectAttachments {
1664 pub(crate) fn new(
1665 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1666 ) -> Self {
1667 Self(RequestBuilder::new(stub))
1668 }
1669
1670 pub fn with_request<V: Into<crate::model::ListInterconnectAttachmentsRequest>>(
1672 mut self,
1673 v: V,
1674 ) -> Self {
1675 self.0.request = v.into();
1676 self
1677 }
1678
1679 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1681 self.0.options = v.into();
1682 self
1683 }
1684
1685 pub async fn send(self) -> Result<crate::model::ListInterconnectAttachmentsResponse> {
1687 (*self.0.stub)
1688 .list_interconnect_attachments(self.0.request, self.0.options)
1689 .await
1690 .map(crate::Response::into_body)
1691 }
1692
1693 pub fn by_page(
1695 self,
1696 ) -> impl google_cloud_gax::paginator::Paginator<
1697 crate::model::ListInterconnectAttachmentsResponse,
1698 crate::Error,
1699 > {
1700 use std::clone::Clone;
1701 let token = self.0.request.page_token.clone();
1702 let execute = move |token: String| {
1703 let mut builder = self.clone();
1704 builder.0.request = builder.0.request.set_page_token(token);
1705 builder.send()
1706 };
1707 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1708 }
1709
1710 pub fn by_item(
1712 self,
1713 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1714 crate::model::ListInterconnectAttachmentsResponse,
1715 crate::Error,
1716 > {
1717 use google_cloud_gax::paginator::Paginator;
1718 self.by_page().items()
1719 }
1720
1721 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1725 self.0.request.parent = v.into();
1726 self
1727 }
1728
1729 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1731 self.0.request.page_size = v.into();
1732 self
1733 }
1734
1735 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1737 self.0.request.page_token = v.into();
1738 self
1739 }
1740
1741 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1743 self.0.request.filter = v.into();
1744 self
1745 }
1746
1747 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1749 self.0.request.order_by = v.into();
1750 self
1751 }
1752 }
1753
1754 #[doc(hidden)]
1755 impl crate::RequestBuilder for ListInterconnectAttachments {
1756 fn request_options(&mut self) -> &mut crate::RequestOptions {
1757 &mut self.0.options
1758 }
1759 }
1760
1761 #[derive(Clone, Debug)]
1778 pub struct GetInterconnectAttachment(
1779 RequestBuilder<crate::model::GetInterconnectAttachmentRequest>,
1780 );
1781
1782 impl GetInterconnectAttachment {
1783 pub(crate) fn new(
1784 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1785 ) -> Self {
1786 Self(RequestBuilder::new(stub))
1787 }
1788
1789 pub fn with_request<V: Into<crate::model::GetInterconnectAttachmentRequest>>(
1791 mut self,
1792 v: V,
1793 ) -> Self {
1794 self.0.request = v.into();
1795 self
1796 }
1797
1798 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1800 self.0.options = v.into();
1801 self
1802 }
1803
1804 pub async fn send(self) -> Result<crate::model::InterconnectAttachment> {
1806 (*self.0.stub)
1807 .get_interconnect_attachment(self.0.request, self.0.options)
1808 .await
1809 .map(crate::Response::into_body)
1810 }
1811
1812 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1816 self.0.request.name = v.into();
1817 self
1818 }
1819 }
1820
1821 #[doc(hidden)]
1822 impl crate::RequestBuilder for GetInterconnectAttachment {
1823 fn request_options(&mut self) -> &mut crate::RequestOptions {
1824 &mut self.0.options
1825 }
1826 }
1827
1828 #[derive(Clone, Debug)]
1846 pub struct CreateInterconnectAttachment(
1847 RequestBuilder<crate::model::CreateInterconnectAttachmentRequest>,
1848 );
1849
1850 impl CreateInterconnectAttachment {
1851 pub(crate) fn new(
1852 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
1853 ) -> Self {
1854 Self(RequestBuilder::new(stub))
1855 }
1856
1857 pub fn with_request<V: Into<crate::model::CreateInterconnectAttachmentRequest>>(
1859 mut self,
1860 v: V,
1861 ) -> Self {
1862 self.0.request = v.into();
1863 self
1864 }
1865
1866 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1868 self.0.options = v.into();
1869 self
1870 }
1871
1872 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1879 (*self.0.stub)
1880 .create_interconnect_attachment(self.0.request, self.0.options)
1881 .await
1882 .map(crate::Response::into_body)
1883 }
1884
1885 pub fn poller(
1887 self,
1888 ) -> impl google_cloud_lro::Poller<
1889 crate::model::InterconnectAttachment,
1890 crate::model::OperationMetadata,
1891 > {
1892 type Operation = google_cloud_lro::internal::Operation<
1893 crate::model::InterconnectAttachment,
1894 crate::model::OperationMetadata,
1895 >;
1896 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1897 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1898
1899 let stub = self.0.stub.clone();
1900 let mut options = self.0.options.clone();
1901 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1902 let query = move |name| {
1903 let stub = stub.clone();
1904 let options = options.clone();
1905 async {
1906 let op = GetOperation::new(stub)
1907 .set_name(name)
1908 .with_options(options)
1909 .send()
1910 .await?;
1911 Ok(Operation::new(op))
1912 }
1913 };
1914
1915 let start = move || async {
1916 let op = self.send().await?;
1917 Ok(Operation::new(op))
1918 };
1919
1920 google_cloud_lro::internal::new_poller(
1921 polling_error_policy,
1922 polling_backoff_policy,
1923 start,
1924 query,
1925 )
1926 }
1927
1928 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1932 self.0.request.parent = v.into();
1933 self
1934 }
1935
1936 pub fn set_interconnect_attachment_id<T: Into<std::string::String>>(
1940 mut self,
1941 v: T,
1942 ) -> Self {
1943 self.0.request.interconnect_attachment_id = v.into();
1944 self
1945 }
1946
1947 pub fn set_interconnect_attachment<T>(mut self, v: T) -> Self
1951 where
1952 T: std::convert::Into<crate::model::InterconnectAttachment>,
1953 {
1954 self.0.request.interconnect_attachment = std::option::Option::Some(v.into());
1955 self
1956 }
1957
1958 pub fn set_or_clear_interconnect_attachment<T>(mut self, v: std::option::Option<T>) -> Self
1962 where
1963 T: std::convert::Into<crate::model::InterconnectAttachment>,
1964 {
1965 self.0.request.interconnect_attachment = v.map(|x| x.into());
1966 self
1967 }
1968
1969 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1971 self.0.request.request_id = v.into();
1972 self
1973 }
1974 }
1975
1976 #[doc(hidden)]
1977 impl crate::RequestBuilder for CreateInterconnectAttachment {
1978 fn request_options(&mut self) -> &mut crate::RequestOptions {
1979 &mut self.0.options
1980 }
1981 }
1982
1983 #[derive(Clone, Debug)]
2001 pub struct DeleteInterconnectAttachment(
2002 RequestBuilder<crate::model::DeleteInterconnectAttachmentRequest>,
2003 );
2004
2005 impl DeleteInterconnectAttachment {
2006 pub(crate) fn new(
2007 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2008 ) -> Self {
2009 Self(RequestBuilder::new(stub))
2010 }
2011
2012 pub fn with_request<V: Into<crate::model::DeleteInterconnectAttachmentRequest>>(
2014 mut self,
2015 v: V,
2016 ) -> Self {
2017 self.0.request = v.into();
2018 self
2019 }
2020
2021 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2023 self.0.options = v.into();
2024 self
2025 }
2026
2027 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2034 (*self.0.stub)
2035 .delete_interconnect_attachment(self.0.request, self.0.options)
2036 .await
2037 .map(crate::Response::into_body)
2038 }
2039
2040 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2042 type Operation =
2043 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2044 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2045 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2046
2047 let stub = self.0.stub.clone();
2048 let mut options = self.0.options.clone();
2049 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2050 let query = move |name| {
2051 let stub = stub.clone();
2052 let options = options.clone();
2053 async {
2054 let op = GetOperation::new(stub)
2055 .set_name(name)
2056 .with_options(options)
2057 .send()
2058 .await?;
2059 Ok(Operation::new(op))
2060 }
2061 };
2062
2063 let start = move || async {
2064 let op = self.send().await?;
2065 Ok(Operation::new(op))
2066 };
2067
2068 google_cloud_lro::internal::new_unit_response_poller(
2069 polling_error_policy,
2070 polling_backoff_policy,
2071 start,
2072 query,
2073 )
2074 }
2075
2076 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2080 self.0.request.name = v.into();
2081 self
2082 }
2083
2084 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2086 self.0.request.request_id = v.into();
2087 self
2088 }
2089 }
2090
2091 #[doc(hidden)]
2092 impl crate::RequestBuilder for DeleteInterconnectAttachment {
2093 fn request_options(&mut self) -> &mut crate::RequestOptions {
2094 &mut self.0.options
2095 }
2096 }
2097
2098 #[derive(Clone, Debug)]
2119 pub struct ListRouters(RequestBuilder<crate::model::ListRoutersRequest>);
2120
2121 impl ListRouters {
2122 pub(crate) fn new(
2123 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2124 ) -> Self {
2125 Self(RequestBuilder::new(stub))
2126 }
2127
2128 pub fn with_request<V: Into<crate::model::ListRoutersRequest>>(mut self, v: V) -> Self {
2130 self.0.request = v.into();
2131 self
2132 }
2133
2134 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2136 self.0.options = v.into();
2137 self
2138 }
2139
2140 pub async fn send(self) -> Result<crate::model::ListRoutersResponse> {
2142 (*self.0.stub)
2143 .list_routers(self.0.request, self.0.options)
2144 .await
2145 .map(crate::Response::into_body)
2146 }
2147
2148 pub fn by_page(
2150 self,
2151 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListRoutersResponse, crate::Error>
2152 {
2153 use std::clone::Clone;
2154 let token = self.0.request.page_token.clone();
2155 let execute = move |token: String| {
2156 let mut builder = self.clone();
2157 builder.0.request = builder.0.request.set_page_token(token);
2158 builder.send()
2159 };
2160 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2161 }
2162
2163 pub fn by_item(
2165 self,
2166 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2167 crate::model::ListRoutersResponse,
2168 crate::Error,
2169 > {
2170 use google_cloud_gax::paginator::Paginator;
2171 self.by_page().items()
2172 }
2173
2174 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2178 self.0.request.parent = v.into();
2179 self
2180 }
2181
2182 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2184 self.0.request.page_size = v.into();
2185 self
2186 }
2187
2188 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2190 self.0.request.page_token = v.into();
2191 self
2192 }
2193
2194 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2196 self.0.request.filter = v.into();
2197 self
2198 }
2199
2200 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2202 self.0.request.order_by = v.into();
2203 self
2204 }
2205 }
2206
2207 #[doc(hidden)]
2208 impl crate::RequestBuilder for ListRouters {
2209 fn request_options(&mut self) -> &mut crate::RequestOptions {
2210 &mut self.0.options
2211 }
2212 }
2213
2214 #[derive(Clone, Debug)]
2231 pub struct GetRouter(RequestBuilder<crate::model::GetRouterRequest>);
2232
2233 impl GetRouter {
2234 pub(crate) fn new(
2235 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2236 ) -> Self {
2237 Self(RequestBuilder::new(stub))
2238 }
2239
2240 pub fn with_request<V: Into<crate::model::GetRouterRequest>>(mut self, v: V) -> Self {
2242 self.0.request = v.into();
2243 self
2244 }
2245
2246 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2248 self.0.options = v.into();
2249 self
2250 }
2251
2252 pub async fn send(self) -> Result<crate::model::Router> {
2254 (*self.0.stub)
2255 .get_router(self.0.request, self.0.options)
2256 .await
2257 .map(crate::Response::into_body)
2258 }
2259
2260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2264 self.0.request.name = v.into();
2265 self
2266 }
2267 }
2268
2269 #[doc(hidden)]
2270 impl crate::RequestBuilder for GetRouter {
2271 fn request_options(&mut self) -> &mut crate::RequestOptions {
2272 &mut self.0.options
2273 }
2274 }
2275
2276 #[derive(Clone, Debug)]
2293 pub struct DiagnoseRouter(RequestBuilder<crate::model::DiagnoseRouterRequest>);
2294
2295 impl DiagnoseRouter {
2296 pub(crate) fn new(
2297 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2298 ) -> Self {
2299 Self(RequestBuilder::new(stub))
2300 }
2301
2302 pub fn with_request<V: Into<crate::model::DiagnoseRouterRequest>>(mut self, v: V) -> Self {
2304 self.0.request = v.into();
2305 self
2306 }
2307
2308 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2310 self.0.options = v.into();
2311 self
2312 }
2313
2314 pub async fn send(self) -> Result<crate::model::DiagnoseRouterResponse> {
2316 (*self.0.stub)
2317 .diagnose_router(self.0.request, self.0.options)
2318 .await
2319 .map(crate::Response::into_body)
2320 }
2321
2322 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2326 self.0.request.name = v.into();
2327 self
2328 }
2329 }
2330
2331 #[doc(hidden)]
2332 impl crate::RequestBuilder for DiagnoseRouter {
2333 fn request_options(&mut self) -> &mut crate::RequestOptions {
2334 &mut self.0.options
2335 }
2336 }
2337
2338 #[derive(Clone, Debug)]
2356 pub struct CreateRouter(RequestBuilder<crate::model::CreateRouterRequest>);
2357
2358 impl CreateRouter {
2359 pub(crate) fn new(
2360 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2361 ) -> Self {
2362 Self(RequestBuilder::new(stub))
2363 }
2364
2365 pub fn with_request<V: Into<crate::model::CreateRouterRequest>>(mut self, v: V) -> Self {
2367 self.0.request = v.into();
2368 self
2369 }
2370
2371 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2373 self.0.options = v.into();
2374 self
2375 }
2376
2377 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2384 (*self.0.stub)
2385 .create_router(self.0.request, self.0.options)
2386 .await
2387 .map(crate::Response::into_body)
2388 }
2389
2390 pub fn poller(
2392 self,
2393 ) -> impl google_cloud_lro::Poller<crate::model::Router, crate::model::OperationMetadata>
2394 {
2395 type Operation = google_cloud_lro::internal::Operation<
2396 crate::model::Router,
2397 crate::model::OperationMetadata,
2398 >;
2399 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2400 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2401
2402 let stub = self.0.stub.clone();
2403 let mut options = self.0.options.clone();
2404 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2405 let query = move |name| {
2406 let stub = stub.clone();
2407 let options = options.clone();
2408 async {
2409 let op = GetOperation::new(stub)
2410 .set_name(name)
2411 .with_options(options)
2412 .send()
2413 .await?;
2414 Ok(Operation::new(op))
2415 }
2416 };
2417
2418 let start = move || async {
2419 let op = self.send().await?;
2420 Ok(Operation::new(op))
2421 };
2422
2423 google_cloud_lro::internal::new_poller(
2424 polling_error_policy,
2425 polling_backoff_policy,
2426 start,
2427 query,
2428 )
2429 }
2430
2431 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2435 self.0.request.parent = v.into();
2436 self
2437 }
2438
2439 pub fn set_router_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2443 self.0.request.router_id = v.into();
2444 self
2445 }
2446
2447 pub fn set_router<T>(mut self, v: T) -> Self
2451 where
2452 T: std::convert::Into<crate::model::Router>,
2453 {
2454 self.0.request.router = std::option::Option::Some(v.into());
2455 self
2456 }
2457
2458 pub fn set_or_clear_router<T>(mut self, v: std::option::Option<T>) -> Self
2462 where
2463 T: std::convert::Into<crate::model::Router>,
2464 {
2465 self.0.request.router = v.map(|x| x.into());
2466 self
2467 }
2468
2469 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2471 self.0.request.request_id = v.into();
2472 self
2473 }
2474 }
2475
2476 #[doc(hidden)]
2477 impl crate::RequestBuilder for CreateRouter {
2478 fn request_options(&mut self) -> &mut crate::RequestOptions {
2479 &mut self.0.options
2480 }
2481 }
2482
2483 #[derive(Clone, Debug)]
2501 pub struct UpdateRouter(RequestBuilder<crate::model::UpdateRouterRequest>);
2502
2503 impl UpdateRouter {
2504 pub(crate) fn new(
2505 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2506 ) -> Self {
2507 Self(RequestBuilder::new(stub))
2508 }
2509
2510 pub fn with_request<V: Into<crate::model::UpdateRouterRequest>>(mut self, v: V) -> Self {
2512 self.0.request = v.into();
2513 self
2514 }
2515
2516 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2518 self.0.options = v.into();
2519 self
2520 }
2521
2522 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2529 (*self.0.stub)
2530 .update_router(self.0.request, self.0.options)
2531 .await
2532 .map(crate::Response::into_body)
2533 }
2534
2535 pub fn poller(
2537 self,
2538 ) -> impl google_cloud_lro::Poller<crate::model::Router, crate::model::OperationMetadata>
2539 {
2540 type Operation = google_cloud_lro::internal::Operation<
2541 crate::model::Router,
2542 crate::model::OperationMetadata,
2543 >;
2544 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2545 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2546
2547 let stub = self.0.stub.clone();
2548 let mut options = self.0.options.clone();
2549 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2550 let query = move |name| {
2551 let stub = stub.clone();
2552 let options = options.clone();
2553 async {
2554 let op = GetOperation::new(stub)
2555 .set_name(name)
2556 .with_options(options)
2557 .send()
2558 .await?;
2559 Ok(Operation::new(op))
2560 }
2561 };
2562
2563 let start = move || async {
2564 let op = self.send().await?;
2565 Ok(Operation::new(op))
2566 };
2567
2568 google_cloud_lro::internal::new_poller(
2569 polling_error_policy,
2570 polling_backoff_policy,
2571 start,
2572 query,
2573 )
2574 }
2575
2576 pub fn set_update_mask<T>(mut self, v: T) -> Self
2580 where
2581 T: std::convert::Into<wkt::FieldMask>,
2582 {
2583 self.0.request.update_mask = std::option::Option::Some(v.into());
2584 self
2585 }
2586
2587 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2591 where
2592 T: std::convert::Into<wkt::FieldMask>,
2593 {
2594 self.0.request.update_mask = v.map(|x| x.into());
2595 self
2596 }
2597
2598 pub fn set_router<T>(mut self, v: T) -> Self
2602 where
2603 T: std::convert::Into<crate::model::Router>,
2604 {
2605 self.0.request.router = std::option::Option::Some(v.into());
2606 self
2607 }
2608
2609 pub fn set_or_clear_router<T>(mut self, v: std::option::Option<T>) -> Self
2613 where
2614 T: std::convert::Into<crate::model::Router>,
2615 {
2616 self.0.request.router = v.map(|x| x.into());
2617 self
2618 }
2619
2620 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2622 self.0.request.request_id = v.into();
2623 self
2624 }
2625 }
2626
2627 #[doc(hidden)]
2628 impl crate::RequestBuilder for UpdateRouter {
2629 fn request_options(&mut self) -> &mut crate::RequestOptions {
2630 &mut self.0.options
2631 }
2632 }
2633
2634 #[derive(Clone, Debug)]
2652 pub struct DeleteRouter(RequestBuilder<crate::model::DeleteRouterRequest>);
2653
2654 impl DeleteRouter {
2655 pub(crate) fn new(
2656 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2657 ) -> Self {
2658 Self(RequestBuilder::new(stub))
2659 }
2660
2661 pub fn with_request<V: Into<crate::model::DeleteRouterRequest>>(mut self, v: V) -> Self {
2663 self.0.request = v.into();
2664 self
2665 }
2666
2667 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2669 self.0.options = v.into();
2670 self
2671 }
2672
2673 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2680 (*self.0.stub)
2681 .delete_router(self.0.request, self.0.options)
2682 .await
2683 .map(crate::Response::into_body)
2684 }
2685
2686 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2688 type Operation =
2689 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2690 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2691 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2692
2693 let stub = self.0.stub.clone();
2694 let mut options = self.0.options.clone();
2695 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2696 let query = move |name| {
2697 let stub = stub.clone();
2698 let options = options.clone();
2699 async {
2700 let op = GetOperation::new(stub)
2701 .set_name(name)
2702 .with_options(options)
2703 .send()
2704 .await?;
2705 Ok(Operation::new(op))
2706 }
2707 };
2708
2709 let start = move || async {
2710 let op = self.send().await?;
2711 Ok(Operation::new(op))
2712 };
2713
2714 google_cloud_lro::internal::new_unit_response_poller(
2715 polling_error_policy,
2716 polling_backoff_policy,
2717 start,
2718 query,
2719 )
2720 }
2721
2722 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2726 self.0.request.name = v.into();
2727 self
2728 }
2729
2730 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2732 self.0.request.request_id = v.into();
2733 self
2734 }
2735 }
2736
2737 #[doc(hidden)]
2738 impl crate::RequestBuilder for DeleteRouter {
2739 fn request_options(&mut self) -> &mut crate::RequestOptions {
2740 &mut self.0.options
2741 }
2742 }
2743
2744 #[derive(Clone, Debug)]
2765 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2766
2767 impl ListLocations {
2768 pub(crate) fn new(
2769 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2770 ) -> Self {
2771 Self(RequestBuilder::new(stub))
2772 }
2773
2774 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2776 mut self,
2777 v: V,
2778 ) -> Self {
2779 self.0.request = v.into();
2780 self
2781 }
2782
2783 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2785 self.0.options = v.into();
2786 self
2787 }
2788
2789 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2791 (*self.0.stub)
2792 .list_locations(self.0.request, self.0.options)
2793 .await
2794 .map(crate::Response::into_body)
2795 }
2796
2797 pub fn by_page(
2799 self,
2800 ) -> impl google_cloud_gax::paginator::Paginator<
2801 google_cloud_location::model::ListLocationsResponse,
2802 crate::Error,
2803 > {
2804 use std::clone::Clone;
2805 let token = self.0.request.page_token.clone();
2806 let execute = move |token: String| {
2807 let mut builder = self.clone();
2808 builder.0.request = builder.0.request.set_page_token(token);
2809 builder.send()
2810 };
2811 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2812 }
2813
2814 pub fn by_item(
2816 self,
2817 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2818 google_cloud_location::model::ListLocationsResponse,
2819 crate::Error,
2820 > {
2821 use google_cloud_gax::paginator::Paginator;
2822 self.by_page().items()
2823 }
2824
2825 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2827 self.0.request.name = v.into();
2828 self
2829 }
2830
2831 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2833 self.0.request.filter = v.into();
2834 self
2835 }
2836
2837 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2839 self.0.request.page_size = v.into();
2840 self
2841 }
2842
2843 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2845 self.0.request.page_token = v.into();
2846 self
2847 }
2848 }
2849
2850 #[doc(hidden)]
2851 impl crate::RequestBuilder for ListLocations {
2852 fn request_options(&mut self) -> &mut crate::RequestOptions {
2853 &mut self.0.options
2854 }
2855 }
2856
2857 #[derive(Clone, Debug)]
2874 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2875
2876 impl GetLocation {
2877 pub(crate) fn new(
2878 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2879 ) -> Self {
2880 Self(RequestBuilder::new(stub))
2881 }
2882
2883 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2885 mut self,
2886 v: V,
2887 ) -> Self {
2888 self.0.request = v.into();
2889 self
2890 }
2891
2892 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2894 self.0.options = v.into();
2895 self
2896 }
2897
2898 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2900 (*self.0.stub)
2901 .get_location(self.0.request, self.0.options)
2902 .await
2903 .map(crate::Response::into_body)
2904 }
2905
2906 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2908 self.0.request.name = v.into();
2909 self
2910 }
2911 }
2912
2913 #[doc(hidden)]
2914 impl crate::RequestBuilder for GetLocation {
2915 fn request_options(&mut self) -> &mut crate::RequestOptions {
2916 &mut self.0.options
2917 }
2918 }
2919
2920 #[derive(Clone, Debug)]
2941 pub struct ListOperations(
2942 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2943 );
2944
2945 impl ListOperations {
2946 pub(crate) fn new(
2947 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
2948 ) -> Self {
2949 Self(RequestBuilder::new(stub))
2950 }
2951
2952 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2954 mut self,
2955 v: V,
2956 ) -> Self {
2957 self.0.request = v.into();
2958 self
2959 }
2960
2961 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2963 self.0.options = v.into();
2964 self
2965 }
2966
2967 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2969 (*self.0.stub)
2970 .list_operations(self.0.request, self.0.options)
2971 .await
2972 .map(crate::Response::into_body)
2973 }
2974
2975 pub fn by_page(
2977 self,
2978 ) -> impl google_cloud_gax::paginator::Paginator<
2979 google_cloud_longrunning::model::ListOperationsResponse,
2980 crate::Error,
2981 > {
2982 use std::clone::Clone;
2983 let token = self.0.request.page_token.clone();
2984 let execute = move |token: String| {
2985 let mut builder = self.clone();
2986 builder.0.request = builder.0.request.set_page_token(token);
2987 builder.send()
2988 };
2989 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2990 }
2991
2992 pub fn by_item(
2994 self,
2995 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2996 google_cloud_longrunning::model::ListOperationsResponse,
2997 crate::Error,
2998 > {
2999 use google_cloud_gax::paginator::Paginator;
3000 self.by_page().items()
3001 }
3002
3003 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3005 self.0.request.name = v.into();
3006 self
3007 }
3008
3009 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3011 self.0.request.filter = v.into();
3012 self
3013 }
3014
3015 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3017 self.0.request.page_size = v.into();
3018 self
3019 }
3020
3021 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3023 self.0.request.page_token = v.into();
3024 self
3025 }
3026
3027 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3029 self.0.request.return_partial_success = v.into();
3030 self
3031 }
3032 }
3033
3034 #[doc(hidden)]
3035 impl crate::RequestBuilder for ListOperations {
3036 fn request_options(&mut self) -> &mut crate::RequestOptions {
3037 &mut self.0.options
3038 }
3039 }
3040
3041 #[derive(Clone, Debug)]
3058 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3059
3060 impl GetOperation {
3061 pub(crate) fn new(
3062 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
3063 ) -> Self {
3064 Self(RequestBuilder::new(stub))
3065 }
3066
3067 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3069 mut self,
3070 v: V,
3071 ) -> Self {
3072 self.0.request = v.into();
3073 self
3074 }
3075
3076 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3078 self.0.options = v.into();
3079 self
3080 }
3081
3082 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3084 (*self.0.stub)
3085 .get_operation(self.0.request, self.0.options)
3086 .await
3087 .map(crate::Response::into_body)
3088 }
3089
3090 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3092 self.0.request.name = v.into();
3093 self
3094 }
3095 }
3096
3097 #[doc(hidden)]
3098 impl crate::RequestBuilder for GetOperation {
3099 fn request_options(&mut self) -> &mut crate::RequestOptions {
3100 &mut self.0.options
3101 }
3102 }
3103
3104 #[derive(Clone, Debug)]
3121 pub struct DeleteOperation(
3122 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3123 );
3124
3125 impl DeleteOperation {
3126 pub(crate) fn new(
3127 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
3128 ) -> Self {
3129 Self(RequestBuilder::new(stub))
3130 }
3131
3132 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3134 mut self,
3135 v: V,
3136 ) -> Self {
3137 self.0.request = v.into();
3138 self
3139 }
3140
3141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3143 self.0.options = v.into();
3144 self
3145 }
3146
3147 pub async fn send(self) -> Result<()> {
3149 (*self.0.stub)
3150 .delete_operation(self.0.request, self.0.options)
3151 .await
3152 .map(crate::Response::into_body)
3153 }
3154
3155 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3157 self.0.request.name = v.into();
3158 self
3159 }
3160 }
3161
3162 #[doc(hidden)]
3163 impl crate::RequestBuilder for DeleteOperation {
3164 fn request_options(&mut self) -> &mut crate::RequestOptions {
3165 &mut self.0.options
3166 }
3167 }
3168
3169 #[derive(Clone, Debug)]
3186 pub struct CancelOperation(
3187 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3188 );
3189
3190 impl CancelOperation {
3191 pub(crate) fn new(
3192 stub: std::sync::Arc<dyn super::super::stub::dynamic::EdgeNetwork>,
3193 ) -> Self {
3194 Self(RequestBuilder::new(stub))
3195 }
3196
3197 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3199 mut self,
3200 v: V,
3201 ) -> Self {
3202 self.0.request = v.into();
3203 self
3204 }
3205
3206 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3208 self.0.options = v.into();
3209 self
3210 }
3211
3212 pub async fn send(self) -> Result<()> {
3214 (*self.0.stub)
3215 .cancel_operation(self.0.request, self.0.options)
3216 .await
3217 .map(crate::Response::into_body)
3218 }
3219
3220 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3222 self.0.request.name = v.into();
3223 self
3224 }
3225 }
3226
3227 #[doc(hidden)]
3228 impl crate::RequestBuilder for CancelOperation {
3229 fn request_options(&mut self) -> &mut crate::RequestOptions {
3230 &mut self.0.options
3231 }
3232 }
3233}