1pub mod reachability_service {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::ReachabilityService;
38 pub struct Factory;
39 impl gax::client_builder::internal::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 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct 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<gax::options::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(gax::response::Response::into_body)
125 }
126
127 pub fn by_page(
129 self,
130 ) -> impl gax::paginator::Paginator<crate::model::ListConnectivityTestsResponse, gax::error::Error>
131 {
132 use std::clone::Clone;
133 let token = self.0.request.page_token.clone();
134 let execute = move |token: String| {
135 let mut builder = self.clone();
136 builder.0.request = builder.0.request.set_page_token(token);
137 builder.send()
138 };
139 gax::paginator::internal::new_paginator(token, execute)
140 }
141
142 pub fn by_item(
144 self,
145 ) -> impl gax::paginator::ItemPaginator<
146 crate::model::ListConnectivityTestsResponse,
147 gax::error::Error,
148 > {
149 use gax::paginator::Paginator;
150 self.by_page().items()
151 }
152
153 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
157 self.0.request.parent = v.into();
158 self
159 }
160
161 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
163 self.0.request.page_size = v.into();
164 self
165 }
166
167 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
169 self.0.request.page_token = v.into();
170 self
171 }
172
173 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
175 self.0.request.filter = v.into();
176 self
177 }
178
179 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
181 self.0.request.order_by = v.into();
182 self
183 }
184 }
185
186 #[doc(hidden)]
187 impl gax::options::internal::RequestBuilder for ListConnectivityTests {
188 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
189 &mut self.0.options
190 }
191 }
192
193 #[derive(Clone, Debug)]
210 pub struct GetConnectivityTest(RequestBuilder<crate::model::GetConnectivityTestRequest>);
211
212 impl GetConnectivityTest {
213 pub(crate) fn new(
214 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
215 ) -> Self {
216 Self(RequestBuilder::new(stub))
217 }
218
219 pub fn with_request<V: Into<crate::model::GetConnectivityTestRequest>>(
221 mut self,
222 v: V,
223 ) -> Self {
224 self.0.request = v.into();
225 self
226 }
227
228 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
230 self.0.options = v.into();
231 self
232 }
233
234 pub async fn send(self) -> Result<crate::model::ConnectivityTest> {
236 (*self.0.stub)
237 .get_connectivity_test(self.0.request, self.0.options)
238 .await
239 .map(gax::response::Response::into_body)
240 }
241
242 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
246 self.0.request.name = v.into();
247 self
248 }
249 }
250
251 #[doc(hidden)]
252 impl gax::options::internal::RequestBuilder for GetConnectivityTest {
253 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
254 &mut self.0.options
255 }
256 }
257
258 #[derive(Clone, Debug)]
276 pub struct CreateConnectivityTest(RequestBuilder<crate::model::CreateConnectivityTestRequest>);
277
278 impl CreateConnectivityTest {
279 pub(crate) fn new(
280 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
281 ) -> Self {
282 Self(RequestBuilder::new(stub))
283 }
284
285 pub fn with_request<V: Into<crate::model::CreateConnectivityTestRequest>>(
287 mut self,
288 v: V,
289 ) -> Self {
290 self.0.request = v.into();
291 self
292 }
293
294 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
296 self.0.options = v.into();
297 self
298 }
299
300 pub async fn send(self) -> Result<longrunning::model::Operation> {
307 (*self.0.stub)
308 .create_connectivity_test(self.0.request, self.0.options)
309 .await
310 .map(gax::response::Response::into_body)
311 }
312
313 pub fn poller(
315 self,
316 ) -> impl lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
317 {
318 type Operation = lro::internal::Operation<
319 crate::model::ConnectivityTest,
320 crate::model::OperationMetadata,
321 >;
322 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
323 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
324
325 let stub = self.0.stub.clone();
326 let mut options = self.0.options.clone();
327 options.set_retry_policy(gax::retry_policy::NeverRetry);
328 let query = move |name| {
329 let stub = stub.clone();
330 let options = options.clone();
331 async {
332 let op = GetOperation::new(stub)
333 .set_name(name)
334 .with_options(options)
335 .send()
336 .await?;
337 Ok(Operation::new(op))
338 }
339 };
340
341 let start = move || async {
342 let op = self.send().await?;
343 Ok(Operation::new(op))
344 };
345
346 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
347 }
348
349 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
353 self.0.request.parent = v.into();
354 self
355 }
356
357 pub fn set_test_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
361 self.0.request.test_id = v.into();
362 self
363 }
364
365 pub fn set_resource<T>(mut self, v: T) -> Self
369 where
370 T: std::convert::Into<crate::model::ConnectivityTest>,
371 {
372 self.0.request.resource = std::option::Option::Some(v.into());
373 self
374 }
375
376 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
380 where
381 T: std::convert::Into<crate::model::ConnectivityTest>,
382 {
383 self.0.request.resource = v.map(|x| x.into());
384 self
385 }
386 }
387
388 #[doc(hidden)]
389 impl gax::options::internal::RequestBuilder for CreateConnectivityTest {
390 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
391 &mut self.0.options
392 }
393 }
394
395 #[derive(Clone, Debug)]
413 pub struct UpdateConnectivityTest(RequestBuilder<crate::model::UpdateConnectivityTestRequest>);
414
415 impl UpdateConnectivityTest {
416 pub(crate) fn new(
417 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
418 ) -> Self {
419 Self(RequestBuilder::new(stub))
420 }
421
422 pub fn with_request<V: Into<crate::model::UpdateConnectivityTestRequest>>(
424 mut self,
425 v: V,
426 ) -> Self {
427 self.0.request = v.into();
428 self
429 }
430
431 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
433 self.0.options = v.into();
434 self
435 }
436
437 pub async fn send(self) -> Result<longrunning::model::Operation> {
444 (*self.0.stub)
445 .update_connectivity_test(self.0.request, self.0.options)
446 .await
447 .map(gax::response::Response::into_body)
448 }
449
450 pub fn poller(
452 self,
453 ) -> impl lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
454 {
455 type Operation = lro::internal::Operation<
456 crate::model::ConnectivityTest,
457 crate::model::OperationMetadata,
458 >;
459 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
460 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
461
462 let stub = self.0.stub.clone();
463 let mut options = self.0.options.clone();
464 options.set_retry_policy(gax::retry_policy::NeverRetry);
465 let query = move |name| {
466 let stub = stub.clone();
467 let options = options.clone();
468 async {
469 let op = GetOperation::new(stub)
470 .set_name(name)
471 .with_options(options)
472 .send()
473 .await?;
474 Ok(Operation::new(op))
475 }
476 };
477
478 let start = move || async {
479 let op = self.send().await?;
480 Ok(Operation::new(op))
481 };
482
483 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
484 }
485
486 pub fn set_update_mask<T>(mut self, v: T) -> Self
490 where
491 T: std::convert::Into<wkt::FieldMask>,
492 {
493 self.0.request.update_mask = std::option::Option::Some(v.into());
494 self
495 }
496
497 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
501 where
502 T: std::convert::Into<wkt::FieldMask>,
503 {
504 self.0.request.update_mask = v.map(|x| x.into());
505 self
506 }
507
508 pub fn set_resource<T>(mut self, v: T) -> Self
512 where
513 T: std::convert::Into<crate::model::ConnectivityTest>,
514 {
515 self.0.request.resource = std::option::Option::Some(v.into());
516 self
517 }
518
519 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
523 where
524 T: std::convert::Into<crate::model::ConnectivityTest>,
525 {
526 self.0.request.resource = v.map(|x| x.into());
527 self
528 }
529 }
530
531 #[doc(hidden)]
532 impl gax::options::internal::RequestBuilder for UpdateConnectivityTest {
533 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
534 &mut self.0.options
535 }
536 }
537
538 #[derive(Clone, Debug)]
556 pub struct RerunConnectivityTest(RequestBuilder<crate::model::RerunConnectivityTestRequest>);
557
558 impl RerunConnectivityTest {
559 pub(crate) fn new(
560 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
561 ) -> Self {
562 Self(RequestBuilder::new(stub))
563 }
564
565 pub fn with_request<V: Into<crate::model::RerunConnectivityTestRequest>>(
567 mut self,
568 v: V,
569 ) -> Self {
570 self.0.request = v.into();
571 self
572 }
573
574 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
576 self.0.options = v.into();
577 self
578 }
579
580 pub async fn send(self) -> Result<longrunning::model::Operation> {
587 (*self.0.stub)
588 .rerun_connectivity_test(self.0.request, self.0.options)
589 .await
590 .map(gax::response::Response::into_body)
591 }
592
593 pub fn poller(
595 self,
596 ) -> impl lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
597 {
598 type Operation = lro::internal::Operation<
599 crate::model::ConnectivityTest,
600 crate::model::OperationMetadata,
601 >;
602 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
603 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
604
605 let stub = self.0.stub.clone();
606 let mut options = self.0.options.clone();
607 options.set_retry_policy(gax::retry_policy::NeverRetry);
608 let query = move |name| {
609 let stub = stub.clone();
610 let options = options.clone();
611 async {
612 let op = GetOperation::new(stub)
613 .set_name(name)
614 .with_options(options)
615 .send()
616 .await?;
617 Ok(Operation::new(op))
618 }
619 };
620
621 let start = move || async {
622 let op = self.send().await?;
623 Ok(Operation::new(op))
624 };
625
626 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
627 }
628
629 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
633 self.0.request.name = v.into();
634 self
635 }
636 }
637
638 #[doc(hidden)]
639 impl gax::options::internal::RequestBuilder for RerunConnectivityTest {
640 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
641 &mut self.0.options
642 }
643 }
644
645 #[derive(Clone, Debug)]
663 pub struct DeleteConnectivityTest(RequestBuilder<crate::model::DeleteConnectivityTestRequest>);
664
665 impl DeleteConnectivityTest {
666 pub(crate) fn new(
667 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
668 ) -> Self {
669 Self(RequestBuilder::new(stub))
670 }
671
672 pub fn with_request<V: Into<crate::model::DeleteConnectivityTestRequest>>(
674 mut self,
675 v: V,
676 ) -> Self {
677 self.0.request = v.into();
678 self
679 }
680
681 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
683 self.0.options = v.into();
684 self
685 }
686
687 pub async fn send(self) -> Result<longrunning::model::Operation> {
694 (*self.0.stub)
695 .delete_connectivity_test(self.0.request, self.0.options)
696 .await
697 .map(gax::response::Response::into_body)
698 }
699
700 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
702 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
703 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
704 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
705
706 let stub = self.0.stub.clone();
707 let mut options = self.0.options.clone();
708 options.set_retry_policy(gax::retry_policy::NeverRetry);
709 let query = move |name| {
710 let stub = stub.clone();
711 let options = options.clone();
712 async {
713 let op = GetOperation::new(stub)
714 .set_name(name)
715 .with_options(options)
716 .send()
717 .await?;
718 Ok(Operation::new(op))
719 }
720 };
721
722 let start = move || async {
723 let op = self.send().await?;
724 Ok(Operation::new(op))
725 };
726
727 lro::internal::new_unit_response_poller(
728 polling_error_policy,
729 polling_backoff_policy,
730 start,
731 query,
732 )
733 }
734
735 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
739 self.0.request.name = v.into();
740 self
741 }
742 }
743
744 #[doc(hidden)]
745 impl gax::options::internal::RequestBuilder for DeleteConnectivityTest {
746 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
747 &mut self.0.options
748 }
749 }
750
751 #[derive(Clone, Debug)]
772 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
773
774 impl ListLocations {
775 pub(crate) fn new(
776 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
777 ) -> Self {
778 Self(RequestBuilder::new(stub))
779 }
780
781 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
783 mut self,
784 v: V,
785 ) -> Self {
786 self.0.request = v.into();
787 self
788 }
789
790 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
792 self.0.options = v.into();
793 self
794 }
795
796 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
798 (*self.0.stub)
799 .list_locations(self.0.request, self.0.options)
800 .await
801 .map(gax::response::Response::into_body)
802 }
803
804 pub fn by_page(
806 self,
807 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
808 {
809 use std::clone::Clone;
810 let token = self.0.request.page_token.clone();
811 let execute = move |token: String| {
812 let mut builder = self.clone();
813 builder.0.request = builder.0.request.set_page_token(token);
814 builder.send()
815 };
816 gax::paginator::internal::new_paginator(token, execute)
817 }
818
819 pub fn by_item(
821 self,
822 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
823 {
824 use gax::paginator::Paginator;
825 self.by_page().items()
826 }
827
828 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
830 self.0.request.name = v.into();
831 self
832 }
833
834 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
836 self.0.request.filter = v.into();
837 self
838 }
839
840 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
842 self.0.request.page_size = v.into();
843 self
844 }
845
846 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
848 self.0.request.page_token = v.into();
849 self
850 }
851 }
852
853 #[doc(hidden)]
854 impl gax::options::internal::RequestBuilder for ListLocations {
855 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
856 &mut self.0.options
857 }
858 }
859
860 #[derive(Clone, Debug)]
877 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
878
879 impl GetLocation {
880 pub(crate) fn new(
881 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
882 ) -> Self {
883 Self(RequestBuilder::new(stub))
884 }
885
886 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
888 self.0.request = v.into();
889 self
890 }
891
892 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
894 self.0.options = v.into();
895 self
896 }
897
898 pub async fn send(self) -> Result<location::model::Location> {
900 (*self.0.stub)
901 .get_location(self.0.request, self.0.options)
902 .await
903 .map(gax::response::Response::into_body)
904 }
905
906 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
908 self.0.request.name = v.into();
909 self
910 }
911 }
912
913 #[doc(hidden)]
914 impl gax::options::internal::RequestBuilder for GetLocation {
915 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
916 &mut self.0.options
917 }
918 }
919
920 #[derive(Clone, Debug)]
937 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
938
939 impl SetIamPolicy {
940 pub(crate) fn new(
941 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
942 ) -> Self {
943 Self(RequestBuilder::new(stub))
944 }
945
946 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
948 self.0.request = v.into();
949 self
950 }
951
952 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
954 self.0.options = v.into();
955 self
956 }
957
958 pub async fn send(self) -> Result<iam_v1::model::Policy> {
960 (*self.0.stub)
961 .set_iam_policy(self.0.request, self.0.options)
962 .await
963 .map(gax::response::Response::into_body)
964 }
965
966 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
970 self.0.request.resource = v.into();
971 self
972 }
973
974 pub fn set_policy<T>(mut self, v: T) -> Self
978 where
979 T: std::convert::Into<iam_v1::model::Policy>,
980 {
981 self.0.request.policy = std::option::Option::Some(v.into());
982 self
983 }
984
985 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
989 where
990 T: std::convert::Into<iam_v1::model::Policy>,
991 {
992 self.0.request.policy = v.map(|x| x.into());
993 self
994 }
995
996 pub fn set_update_mask<T>(mut self, v: T) -> Self
998 where
999 T: std::convert::Into<wkt::FieldMask>,
1000 {
1001 self.0.request.update_mask = std::option::Option::Some(v.into());
1002 self
1003 }
1004
1005 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1007 where
1008 T: std::convert::Into<wkt::FieldMask>,
1009 {
1010 self.0.request.update_mask = v.map(|x| x.into());
1011 self
1012 }
1013 }
1014
1015 #[doc(hidden)]
1016 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1017 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1018 &mut self.0.options
1019 }
1020 }
1021
1022 #[derive(Clone, Debug)]
1039 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1040
1041 impl GetIamPolicy {
1042 pub(crate) fn new(
1043 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1044 ) -> Self {
1045 Self(RequestBuilder::new(stub))
1046 }
1047
1048 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1050 self.0.request = v.into();
1051 self
1052 }
1053
1054 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1056 self.0.options = v.into();
1057 self
1058 }
1059
1060 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1062 (*self.0.stub)
1063 .get_iam_policy(self.0.request, self.0.options)
1064 .await
1065 .map(gax::response::Response::into_body)
1066 }
1067
1068 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1072 self.0.request.resource = v.into();
1073 self
1074 }
1075
1076 pub fn set_options<T>(mut self, v: T) -> Self
1078 where
1079 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1080 {
1081 self.0.request.options = std::option::Option::Some(v.into());
1082 self
1083 }
1084
1085 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1087 where
1088 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1089 {
1090 self.0.request.options = v.map(|x| x.into());
1091 self
1092 }
1093 }
1094
1095 #[doc(hidden)]
1096 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1097 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1098 &mut self.0.options
1099 }
1100 }
1101
1102 #[derive(Clone, Debug)]
1119 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1120
1121 impl TestIamPermissions {
1122 pub(crate) fn new(
1123 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1124 ) -> Self {
1125 Self(RequestBuilder::new(stub))
1126 }
1127
1128 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1130 mut self,
1131 v: V,
1132 ) -> Self {
1133 self.0.request = v.into();
1134 self
1135 }
1136
1137 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1139 self.0.options = v.into();
1140 self
1141 }
1142
1143 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1145 (*self.0.stub)
1146 .test_iam_permissions(self.0.request, self.0.options)
1147 .await
1148 .map(gax::response::Response::into_body)
1149 }
1150
1151 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1155 self.0.request.resource = v.into();
1156 self
1157 }
1158
1159 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1163 where
1164 T: std::iter::IntoIterator<Item = V>,
1165 V: std::convert::Into<std::string::String>,
1166 {
1167 use std::iter::Iterator;
1168 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1169 self
1170 }
1171 }
1172
1173 #[doc(hidden)]
1174 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1175 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1176 &mut self.0.options
1177 }
1178 }
1179
1180 #[derive(Clone, Debug)]
1201 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1202
1203 impl ListOperations {
1204 pub(crate) fn new(
1205 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1206 ) -> Self {
1207 Self(RequestBuilder::new(stub))
1208 }
1209
1210 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1212 mut self,
1213 v: V,
1214 ) -> Self {
1215 self.0.request = v.into();
1216 self
1217 }
1218
1219 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1221 self.0.options = v.into();
1222 self
1223 }
1224
1225 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1227 (*self.0.stub)
1228 .list_operations(self.0.request, self.0.options)
1229 .await
1230 .map(gax::response::Response::into_body)
1231 }
1232
1233 pub fn by_page(
1235 self,
1236 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1237 {
1238 use std::clone::Clone;
1239 let token = self.0.request.page_token.clone();
1240 let execute = move |token: String| {
1241 let mut builder = self.clone();
1242 builder.0.request = builder.0.request.set_page_token(token);
1243 builder.send()
1244 };
1245 gax::paginator::internal::new_paginator(token, execute)
1246 }
1247
1248 pub fn by_item(
1250 self,
1251 ) -> impl gax::paginator::ItemPaginator<
1252 longrunning::model::ListOperationsResponse,
1253 gax::error::Error,
1254 > {
1255 use gax::paginator::Paginator;
1256 self.by_page().items()
1257 }
1258
1259 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1261 self.0.request.name = v.into();
1262 self
1263 }
1264
1265 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1267 self.0.request.filter = v.into();
1268 self
1269 }
1270
1271 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1273 self.0.request.page_size = v.into();
1274 self
1275 }
1276
1277 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1279 self.0.request.page_token = v.into();
1280 self
1281 }
1282
1283 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1285 self.0.request.return_partial_success = v.into();
1286 self
1287 }
1288 }
1289
1290 #[doc(hidden)]
1291 impl gax::options::internal::RequestBuilder for ListOperations {
1292 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1293 &mut self.0.options
1294 }
1295 }
1296
1297 #[derive(Clone, Debug)]
1314 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1315
1316 impl GetOperation {
1317 pub(crate) fn new(
1318 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1319 ) -> Self {
1320 Self(RequestBuilder::new(stub))
1321 }
1322
1323 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1325 mut self,
1326 v: V,
1327 ) -> Self {
1328 self.0.request = v.into();
1329 self
1330 }
1331
1332 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1334 self.0.options = v.into();
1335 self
1336 }
1337
1338 pub async fn send(self) -> Result<longrunning::model::Operation> {
1340 (*self.0.stub)
1341 .get_operation(self.0.request, self.0.options)
1342 .await
1343 .map(gax::response::Response::into_body)
1344 }
1345
1346 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1348 self.0.request.name = v.into();
1349 self
1350 }
1351 }
1352
1353 #[doc(hidden)]
1354 impl gax::options::internal::RequestBuilder for GetOperation {
1355 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1356 &mut self.0.options
1357 }
1358 }
1359
1360 #[derive(Clone, Debug)]
1377 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1378
1379 impl DeleteOperation {
1380 pub(crate) fn new(
1381 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1382 ) -> Self {
1383 Self(RequestBuilder::new(stub))
1384 }
1385
1386 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1388 mut self,
1389 v: V,
1390 ) -> Self {
1391 self.0.request = v.into();
1392 self
1393 }
1394
1395 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1397 self.0.options = v.into();
1398 self
1399 }
1400
1401 pub async fn send(self) -> Result<()> {
1403 (*self.0.stub)
1404 .delete_operation(self.0.request, self.0.options)
1405 .await
1406 .map(gax::response::Response::into_body)
1407 }
1408
1409 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1411 self.0.request.name = v.into();
1412 self
1413 }
1414 }
1415
1416 #[doc(hidden)]
1417 impl gax::options::internal::RequestBuilder for DeleteOperation {
1418 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1419 &mut self.0.options
1420 }
1421 }
1422
1423 #[derive(Clone, Debug)]
1440 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1441
1442 impl CancelOperation {
1443 pub(crate) fn new(
1444 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1445 ) -> Self {
1446 Self(RequestBuilder::new(stub))
1447 }
1448
1449 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1451 mut self,
1452 v: V,
1453 ) -> Self {
1454 self.0.request = v.into();
1455 self
1456 }
1457
1458 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1460 self.0.options = v.into();
1461 self
1462 }
1463
1464 pub async fn send(self) -> Result<()> {
1466 (*self.0.stub)
1467 .cancel_operation(self.0.request, self.0.options)
1468 .await
1469 .map(gax::response::Response::into_body)
1470 }
1471
1472 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1474 self.0.request.name = v.into();
1475 self
1476 }
1477 }
1478
1479 #[doc(hidden)]
1480 impl gax::options::internal::RequestBuilder for CancelOperation {
1481 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1482 &mut self.0.options
1483 }
1484 }
1485}
1486
1487pub mod vpc_flow_logs_service {
1488 use crate::Result;
1489
1490 pub type ClientBuilder =
1504 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1505
1506 pub(crate) mod client {
1507 use super::super::super::client::VpcFlowLogsService;
1508 pub struct Factory;
1509 impl gax::client_builder::internal::ClientFactory for Factory {
1510 type Client = VpcFlowLogsService;
1511 type Credentials = gaxi::options::Credentials;
1512 async fn build(
1513 self,
1514 config: gaxi::options::ClientConfig,
1515 ) -> gax::client_builder::Result<Self::Client> {
1516 Self::Client::new(config).await
1517 }
1518 }
1519 }
1520
1521 #[derive(Clone, Debug)]
1523 pub(crate) struct RequestBuilder<R: std::default::Default> {
1524 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1525 request: R,
1526 options: gax::options::RequestOptions,
1527 }
1528
1529 impl<R> RequestBuilder<R>
1530 where
1531 R: std::default::Default,
1532 {
1533 pub(crate) fn new(
1534 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1535 ) -> Self {
1536 Self {
1537 stub,
1538 request: R::default(),
1539 options: gax::options::RequestOptions::default(),
1540 }
1541 }
1542 }
1543
1544 #[derive(Clone, Debug)]
1565 pub struct ListVpcFlowLogsConfigs(RequestBuilder<crate::model::ListVpcFlowLogsConfigsRequest>);
1566
1567 impl ListVpcFlowLogsConfigs {
1568 pub(crate) fn new(
1569 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1570 ) -> Self {
1571 Self(RequestBuilder::new(stub))
1572 }
1573
1574 pub fn with_request<V: Into<crate::model::ListVpcFlowLogsConfigsRequest>>(
1576 mut self,
1577 v: V,
1578 ) -> Self {
1579 self.0.request = v.into();
1580 self
1581 }
1582
1583 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1585 self.0.options = v.into();
1586 self
1587 }
1588
1589 pub async fn send(self) -> Result<crate::model::ListVpcFlowLogsConfigsResponse> {
1591 (*self.0.stub)
1592 .list_vpc_flow_logs_configs(self.0.request, self.0.options)
1593 .await
1594 .map(gax::response::Response::into_body)
1595 }
1596
1597 pub fn by_page(
1599 self,
1600 ) -> impl gax::paginator::Paginator<
1601 crate::model::ListVpcFlowLogsConfigsResponse,
1602 gax::error::Error,
1603 > {
1604 use std::clone::Clone;
1605 let token = self.0.request.page_token.clone();
1606 let execute = move |token: String| {
1607 let mut builder = self.clone();
1608 builder.0.request = builder.0.request.set_page_token(token);
1609 builder.send()
1610 };
1611 gax::paginator::internal::new_paginator(token, execute)
1612 }
1613
1614 pub fn by_item(
1616 self,
1617 ) -> impl gax::paginator::ItemPaginator<
1618 crate::model::ListVpcFlowLogsConfigsResponse,
1619 gax::error::Error,
1620 > {
1621 use gax::paginator::Paginator;
1622 self.by_page().items()
1623 }
1624
1625 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1629 self.0.request.parent = v.into();
1630 self
1631 }
1632
1633 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1635 self.0.request.page_size = v.into();
1636 self
1637 }
1638
1639 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1641 self.0.request.page_token = v.into();
1642 self
1643 }
1644
1645 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1647 self.0.request.filter = v.into();
1648 self
1649 }
1650
1651 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1653 self.0.request.order_by = v.into();
1654 self
1655 }
1656 }
1657
1658 #[doc(hidden)]
1659 impl gax::options::internal::RequestBuilder for ListVpcFlowLogsConfigs {
1660 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1661 &mut self.0.options
1662 }
1663 }
1664
1665 #[derive(Clone, Debug)]
1682 pub struct GetVpcFlowLogsConfig(RequestBuilder<crate::model::GetVpcFlowLogsConfigRequest>);
1683
1684 impl GetVpcFlowLogsConfig {
1685 pub(crate) fn new(
1686 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1687 ) -> Self {
1688 Self(RequestBuilder::new(stub))
1689 }
1690
1691 pub fn with_request<V: Into<crate::model::GetVpcFlowLogsConfigRequest>>(
1693 mut self,
1694 v: V,
1695 ) -> Self {
1696 self.0.request = v.into();
1697 self
1698 }
1699
1700 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1702 self.0.options = v.into();
1703 self
1704 }
1705
1706 pub async fn send(self) -> Result<crate::model::VpcFlowLogsConfig> {
1708 (*self.0.stub)
1709 .get_vpc_flow_logs_config(self.0.request, self.0.options)
1710 .await
1711 .map(gax::response::Response::into_body)
1712 }
1713
1714 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1718 self.0.request.name = v.into();
1719 self
1720 }
1721 }
1722
1723 #[doc(hidden)]
1724 impl gax::options::internal::RequestBuilder for GetVpcFlowLogsConfig {
1725 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1726 &mut self.0.options
1727 }
1728 }
1729
1730 #[derive(Clone, Debug)]
1748 pub struct CreateVpcFlowLogsConfig(
1749 RequestBuilder<crate::model::CreateVpcFlowLogsConfigRequest>,
1750 );
1751
1752 impl CreateVpcFlowLogsConfig {
1753 pub(crate) fn new(
1754 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1755 ) -> Self {
1756 Self(RequestBuilder::new(stub))
1757 }
1758
1759 pub fn with_request<V: Into<crate::model::CreateVpcFlowLogsConfigRequest>>(
1761 mut self,
1762 v: V,
1763 ) -> Self {
1764 self.0.request = v.into();
1765 self
1766 }
1767
1768 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1770 self.0.options = v.into();
1771 self
1772 }
1773
1774 pub async fn send(self) -> Result<longrunning::model::Operation> {
1781 (*self.0.stub)
1782 .create_vpc_flow_logs_config(self.0.request, self.0.options)
1783 .await
1784 .map(gax::response::Response::into_body)
1785 }
1786
1787 pub fn poller(
1789 self,
1790 ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
1791 {
1792 type Operation = lro::internal::Operation<
1793 crate::model::VpcFlowLogsConfig,
1794 crate::model::OperationMetadata,
1795 >;
1796 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1797 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1798
1799 let stub = self.0.stub.clone();
1800 let mut options = self.0.options.clone();
1801 options.set_retry_policy(gax::retry_policy::NeverRetry);
1802 let query = move |name| {
1803 let stub = stub.clone();
1804 let options = options.clone();
1805 async {
1806 let op = GetOperation::new(stub)
1807 .set_name(name)
1808 .with_options(options)
1809 .send()
1810 .await?;
1811 Ok(Operation::new(op))
1812 }
1813 };
1814
1815 let start = move || async {
1816 let op = self.send().await?;
1817 Ok(Operation::new(op))
1818 };
1819
1820 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1821 }
1822
1823 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1827 self.0.request.parent = v.into();
1828 self
1829 }
1830
1831 pub fn set_vpc_flow_logs_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1835 self.0.request.vpc_flow_logs_config_id = v.into();
1836 self
1837 }
1838
1839 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
1843 where
1844 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
1845 {
1846 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
1847 self
1848 }
1849
1850 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
1854 where
1855 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
1856 {
1857 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
1858 self
1859 }
1860 }
1861
1862 #[doc(hidden)]
1863 impl gax::options::internal::RequestBuilder for CreateVpcFlowLogsConfig {
1864 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1865 &mut self.0.options
1866 }
1867 }
1868
1869 #[derive(Clone, Debug)]
1887 pub struct UpdateVpcFlowLogsConfig(
1888 RequestBuilder<crate::model::UpdateVpcFlowLogsConfigRequest>,
1889 );
1890
1891 impl UpdateVpcFlowLogsConfig {
1892 pub(crate) fn new(
1893 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1894 ) -> Self {
1895 Self(RequestBuilder::new(stub))
1896 }
1897
1898 pub fn with_request<V: Into<crate::model::UpdateVpcFlowLogsConfigRequest>>(
1900 mut self,
1901 v: V,
1902 ) -> Self {
1903 self.0.request = v.into();
1904 self
1905 }
1906
1907 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1909 self.0.options = v.into();
1910 self
1911 }
1912
1913 pub async fn send(self) -> Result<longrunning::model::Operation> {
1920 (*self.0.stub)
1921 .update_vpc_flow_logs_config(self.0.request, self.0.options)
1922 .await
1923 .map(gax::response::Response::into_body)
1924 }
1925
1926 pub fn poller(
1928 self,
1929 ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
1930 {
1931 type Operation = lro::internal::Operation<
1932 crate::model::VpcFlowLogsConfig,
1933 crate::model::OperationMetadata,
1934 >;
1935 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1936 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1937
1938 let stub = self.0.stub.clone();
1939 let mut options = self.0.options.clone();
1940 options.set_retry_policy(gax::retry_policy::NeverRetry);
1941 let query = move |name| {
1942 let stub = stub.clone();
1943 let options = options.clone();
1944 async {
1945 let op = GetOperation::new(stub)
1946 .set_name(name)
1947 .with_options(options)
1948 .send()
1949 .await?;
1950 Ok(Operation::new(op))
1951 }
1952 };
1953
1954 let start = move || async {
1955 let op = self.send().await?;
1956 Ok(Operation::new(op))
1957 };
1958
1959 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1960 }
1961
1962 pub fn set_update_mask<T>(mut self, v: T) -> Self
1966 where
1967 T: std::convert::Into<wkt::FieldMask>,
1968 {
1969 self.0.request.update_mask = std::option::Option::Some(v.into());
1970 self
1971 }
1972
1973 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1977 where
1978 T: std::convert::Into<wkt::FieldMask>,
1979 {
1980 self.0.request.update_mask = v.map(|x| x.into());
1981 self
1982 }
1983
1984 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
1988 where
1989 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
1990 {
1991 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
1992 self
1993 }
1994
1995 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
1999 where
2000 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
2001 {
2002 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
2003 self
2004 }
2005 }
2006
2007 #[doc(hidden)]
2008 impl gax::options::internal::RequestBuilder for UpdateVpcFlowLogsConfig {
2009 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2010 &mut self.0.options
2011 }
2012 }
2013
2014 #[derive(Clone, Debug)]
2032 pub struct DeleteVpcFlowLogsConfig(
2033 RequestBuilder<crate::model::DeleteVpcFlowLogsConfigRequest>,
2034 );
2035
2036 impl DeleteVpcFlowLogsConfig {
2037 pub(crate) fn new(
2038 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2039 ) -> Self {
2040 Self(RequestBuilder::new(stub))
2041 }
2042
2043 pub fn with_request<V: Into<crate::model::DeleteVpcFlowLogsConfigRequest>>(
2045 mut self,
2046 v: V,
2047 ) -> Self {
2048 self.0.request = v.into();
2049 self
2050 }
2051
2052 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2054 self.0.options = v.into();
2055 self
2056 }
2057
2058 pub async fn send(self) -> Result<longrunning::model::Operation> {
2065 (*self.0.stub)
2066 .delete_vpc_flow_logs_config(self.0.request, self.0.options)
2067 .await
2068 .map(gax::response::Response::into_body)
2069 }
2070
2071 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2073 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2074 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2075 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2076
2077 let stub = self.0.stub.clone();
2078 let mut options = self.0.options.clone();
2079 options.set_retry_policy(gax::retry_policy::NeverRetry);
2080 let query = move |name| {
2081 let stub = stub.clone();
2082 let options = options.clone();
2083 async {
2084 let op = GetOperation::new(stub)
2085 .set_name(name)
2086 .with_options(options)
2087 .send()
2088 .await?;
2089 Ok(Operation::new(op))
2090 }
2091 };
2092
2093 let start = move || async {
2094 let op = self.send().await?;
2095 Ok(Operation::new(op))
2096 };
2097
2098 lro::internal::new_unit_response_poller(
2099 polling_error_policy,
2100 polling_backoff_policy,
2101 start,
2102 query,
2103 )
2104 }
2105
2106 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2110 self.0.request.name = v.into();
2111 self
2112 }
2113 }
2114
2115 #[doc(hidden)]
2116 impl gax::options::internal::RequestBuilder for DeleteVpcFlowLogsConfig {
2117 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2118 &mut self.0.options
2119 }
2120 }
2121
2122 #[derive(Clone, Debug)]
2143 pub struct QueryOrgVpcFlowLogsConfigs(
2144 RequestBuilder<crate::model::QueryOrgVpcFlowLogsConfigsRequest>,
2145 );
2146
2147 impl QueryOrgVpcFlowLogsConfigs {
2148 pub(crate) fn new(
2149 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2150 ) -> Self {
2151 Self(RequestBuilder::new(stub))
2152 }
2153
2154 pub fn with_request<V: Into<crate::model::QueryOrgVpcFlowLogsConfigsRequest>>(
2156 mut self,
2157 v: V,
2158 ) -> Self {
2159 self.0.request = v.into();
2160 self
2161 }
2162
2163 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2165 self.0.options = v.into();
2166 self
2167 }
2168
2169 pub async fn send(self) -> Result<crate::model::QueryOrgVpcFlowLogsConfigsResponse> {
2171 (*self.0.stub)
2172 .query_org_vpc_flow_logs_configs(self.0.request, self.0.options)
2173 .await
2174 .map(gax::response::Response::into_body)
2175 }
2176
2177 pub fn by_page(
2179 self,
2180 ) -> impl gax::paginator::Paginator<
2181 crate::model::QueryOrgVpcFlowLogsConfigsResponse,
2182 gax::error::Error,
2183 > {
2184 use std::clone::Clone;
2185 let token = self.0.request.page_token.clone();
2186 let execute = move |token: String| {
2187 let mut builder = self.clone();
2188 builder.0.request = builder.0.request.set_page_token(token);
2189 builder.send()
2190 };
2191 gax::paginator::internal::new_paginator(token, execute)
2192 }
2193
2194 pub fn by_item(
2196 self,
2197 ) -> impl gax::paginator::ItemPaginator<
2198 crate::model::QueryOrgVpcFlowLogsConfigsResponse,
2199 gax::error::Error,
2200 > {
2201 use gax::paginator::Paginator;
2202 self.by_page().items()
2203 }
2204
2205 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2209 self.0.request.parent = v.into();
2210 self
2211 }
2212
2213 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2215 self.0.request.page_size = v.into();
2216 self
2217 }
2218
2219 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2221 self.0.request.page_token = v.into();
2222 self
2223 }
2224
2225 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2227 self.0.request.filter = v.into();
2228 self
2229 }
2230 }
2231
2232 #[doc(hidden)]
2233 impl gax::options::internal::RequestBuilder for QueryOrgVpcFlowLogsConfigs {
2234 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2235 &mut self.0.options
2236 }
2237 }
2238
2239 #[derive(Clone, Debug)]
2260 pub struct ShowEffectiveFlowLogsConfigs(
2261 RequestBuilder<crate::model::ShowEffectiveFlowLogsConfigsRequest>,
2262 );
2263
2264 impl ShowEffectiveFlowLogsConfigs {
2265 pub(crate) fn new(
2266 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2267 ) -> Self {
2268 Self(RequestBuilder::new(stub))
2269 }
2270
2271 pub fn with_request<V: Into<crate::model::ShowEffectiveFlowLogsConfigsRequest>>(
2273 mut self,
2274 v: V,
2275 ) -> Self {
2276 self.0.request = v.into();
2277 self
2278 }
2279
2280 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2282 self.0.options = v.into();
2283 self
2284 }
2285
2286 pub async fn send(self) -> Result<crate::model::ShowEffectiveFlowLogsConfigsResponse> {
2288 (*self.0.stub)
2289 .show_effective_flow_logs_configs(self.0.request, self.0.options)
2290 .await
2291 .map(gax::response::Response::into_body)
2292 }
2293
2294 pub fn by_page(
2296 self,
2297 ) -> impl gax::paginator::Paginator<
2298 crate::model::ShowEffectiveFlowLogsConfigsResponse,
2299 gax::error::Error,
2300 > {
2301 use std::clone::Clone;
2302 let token = self.0.request.page_token.clone();
2303 let execute = move |token: String| {
2304 let mut builder = self.clone();
2305 builder.0.request = builder.0.request.set_page_token(token);
2306 builder.send()
2307 };
2308 gax::paginator::internal::new_paginator(token, execute)
2309 }
2310
2311 pub fn by_item(
2313 self,
2314 ) -> impl gax::paginator::ItemPaginator<
2315 crate::model::ShowEffectiveFlowLogsConfigsResponse,
2316 gax::error::Error,
2317 > {
2318 use gax::paginator::Paginator;
2319 self.by_page().items()
2320 }
2321
2322 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2326 self.0.request.parent = v.into();
2327 self
2328 }
2329
2330 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2334 self.0.request.resource = v.into();
2335 self
2336 }
2337
2338 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2340 self.0.request.page_size = v.into();
2341 self
2342 }
2343
2344 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2346 self.0.request.page_token = v.into();
2347 self
2348 }
2349
2350 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2352 self.0.request.filter = v.into();
2353 self
2354 }
2355 }
2356
2357 #[doc(hidden)]
2358 impl gax::options::internal::RequestBuilder for ShowEffectiveFlowLogsConfigs {
2359 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2360 &mut self.0.options
2361 }
2362 }
2363
2364 #[derive(Clone, Debug)]
2385 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2386
2387 impl ListLocations {
2388 pub(crate) fn new(
2389 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2390 ) -> Self {
2391 Self(RequestBuilder::new(stub))
2392 }
2393
2394 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2396 mut self,
2397 v: V,
2398 ) -> Self {
2399 self.0.request = v.into();
2400 self
2401 }
2402
2403 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2405 self.0.options = v.into();
2406 self
2407 }
2408
2409 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2411 (*self.0.stub)
2412 .list_locations(self.0.request, self.0.options)
2413 .await
2414 .map(gax::response::Response::into_body)
2415 }
2416
2417 pub fn by_page(
2419 self,
2420 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2421 {
2422 use std::clone::Clone;
2423 let token = self.0.request.page_token.clone();
2424 let execute = move |token: String| {
2425 let mut builder = self.clone();
2426 builder.0.request = builder.0.request.set_page_token(token);
2427 builder.send()
2428 };
2429 gax::paginator::internal::new_paginator(token, execute)
2430 }
2431
2432 pub fn by_item(
2434 self,
2435 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2436 {
2437 use gax::paginator::Paginator;
2438 self.by_page().items()
2439 }
2440
2441 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2443 self.0.request.name = v.into();
2444 self
2445 }
2446
2447 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2449 self.0.request.filter = v.into();
2450 self
2451 }
2452
2453 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2455 self.0.request.page_size = v.into();
2456 self
2457 }
2458
2459 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2461 self.0.request.page_token = v.into();
2462 self
2463 }
2464 }
2465
2466 #[doc(hidden)]
2467 impl gax::options::internal::RequestBuilder for ListLocations {
2468 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2469 &mut self.0.options
2470 }
2471 }
2472
2473 #[derive(Clone, Debug)]
2490 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2491
2492 impl GetLocation {
2493 pub(crate) fn new(
2494 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2495 ) -> Self {
2496 Self(RequestBuilder::new(stub))
2497 }
2498
2499 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2501 self.0.request = v.into();
2502 self
2503 }
2504
2505 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2507 self.0.options = v.into();
2508 self
2509 }
2510
2511 pub async fn send(self) -> Result<location::model::Location> {
2513 (*self.0.stub)
2514 .get_location(self.0.request, self.0.options)
2515 .await
2516 .map(gax::response::Response::into_body)
2517 }
2518
2519 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2521 self.0.request.name = v.into();
2522 self
2523 }
2524 }
2525
2526 #[doc(hidden)]
2527 impl gax::options::internal::RequestBuilder for GetLocation {
2528 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2529 &mut self.0.options
2530 }
2531 }
2532
2533 #[derive(Clone, Debug)]
2550 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2551
2552 impl SetIamPolicy {
2553 pub(crate) fn new(
2554 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2555 ) -> Self {
2556 Self(RequestBuilder::new(stub))
2557 }
2558
2559 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2561 self.0.request = v.into();
2562 self
2563 }
2564
2565 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2567 self.0.options = v.into();
2568 self
2569 }
2570
2571 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2573 (*self.0.stub)
2574 .set_iam_policy(self.0.request, self.0.options)
2575 .await
2576 .map(gax::response::Response::into_body)
2577 }
2578
2579 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2583 self.0.request.resource = v.into();
2584 self
2585 }
2586
2587 pub fn set_policy<T>(mut self, v: T) -> Self
2591 where
2592 T: std::convert::Into<iam_v1::model::Policy>,
2593 {
2594 self.0.request.policy = std::option::Option::Some(v.into());
2595 self
2596 }
2597
2598 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2602 where
2603 T: std::convert::Into<iam_v1::model::Policy>,
2604 {
2605 self.0.request.policy = v.map(|x| x.into());
2606 self
2607 }
2608
2609 pub fn set_update_mask<T>(mut self, v: T) -> Self
2611 where
2612 T: std::convert::Into<wkt::FieldMask>,
2613 {
2614 self.0.request.update_mask = std::option::Option::Some(v.into());
2615 self
2616 }
2617
2618 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2620 where
2621 T: std::convert::Into<wkt::FieldMask>,
2622 {
2623 self.0.request.update_mask = v.map(|x| x.into());
2624 self
2625 }
2626 }
2627
2628 #[doc(hidden)]
2629 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2630 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2631 &mut self.0.options
2632 }
2633 }
2634
2635 #[derive(Clone, Debug)]
2652 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2653
2654 impl GetIamPolicy {
2655 pub(crate) fn new(
2656 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2657 ) -> Self {
2658 Self(RequestBuilder::new(stub))
2659 }
2660
2661 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2663 self.0.request = v.into();
2664 self
2665 }
2666
2667 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2669 self.0.options = v.into();
2670 self
2671 }
2672
2673 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2675 (*self.0.stub)
2676 .get_iam_policy(self.0.request, self.0.options)
2677 .await
2678 .map(gax::response::Response::into_body)
2679 }
2680
2681 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2685 self.0.request.resource = v.into();
2686 self
2687 }
2688
2689 pub fn set_options<T>(mut self, v: T) -> Self
2691 where
2692 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2693 {
2694 self.0.request.options = std::option::Option::Some(v.into());
2695 self
2696 }
2697
2698 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2700 where
2701 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2702 {
2703 self.0.request.options = v.map(|x| x.into());
2704 self
2705 }
2706 }
2707
2708 #[doc(hidden)]
2709 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2710 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2711 &mut self.0.options
2712 }
2713 }
2714
2715 #[derive(Clone, Debug)]
2732 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2733
2734 impl TestIamPermissions {
2735 pub(crate) fn new(
2736 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2737 ) -> Self {
2738 Self(RequestBuilder::new(stub))
2739 }
2740
2741 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2743 mut self,
2744 v: V,
2745 ) -> Self {
2746 self.0.request = v.into();
2747 self
2748 }
2749
2750 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2752 self.0.options = v.into();
2753 self
2754 }
2755
2756 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2758 (*self.0.stub)
2759 .test_iam_permissions(self.0.request, self.0.options)
2760 .await
2761 .map(gax::response::Response::into_body)
2762 }
2763
2764 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2768 self.0.request.resource = v.into();
2769 self
2770 }
2771
2772 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2776 where
2777 T: std::iter::IntoIterator<Item = V>,
2778 V: std::convert::Into<std::string::String>,
2779 {
2780 use std::iter::Iterator;
2781 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2782 self
2783 }
2784 }
2785
2786 #[doc(hidden)]
2787 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2788 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2789 &mut self.0.options
2790 }
2791 }
2792
2793 #[derive(Clone, Debug)]
2814 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2815
2816 impl ListOperations {
2817 pub(crate) fn new(
2818 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2819 ) -> Self {
2820 Self(RequestBuilder::new(stub))
2821 }
2822
2823 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2825 mut self,
2826 v: V,
2827 ) -> Self {
2828 self.0.request = v.into();
2829 self
2830 }
2831
2832 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2834 self.0.options = v.into();
2835 self
2836 }
2837
2838 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2840 (*self.0.stub)
2841 .list_operations(self.0.request, self.0.options)
2842 .await
2843 .map(gax::response::Response::into_body)
2844 }
2845
2846 pub fn by_page(
2848 self,
2849 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2850 {
2851 use std::clone::Clone;
2852 let token = self.0.request.page_token.clone();
2853 let execute = move |token: String| {
2854 let mut builder = self.clone();
2855 builder.0.request = builder.0.request.set_page_token(token);
2856 builder.send()
2857 };
2858 gax::paginator::internal::new_paginator(token, execute)
2859 }
2860
2861 pub fn by_item(
2863 self,
2864 ) -> impl gax::paginator::ItemPaginator<
2865 longrunning::model::ListOperationsResponse,
2866 gax::error::Error,
2867 > {
2868 use gax::paginator::Paginator;
2869 self.by_page().items()
2870 }
2871
2872 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2874 self.0.request.name = v.into();
2875 self
2876 }
2877
2878 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2880 self.0.request.filter = v.into();
2881 self
2882 }
2883
2884 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2886 self.0.request.page_size = v.into();
2887 self
2888 }
2889
2890 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2892 self.0.request.page_token = v.into();
2893 self
2894 }
2895
2896 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2898 self.0.request.return_partial_success = v.into();
2899 self
2900 }
2901 }
2902
2903 #[doc(hidden)]
2904 impl gax::options::internal::RequestBuilder for ListOperations {
2905 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2906 &mut self.0.options
2907 }
2908 }
2909
2910 #[derive(Clone, Debug)]
2927 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2928
2929 impl GetOperation {
2930 pub(crate) fn new(
2931 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2932 ) -> Self {
2933 Self(RequestBuilder::new(stub))
2934 }
2935
2936 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2938 mut self,
2939 v: V,
2940 ) -> Self {
2941 self.0.request = v.into();
2942 self
2943 }
2944
2945 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2947 self.0.options = v.into();
2948 self
2949 }
2950
2951 pub async fn send(self) -> Result<longrunning::model::Operation> {
2953 (*self.0.stub)
2954 .get_operation(self.0.request, self.0.options)
2955 .await
2956 .map(gax::response::Response::into_body)
2957 }
2958
2959 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2961 self.0.request.name = v.into();
2962 self
2963 }
2964 }
2965
2966 #[doc(hidden)]
2967 impl gax::options::internal::RequestBuilder for GetOperation {
2968 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2969 &mut self.0.options
2970 }
2971 }
2972
2973 #[derive(Clone, Debug)]
2990 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2991
2992 impl DeleteOperation {
2993 pub(crate) fn new(
2994 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2995 ) -> Self {
2996 Self(RequestBuilder::new(stub))
2997 }
2998
2999 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3001 mut self,
3002 v: V,
3003 ) -> Self {
3004 self.0.request = v.into();
3005 self
3006 }
3007
3008 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3010 self.0.options = v.into();
3011 self
3012 }
3013
3014 pub async fn send(self) -> Result<()> {
3016 (*self.0.stub)
3017 .delete_operation(self.0.request, self.0.options)
3018 .await
3019 .map(gax::response::Response::into_body)
3020 }
3021
3022 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3024 self.0.request.name = v.into();
3025 self
3026 }
3027 }
3028
3029 #[doc(hidden)]
3030 impl gax::options::internal::RequestBuilder for DeleteOperation {
3031 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3032 &mut self.0.options
3033 }
3034 }
3035
3036 #[derive(Clone, Debug)]
3053 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3054
3055 impl CancelOperation {
3056 pub(crate) fn new(
3057 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
3058 ) -> Self {
3059 Self(RequestBuilder::new(stub))
3060 }
3061
3062 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3064 mut self,
3065 v: V,
3066 ) -> Self {
3067 self.0.request = v.into();
3068 self
3069 }
3070
3071 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3073 self.0.options = v.into();
3074 self
3075 }
3076
3077 pub async fn send(self) -> Result<()> {
3079 (*self.0.stub)
3080 .cancel_operation(self.0.request, self.0.options)
3081 .await
3082 .map(gax::response::Response::into_body)
3083 }
3084
3085 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3087 self.0.request.name = v.into();
3088 self
3089 }
3090 }
3091
3092 #[doc(hidden)]
3093 impl gax::options::internal::RequestBuilder for CancelOperation {
3094 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3095 &mut self.0.options
3096 }
3097 }
3098}
3099
3100pub mod organization_vpc_flow_logs_service {
3101 use crate::Result;
3102
3103 pub type ClientBuilder =
3117 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3118
3119 pub(crate) mod client {
3120 use super::super::super::client::OrganizationVpcFlowLogsService;
3121 pub struct Factory;
3122 impl gax::client_builder::internal::ClientFactory for Factory {
3123 type Client = OrganizationVpcFlowLogsService;
3124 type Credentials = gaxi::options::Credentials;
3125 async fn build(
3126 self,
3127 config: gaxi::options::ClientConfig,
3128 ) -> gax::client_builder::Result<Self::Client> {
3129 Self::Client::new(config).await
3130 }
3131 }
3132 }
3133
3134 #[derive(Clone, Debug)]
3136 pub(crate) struct RequestBuilder<R: std::default::Default> {
3137 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3138 request: R,
3139 options: gax::options::RequestOptions,
3140 }
3141
3142 impl<R> RequestBuilder<R>
3143 where
3144 R: std::default::Default,
3145 {
3146 pub(crate) fn new(
3147 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3148 ) -> Self {
3149 Self {
3150 stub,
3151 request: R::default(),
3152 options: gax::options::RequestOptions::default(),
3153 }
3154 }
3155 }
3156
3157 #[derive(Clone, Debug)]
3178 pub struct ListVpcFlowLogsConfigs(RequestBuilder<crate::model::ListVpcFlowLogsConfigsRequest>);
3179
3180 impl ListVpcFlowLogsConfigs {
3181 pub(crate) fn new(
3182 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3183 ) -> Self {
3184 Self(RequestBuilder::new(stub))
3185 }
3186
3187 pub fn with_request<V: Into<crate::model::ListVpcFlowLogsConfigsRequest>>(
3189 mut self,
3190 v: V,
3191 ) -> Self {
3192 self.0.request = v.into();
3193 self
3194 }
3195
3196 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3198 self.0.options = v.into();
3199 self
3200 }
3201
3202 pub async fn send(self) -> Result<crate::model::ListVpcFlowLogsConfigsResponse> {
3204 (*self.0.stub)
3205 .list_vpc_flow_logs_configs(self.0.request, self.0.options)
3206 .await
3207 .map(gax::response::Response::into_body)
3208 }
3209
3210 pub fn by_page(
3212 self,
3213 ) -> impl gax::paginator::Paginator<
3214 crate::model::ListVpcFlowLogsConfigsResponse,
3215 gax::error::Error,
3216 > {
3217 use std::clone::Clone;
3218 let token = self.0.request.page_token.clone();
3219 let execute = move |token: String| {
3220 let mut builder = self.clone();
3221 builder.0.request = builder.0.request.set_page_token(token);
3222 builder.send()
3223 };
3224 gax::paginator::internal::new_paginator(token, execute)
3225 }
3226
3227 pub fn by_item(
3229 self,
3230 ) -> impl gax::paginator::ItemPaginator<
3231 crate::model::ListVpcFlowLogsConfigsResponse,
3232 gax::error::Error,
3233 > {
3234 use gax::paginator::Paginator;
3235 self.by_page().items()
3236 }
3237
3238 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3242 self.0.request.parent = v.into();
3243 self
3244 }
3245
3246 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3248 self.0.request.page_size = v.into();
3249 self
3250 }
3251
3252 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3254 self.0.request.page_token = v.into();
3255 self
3256 }
3257
3258 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3260 self.0.request.filter = v.into();
3261 self
3262 }
3263
3264 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3266 self.0.request.order_by = v.into();
3267 self
3268 }
3269 }
3270
3271 #[doc(hidden)]
3272 impl gax::options::internal::RequestBuilder for ListVpcFlowLogsConfigs {
3273 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3274 &mut self.0.options
3275 }
3276 }
3277
3278 #[derive(Clone, Debug)]
3295 pub struct GetVpcFlowLogsConfig(RequestBuilder<crate::model::GetVpcFlowLogsConfigRequest>);
3296
3297 impl GetVpcFlowLogsConfig {
3298 pub(crate) fn new(
3299 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3300 ) -> Self {
3301 Self(RequestBuilder::new(stub))
3302 }
3303
3304 pub fn with_request<V: Into<crate::model::GetVpcFlowLogsConfigRequest>>(
3306 mut self,
3307 v: V,
3308 ) -> Self {
3309 self.0.request = v.into();
3310 self
3311 }
3312
3313 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3315 self.0.options = v.into();
3316 self
3317 }
3318
3319 pub async fn send(self) -> Result<crate::model::VpcFlowLogsConfig> {
3321 (*self.0.stub)
3322 .get_vpc_flow_logs_config(self.0.request, self.0.options)
3323 .await
3324 .map(gax::response::Response::into_body)
3325 }
3326
3327 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3331 self.0.request.name = v.into();
3332 self
3333 }
3334 }
3335
3336 #[doc(hidden)]
3337 impl gax::options::internal::RequestBuilder for GetVpcFlowLogsConfig {
3338 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3339 &mut self.0.options
3340 }
3341 }
3342
3343 #[derive(Clone, Debug)]
3361 pub struct CreateVpcFlowLogsConfig(
3362 RequestBuilder<crate::model::CreateVpcFlowLogsConfigRequest>,
3363 );
3364
3365 impl CreateVpcFlowLogsConfig {
3366 pub(crate) fn new(
3367 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3368 ) -> Self {
3369 Self(RequestBuilder::new(stub))
3370 }
3371
3372 pub fn with_request<V: Into<crate::model::CreateVpcFlowLogsConfigRequest>>(
3374 mut self,
3375 v: V,
3376 ) -> Self {
3377 self.0.request = v.into();
3378 self
3379 }
3380
3381 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3383 self.0.options = v.into();
3384 self
3385 }
3386
3387 pub async fn send(self) -> Result<longrunning::model::Operation> {
3394 (*self.0.stub)
3395 .create_vpc_flow_logs_config(self.0.request, self.0.options)
3396 .await
3397 .map(gax::response::Response::into_body)
3398 }
3399
3400 pub fn poller(
3402 self,
3403 ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
3404 {
3405 type Operation = lro::internal::Operation<
3406 crate::model::VpcFlowLogsConfig,
3407 crate::model::OperationMetadata,
3408 >;
3409 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3410 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3411
3412 let stub = self.0.stub.clone();
3413 let mut options = self.0.options.clone();
3414 options.set_retry_policy(gax::retry_policy::NeverRetry);
3415 let query = move |name| {
3416 let stub = stub.clone();
3417 let options = options.clone();
3418 async {
3419 let op = GetOperation::new(stub)
3420 .set_name(name)
3421 .with_options(options)
3422 .send()
3423 .await?;
3424 Ok(Operation::new(op))
3425 }
3426 };
3427
3428 let start = move || async {
3429 let op = self.send().await?;
3430 Ok(Operation::new(op))
3431 };
3432
3433 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3434 }
3435
3436 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3440 self.0.request.parent = v.into();
3441 self
3442 }
3443
3444 pub fn set_vpc_flow_logs_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3448 self.0.request.vpc_flow_logs_config_id = v.into();
3449 self
3450 }
3451
3452 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
3456 where
3457 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3458 {
3459 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
3460 self
3461 }
3462
3463 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
3467 where
3468 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3469 {
3470 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
3471 self
3472 }
3473 }
3474
3475 #[doc(hidden)]
3476 impl gax::options::internal::RequestBuilder for CreateVpcFlowLogsConfig {
3477 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3478 &mut self.0.options
3479 }
3480 }
3481
3482 #[derive(Clone, Debug)]
3500 pub struct UpdateVpcFlowLogsConfig(
3501 RequestBuilder<crate::model::UpdateVpcFlowLogsConfigRequest>,
3502 );
3503
3504 impl UpdateVpcFlowLogsConfig {
3505 pub(crate) fn new(
3506 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3507 ) -> Self {
3508 Self(RequestBuilder::new(stub))
3509 }
3510
3511 pub fn with_request<V: Into<crate::model::UpdateVpcFlowLogsConfigRequest>>(
3513 mut self,
3514 v: V,
3515 ) -> Self {
3516 self.0.request = v.into();
3517 self
3518 }
3519
3520 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3522 self.0.options = v.into();
3523 self
3524 }
3525
3526 pub async fn send(self) -> Result<longrunning::model::Operation> {
3533 (*self.0.stub)
3534 .update_vpc_flow_logs_config(self.0.request, self.0.options)
3535 .await
3536 .map(gax::response::Response::into_body)
3537 }
3538
3539 pub fn poller(
3541 self,
3542 ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
3543 {
3544 type Operation = lro::internal::Operation<
3545 crate::model::VpcFlowLogsConfig,
3546 crate::model::OperationMetadata,
3547 >;
3548 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3549 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3550
3551 let stub = self.0.stub.clone();
3552 let mut options = self.0.options.clone();
3553 options.set_retry_policy(gax::retry_policy::NeverRetry);
3554 let query = move |name| {
3555 let stub = stub.clone();
3556 let options = options.clone();
3557 async {
3558 let op = GetOperation::new(stub)
3559 .set_name(name)
3560 .with_options(options)
3561 .send()
3562 .await?;
3563 Ok(Operation::new(op))
3564 }
3565 };
3566
3567 let start = move || async {
3568 let op = self.send().await?;
3569 Ok(Operation::new(op))
3570 };
3571
3572 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3573 }
3574
3575 pub fn set_update_mask<T>(mut self, v: T) -> Self
3579 where
3580 T: std::convert::Into<wkt::FieldMask>,
3581 {
3582 self.0.request.update_mask = std::option::Option::Some(v.into());
3583 self
3584 }
3585
3586 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3590 where
3591 T: std::convert::Into<wkt::FieldMask>,
3592 {
3593 self.0.request.update_mask = v.map(|x| x.into());
3594 self
3595 }
3596
3597 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
3601 where
3602 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3603 {
3604 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
3605 self
3606 }
3607
3608 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
3612 where
3613 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3614 {
3615 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
3616 self
3617 }
3618 }
3619
3620 #[doc(hidden)]
3621 impl gax::options::internal::RequestBuilder for UpdateVpcFlowLogsConfig {
3622 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3623 &mut self.0.options
3624 }
3625 }
3626
3627 #[derive(Clone, Debug)]
3645 pub struct DeleteVpcFlowLogsConfig(
3646 RequestBuilder<crate::model::DeleteVpcFlowLogsConfigRequest>,
3647 );
3648
3649 impl DeleteVpcFlowLogsConfig {
3650 pub(crate) fn new(
3651 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3652 ) -> Self {
3653 Self(RequestBuilder::new(stub))
3654 }
3655
3656 pub fn with_request<V: Into<crate::model::DeleteVpcFlowLogsConfigRequest>>(
3658 mut self,
3659 v: V,
3660 ) -> Self {
3661 self.0.request = v.into();
3662 self
3663 }
3664
3665 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3667 self.0.options = v.into();
3668 self
3669 }
3670
3671 pub async fn send(self) -> Result<longrunning::model::Operation> {
3678 (*self.0.stub)
3679 .delete_vpc_flow_logs_config(self.0.request, self.0.options)
3680 .await
3681 .map(gax::response::Response::into_body)
3682 }
3683
3684 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3686 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3687 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3688 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3689
3690 let stub = self.0.stub.clone();
3691 let mut options = self.0.options.clone();
3692 options.set_retry_policy(gax::retry_policy::NeverRetry);
3693 let query = move |name| {
3694 let stub = stub.clone();
3695 let options = options.clone();
3696 async {
3697 let op = GetOperation::new(stub)
3698 .set_name(name)
3699 .with_options(options)
3700 .send()
3701 .await?;
3702 Ok(Operation::new(op))
3703 }
3704 };
3705
3706 let start = move || async {
3707 let op = self.send().await?;
3708 Ok(Operation::new(op))
3709 };
3710
3711 lro::internal::new_unit_response_poller(
3712 polling_error_policy,
3713 polling_backoff_policy,
3714 start,
3715 query,
3716 )
3717 }
3718
3719 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3723 self.0.request.name = v.into();
3724 self
3725 }
3726 }
3727
3728 #[doc(hidden)]
3729 impl gax::options::internal::RequestBuilder for DeleteVpcFlowLogsConfig {
3730 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3731 &mut self.0.options
3732 }
3733 }
3734
3735 #[derive(Clone, Debug)]
3756 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3757
3758 impl ListLocations {
3759 pub(crate) fn new(
3760 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3761 ) -> Self {
3762 Self(RequestBuilder::new(stub))
3763 }
3764
3765 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3767 mut self,
3768 v: V,
3769 ) -> Self {
3770 self.0.request = v.into();
3771 self
3772 }
3773
3774 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3776 self.0.options = v.into();
3777 self
3778 }
3779
3780 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3782 (*self.0.stub)
3783 .list_locations(self.0.request, self.0.options)
3784 .await
3785 .map(gax::response::Response::into_body)
3786 }
3787
3788 pub fn by_page(
3790 self,
3791 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3792 {
3793 use std::clone::Clone;
3794 let token = self.0.request.page_token.clone();
3795 let execute = move |token: String| {
3796 let mut builder = self.clone();
3797 builder.0.request = builder.0.request.set_page_token(token);
3798 builder.send()
3799 };
3800 gax::paginator::internal::new_paginator(token, execute)
3801 }
3802
3803 pub fn by_item(
3805 self,
3806 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3807 {
3808 use gax::paginator::Paginator;
3809 self.by_page().items()
3810 }
3811
3812 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3814 self.0.request.name = v.into();
3815 self
3816 }
3817
3818 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3820 self.0.request.filter = v.into();
3821 self
3822 }
3823
3824 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3826 self.0.request.page_size = v.into();
3827 self
3828 }
3829
3830 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3832 self.0.request.page_token = v.into();
3833 self
3834 }
3835 }
3836
3837 #[doc(hidden)]
3838 impl gax::options::internal::RequestBuilder for ListLocations {
3839 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3840 &mut self.0.options
3841 }
3842 }
3843
3844 #[derive(Clone, Debug)]
3861 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3862
3863 impl GetLocation {
3864 pub(crate) fn new(
3865 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3866 ) -> Self {
3867 Self(RequestBuilder::new(stub))
3868 }
3869
3870 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3872 self.0.request = v.into();
3873 self
3874 }
3875
3876 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3878 self.0.options = v.into();
3879 self
3880 }
3881
3882 pub async fn send(self) -> Result<location::model::Location> {
3884 (*self.0.stub)
3885 .get_location(self.0.request, self.0.options)
3886 .await
3887 .map(gax::response::Response::into_body)
3888 }
3889
3890 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3892 self.0.request.name = v.into();
3893 self
3894 }
3895 }
3896
3897 #[doc(hidden)]
3898 impl gax::options::internal::RequestBuilder for GetLocation {
3899 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3900 &mut self.0.options
3901 }
3902 }
3903
3904 #[derive(Clone, Debug)]
3921 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3922
3923 impl SetIamPolicy {
3924 pub(crate) fn new(
3925 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3926 ) -> Self {
3927 Self(RequestBuilder::new(stub))
3928 }
3929
3930 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
3932 self.0.request = v.into();
3933 self
3934 }
3935
3936 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3938 self.0.options = v.into();
3939 self
3940 }
3941
3942 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3944 (*self.0.stub)
3945 .set_iam_policy(self.0.request, self.0.options)
3946 .await
3947 .map(gax::response::Response::into_body)
3948 }
3949
3950 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3954 self.0.request.resource = v.into();
3955 self
3956 }
3957
3958 pub fn set_policy<T>(mut self, v: T) -> Self
3962 where
3963 T: std::convert::Into<iam_v1::model::Policy>,
3964 {
3965 self.0.request.policy = std::option::Option::Some(v.into());
3966 self
3967 }
3968
3969 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3973 where
3974 T: std::convert::Into<iam_v1::model::Policy>,
3975 {
3976 self.0.request.policy = v.map(|x| x.into());
3977 self
3978 }
3979
3980 pub fn set_update_mask<T>(mut self, v: T) -> Self
3982 where
3983 T: std::convert::Into<wkt::FieldMask>,
3984 {
3985 self.0.request.update_mask = std::option::Option::Some(v.into());
3986 self
3987 }
3988
3989 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3991 where
3992 T: std::convert::Into<wkt::FieldMask>,
3993 {
3994 self.0.request.update_mask = v.map(|x| x.into());
3995 self
3996 }
3997 }
3998
3999 #[doc(hidden)]
4000 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4001 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4002 &mut self.0.options
4003 }
4004 }
4005
4006 #[derive(Clone, Debug)]
4023 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4024
4025 impl GetIamPolicy {
4026 pub(crate) fn new(
4027 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4028 ) -> Self {
4029 Self(RequestBuilder::new(stub))
4030 }
4031
4032 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4034 self.0.request = v.into();
4035 self
4036 }
4037
4038 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4040 self.0.options = v.into();
4041 self
4042 }
4043
4044 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4046 (*self.0.stub)
4047 .get_iam_policy(self.0.request, self.0.options)
4048 .await
4049 .map(gax::response::Response::into_body)
4050 }
4051
4052 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4056 self.0.request.resource = v.into();
4057 self
4058 }
4059
4060 pub fn set_options<T>(mut self, v: T) -> Self
4062 where
4063 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4064 {
4065 self.0.request.options = std::option::Option::Some(v.into());
4066 self
4067 }
4068
4069 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4071 where
4072 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4073 {
4074 self.0.request.options = v.map(|x| x.into());
4075 self
4076 }
4077 }
4078
4079 #[doc(hidden)]
4080 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4081 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4082 &mut self.0.options
4083 }
4084 }
4085
4086 #[derive(Clone, Debug)]
4103 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4104
4105 impl TestIamPermissions {
4106 pub(crate) fn new(
4107 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4108 ) -> Self {
4109 Self(RequestBuilder::new(stub))
4110 }
4111
4112 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4114 mut self,
4115 v: V,
4116 ) -> Self {
4117 self.0.request = v.into();
4118 self
4119 }
4120
4121 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4123 self.0.options = v.into();
4124 self
4125 }
4126
4127 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4129 (*self.0.stub)
4130 .test_iam_permissions(self.0.request, self.0.options)
4131 .await
4132 .map(gax::response::Response::into_body)
4133 }
4134
4135 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4139 self.0.request.resource = v.into();
4140 self
4141 }
4142
4143 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4147 where
4148 T: std::iter::IntoIterator<Item = V>,
4149 V: std::convert::Into<std::string::String>,
4150 {
4151 use std::iter::Iterator;
4152 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4153 self
4154 }
4155 }
4156
4157 #[doc(hidden)]
4158 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4159 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4160 &mut self.0.options
4161 }
4162 }
4163
4164 #[derive(Clone, Debug)]
4185 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4186
4187 impl ListOperations {
4188 pub(crate) fn new(
4189 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4190 ) -> Self {
4191 Self(RequestBuilder::new(stub))
4192 }
4193
4194 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4196 mut self,
4197 v: V,
4198 ) -> Self {
4199 self.0.request = v.into();
4200 self
4201 }
4202
4203 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4205 self.0.options = v.into();
4206 self
4207 }
4208
4209 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4211 (*self.0.stub)
4212 .list_operations(self.0.request, self.0.options)
4213 .await
4214 .map(gax::response::Response::into_body)
4215 }
4216
4217 pub fn by_page(
4219 self,
4220 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4221 {
4222 use std::clone::Clone;
4223 let token = self.0.request.page_token.clone();
4224 let execute = move |token: String| {
4225 let mut builder = self.clone();
4226 builder.0.request = builder.0.request.set_page_token(token);
4227 builder.send()
4228 };
4229 gax::paginator::internal::new_paginator(token, execute)
4230 }
4231
4232 pub fn by_item(
4234 self,
4235 ) -> impl gax::paginator::ItemPaginator<
4236 longrunning::model::ListOperationsResponse,
4237 gax::error::Error,
4238 > {
4239 use gax::paginator::Paginator;
4240 self.by_page().items()
4241 }
4242
4243 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4245 self.0.request.name = v.into();
4246 self
4247 }
4248
4249 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4251 self.0.request.filter = v.into();
4252 self
4253 }
4254
4255 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4257 self.0.request.page_size = v.into();
4258 self
4259 }
4260
4261 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4263 self.0.request.page_token = v.into();
4264 self
4265 }
4266
4267 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4269 self.0.request.return_partial_success = v.into();
4270 self
4271 }
4272 }
4273
4274 #[doc(hidden)]
4275 impl gax::options::internal::RequestBuilder for ListOperations {
4276 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4277 &mut self.0.options
4278 }
4279 }
4280
4281 #[derive(Clone, Debug)]
4298 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4299
4300 impl GetOperation {
4301 pub(crate) fn new(
4302 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4303 ) -> Self {
4304 Self(RequestBuilder::new(stub))
4305 }
4306
4307 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4309 mut self,
4310 v: V,
4311 ) -> Self {
4312 self.0.request = v.into();
4313 self
4314 }
4315
4316 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4318 self.0.options = v.into();
4319 self
4320 }
4321
4322 pub async fn send(self) -> Result<longrunning::model::Operation> {
4324 (*self.0.stub)
4325 .get_operation(self.0.request, self.0.options)
4326 .await
4327 .map(gax::response::Response::into_body)
4328 }
4329
4330 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4332 self.0.request.name = v.into();
4333 self
4334 }
4335 }
4336
4337 #[doc(hidden)]
4338 impl gax::options::internal::RequestBuilder for GetOperation {
4339 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4340 &mut self.0.options
4341 }
4342 }
4343
4344 #[derive(Clone, Debug)]
4361 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4362
4363 impl DeleteOperation {
4364 pub(crate) fn new(
4365 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4366 ) -> Self {
4367 Self(RequestBuilder::new(stub))
4368 }
4369
4370 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4372 mut self,
4373 v: V,
4374 ) -> Self {
4375 self.0.request = v.into();
4376 self
4377 }
4378
4379 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4381 self.0.options = v.into();
4382 self
4383 }
4384
4385 pub async fn send(self) -> Result<()> {
4387 (*self.0.stub)
4388 .delete_operation(self.0.request, self.0.options)
4389 .await
4390 .map(gax::response::Response::into_body)
4391 }
4392
4393 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4395 self.0.request.name = v.into();
4396 self
4397 }
4398 }
4399
4400 #[doc(hidden)]
4401 impl gax::options::internal::RequestBuilder for DeleteOperation {
4402 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4403 &mut self.0.options
4404 }
4405 }
4406
4407 #[derive(Clone, Debug)]
4424 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4425
4426 impl CancelOperation {
4427 pub(crate) fn new(
4428 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4429 ) -> Self {
4430 Self(RequestBuilder::new(stub))
4431 }
4432
4433 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4435 mut self,
4436 v: V,
4437 ) -> Self {
4438 self.0.request = v.into();
4439 self
4440 }
4441
4442 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4444 self.0.options = v.into();
4445 self
4446 }
4447
4448 pub async fn send(self) -> Result<()> {
4450 (*self.0.stub)
4451 .cancel_operation(self.0.request, self.0.options)
4452 .await
4453 .map(gax::response::Response::into_body)
4454 }
4455
4456 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4458 self.0.request.name = v.into();
4459 self
4460 }
4461 }
4462
4463 #[doc(hidden)]
4464 impl gax::options::internal::RequestBuilder for CancelOperation {
4465 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4466 &mut self.0.options
4467 }
4468 }
4469}