1pub mod reachability_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::ReachabilityService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = ReachabilityService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListConnectivityTests(RequestBuilder<crate::model::ListConnectivityTestsRequest>);
96
97 impl ListConnectivityTests {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListConnectivityTestsRequest>>(
106 mut self,
107 v: V,
108 ) -> Self {
109 self.0.request = v.into();
110 self
111 }
112
113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
115 self.0.options = v.into();
116 self
117 }
118
119 pub async fn send(self) -> Result<crate::model::ListConnectivityTestsResponse> {
121 (*self.0.stub)
122 .list_connectivity_tests(self.0.request, self.0.options)
123 .await
124 .map(crate::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl google_cloud_gax::paginator::Paginator<
131 crate::model::ListConnectivityTestsResponse,
132 crate::Error,
133 > {
134 use std::clone::Clone;
135 let token = self.0.request.page_token.clone();
136 let execute = move |token: String| {
137 let mut builder = self.clone();
138 builder.0.request = builder.0.request.set_page_token(token);
139 builder.send()
140 };
141 google_cloud_gax::paginator::internal::new_paginator(token, execute)
142 }
143
144 pub fn by_item(
146 self,
147 ) -> impl google_cloud_gax::paginator::ItemPaginator<
148 crate::model::ListConnectivityTestsResponse,
149 crate::Error,
150 > {
151 use google_cloud_gax::paginator::Paginator;
152 self.by_page().items()
153 }
154
155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
159 self.0.request.parent = v.into();
160 self
161 }
162
163 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
165 self.0.request.page_size = v.into();
166 self
167 }
168
169 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.page_token = v.into();
172 self
173 }
174
175 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
177 self.0.request.filter = v.into();
178 self
179 }
180
181 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
183 self.0.request.order_by = v.into();
184 self
185 }
186 }
187
188 #[doc(hidden)]
189 impl crate::RequestBuilder for ListConnectivityTests {
190 fn request_options(&mut self) -> &mut crate::RequestOptions {
191 &mut self.0.options
192 }
193 }
194
195 #[derive(Clone, Debug)]
212 pub struct GetConnectivityTest(RequestBuilder<crate::model::GetConnectivityTestRequest>);
213
214 impl GetConnectivityTest {
215 pub(crate) fn new(
216 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
217 ) -> Self {
218 Self(RequestBuilder::new(stub))
219 }
220
221 pub fn with_request<V: Into<crate::model::GetConnectivityTestRequest>>(
223 mut self,
224 v: V,
225 ) -> Self {
226 self.0.request = v.into();
227 self
228 }
229
230 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
232 self.0.options = v.into();
233 self
234 }
235
236 pub async fn send(self) -> Result<crate::model::ConnectivityTest> {
238 (*self.0.stub)
239 .get_connectivity_test(self.0.request, self.0.options)
240 .await
241 .map(crate::Response::into_body)
242 }
243
244 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
248 self.0.request.name = v.into();
249 self
250 }
251 }
252
253 #[doc(hidden)]
254 impl crate::RequestBuilder for GetConnectivityTest {
255 fn request_options(&mut self) -> &mut crate::RequestOptions {
256 &mut self.0.options
257 }
258 }
259
260 #[derive(Clone, Debug)]
278 pub struct CreateConnectivityTest(RequestBuilder<crate::model::CreateConnectivityTestRequest>);
279
280 impl CreateConnectivityTest {
281 pub(crate) fn new(
282 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
283 ) -> Self {
284 Self(RequestBuilder::new(stub))
285 }
286
287 pub fn with_request<V: Into<crate::model::CreateConnectivityTestRequest>>(
289 mut self,
290 v: V,
291 ) -> Self {
292 self.0.request = v.into();
293 self
294 }
295
296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
298 self.0.options = v.into();
299 self
300 }
301
302 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
309 (*self.0.stub)
310 .create_connectivity_test(self.0.request, self.0.options)
311 .await
312 .map(crate::Response::into_body)
313 }
314
315 pub fn poller(
317 self,
318 ) -> impl google_cloud_lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
319 {
320 type Operation = google_cloud_lro::internal::Operation<
321 crate::model::ConnectivityTest,
322 crate::model::OperationMetadata,
323 >;
324 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
325 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
326 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
327 if let Some(ref mut details) = poller_options.tracing {
328 details.method_name = "google_cloud_networkmanagement_v1::client::ReachabilityService::create_connectivity_test::until_done";
329 }
330
331 let stub = self.0.stub.clone();
332 let mut options = self.0.options.clone();
333 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
334 let query = move |name| {
335 let stub = stub.clone();
336 let options = options.clone();
337 async {
338 let op = GetOperation::new(stub)
339 .set_name(name)
340 .with_options(options)
341 .send()
342 .await?;
343 Ok(Operation::new(op))
344 }
345 };
346
347 let start = move || async {
348 let op = self.send().await?;
349 Ok(Operation::new(op))
350 };
351
352 use google_cloud_lro::internal::PollerExt;
353 {
354 google_cloud_lro::internal::new_poller(
355 polling_error_policy,
356 polling_backoff_policy,
357 start,
358 query,
359 )
360 }
361 .with_options(poller_options)
362 }
363
364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
368 self.0.request.parent = v.into();
369 self
370 }
371
372 pub fn set_test_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
376 self.0.request.test_id = v.into();
377 self
378 }
379
380 pub fn set_resource<T>(mut self, v: T) -> Self
384 where
385 T: std::convert::Into<crate::model::ConnectivityTest>,
386 {
387 self.0.request.resource = std::option::Option::Some(v.into());
388 self
389 }
390
391 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
395 where
396 T: std::convert::Into<crate::model::ConnectivityTest>,
397 {
398 self.0.request.resource = v.map(|x| x.into());
399 self
400 }
401 }
402
403 #[doc(hidden)]
404 impl crate::RequestBuilder for CreateConnectivityTest {
405 fn request_options(&mut self) -> &mut crate::RequestOptions {
406 &mut self.0.options
407 }
408 }
409
410 #[derive(Clone, Debug)]
428 pub struct UpdateConnectivityTest(RequestBuilder<crate::model::UpdateConnectivityTestRequest>);
429
430 impl UpdateConnectivityTest {
431 pub(crate) fn new(
432 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
433 ) -> Self {
434 Self(RequestBuilder::new(stub))
435 }
436
437 pub fn with_request<V: Into<crate::model::UpdateConnectivityTestRequest>>(
439 mut self,
440 v: V,
441 ) -> Self {
442 self.0.request = v.into();
443 self
444 }
445
446 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
448 self.0.options = v.into();
449 self
450 }
451
452 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
459 (*self.0.stub)
460 .update_connectivity_test(self.0.request, self.0.options)
461 .await
462 .map(crate::Response::into_body)
463 }
464
465 pub fn poller(
467 self,
468 ) -> impl google_cloud_lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
469 {
470 type Operation = google_cloud_lro::internal::Operation<
471 crate::model::ConnectivityTest,
472 crate::model::OperationMetadata,
473 >;
474 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
475 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
476 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
477 if let Some(ref mut details) = poller_options.tracing {
478 details.method_name = "google_cloud_networkmanagement_v1::client::ReachabilityService::update_connectivity_test::until_done";
479 }
480
481 let stub = self.0.stub.clone();
482 let mut options = self.0.options.clone();
483 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
484 let query = move |name| {
485 let stub = stub.clone();
486 let options = options.clone();
487 async {
488 let op = GetOperation::new(stub)
489 .set_name(name)
490 .with_options(options)
491 .send()
492 .await?;
493 Ok(Operation::new(op))
494 }
495 };
496
497 let start = move || async {
498 let op = self.send().await?;
499 Ok(Operation::new(op))
500 };
501
502 use google_cloud_lro::internal::PollerExt;
503 {
504 google_cloud_lro::internal::new_poller(
505 polling_error_policy,
506 polling_backoff_policy,
507 start,
508 query,
509 )
510 }
511 .with_options(poller_options)
512 }
513
514 pub fn set_update_mask<T>(mut self, v: T) -> Self
518 where
519 T: std::convert::Into<wkt::FieldMask>,
520 {
521 self.0.request.update_mask = std::option::Option::Some(v.into());
522 self
523 }
524
525 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
529 where
530 T: std::convert::Into<wkt::FieldMask>,
531 {
532 self.0.request.update_mask = v.map(|x| x.into());
533 self
534 }
535
536 pub fn set_resource<T>(mut self, v: T) -> Self
540 where
541 T: std::convert::Into<crate::model::ConnectivityTest>,
542 {
543 self.0.request.resource = std::option::Option::Some(v.into());
544 self
545 }
546
547 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
551 where
552 T: std::convert::Into<crate::model::ConnectivityTest>,
553 {
554 self.0.request.resource = v.map(|x| x.into());
555 self
556 }
557 }
558
559 #[doc(hidden)]
560 impl crate::RequestBuilder for UpdateConnectivityTest {
561 fn request_options(&mut self) -> &mut crate::RequestOptions {
562 &mut self.0.options
563 }
564 }
565
566 #[derive(Clone, Debug)]
584 pub struct RerunConnectivityTest(RequestBuilder<crate::model::RerunConnectivityTestRequest>);
585
586 impl RerunConnectivityTest {
587 pub(crate) fn new(
588 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
589 ) -> Self {
590 Self(RequestBuilder::new(stub))
591 }
592
593 pub fn with_request<V: Into<crate::model::RerunConnectivityTestRequest>>(
595 mut self,
596 v: V,
597 ) -> Self {
598 self.0.request = v.into();
599 self
600 }
601
602 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
604 self.0.options = v.into();
605 self
606 }
607
608 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
615 (*self.0.stub)
616 .rerun_connectivity_test(self.0.request, self.0.options)
617 .await
618 .map(crate::Response::into_body)
619 }
620
621 pub fn poller(
623 self,
624 ) -> impl google_cloud_lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
625 {
626 type Operation = google_cloud_lro::internal::Operation<
627 crate::model::ConnectivityTest,
628 crate::model::OperationMetadata,
629 >;
630 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
631 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
632 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
633 if let Some(ref mut details) = poller_options.tracing {
634 details.method_name = "google_cloud_networkmanagement_v1::client::ReachabilityService::rerun_connectivity_test::until_done";
635 }
636
637 let stub = self.0.stub.clone();
638 let mut options = self.0.options.clone();
639 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
640 let query = move |name| {
641 let stub = stub.clone();
642 let options = options.clone();
643 async {
644 let op = GetOperation::new(stub)
645 .set_name(name)
646 .with_options(options)
647 .send()
648 .await?;
649 Ok(Operation::new(op))
650 }
651 };
652
653 let start = move || async {
654 let op = self.send().await?;
655 Ok(Operation::new(op))
656 };
657
658 use google_cloud_lro::internal::PollerExt;
659 {
660 google_cloud_lro::internal::new_poller(
661 polling_error_policy,
662 polling_backoff_policy,
663 start,
664 query,
665 )
666 }
667 .with_options(poller_options)
668 }
669
670 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
674 self.0.request.name = v.into();
675 self
676 }
677 }
678
679 #[doc(hidden)]
680 impl crate::RequestBuilder for RerunConnectivityTest {
681 fn request_options(&mut self) -> &mut crate::RequestOptions {
682 &mut self.0.options
683 }
684 }
685
686 #[derive(Clone, Debug)]
704 pub struct DeleteConnectivityTest(RequestBuilder<crate::model::DeleteConnectivityTestRequest>);
705
706 impl DeleteConnectivityTest {
707 pub(crate) fn new(
708 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
709 ) -> Self {
710 Self(RequestBuilder::new(stub))
711 }
712
713 pub fn with_request<V: Into<crate::model::DeleteConnectivityTestRequest>>(
715 mut self,
716 v: V,
717 ) -> Self {
718 self.0.request = v.into();
719 self
720 }
721
722 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
724 self.0.options = v.into();
725 self
726 }
727
728 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
735 (*self.0.stub)
736 .delete_connectivity_test(self.0.request, self.0.options)
737 .await
738 .map(crate::Response::into_body)
739 }
740
741 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
743 type Operation =
744 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
745 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
746 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
747 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
748 if let Some(ref mut details) = poller_options.tracing {
749 details.method_name = "google_cloud_networkmanagement_v1::client::ReachabilityService::delete_connectivity_test::until_done";
750 }
751
752 let stub = self.0.stub.clone();
753 let mut options = self.0.options.clone();
754 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
755 let query = move |name| {
756 let stub = stub.clone();
757 let options = options.clone();
758 async {
759 let op = GetOperation::new(stub)
760 .set_name(name)
761 .with_options(options)
762 .send()
763 .await?;
764 Ok(Operation::new(op))
765 }
766 };
767
768 let start = move || async {
769 let op = self.send().await?;
770 Ok(Operation::new(op))
771 };
772
773 use google_cloud_lro::internal::PollerExt;
774 {
775 google_cloud_lro::internal::new_unit_response_poller(
776 polling_error_policy,
777 polling_backoff_policy,
778 start,
779 query,
780 )
781 }
782 .with_options(poller_options)
783 }
784
785 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
789 self.0.request.name = v.into();
790 self
791 }
792 }
793
794 #[doc(hidden)]
795 impl crate::RequestBuilder for DeleteConnectivityTest {
796 fn request_options(&mut self) -> &mut crate::RequestOptions {
797 &mut self.0.options
798 }
799 }
800
801 #[derive(Clone, Debug)]
822 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
823
824 impl ListLocations {
825 pub(crate) fn new(
826 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
827 ) -> Self {
828 Self(RequestBuilder::new(stub))
829 }
830
831 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
833 mut self,
834 v: V,
835 ) -> Self {
836 self.0.request = v.into();
837 self
838 }
839
840 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
842 self.0.options = v.into();
843 self
844 }
845
846 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
848 (*self.0.stub)
849 .list_locations(self.0.request, self.0.options)
850 .await
851 .map(crate::Response::into_body)
852 }
853
854 pub fn by_page(
856 self,
857 ) -> impl google_cloud_gax::paginator::Paginator<
858 google_cloud_location::model::ListLocationsResponse,
859 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 google_cloud_location::model::ListLocationsResponse,
876 crate::Error,
877 > {
878 use google_cloud_gax::paginator::Paginator;
879 self.by_page().items()
880 }
881
882 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
884 self.0.request.name = v.into();
885 self
886 }
887
888 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
890 self.0.request.filter = v.into();
891 self
892 }
893
894 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
896 self.0.request.page_size = v.into();
897 self
898 }
899
900 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
902 self.0.request.page_token = v.into();
903 self
904 }
905 }
906
907 #[doc(hidden)]
908 impl crate::RequestBuilder for ListLocations {
909 fn request_options(&mut self) -> &mut crate::RequestOptions {
910 &mut self.0.options
911 }
912 }
913
914 #[derive(Clone, Debug)]
931 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
932
933 impl GetLocation {
934 pub(crate) fn new(
935 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
936 ) -> Self {
937 Self(RequestBuilder::new(stub))
938 }
939
940 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
942 mut self,
943 v: V,
944 ) -> Self {
945 self.0.request = v.into();
946 self
947 }
948
949 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
951 self.0.options = v.into();
952 self
953 }
954
955 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
957 (*self.0.stub)
958 .get_location(self.0.request, self.0.options)
959 .await
960 .map(crate::Response::into_body)
961 }
962
963 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
965 self.0.request.name = v.into();
966 self
967 }
968 }
969
970 #[doc(hidden)]
971 impl crate::RequestBuilder for GetLocation {
972 fn request_options(&mut self) -> &mut crate::RequestOptions {
973 &mut self.0.options
974 }
975 }
976
977 #[derive(Clone, Debug)]
994 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
995
996 impl SetIamPolicy {
997 pub(crate) fn new(
998 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
999 ) -> Self {
1000 Self(RequestBuilder::new(stub))
1001 }
1002
1003 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1005 mut self,
1006 v: V,
1007 ) -> Self {
1008 self.0.request = v.into();
1009 self
1010 }
1011
1012 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1014 self.0.options = v.into();
1015 self
1016 }
1017
1018 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1020 (*self.0.stub)
1021 .set_iam_policy(self.0.request, self.0.options)
1022 .await
1023 .map(crate::Response::into_body)
1024 }
1025
1026 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1030 self.0.request.resource = v.into();
1031 self
1032 }
1033
1034 pub fn set_policy<T>(mut self, v: T) -> Self
1038 where
1039 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1040 {
1041 self.0.request.policy = std::option::Option::Some(v.into());
1042 self
1043 }
1044
1045 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1049 where
1050 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1051 {
1052 self.0.request.policy = v.map(|x| x.into());
1053 self
1054 }
1055
1056 pub fn set_update_mask<T>(mut self, v: T) -> Self
1058 where
1059 T: std::convert::Into<wkt::FieldMask>,
1060 {
1061 self.0.request.update_mask = std::option::Option::Some(v.into());
1062 self
1063 }
1064
1065 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1067 where
1068 T: std::convert::Into<wkt::FieldMask>,
1069 {
1070 self.0.request.update_mask = v.map(|x| x.into());
1071 self
1072 }
1073 }
1074
1075 #[doc(hidden)]
1076 impl crate::RequestBuilder for SetIamPolicy {
1077 fn request_options(&mut self) -> &mut crate::RequestOptions {
1078 &mut self.0.options
1079 }
1080 }
1081
1082 #[derive(Clone, Debug)]
1099 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1100
1101 impl GetIamPolicy {
1102 pub(crate) fn new(
1103 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1104 ) -> Self {
1105 Self(RequestBuilder::new(stub))
1106 }
1107
1108 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1110 mut self,
1111 v: V,
1112 ) -> Self {
1113 self.0.request = v.into();
1114 self
1115 }
1116
1117 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1119 self.0.options = v.into();
1120 self
1121 }
1122
1123 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1125 (*self.0.stub)
1126 .get_iam_policy(self.0.request, self.0.options)
1127 .await
1128 .map(crate::Response::into_body)
1129 }
1130
1131 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1135 self.0.request.resource = v.into();
1136 self
1137 }
1138
1139 pub fn set_options<T>(mut self, v: T) -> Self
1141 where
1142 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1143 {
1144 self.0.request.options = std::option::Option::Some(v.into());
1145 self
1146 }
1147
1148 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1150 where
1151 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1152 {
1153 self.0.request.options = v.map(|x| x.into());
1154 self
1155 }
1156 }
1157
1158 #[doc(hidden)]
1159 impl crate::RequestBuilder for GetIamPolicy {
1160 fn request_options(&mut self) -> &mut crate::RequestOptions {
1161 &mut self.0.options
1162 }
1163 }
1164
1165 #[derive(Clone, Debug)]
1182 pub struct TestIamPermissions(
1183 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1184 );
1185
1186 impl TestIamPermissions {
1187 pub(crate) fn new(
1188 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1189 ) -> Self {
1190 Self(RequestBuilder::new(stub))
1191 }
1192
1193 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1195 mut self,
1196 v: V,
1197 ) -> Self {
1198 self.0.request = v.into();
1199 self
1200 }
1201
1202 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1204 self.0.options = v.into();
1205 self
1206 }
1207
1208 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1210 (*self.0.stub)
1211 .test_iam_permissions(self.0.request, self.0.options)
1212 .await
1213 .map(crate::Response::into_body)
1214 }
1215
1216 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1220 self.0.request.resource = v.into();
1221 self
1222 }
1223
1224 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1228 where
1229 T: std::iter::IntoIterator<Item = V>,
1230 V: std::convert::Into<std::string::String>,
1231 {
1232 use std::iter::Iterator;
1233 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1234 self
1235 }
1236 }
1237
1238 #[doc(hidden)]
1239 impl crate::RequestBuilder for TestIamPermissions {
1240 fn request_options(&mut self) -> &mut crate::RequestOptions {
1241 &mut self.0.options
1242 }
1243 }
1244
1245 #[derive(Clone, Debug)]
1266 pub struct ListOperations(
1267 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1268 );
1269
1270 impl ListOperations {
1271 pub(crate) fn new(
1272 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1273 ) -> Self {
1274 Self(RequestBuilder::new(stub))
1275 }
1276
1277 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1279 mut self,
1280 v: V,
1281 ) -> Self {
1282 self.0.request = v.into();
1283 self
1284 }
1285
1286 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1288 self.0.options = v.into();
1289 self
1290 }
1291
1292 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1294 (*self.0.stub)
1295 .list_operations(self.0.request, self.0.options)
1296 .await
1297 .map(crate::Response::into_body)
1298 }
1299
1300 pub fn by_page(
1302 self,
1303 ) -> impl google_cloud_gax::paginator::Paginator<
1304 google_cloud_longrunning::model::ListOperationsResponse,
1305 crate::Error,
1306 > {
1307 use std::clone::Clone;
1308 let token = self.0.request.page_token.clone();
1309 let execute = move |token: String| {
1310 let mut builder = self.clone();
1311 builder.0.request = builder.0.request.set_page_token(token);
1312 builder.send()
1313 };
1314 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1315 }
1316
1317 pub fn by_item(
1319 self,
1320 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1321 google_cloud_longrunning::model::ListOperationsResponse,
1322 crate::Error,
1323 > {
1324 use google_cloud_gax::paginator::Paginator;
1325 self.by_page().items()
1326 }
1327
1328 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1330 self.0.request.name = v.into();
1331 self
1332 }
1333
1334 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.0.request.filter = v.into();
1337 self
1338 }
1339
1340 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1342 self.0.request.page_size = v.into();
1343 self
1344 }
1345
1346 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1348 self.0.request.page_token = v.into();
1349 self
1350 }
1351
1352 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1354 self.0.request.return_partial_success = v.into();
1355 self
1356 }
1357 }
1358
1359 #[doc(hidden)]
1360 impl crate::RequestBuilder for ListOperations {
1361 fn request_options(&mut self) -> &mut crate::RequestOptions {
1362 &mut self.0.options
1363 }
1364 }
1365
1366 #[derive(Clone, Debug)]
1383 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1384
1385 impl GetOperation {
1386 pub(crate) fn new(
1387 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1388 ) -> Self {
1389 Self(RequestBuilder::new(stub))
1390 }
1391
1392 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1394 mut self,
1395 v: V,
1396 ) -> Self {
1397 self.0.request = v.into();
1398 self
1399 }
1400
1401 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1403 self.0.options = v.into();
1404 self
1405 }
1406
1407 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1409 (*self.0.stub)
1410 .get_operation(self.0.request, self.0.options)
1411 .await
1412 .map(crate::Response::into_body)
1413 }
1414
1415 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1417 self.0.request.name = v.into();
1418 self
1419 }
1420 }
1421
1422 #[doc(hidden)]
1423 impl crate::RequestBuilder for GetOperation {
1424 fn request_options(&mut self) -> &mut crate::RequestOptions {
1425 &mut self.0.options
1426 }
1427 }
1428
1429 #[derive(Clone, Debug)]
1446 pub struct DeleteOperation(
1447 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
1448 );
1449
1450 impl DeleteOperation {
1451 pub(crate) fn new(
1452 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1453 ) -> Self {
1454 Self(RequestBuilder::new(stub))
1455 }
1456
1457 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
1459 mut self,
1460 v: V,
1461 ) -> Self {
1462 self.0.request = v.into();
1463 self
1464 }
1465
1466 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1468 self.0.options = v.into();
1469 self
1470 }
1471
1472 pub async fn send(self) -> Result<()> {
1474 (*self.0.stub)
1475 .delete_operation(self.0.request, self.0.options)
1476 .await
1477 .map(crate::Response::into_body)
1478 }
1479
1480 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1482 self.0.request.name = v.into();
1483 self
1484 }
1485 }
1486
1487 #[doc(hidden)]
1488 impl crate::RequestBuilder for DeleteOperation {
1489 fn request_options(&mut self) -> &mut crate::RequestOptions {
1490 &mut self.0.options
1491 }
1492 }
1493
1494 #[derive(Clone, Debug)]
1511 pub struct CancelOperation(
1512 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1513 );
1514
1515 impl CancelOperation {
1516 pub(crate) fn new(
1517 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1518 ) -> Self {
1519 Self(RequestBuilder::new(stub))
1520 }
1521
1522 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1524 mut self,
1525 v: V,
1526 ) -> Self {
1527 self.0.request = v.into();
1528 self
1529 }
1530
1531 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1533 self.0.options = v.into();
1534 self
1535 }
1536
1537 pub async fn send(self) -> Result<()> {
1539 (*self.0.stub)
1540 .cancel_operation(self.0.request, self.0.options)
1541 .await
1542 .map(crate::Response::into_body)
1543 }
1544
1545 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 crate::RequestBuilder for CancelOperation {
1554 fn request_options(&mut self) -> &mut crate::RequestOptions {
1555 &mut self.0.options
1556 }
1557 }
1558}
1559
1560pub mod vpc_flow_logs_service {
1562 use crate::Result;
1563
1564 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1578
1579 pub(crate) mod client {
1580 use super::super::super::client::VpcFlowLogsService;
1581 pub struct Factory;
1582 impl crate::ClientFactory for Factory {
1583 type Client = VpcFlowLogsService;
1584 type Credentials = gaxi::options::Credentials;
1585 async fn build(
1586 self,
1587 config: gaxi::options::ClientConfig,
1588 ) -> crate::ClientBuilderResult<Self::Client> {
1589 Self::Client::new(config).await
1590 }
1591 }
1592 }
1593
1594 #[derive(Clone, Debug)]
1596 pub(crate) struct RequestBuilder<R: std::default::Default> {
1597 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1598 request: R,
1599 options: crate::RequestOptions,
1600 }
1601
1602 impl<R> RequestBuilder<R>
1603 where
1604 R: std::default::Default,
1605 {
1606 pub(crate) fn new(
1607 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1608 ) -> Self {
1609 Self {
1610 stub,
1611 request: R::default(),
1612 options: crate::RequestOptions::default(),
1613 }
1614 }
1615 }
1616
1617 #[derive(Clone, Debug)]
1638 pub struct ListVpcFlowLogsConfigs(RequestBuilder<crate::model::ListVpcFlowLogsConfigsRequest>);
1639
1640 impl ListVpcFlowLogsConfigs {
1641 pub(crate) fn new(
1642 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1643 ) -> Self {
1644 Self(RequestBuilder::new(stub))
1645 }
1646
1647 pub fn with_request<V: Into<crate::model::ListVpcFlowLogsConfigsRequest>>(
1649 mut self,
1650 v: V,
1651 ) -> Self {
1652 self.0.request = v.into();
1653 self
1654 }
1655
1656 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1658 self.0.options = v.into();
1659 self
1660 }
1661
1662 pub async fn send(self) -> Result<crate::model::ListVpcFlowLogsConfigsResponse> {
1664 (*self.0.stub)
1665 .list_vpc_flow_logs_configs(self.0.request, self.0.options)
1666 .await
1667 .map(crate::Response::into_body)
1668 }
1669
1670 pub fn by_page(
1672 self,
1673 ) -> impl google_cloud_gax::paginator::Paginator<
1674 crate::model::ListVpcFlowLogsConfigsResponse,
1675 crate::Error,
1676 > {
1677 use std::clone::Clone;
1678 let token = self.0.request.page_token.clone();
1679 let execute = move |token: String| {
1680 let mut builder = self.clone();
1681 builder.0.request = builder.0.request.set_page_token(token);
1682 builder.send()
1683 };
1684 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1685 }
1686
1687 pub fn by_item(
1689 self,
1690 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1691 crate::model::ListVpcFlowLogsConfigsResponse,
1692 crate::Error,
1693 > {
1694 use google_cloud_gax::paginator::Paginator;
1695 self.by_page().items()
1696 }
1697
1698 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1702 self.0.request.parent = v.into();
1703 self
1704 }
1705
1706 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1708 self.0.request.page_size = v.into();
1709 self
1710 }
1711
1712 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1714 self.0.request.page_token = v.into();
1715 self
1716 }
1717
1718 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1720 self.0.request.filter = v.into();
1721 self
1722 }
1723
1724 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1726 self.0.request.order_by = v.into();
1727 self
1728 }
1729 }
1730
1731 #[doc(hidden)]
1732 impl crate::RequestBuilder for ListVpcFlowLogsConfigs {
1733 fn request_options(&mut self) -> &mut crate::RequestOptions {
1734 &mut self.0.options
1735 }
1736 }
1737
1738 #[derive(Clone, Debug)]
1755 pub struct GetVpcFlowLogsConfig(RequestBuilder<crate::model::GetVpcFlowLogsConfigRequest>);
1756
1757 impl GetVpcFlowLogsConfig {
1758 pub(crate) fn new(
1759 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1760 ) -> Self {
1761 Self(RequestBuilder::new(stub))
1762 }
1763
1764 pub fn with_request<V: Into<crate::model::GetVpcFlowLogsConfigRequest>>(
1766 mut self,
1767 v: V,
1768 ) -> Self {
1769 self.0.request = v.into();
1770 self
1771 }
1772
1773 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1775 self.0.options = v.into();
1776 self
1777 }
1778
1779 pub async fn send(self) -> Result<crate::model::VpcFlowLogsConfig> {
1781 (*self.0.stub)
1782 .get_vpc_flow_logs_config(self.0.request, self.0.options)
1783 .await
1784 .map(crate::Response::into_body)
1785 }
1786
1787 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1791 self.0.request.name = v.into();
1792 self
1793 }
1794 }
1795
1796 #[doc(hidden)]
1797 impl crate::RequestBuilder for GetVpcFlowLogsConfig {
1798 fn request_options(&mut self) -> &mut crate::RequestOptions {
1799 &mut self.0.options
1800 }
1801 }
1802
1803 #[derive(Clone, Debug)]
1821 pub struct CreateVpcFlowLogsConfig(
1822 RequestBuilder<crate::model::CreateVpcFlowLogsConfigRequest>,
1823 );
1824
1825 impl CreateVpcFlowLogsConfig {
1826 pub(crate) fn new(
1827 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1828 ) -> Self {
1829 Self(RequestBuilder::new(stub))
1830 }
1831
1832 pub fn with_request<V: Into<crate::model::CreateVpcFlowLogsConfigRequest>>(
1834 mut self,
1835 v: V,
1836 ) -> Self {
1837 self.0.request = v.into();
1838 self
1839 }
1840
1841 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1843 self.0.options = v.into();
1844 self
1845 }
1846
1847 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1854 (*self.0.stub)
1855 .create_vpc_flow_logs_config(self.0.request, self.0.options)
1856 .await
1857 .map(crate::Response::into_body)
1858 }
1859
1860 pub fn poller(
1862 self,
1863 ) -> impl google_cloud_lro::Poller<
1864 crate::model::VpcFlowLogsConfig,
1865 crate::model::OperationMetadata,
1866 > {
1867 type Operation = google_cloud_lro::internal::Operation<
1868 crate::model::VpcFlowLogsConfig,
1869 crate::model::OperationMetadata,
1870 >;
1871 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1872 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1873 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1874 if let Some(ref mut details) = poller_options.tracing {
1875 details.method_name = "google_cloud_networkmanagement_v1::client::VpcFlowLogsService::create_vpc_flow_logs_config::until_done";
1876 }
1877
1878 let stub = self.0.stub.clone();
1879 let mut options = self.0.options.clone();
1880 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1881 let query = move |name| {
1882 let stub = stub.clone();
1883 let options = options.clone();
1884 async {
1885 let op = GetOperation::new(stub)
1886 .set_name(name)
1887 .with_options(options)
1888 .send()
1889 .await?;
1890 Ok(Operation::new(op))
1891 }
1892 };
1893
1894 let start = move || async {
1895 let op = self.send().await?;
1896 Ok(Operation::new(op))
1897 };
1898
1899 use google_cloud_lro::internal::PollerExt;
1900 {
1901 google_cloud_lro::internal::new_poller(
1902 polling_error_policy,
1903 polling_backoff_policy,
1904 start,
1905 query,
1906 )
1907 }
1908 .with_options(poller_options)
1909 }
1910
1911 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1915 self.0.request.parent = v.into();
1916 self
1917 }
1918
1919 pub fn set_vpc_flow_logs_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1923 self.0.request.vpc_flow_logs_config_id = v.into();
1924 self
1925 }
1926
1927 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
1931 where
1932 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
1933 {
1934 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
1935 self
1936 }
1937
1938 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
1942 where
1943 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
1944 {
1945 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
1946 self
1947 }
1948 }
1949
1950 #[doc(hidden)]
1951 impl crate::RequestBuilder for CreateVpcFlowLogsConfig {
1952 fn request_options(&mut self) -> &mut crate::RequestOptions {
1953 &mut self.0.options
1954 }
1955 }
1956
1957 #[derive(Clone, Debug)]
1975 pub struct UpdateVpcFlowLogsConfig(
1976 RequestBuilder<crate::model::UpdateVpcFlowLogsConfigRequest>,
1977 );
1978
1979 impl UpdateVpcFlowLogsConfig {
1980 pub(crate) fn new(
1981 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1982 ) -> Self {
1983 Self(RequestBuilder::new(stub))
1984 }
1985
1986 pub fn with_request<V: Into<crate::model::UpdateVpcFlowLogsConfigRequest>>(
1988 mut self,
1989 v: V,
1990 ) -> Self {
1991 self.0.request = v.into();
1992 self
1993 }
1994
1995 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1997 self.0.options = v.into();
1998 self
1999 }
2000
2001 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2008 (*self.0.stub)
2009 .update_vpc_flow_logs_config(self.0.request, self.0.options)
2010 .await
2011 .map(crate::Response::into_body)
2012 }
2013
2014 pub fn poller(
2016 self,
2017 ) -> impl google_cloud_lro::Poller<
2018 crate::model::VpcFlowLogsConfig,
2019 crate::model::OperationMetadata,
2020 > {
2021 type Operation = google_cloud_lro::internal::Operation<
2022 crate::model::VpcFlowLogsConfig,
2023 crate::model::OperationMetadata,
2024 >;
2025 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2026 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2027 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2028 if let Some(ref mut details) = poller_options.tracing {
2029 details.method_name = "google_cloud_networkmanagement_v1::client::VpcFlowLogsService::update_vpc_flow_logs_config::until_done";
2030 }
2031
2032 let stub = self.0.stub.clone();
2033 let mut options = self.0.options.clone();
2034 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2035 let query = move |name| {
2036 let stub = stub.clone();
2037 let options = options.clone();
2038 async {
2039 let op = GetOperation::new(stub)
2040 .set_name(name)
2041 .with_options(options)
2042 .send()
2043 .await?;
2044 Ok(Operation::new(op))
2045 }
2046 };
2047
2048 let start = move || async {
2049 let op = self.send().await?;
2050 Ok(Operation::new(op))
2051 };
2052
2053 use google_cloud_lro::internal::PollerExt;
2054 {
2055 google_cloud_lro::internal::new_poller(
2056 polling_error_policy,
2057 polling_backoff_policy,
2058 start,
2059 query,
2060 )
2061 }
2062 .with_options(poller_options)
2063 }
2064
2065 pub fn set_update_mask<T>(mut self, v: T) -> Self
2069 where
2070 T: std::convert::Into<wkt::FieldMask>,
2071 {
2072 self.0.request.update_mask = std::option::Option::Some(v.into());
2073 self
2074 }
2075
2076 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2080 where
2081 T: std::convert::Into<wkt::FieldMask>,
2082 {
2083 self.0.request.update_mask = v.map(|x| x.into());
2084 self
2085 }
2086
2087 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
2091 where
2092 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
2093 {
2094 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
2095 self
2096 }
2097
2098 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
2102 where
2103 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
2104 {
2105 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
2106 self
2107 }
2108 }
2109
2110 #[doc(hidden)]
2111 impl crate::RequestBuilder for UpdateVpcFlowLogsConfig {
2112 fn request_options(&mut self) -> &mut crate::RequestOptions {
2113 &mut self.0.options
2114 }
2115 }
2116
2117 #[derive(Clone, Debug)]
2135 pub struct DeleteVpcFlowLogsConfig(
2136 RequestBuilder<crate::model::DeleteVpcFlowLogsConfigRequest>,
2137 );
2138
2139 impl DeleteVpcFlowLogsConfig {
2140 pub(crate) fn new(
2141 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2142 ) -> Self {
2143 Self(RequestBuilder::new(stub))
2144 }
2145
2146 pub fn with_request<V: Into<crate::model::DeleteVpcFlowLogsConfigRequest>>(
2148 mut self,
2149 v: V,
2150 ) -> Self {
2151 self.0.request = v.into();
2152 self
2153 }
2154
2155 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2157 self.0.options = v.into();
2158 self
2159 }
2160
2161 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2168 (*self.0.stub)
2169 .delete_vpc_flow_logs_config(self.0.request, self.0.options)
2170 .await
2171 .map(crate::Response::into_body)
2172 }
2173
2174 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2176 type Operation =
2177 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2178 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2179 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2180 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2181 if let Some(ref mut details) = poller_options.tracing {
2182 details.method_name = "google_cloud_networkmanagement_v1::client::VpcFlowLogsService::delete_vpc_flow_logs_config::until_done";
2183 }
2184
2185 let stub = self.0.stub.clone();
2186 let mut options = self.0.options.clone();
2187 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2188 let query = move |name| {
2189 let stub = stub.clone();
2190 let options = options.clone();
2191 async {
2192 let op = GetOperation::new(stub)
2193 .set_name(name)
2194 .with_options(options)
2195 .send()
2196 .await?;
2197 Ok(Operation::new(op))
2198 }
2199 };
2200
2201 let start = move || async {
2202 let op = self.send().await?;
2203 Ok(Operation::new(op))
2204 };
2205
2206 use google_cloud_lro::internal::PollerExt;
2207 {
2208 google_cloud_lro::internal::new_unit_response_poller(
2209 polling_error_policy,
2210 polling_backoff_policy,
2211 start,
2212 query,
2213 )
2214 }
2215 .with_options(poller_options)
2216 }
2217
2218 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2222 self.0.request.name = v.into();
2223 self
2224 }
2225 }
2226
2227 #[doc(hidden)]
2228 impl crate::RequestBuilder for DeleteVpcFlowLogsConfig {
2229 fn request_options(&mut self) -> &mut crate::RequestOptions {
2230 &mut self.0.options
2231 }
2232 }
2233
2234 #[derive(Clone, Debug)]
2255 pub struct QueryOrgVpcFlowLogsConfigs(
2256 RequestBuilder<crate::model::QueryOrgVpcFlowLogsConfigsRequest>,
2257 );
2258
2259 impl QueryOrgVpcFlowLogsConfigs {
2260 pub(crate) fn new(
2261 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2262 ) -> Self {
2263 Self(RequestBuilder::new(stub))
2264 }
2265
2266 pub fn with_request<V: Into<crate::model::QueryOrgVpcFlowLogsConfigsRequest>>(
2268 mut self,
2269 v: V,
2270 ) -> Self {
2271 self.0.request = v.into();
2272 self
2273 }
2274
2275 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2277 self.0.options = v.into();
2278 self
2279 }
2280
2281 pub async fn send(self) -> Result<crate::model::QueryOrgVpcFlowLogsConfigsResponse> {
2283 (*self.0.stub)
2284 .query_org_vpc_flow_logs_configs(self.0.request, self.0.options)
2285 .await
2286 .map(crate::Response::into_body)
2287 }
2288
2289 pub fn by_page(
2291 self,
2292 ) -> impl google_cloud_gax::paginator::Paginator<
2293 crate::model::QueryOrgVpcFlowLogsConfigsResponse,
2294 crate::Error,
2295 > {
2296 use std::clone::Clone;
2297 let token = self.0.request.page_token.clone();
2298 let execute = move |token: String| {
2299 let mut builder = self.clone();
2300 builder.0.request = builder.0.request.set_page_token(token);
2301 builder.send()
2302 };
2303 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2304 }
2305
2306 pub fn by_item(
2308 self,
2309 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2310 crate::model::QueryOrgVpcFlowLogsConfigsResponse,
2311 crate::Error,
2312 > {
2313 use google_cloud_gax::paginator::Paginator;
2314 self.by_page().items()
2315 }
2316
2317 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2321 self.0.request.parent = v.into();
2322 self
2323 }
2324
2325 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2327 self.0.request.page_size = v.into();
2328 self
2329 }
2330
2331 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2333 self.0.request.page_token = v.into();
2334 self
2335 }
2336
2337 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2339 self.0.request.filter = v.into();
2340 self
2341 }
2342 }
2343
2344 #[doc(hidden)]
2345 impl crate::RequestBuilder for QueryOrgVpcFlowLogsConfigs {
2346 fn request_options(&mut self) -> &mut crate::RequestOptions {
2347 &mut self.0.options
2348 }
2349 }
2350
2351 #[derive(Clone, Debug)]
2372 pub struct ShowEffectiveFlowLogsConfigs(
2373 RequestBuilder<crate::model::ShowEffectiveFlowLogsConfigsRequest>,
2374 );
2375
2376 impl ShowEffectiveFlowLogsConfigs {
2377 pub(crate) fn new(
2378 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2379 ) -> Self {
2380 Self(RequestBuilder::new(stub))
2381 }
2382
2383 pub fn with_request<V: Into<crate::model::ShowEffectiveFlowLogsConfigsRequest>>(
2385 mut self,
2386 v: V,
2387 ) -> Self {
2388 self.0.request = v.into();
2389 self
2390 }
2391
2392 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2394 self.0.options = v.into();
2395 self
2396 }
2397
2398 pub async fn send(self) -> Result<crate::model::ShowEffectiveFlowLogsConfigsResponse> {
2400 (*self.0.stub)
2401 .show_effective_flow_logs_configs(self.0.request, self.0.options)
2402 .await
2403 .map(crate::Response::into_body)
2404 }
2405
2406 pub fn by_page(
2408 self,
2409 ) -> impl google_cloud_gax::paginator::Paginator<
2410 crate::model::ShowEffectiveFlowLogsConfigsResponse,
2411 crate::Error,
2412 > {
2413 use std::clone::Clone;
2414 let token = self.0.request.page_token.clone();
2415 let execute = move |token: String| {
2416 let mut builder = self.clone();
2417 builder.0.request = builder.0.request.set_page_token(token);
2418 builder.send()
2419 };
2420 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2421 }
2422
2423 pub fn by_item(
2425 self,
2426 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2427 crate::model::ShowEffectiveFlowLogsConfigsResponse,
2428 crate::Error,
2429 > {
2430 use google_cloud_gax::paginator::Paginator;
2431 self.by_page().items()
2432 }
2433
2434 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2438 self.0.request.parent = v.into();
2439 self
2440 }
2441
2442 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2446 self.0.request.resource = v.into();
2447 self
2448 }
2449
2450 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2452 self.0.request.page_size = v.into();
2453 self
2454 }
2455
2456 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2458 self.0.request.page_token = v.into();
2459 self
2460 }
2461
2462 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2464 self.0.request.filter = v.into();
2465 self
2466 }
2467 }
2468
2469 #[doc(hidden)]
2470 impl crate::RequestBuilder for ShowEffectiveFlowLogsConfigs {
2471 fn request_options(&mut self) -> &mut crate::RequestOptions {
2472 &mut self.0.options
2473 }
2474 }
2475
2476 #[derive(Clone, Debug)]
2497 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2498
2499 impl ListLocations {
2500 pub(crate) fn new(
2501 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2502 ) -> Self {
2503 Self(RequestBuilder::new(stub))
2504 }
2505
2506 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2508 mut self,
2509 v: V,
2510 ) -> Self {
2511 self.0.request = v.into();
2512 self
2513 }
2514
2515 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2517 self.0.options = v.into();
2518 self
2519 }
2520
2521 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2523 (*self.0.stub)
2524 .list_locations(self.0.request, self.0.options)
2525 .await
2526 .map(crate::Response::into_body)
2527 }
2528
2529 pub fn by_page(
2531 self,
2532 ) -> impl google_cloud_gax::paginator::Paginator<
2533 google_cloud_location::model::ListLocationsResponse,
2534 crate::Error,
2535 > {
2536 use std::clone::Clone;
2537 let token = self.0.request.page_token.clone();
2538 let execute = move |token: String| {
2539 let mut builder = self.clone();
2540 builder.0.request = builder.0.request.set_page_token(token);
2541 builder.send()
2542 };
2543 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2544 }
2545
2546 pub fn by_item(
2548 self,
2549 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2550 google_cloud_location::model::ListLocationsResponse,
2551 crate::Error,
2552 > {
2553 use google_cloud_gax::paginator::Paginator;
2554 self.by_page().items()
2555 }
2556
2557 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2559 self.0.request.name = v.into();
2560 self
2561 }
2562
2563 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2565 self.0.request.filter = v.into();
2566 self
2567 }
2568
2569 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2571 self.0.request.page_size = v.into();
2572 self
2573 }
2574
2575 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2577 self.0.request.page_token = v.into();
2578 self
2579 }
2580 }
2581
2582 #[doc(hidden)]
2583 impl crate::RequestBuilder for ListLocations {
2584 fn request_options(&mut self) -> &mut crate::RequestOptions {
2585 &mut self.0.options
2586 }
2587 }
2588
2589 #[derive(Clone, Debug)]
2606 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2607
2608 impl GetLocation {
2609 pub(crate) fn new(
2610 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2611 ) -> Self {
2612 Self(RequestBuilder::new(stub))
2613 }
2614
2615 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2617 mut self,
2618 v: V,
2619 ) -> Self {
2620 self.0.request = v.into();
2621 self
2622 }
2623
2624 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2626 self.0.options = v.into();
2627 self
2628 }
2629
2630 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2632 (*self.0.stub)
2633 .get_location(self.0.request, self.0.options)
2634 .await
2635 .map(crate::Response::into_body)
2636 }
2637
2638 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2640 self.0.request.name = v.into();
2641 self
2642 }
2643 }
2644
2645 #[doc(hidden)]
2646 impl crate::RequestBuilder for GetLocation {
2647 fn request_options(&mut self) -> &mut crate::RequestOptions {
2648 &mut self.0.options
2649 }
2650 }
2651
2652 #[derive(Clone, Debug)]
2669 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2670
2671 impl SetIamPolicy {
2672 pub(crate) fn new(
2673 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2674 ) -> Self {
2675 Self(RequestBuilder::new(stub))
2676 }
2677
2678 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2680 mut self,
2681 v: V,
2682 ) -> Self {
2683 self.0.request = v.into();
2684 self
2685 }
2686
2687 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2689 self.0.options = v.into();
2690 self
2691 }
2692
2693 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2695 (*self.0.stub)
2696 .set_iam_policy(self.0.request, self.0.options)
2697 .await
2698 .map(crate::Response::into_body)
2699 }
2700
2701 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2705 self.0.request.resource = v.into();
2706 self
2707 }
2708
2709 pub fn set_policy<T>(mut self, v: T) -> Self
2713 where
2714 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2715 {
2716 self.0.request.policy = std::option::Option::Some(v.into());
2717 self
2718 }
2719
2720 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2724 where
2725 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2726 {
2727 self.0.request.policy = v.map(|x| x.into());
2728 self
2729 }
2730
2731 pub fn set_update_mask<T>(mut self, v: T) -> Self
2733 where
2734 T: std::convert::Into<wkt::FieldMask>,
2735 {
2736 self.0.request.update_mask = std::option::Option::Some(v.into());
2737 self
2738 }
2739
2740 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2742 where
2743 T: std::convert::Into<wkt::FieldMask>,
2744 {
2745 self.0.request.update_mask = v.map(|x| x.into());
2746 self
2747 }
2748 }
2749
2750 #[doc(hidden)]
2751 impl crate::RequestBuilder for SetIamPolicy {
2752 fn request_options(&mut self) -> &mut crate::RequestOptions {
2753 &mut self.0.options
2754 }
2755 }
2756
2757 #[derive(Clone, Debug)]
2774 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2775
2776 impl GetIamPolicy {
2777 pub(crate) fn new(
2778 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2779 ) -> Self {
2780 Self(RequestBuilder::new(stub))
2781 }
2782
2783 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2785 mut self,
2786 v: V,
2787 ) -> Self {
2788 self.0.request = v.into();
2789 self
2790 }
2791
2792 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2794 self.0.options = v.into();
2795 self
2796 }
2797
2798 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2800 (*self.0.stub)
2801 .get_iam_policy(self.0.request, self.0.options)
2802 .await
2803 .map(crate::Response::into_body)
2804 }
2805
2806 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2810 self.0.request.resource = v.into();
2811 self
2812 }
2813
2814 pub fn set_options<T>(mut self, v: T) -> Self
2816 where
2817 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2818 {
2819 self.0.request.options = std::option::Option::Some(v.into());
2820 self
2821 }
2822
2823 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2825 where
2826 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2827 {
2828 self.0.request.options = v.map(|x| x.into());
2829 self
2830 }
2831 }
2832
2833 #[doc(hidden)]
2834 impl crate::RequestBuilder for GetIamPolicy {
2835 fn request_options(&mut self) -> &mut crate::RequestOptions {
2836 &mut self.0.options
2837 }
2838 }
2839
2840 #[derive(Clone, Debug)]
2857 pub struct TestIamPermissions(
2858 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2859 );
2860
2861 impl TestIamPermissions {
2862 pub(crate) fn new(
2863 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2864 ) -> Self {
2865 Self(RequestBuilder::new(stub))
2866 }
2867
2868 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2870 mut self,
2871 v: V,
2872 ) -> Self {
2873 self.0.request = v.into();
2874 self
2875 }
2876
2877 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2879 self.0.options = v.into();
2880 self
2881 }
2882
2883 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2885 (*self.0.stub)
2886 .test_iam_permissions(self.0.request, self.0.options)
2887 .await
2888 .map(crate::Response::into_body)
2889 }
2890
2891 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2895 self.0.request.resource = v.into();
2896 self
2897 }
2898
2899 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2903 where
2904 T: std::iter::IntoIterator<Item = V>,
2905 V: std::convert::Into<std::string::String>,
2906 {
2907 use std::iter::Iterator;
2908 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2909 self
2910 }
2911 }
2912
2913 #[doc(hidden)]
2914 impl crate::RequestBuilder for TestIamPermissions {
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::VpcFlowLogsService>,
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::VpcFlowLogsService>,
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::VpcFlowLogsService>,
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::VpcFlowLogsService>,
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}
3234
3235pub mod organization_vpc_flow_logs_service {
3237 use crate::Result;
3238
3239 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3253
3254 pub(crate) mod client {
3255 use super::super::super::client::OrganizationVpcFlowLogsService;
3256 pub struct Factory;
3257 impl crate::ClientFactory for Factory {
3258 type Client = OrganizationVpcFlowLogsService;
3259 type Credentials = gaxi::options::Credentials;
3260 async fn build(
3261 self,
3262 config: gaxi::options::ClientConfig,
3263 ) -> crate::ClientBuilderResult<Self::Client> {
3264 Self::Client::new(config).await
3265 }
3266 }
3267 }
3268
3269 #[derive(Clone, Debug)]
3271 pub(crate) struct RequestBuilder<R: std::default::Default> {
3272 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3273 request: R,
3274 options: crate::RequestOptions,
3275 }
3276
3277 impl<R> RequestBuilder<R>
3278 where
3279 R: std::default::Default,
3280 {
3281 pub(crate) fn new(
3282 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3283 ) -> Self {
3284 Self {
3285 stub,
3286 request: R::default(),
3287 options: crate::RequestOptions::default(),
3288 }
3289 }
3290 }
3291
3292 #[derive(Clone, Debug)]
3313 pub struct ListVpcFlowLogsConfigs(RequestBuilder<crate::model::ListVpcFlowLogsConfigsRequest>);
3314
3315 impl ListVpcFlowLogsConfigs {
3316 pub(crate) fn new(
3317 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3318 ) -> Self {
3319 Self(RequestBuilder::new(stub))
3320 }
3321
3322 pub fn with_request<V: Into<crate::model::ListVpcFlowLogsConfigsRequest>>(
3324 mut self,
3325 v: V,
3326 ) -> Self {
3327 self.0.request = v.into();
3328 self
3329 }
3330
3331 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3333 self.0.options = v.into();
3334 self
3335 }
3336
3337 pub async fn send(self) -> Result<crate::model::ListVpcFlowLogsConfigsResponse> {
3339 (*self.0.stub)
3340 .list_vpc_flow_logs_configs(self.0.request, self.0.options)
3341 .await
3342 .map(crate::Response::into_body)
3343 }
3344
3345 pub fn by_page(
3347 self,
3348 ) -> impl google_cloud_gax::paginator::Paginator<
3349 crate::model::ListVpcFlowLogsConfigsResponse,
3350 crate::Error,
3351 > {
3352 use std::clone::Clone;
3353 let token = self.0.request.page_token.clone();
3354 let execute = move |token: String| {
3355 let mut builder = self.clone();
3356 builder.0.request = builder.0.request.set_page_token(token);
3357 builder.send()
3358 };
3359 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3360 }
3361
3362 pub fn by_item(
3364 self,
3365 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3366 crate::model::ListVpcFlowLogsConfigsResponse,
3367 crate::Error,
3368 > {
3369 use google_cloud_gax::paginator::Paginator;
3370 self.by_page().items()
3371 }
3372
3373 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3377 self.0.request.parent = v.into();
3378 self
3379 }
3380
3381 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3383 self.0.request.page_size = v.into();
3384 self
3385 }
3386
3387 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3389 self.0.request.page_token = v.into();
3390 self
3391 }
3392
3393 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3395 self.0.request.filter = v.into();
3396 self
3397 }
3398
3399 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3401 self.0.request.order_by = v.into();
3402 self
3403 }
3404 }
3405
3406 #[doc(hidden)]
3407 impl crate::RequestBuilder for ListVpcFlowLogsConfigs {
3408 fn request_options(&mut self) -> &mut crate::RequestOptions {
3409 &mut self.0.options
3410 }
3411 }
3412
3413 #[derive(Clone, Debug)]
3430 pub struct GetVpcFlowLogsConfig(RequestBuilder<crate::model::GetVpcFlowLogsConfigRequest>);
3431
3432 impl GetVpcFlowLogsConfig {
3433 pub(crate) fn new(
3434 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3435 ) -> Self {
3436 Self(RequestBuilder::new(stub))
3437 }
3438
3439 pub fn with_request<V: Into<crate::model::GetVpcFlowLogsConfigRequest>>(
3441 mut self,
3442 v: V,
3443 ) -> Self {
3444 self.0.request = v.into();
3445 self
3446 }
3447
3448 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3450 self.0.options = v.into();
3451 self
3452 }
3453
3454 pub async fn send(self) -> Result<crate::model::VpcFlowLogsConfig> {
3456 (*self.0.stub)
3457 .get_vpc_flow_logs_config(self.0.request, self.0.options)
3458 .await
3459 .map(crate::Response::into_body)
3460 }
3461
3462 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3466 self.0.request.name = v.into();
3467 self
3468 }
3469 }
3470
3471 #[doc(hidden)]
3472 impl crate::RequestBuilder for GetVpcFlowLogsConfig {
3473 fn request_options(&mut self) -> &mut crate::RequestOptions {
3474 &mut self.0.options
3475 }
3476 }
3477
3478 #[derive(Clone, Debug)]
3496 pub struct CreateVpcFlowLogsConfig(
3497 RequestBuilder<crate::model::CreateVpcFlowLogsConfigRequest>,
3498 );
3499
3500 impl CreateVpcFlowLogsConfig {
3501 pub(crate) fn new(
3502 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3503 ) -> Self {
3504 Self(RequestBuilder::new(stub))
3505 }
3506
3507 pub fn with_request<V: Into<crate::model::CreateVpcFlowLogsConfigRequest>>(
3509 mut self,
3510 v: V,
3511 ) -> Self {
3512 self.0.request = v.into();
3513 self
3514 }
3515
3516 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3518 self.0.options = v.into();
3519 self
3520 }
3521
3522 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3529 (*self.0.stub)
3530 .create_vpc_flow_logs_config(self.0.request, self.0.options)
3531 .await
3532 .map(crate::Response::into_body)
3533 }
3534
3535 pub fn poller(
3537 self,
3538 ) -> impl google_cloud_lro::Poller<
3539 crate::model::VpcFlowLogsConfig,
3540 crate::model::OperationMetadata,
3541 > {
3542 type Operation = google_cloud_lro::internal::Operation<
3543 crate::model::VpcFlowLogsConfig,
3544 crate::model::OperationMetadata,
3545 >;
3546 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3547 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3548 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3549 if let Some(ref mut details) = poller_options.tracing {
3550 details.method_name = "google_cloud_networkmanagement_v1::client::OrganizationVpcFlowLogsService::create_vpc_flow_logs_config::until_done";
3551 }
3552
3553 let stub = self.0.stub.clone();
3554 let mut options = self.0.options.clone();
3555 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3556 let query = move |name| {
3557 let stub = stub.clone();
3558 let options = options.clone();
3559 async {
3560 let op = GetOperation::new(stub)
3561 .set_name(name)
3562 .with_options(options)
3563 .send()
3564 .await?;
3565 Ok(Operation::new(op))
3566 }
3567 };
3568
3569 let start = move || async {
3570 let op = self.send().await?;
3571 Ok(Operation::new(op))
3572 };
3573
3574 use google_cloud_lro::internal::PollerExt;
3575 {
3576 google_cloud_lro::internal::new_poller(
3577 polling_error_policy,
3578 polling_backoff_policy,
3579 start,
3580 query,
3581 )
3582 }
3583 .with_options(poller_options)
3584 }
3585
3586 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3590 self.0.request.parent = v.into();
3591 self
3592 }
3593
3594 pub fn set_vpc_flow_logs_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3598 self.0.request.vpc_flow_logs_config_id = v.into();
3599 self
3600 }
3601
3602 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
3606 where
3607 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3608 {
3609 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
3610 self
3611 }
3612
3613 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
3617 where
3618 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3619 {
3620 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
3621 self
3622 }
3623 }
3624
3625 #[doc(hidden)]
3626 impl crate::RequestBuilder for CreateVpcFlowLogsConfig {
3627 fn request_options(&mut self) -> &mut crate::RequestOptions {
3628 &mut self.0.options
3629 }
3630 }
3631
3632 #[derive(Clone, Debug)]
3650 pub struct UpdateVpcFlowLogsConfig(
3651 RequestBuilder<crate::model::UpdateVpcFlowLogsConfigRequest>,
3652 );
3653
3654 impl UpdateVpcFlowLogsConfig {
3655 pub(crate) fn new(
3656 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3657 ) -> Self {
3658 Self(RequestBuilder::new(stub))
3659 }
3660
3661 pub fn with_request<V: Into<crate::model::UpdateVpcFlowLogsConfigRequest>>(
3663 mut self,
3664 v: V,
3665 ) -> Self {
3666 self.0.request = v.into();
3667 self
3668 }
3669
3670 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3672 self.0.options = v.into();
3673 self
3674 }
3675
3676 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3683 (*self.0.stub)
3684 .update_vpc_flow_logs_config(self.0.request, self.0.options)
3685 .await
3686 .map(crate::Response::into_body)
3687 }
3688
3689 pub fn poller(
3691 self,
3692 ) -> impl google_cloud_lro::Poller<
3693 crate::model::VpcFlowLogsConfig,
3694 crate::model::OperationMetadata,
3695 > {
3696 type Operation = google_cloud_lro::internal::Operation<
3697 crate::model::VpcFlowLogsConfig,
3698 crate::model::OperationMetadata,
3699 >;
3700 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3701 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3702 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3703 if let Some(ref mut details) = poller_options.tracing {
3704 details.method_name = "google_cloud_networkmanagement_v1::client::OrganizationVpcFlowLogsService::update_vpc_flow_logs_config::until_done";
3705 }
3706
3707 let stub = self.0.stub.clone();
3708 let mut options = self.0.options.clone();
3709 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3710 let query = move |name| {
3711 let stub = stub.clone();
3712 let options = options.clone();
3713 async {
3714 let op = GetOperation::new(stub)
3715 .set_name(name)
3716 .with_options(options)
3717 .send()
3718 .await?;
3719 Ok(Operation::new(op))
3720 }
3721 };
3722
3723 let start = move || async {
3724 let op = self.send().await?;
3725 Ok(Operation::new(op))
3726 };
3727
3728 use google_cloud_lro::internal::PollerExt;
3729 {
3730 google_cloud_lro::internal::new_poller(
3731 polling_error_policy,
3732 polling_backoff_policy,
3733 start,
3734 query,
3735 )
3736 }
3737 .with_options(poller_options)
3738 }
3739
3740 pub fn set_update_mask<T>(mut self, v: T) -> Self
3744 where
3745 T: std::convert::Into<wkt::FieldMask>,
3746 {
3747 self.0.request.update_mask = std::option::Option::Some(v.into());
3748 self
3749 }
3750
3751 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3755 where
3756 T: std::convert::Into<wkt::FieldMask>,
3757 {
3758 self.0.request.update_mask = v.map(|x| x.into());
3759 self
3760 }
3761
3762 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
3766 where
3767 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3768 {
3769 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
3770 self
3771 }
3772
3773 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
3777 where
3778 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3779 {
3780 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
3781 self
3782 }
3783 }
3784
3785 #[doc(hidden)]
3786 impl crate::RequestBuilder for UpdateVpcFlowLogsConfig {
3787 fn request_options(&mut self) -> &mut crate::RequestOptions {
3788 &mut self.0.options
3789 }
3790 }
3791
3792 #[derive(Clone, Debug)]
3810 pub struct DeleteVpcFlowLogsConfig(
3811 RequestBuilder<crate::model::DeleteVpcFlowLogsConfigRequest>,
3812 );
3813
3814 impl DeleteVpcFlowLogsConfig {
3815 pub(crate) fn new(
3816 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3817 ) -> Self {
3818 Self(RequestBuilder::new(stub))
3819 }
3820
3821 pub fn with_request<V: Into<crate::model::DeleteVpcFlowLogsConfigRequest>>(
3823 mut self,
3824 v: V,
3825 ) -> Self {
3826 self.0.request = v.into();
3827 self
3828 }
3829
3830 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3832 self.0.options = v.into();
3833 self
3834 }
3835
3836 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3843 (*self.0.stub)
3844 .delete_vpc_flow_logs_config(self.0.request, self.0.options)
3845 .await
3846 .map(crate::Response::into_body)
3847 }
3848
3849 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3851 type Operation =
3852 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3853 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3854 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3855 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3856 if let Some(ref mut details) = poller_options.tracing {
3857 details.method_name = "google_cloud_networkmanagement_v1::client::OrganizationVpcFlowLogsService::delete_vpc_flow_logs_config::until_done";
3858 }
3859
3860 let stub = self.0.stub.clone();
3861 let mut options = self.0.options.clone();
3862 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3863 let query = move |name| {
3864 let stub = stub.clone();
3865 let options = options.clone();
3866 async {
3867 let op = GetOperation::new(stub)
3868 .set_name(name)
3869 .with_options(options)
3870 .send()
3871 .await?;
3872 Ok(Operation::new(op))
3873 }
3874 };
3875
3876 let start = move || async {
3877 let op = self.send().await?;
3878 Ok(Operation::new(op))
3879 };
3880
3881 use google_cloud_lro::internal::PollerExt;
3882 {
3883 google_cloud_lro::internal::new_unit_response_poller(
3884 polling_error_policy,
3885 polling_backoff_policy,
3886 start,
3887 query,
3888 )
3889 }
3890 .with_options(poller_options)
3891 }
3892
3893 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3897 self.0.request.name = v.into();
3898 self
3899 }
3900 }
3901
3902 #[doc(hidden)]
3903 impl crate::RequestBuilder for DeleteVpcFlowLogsConfig {
3904 fn request_options(&mut self) -> &mut crate::RequestOptions {
3905 &mut self.0.options
3906 }
3907 }
3908
3909 #[derive(Clone, Debug)]
3930 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3931
3932 impl ListLocations {
3933 pub(crate) fn new(
3934 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3935 ) -> Self {
3936 Self(RequestBuilder::new(stub))
3937 }
3938
3939 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3941 mut self,
3942 v: V,
3943 ) -> Self {
3944 self.0.request = v.into();
3945 self
3946 }
3947
3948 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3950 self.0.options = v.into();
3951 self
3952 }
3953
3954 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3956 (*self.0.stub)
3957 .list_locations(self.0.request, self.0.options)
3958 .await
3959 .map(crate::Response::into_body)
3960 }
3961
3962 pub fn by_page(
3964 self,
3965 ) -> impl google_cloud_gax::paginator::Paginator<
3966 google_cloud_location::model::ListLocationsResponse,
3967 crate::Error,
3968 > {
3969 use std::clone::Clone;
3970 let token = self.0.request.page_token.clone();
3971 let execute = move |token: String| {
3972 let mut builder = self.clone();
3973 builder.0.request = builder.0.request.set_page_token(token);
3974 builder.send()
3975 };
3976 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3977 }
3978
3979 pub fn by_item(
3981 self,
3982 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3983 google_cloud_location::model::ListLocationsResponse,
3984 crate::Error,
3985 > {
3986 use google_cloud_gax::paginator::Paginator;
3987 self.by_page().items()
3988 }
3989
3990 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3992 self.0.request.name = v.into();
3993 self
3994 }
3995
3996 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3998 self.0.request.filter = v.into();
3999 self
4000 }
4001
4002 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4004 self.0.request.page_size = v.into();
4005 self
4006 }
4007
4008 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4010 self.0.request.page_token = v.into();
4011 self
4012 }
4013 }
4014
4015 #[doc(hidden)]
4016 impl crate::RequestBuilder for ListLocations {
4017 fn request_options(&mut self) -> &mut crate::RequestOptions {
4018 &mut self.0.options
4019 }
4020 }
4021
4022 #[derive(Clone, Debug)]
4039 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4040
4041 impl GetLocation {
4042 pub(crate) fn new(
4043 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4044 ) -> Self {
4045 Self(RequestBuilder::new(stub))
4046 }
4047
4048 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4050 mut self,
4051 v: V,
4052 ) -> Self {
4053 self.0.request = v.into();
4054 self
4055 }
4056
4057 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4059 self.0.options = v.into();
4060 self
4061 }
4062
4063 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4065 (*self.0.stub)
4066 .get_location(self.0.request, self.0.options)
4067 .await
4068 .map(crate::Response::into_body)
4069 }
4070
4071 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4073 self.0.request.name = v.into();
4074 self
4075 }
4076 }
4077
4078 #[doc(hidden)]
4079 impl crate::RequestBuilder for GetLocation {
4080 fn request_options(&mut self) -> &mut crate::RequestOptions {
4081 &mut self.0.options
4082 }
4083 }
4084
4085 #[derive(Clone, Debug)]
4102 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4103
4104 impl SetIamPolicy {
4105 pub(crate) fn new(
4106 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4107 ) -> Self {
4108 Self(RequestBuilder::new(stub))
4109 }
4110
4111 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4113 mut self,
4114 v: V,
4115 ) -> Self {
4116 self.0.request = v.into();
4117 self
4118 }
4119
4120 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4122 self.0.options = v.into();
4123 self
4124 }
4125
4126 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4128 (*self.0.stub)
4129 .set_iam_policy(self.0.request, self.0.options)
4130 .await
4131 .map(crate::Response::into_body)
4132 }
4133
4134 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4138 self.0.request.resource = v.into();
4139 self
4140 }
4141
4142 pub fn set_policy<T>(mut self, v: T) -> Self
4146 where
4147 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4148 {
4149 self.0.request.policy = std::option::Option::Some(v.into());
4150 self
4151 }
4152
4153 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4157 where
4158 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4159 {
4160 self.0.request.policy = v.map(|x| x.into());
4161 self
4162 }
4163
4164 pub fn set_update_mask<T>(mut self, v: T) -> Self
4166 where
4167 T: std::convert::Into<wkt::FieldMask>,
4168 {
4169 self.0.request.update_mask = std::option::Option::Some(v.into());
4170 self
4171 }
4172
4173 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4175 where
4176 T: std::convert::Into<wkt::FieldMask>,
4177 {
4178 self.0.request.update_mask = v.map(|x| x.into());
4179 self
4180 }
4181 }
4182
4183 #[doc(hidden)]
4184 impl crate::RequestBuilder for SetIamPolicy {
4185 fn request_options(&mut self) -> &mut crate::RequestOptions {
4186 &mut self.0.options
4187 }
4188 }
4189
4190 #[derive(Clone, Debug)]
4207 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4208
4209 impl GetIamPolicy {
4210 pub(crate) fn new(
4211 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4212 ) -> Self {
4213 Self(RequestBuilder::new(stub))
4214 }
4215
4216 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4218 mut self,
4219 v: V,
4220 ) -> Self {
4221 self.0.request = v.into();
4222 self
4223 }
4224
4225 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4227 self.0.options = v.into();
4228 self
4229 }
4230
4231 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4233 (*self.0.stub)
4234 .get_iam_policy(self.0.request, self.0.options)
4235 .await
4236 .map(crate::Response::into_body)
4237 }
4238
4239 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4243 self.0.request.resource = v.into();
4244 self
4245 }
4246
4247 pub fn set_options<T>(mut self, v: T) -> Self
4249 where
4250 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4251 {
4252 self.0.request.options = std::option::Option::Some(v.into());
4253 self
4254 }
4255
4256 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4258 where
4259 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4260 {
4261 self.0.request.options = v.map(|x| x.into());
4262 self
4263 }
4264 }
4265
4266 #[doc(hidden)]
4267 impl crate::RequestBuilder for GetIamPolicy {
4268 fn request_options(&mut self) -> &mut crate::RequestOptions {
4269 &mut self.0.options
4270 }
4271 }
4272
4273 #[derive(Clone, Debug)]
4290 pub struct TestIamPermissions(
4291 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4292 );
4293
4294 impl TestIamPermissions {
4295 pub(crate) fn new(
4296 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4297 ) -> Self {
4298 Self(RequestBuilder::new(stub))
4299 }
4300
4301 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4303 mut self,
4304 v: V,
4305 ) -> Self {
4306 self.0.request = v.into();
4307 self
4308 }
4309
4310 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4312 self.0.options = v.into();
4313 self
4314 }
4315
4316 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4318 (*self.0.stub)
4319 .test_iam_permissions(self.0.request, self.0.options)
4320 .await
4321 .map(crate::Response::into_body)
4322 }
4323
4324 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4328 self.0.request.resource = v.into();
4329 self
4330 }
4331
4332 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4336 where
4337 T: std::iter::IntoIterator<Item = V>,
4338 V: std::convert::Into<std::string::String>,
4339 {
4340 use std::iter::Iterator;
4341 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4342 self
4343 }
4344 }
4345
4346 #[doc(hidden)]
4347 impl crate::RequestBuilder for TestIamPermissions {
4348 fn request_options(&mut self) -> &mut crate::RequestOptions {
4349 &mut self.0.options
4350 }
4351 }
4352
4353 #[derive(Clone, Debug)]
4374 pub struct ListOperations(
4375 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4376 );
4377
4378 impl ListOperations {
4379 pub(crate) fn new(
4380 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4381 ) -> Self {
4382 Self(RequestBuilder::new(stub))
4383 }
4384
4385 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4387 mut self,
4388 v: V,
4389 ) -> Self {
4390 self.0.request = v.into();
4391 self
4392 }
4393
4394 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4396 self.0.options = v.into();
4397 self
4398 }
4399
4400 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4402 (*self.0.stub)
4403 .list_operations(self.0.request, self.0.options)
4404 .await
4405 .map(crate::Response::into_body)
4406 }
4407
4408 pub fn by_page(
4410 self,
4411 ) -> impl google_cloud_gax::paginator::Paginator<
4412 google_cloud_longrunning::model::ListOperationsResponse,
4413 crate::Error,
4414 > {
4415 use std::clone::Clone;
4416 let token = self.0.request.page_token.clone();
4417 let execute = move |token: String| {
4418 let mut builder = self.clone();
4419 builder.0.request = builder.0.request.set_page_token(token);
4420 builder.send()
4421 };
4422 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4423 }
4424
4425 pub fn by_item(
4427 self,
4428 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4429 google_cloud_longrunning::model::ListOperationsResponse,
4430 crate::Error,
4431 > {
4432 use google_cloud_gax::paginator::Paginator;
4433 self.by_page().items()
4434 }
4435
4436 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4438 self.0.request.name = v.into();
4439 self
4440 }
4441
4442 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4444 self.0.request.filter = v.into();
4445 self
4446 }
4447
4448 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4450 self.0.request.page_size = v.into();
4451 self
4452 }
4453
4454 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4456 self.0.request.page_token = v.into();
4457 self
4458 }
4459
4460 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4462 self.0.request.return_partial_success = v.into();
4463 self
4464 }
4465 }
4466
4467 #[doc(hidden)]
4468 impl crate::RequestBuilder for ListOperations {
4469 fn request_options(&mut self) -> &mut crate::RequestOptions {
4470 &mut self.0.options
4471 }
4472 }
4473
4474 #[derive(Clone, Debug)]
4491 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4492
4493 impl GetOperation {
4494 pub(crate) fn new(
4495 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4496 ) -> Self {
4497 Self(RequestBuilder::new(stub))
4498 }
4499
4500 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4502 mut self,
4503 v: V,
4504 ) -> Self {
4505 self.0.request = v.into();
4506 self
4507 }
4508
4509 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4511 self.0.options = v.into();
4512 self
4513 }
4514
4515 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4517 (*self.0.stub)
4518 .get_operation(self.0.request, self.0.options)
4519 .await
4520 .map(crate::Response::into_body)
4521 }
4522
4523 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4525 self.0.request.name = v.into();
4526 self
4527 }
4528 }
4529
4530 #[doc(hidden)]
4531 impl crate::RequestBuilder for GetOperation {
4532 fn request_options(&mut self) -> &mut crate::RequestOptions {
4533 &mut self.0.options
4534 }
4535 }
4536
4537 #[derive(Clone, Debug)]
4554 pub struct DeleteOperation(
4555 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4556 );
4557
4558 impl DeleteOperation {
4559 pub(crate) fn new(
4560 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4561 ) -> Self {
4562 Self(RequestBuilder::new(stub))
4563 }
4564
4565 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4567 mut self,
4568 v: V,
4569 ) -> Self {
4570 self.0.request = v.into();
4571 self
4572 }
4573
4574 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4576 self.0.options = v.into();
4577 self
4578 }
4579
4580 pub async fn send(self) -> Result<()> {
4582 (*self.0.stub)
4583 .delete_operation(self.0.request, self.0.options)
4584 .await
4585 .map(crate::Response::into_body)
4586 }
4587
4588 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4590 self.0.request.name = v.into();
4591 self
4592 }
4593 }
4594
4595 #[doc(hidden)]
4596 impl crate::RequestBuilder for DeleteOperation {
4597 fn request_options(&mut self) -> &mut crate::RequestOptions {
4598 &mut self.0.options
4599 }
4600 }
4601
4602 #[derive(Clone, Debug)]
4619 pub struct CancelOperation(
4620 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4621 );
4622
4623 impl CancelOperation {
4624 pub(crate) fn new(
4625 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4626 ) -> Self {
4627 Self(RequestBuilder::new(stub))
4628 }
4629
4630 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4632 mut self,
4633 v: V,
4634 ) -> Self {
4635 self.0.request = v.into();
4636 self
4637 }
4638
4639 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4641 self.0.options = v.into();
4642 self
4643 }
4644
4645 pub async fn send(self) -> Result<()> {
4647 (*self.0.stub)
4648 .cancel_operation(self.0.request, self.0.options)
4649 .await
4650 .map(crate::Response::into_body)
4651 }
4652
4653 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4655 self.0.request.name = v.into();
4656 self
4657 }
4658 }
4659
4660 #[doc(hidden)]
4661 impl crate::RequestBuilder for CancelOperation {
4662 fn request_options(&mut self) -> &mut crate::RequestOptions {
4663 &mut self.0.options
4664 }
4665 }
4666}