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)]
96 pub struct ListConnectivityTests(RequestBuilder<crate::model::ListConnectivityTestsRequest>);
97
98 impl ListConnectivityTests {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListConnectivityTestsRequest>>(
107 mut self,
108 v: V,
109 ) -> Self {
110 self.0.request = v.into();
111 self
112 }
113
114 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
116 self.0.options = v.into();
117 self
118 }
119
120 pub async fn send(self) -> Result<crate::model::ListConnectivityTestsResponse> {
122 (*self.0.stub)
123 .list_connectivity_tests(self.0.request, self.0.options)
124 .await
125 .map(gax::response::Response::into_body)
126 }
127
128 pub fn by_page(
130 self,
131 ) -> impl gax::paginator::Paginator<crate::model::ListConnectivityTestsResponse, gax::error::Error>
132 {
133 use std::clone::Clone;
134 let token = self.0.request.page_token.clone();
135 let execute = move |token: String| {
136 let mut builder = self.clone();
137 builder.0.request = builder.0.request.set_page_token(token);
138 builder.send()
139 };
140 gax::paginator::internal::new_paginator(token, execute)
141 }
142
143 pub fn by_item(
145 self,
146 ) -> impl gax::paginator::ItemPaginator<
147 crate::model::ListConnectivityTestsResponse,
148 gax::error::Error,
149 > {
150 use gax::paginator::Paginator;
151 self.by_page().items()
152 }
153
154 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158 self.0.request.parent = v.into();
159 self
160 }
161
162 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164 self.0.request.page_size = v.into();
165 self
166 }
167
168 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.page_token = v.into();
171 self
172 }
173
174 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.filter = v.into();
177 self
178 }
179
180 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
182 self.0.request.order_by = v.into();
183 self
184 }
185 }
186
187 #[doc(hidden)]
188 impl gax::options::internal::RequestBuilder for ListConnectivityTests {
189 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
190 &mut self.0.options
191 }
192 }
193
194 #[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<gax::options::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(gax::response::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 gax::options::internal::RequestBuilder for GetConnectivityTest {
255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
256 &mut self.0.options
257 }
258 }
259
260 #[derive(Clone, Debug)]
279 pub struct CreateConnectivityTest(RequestBuilder<crate::model::CreateConnectivityTestRequest>);
280
281 impl CreateConnectivityTest {
282 pub(crate) fn new(
283 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
284 ) -> Self {
285 Self(RequestBuilder::new(stub))
286 }
287
288 pub fn with_request<V: Into<crate::model::CreateConnectivityTestRequest>>(
290 mut self,
291 v: V,
292 ) -> Self {
293 self.0.request = v.into();
294 self
295 }
296
297 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
299 self.0.options = v.into();
300 self
301 }
302
303 pub async fn send(self) -> Result<longrunning::model::Operation> {
310 (*self.0.stub)
311 .create_connectivity_test(self.0.request, self.0.options)
312 .await
313 .map(gax::response::Response::into_body)
314 }
315
316 pub fn poller(
318 self,
319 ) -> impl lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
320 {
321 type Operation = lro::internal::Operation<
322 crate::model::ConnectivityTest,
323 crate::model::OperationMetadata,
324 >;
325 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
326 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
327
328 let stub = self.0.stub.clone();
329 let mut options = self.0.options.clone();
330 options.set_retry_policy(gax::retry_policy::NeverRetry);
331 let query = move |name| {
332 let stub = stub.clone();
333 let options = options.clone();
334 async {
335 let op = GetOperation::new(stub)
336 .set_name(name)
337 .with_options(options)
338 .send()
339 .await?;
340 Ok(Operation::new(op))
341 }
342 };
343
344 let start = move || async {
345 let op = self.send().await?;
346 Ok(Operation::new(op))
347 };
348
349 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
350 }
351
352 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
356 self.0.request.parent = v.into();
357 self
358 }
359
360 pub fn set_test_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
364 self.0.request.test_id = v.into();
365 self
366 }
367
368 pub fn set_resource<T>(mut self, v: T) -> Self
372 where
373 T: std::convert::Into<crate::model::ConnectivityTest>,
374 {
375 self.0.request.resource = std::option::Option::Some(v.into());
376 self
377 }
378
379 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
383 where
384 T: std::convert::Into<crate::model::ConnectivityTest>,
385 {
386 self.0.request.resource = v.map(|x| x.into());
387 self
388 }
389 }
390
391 #[doc(hidden)]
392 impl gax::options::internal::RequestBuilder for CreateConnectivityTest {
393 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
394 &mut self.0.options
395 }
396 }
397
398 #[derive(Clone, Debug)]
417 pub struct UpdateConnectivityTest(RequestBuilder<crate::model::UpdateConnectivityTestRequest>);
418
419 impl UpdateConnectivityTest {
420 pub(crate) fn new(
421 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
422 ) -> Self {
423 Self(RequestBuilder::new(stub))
424 }
425
426 pub fn with_request<V: Into<crate::model::UpdateConnectivityTestRequest>>(
428 mut self,
429 v: V,
430 ) -> Self {
431 self.0.request = v.into();
432 self
433 }
434
435 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
437 self.0.options = v.into();
438 self
439 }
440
441 pub async fn send(self) -> Result<longrunning::model::Operation> {
448 (*self.0.stub)
449 .update_connectivity_test(self.0.request, self.0.options)
450 .await
451 .map(gax::response::Response::into_body)
452 }
453
454 pub fn poller(
456 self,
457 ) -> impl lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
458 {
459 type Operation = lro::internal::Operation<
460 crate::model::ConnectivityTest,
461 crate::model::OperationMetadata,
462 >;
463 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
464 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
465
466 let stub = self.0.stub.clone();
467 let mut options = self.0.options.clone();
468 options.set_retry_policy(gax::retry_policy::NeverRetry);
469 let query = move |name| {
470 let stub = stub.clone();
471 let options = options.clone();
472 async {
473 let op = GetOperation::new(stub)
474 .set_name(name)
475 .with_options(options)
476 .send()
477 .await?;
478 Ok(Operation::new(op))
479 }
480 };
481
482 let start = move || async {
483 let op = self.send().await?;
484 Ok(Operation::new(op))
485 };
486
487 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
488 }
489
490 pub fn set_update_mask<T>(mut self, v: T) -> Self
494 where
495 T: std::convert::Into<wkt::FieldMask>,
496 {
497 self.0.request.update_mask = std::option::Option::Some(v.into());
498 self
499 }
500
501 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
505 where
506 T: std::convert::Into<wkt::FieldMask>,
507 {
508 self.0.request.update_mask = v.map(|x| x.into());
509 self
510 }
511
512 pub fn set_resource<T>(mut self, v: T) -> Self
516 where
517 T: std::convert::Into<crate::model::ConnectivityTest>,
518 {
519 self.0.request.resource = std::option::Option::Some(v.into());
520 self
521 }
522
523 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
527 where
528 T: std::convert::Into<crate::model::ConnectivityTest>,
529 {
530 self.0.request.resource = v.map(|x| x.into());
531 self
532 }
533 }
534
535 #[doc(hidden)]
536 impl gax::options::internal::RequestBuilder for UpdateConnectivityTest {
537 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
538 &mut self.0.options
539 }
540 }
541
542 #[derive(Clone, Debug)]
561 pub struct RerunConnectivityTest(RequestBuilder<crate::model::RerunConnectivityTestRequest>);
562
563 impl RerunConnectivityTest {
564 pub(crate) fn new(
565 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
566 ) -> Self {
567 Self(RequestBuilder::new(stub))
568 }
569
570 pub fn with_request<V: Into<crate::model::RerunConnectivityTestRequest>>(
572 mut self,
573 v: V,
574 ) -> Self {
575 self.0.request = v.into();
576 self
577 }
578
579 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
581 self.0.options = v.into();
582 self
583 }
584
585 pub async fn send(self) -> Result<longrunning::model::Operation> {
592 (*self.0.stub)
593 .rerun_connectivity_test(self.0.request, self.0.options)
594 .await
595 .map(gax::response::Response::into_body)
596 }
597
598 pub fn poller(
600 self,
601 ) -> impl lro::Poller<crate::model::ConnectivityTest, crate::model::OperationMetadata>
602 {
603 type Operation = lro::internal::Operation<
604 crate::model::ConnectivityTest,
605 crate::model::OperationMetadata,
606 >;
607 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
608 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
609
610 let stub = self.0.stub.clone();
611 let mut options = self.0.options.clone();
612 options.set_retry_policy(gax::retry_policy::NeverRetry);
613 let query = move |name| {
614 let stub = stub.clone();
615 let options = options.clone();
616 async {
617 let op = GetOperation::new(stub)
618 .set_name(name)
619 .with_options(options)
620 .send()
621 .await?;
622 Ok(Operation::new(op))
623 }
624 };
625
626 let start = move || async {
627 let op = self.send().await?;
628 Ok(Operation::new(op))
629 };
630
631 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
632 }
633
634 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
638 self.0.request.name = v.into();
639 self
640 }
641 }
642
643 #[doc(hidden)]
644 impl gax::options::internal::RequestBuilder for RerunConnectivityTest {
645 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
646 &mut self.0.options
647 }
648 }
649
650 #[derive(Clone, Debug)]
669 pub struct DeleteConnectivityTest(RequestBuilder<crate::model::DeleteConnectivityTestRequest>);
670
671 impl DeleteConnectivityTest {
672 pub(crate) fn new(
673 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
674 ) -> Self {
675 Self(RequestBuilder::new(stub))
676 }
677
678 pub fn with_request<V: Into<crate::model::DeleteConnectivityTestRequest>>(
680 mut self,
681 v: V,
682 ) -> Self {
683 self.0.request = v.into();
684 self
685 }
686
687 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
689 self.0.options = v.into();
690 self
691 }
692
693 pub async fn send(self) -> Result<longrunning::model::Operation> {
700 (*self.0.stub)
701 .delete_connectivity_test(self.0.request, self.0.options)
702 .await
703 .map(gax::response::Response::into_body)
704 }
705
706 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
708 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
709 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
710 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
711
712 let stub = self.0.stub.clone();
713 let mut options = self.0.options.clone();
714 options.set_retry_policy(gax::retry_policy::NeverRetry);
715 let query = move |name| {
716 let stub = stub.clone();
717 let options = options.clone();
718 async {
719 let op = GetOperation::new(stub)
720 .set_name(name)
721 .with_options(options)
722 .send()
723 .await?;
724 Ok(Operation::new(op))
725 }
726 };
727
728 let start = move || async {
729 let op = self.send().await?;
730 Ok(Operation::new(op))
731 };
732
733 lro::internal::new_unit_response_poller(
734 polling_error_policy,
735 polling_backoff_policy,
736 start,
737 query,
738 )
739 }
740
741 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
745 self.0.request.name = v.into();
746 self
747 }
748 }
749
750 #[doc(hidden)]
751 impl gax::options::internal::RequestBuilder for DeleteConnectivityTest {
752 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
753 &mut self.0.options
754 }
755 }
756
757 #[derive(Clone, Debug)]
779 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
780
781 impl ListLocations {
782 pub(crate) fn new(
783 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
784 ) -> Self {
785 Self(RequestBuilder::new(stub))
786 }
787
788 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
790 mut self,
791 v: V,
792 ) -> Self {
793 self.0.request = v.into();
794 self
795 }
796
797 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
799 self.0.options = v.into();
800 self
801 }
802
803 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
805 (*self.0.stub)
806 .list_locations(self.0.request, self.0.options)
807 .await
808 .map(gax::response::Response::into_body)
809 }
810
811 pub fn by_page(
813 self,
814 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
815 {
816 use std::clone::Clone;
817 let token = self.0.request.page_token.clone();
818 let execute = move |token: String| {
819 let mut builder = self.clone();
820 builder.0.request = builder.0.request.set_page_token(token);
821 builder.send()
822 };
823 gax::paginator::internal::new_paginator(token, execute)
824 }
825
826 pub fn by_item(
828 self,
829 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
830 {
831 use gax::paginator::Paginator;
832 self.by_page().items()
833 }
834
835 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
837 self.0.request.name = v.into();
838 self
839 }
840
841 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
843 self.0.request.filter = v.into();
844 self
845 }
846
847 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
849 self.0.request.page_size = v.into();
850 self
851 }
852
853 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
855 self.0.request.page_token = v.into();
856 self
857 }
858 }
859
860 #[doc(hidden)]
861 impl gax::options::internal::RequestBuilder for ListLocations {
862 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
863 &mut self.0.options
864 }
865 }
866
867 #[derive(Clone, Debug)]
885 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
886
887 impl GetLocation {
888 pub(crate) fn new(
889 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
890 ) -> Self {
891 Self(RequestBuilder::new(stub))
892 }
893
894 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
896 self.0.request = v.into();
897 self
898 }
899
900 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
902 self.0.options = v.into();
903 self
904 }
905
906 pub async fn send(self) -> Result<location::model::Location> {
908 (*self.0.stub)
909 .get_location(self.0.request, self.0.options)
910 .await
911 .map(gax::response::Response::into_body)
912 }
913
914 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
916 self.0.request.name = v.into();
917 self
918 }
919 }
920
921 #[doc(hidden)]
922 impl gax::options::internal::RequestBuilder for GetLocation {
923 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
924 &mut self.0.options
925 }
926 }
927
928 #[derive(Clone, Debug)]
946 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
947
948 impl SetIamPolicy {
949 pub(crate) fn new(
950 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
951 ) -> Self {
952 Self(RequestBuilder::new(stub))
953 }
954
955 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
957 self.0.request = v.into();
958 self
959 }
960
961 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
963 self.0.options = v.into();
964 self
965 }
966
967 pub async fn send(self) -> Result<iam_v1::model::Policy> {
969 (*self.0.stub)
970 .set_iam_policy(self.0.request, self.0.options)
971 .await
972 .map(gax::response::Response::into_body)
973 }
974
975 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
979 self.0.request.resource = v.into();
980 self
981 }
982
983 pub fn set_policy<T>(mut self, v: T) -> Self
987 where
988 T: std::convert::Into<iam_v1::model::Policy>,
989 {
990 self.0.request.policy = std::option::Option::Some(v.into());
991 self
992 }
993
994 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
998 where
999 T: std::convert::Into<iam_v1::model::Policy>,
1000 {
1001 self.0.request.policy = v.map(|x| x.into());
1002 self
1003 }
1004
1005 pub fn set_update_mask<T>(mut self, v: T) -> Self
1007 where
1008 T: std::convert::Into<wkt::FieldMask>,
1009 {
1010 self.0.request.update_mask = std::option::Option::Some(v.into());
1011 self
1012 }
1013
1014 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1016 where
1017 T: std::convert::Into<wkt::FieldMask>,
1018 {
1019 self.0.request.update_mask = v.map(|x| x.into());
1020 self
1021 }
1022 }
1023
1024 #[doc(hidden)]
1025 impl gax::options::internal::RequestBuilder for SetIamPolicy {
1026 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1027 &mut self.0.options
1028 }
1029 }
1030
1031 #[derive(Clone, Debug)]
1049 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
1050
1051 impl GetIamPolicy {
1052 pub(crate) fn new(
1053 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1054 ) -> Self {
1055 Self(RequestBuilder::new(stub))
1056 }
1057
1058 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
1060 self.0.request = v.into();
1061 self
1062 }
1063
1064 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1066 self.0.options = v.into();
1067 self
1068 }
1069
1070 pub async fn send(self) -> Result<iam_v1::model::Policy> {
1072 (*self.0.stub)
1073 .get_iam_policy(self.0.request, self.0.options)
1074 .await
1075 .map(gax::response::Response::into_body)
1076 }
1077
1078 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1082 self.0.request.resource = v.into();
1083 self
1084 }
1085
1086 pub fn set_options<T>(mut self, v: T) -> Self
1088 where
1089 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1090 {
1091 self.0.request.options = std::option::Option::Some(v.into());
1092 self
1093 }
1094
1095 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1097 where
1098 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
1099 {
1100 self.0.request.options = v.map(|x| x.into());
1101 self
1102 }
1103 }
1104
1105 #[doc(hidden)]
1106 impl gax::options::internal::RequestBuilder for GetIamPolicy {
1107 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1108 &mut self.0.options
1109 }
1110 }
1111
1112 #[derive(Clone, Debug)]
1130 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
1131
1132 impl TestIamPermissions {
1133 pub(crate) fn new(
1134 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1135 ) -> Self {
1136 Self(RequestBuilder::new(stub))
1137 }
1138
1139 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
1141 mut self,
1142 v: V,
1143 ) -> Self {
1144 self.0.request = v.into();
1145 self
1146 }
1147
1148 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1150 self.0.options = v.into();
1151 self
1152 }
1153
1154 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
1156 (*self.0.stub)
1157 .test_iam_permissions(self.0.request, self.0.options)
1158 .await
1159 .map(gax::response::Response::into_body)
1160 }
1161
1162 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1166 self.0.request.resource = v.into();
1167 self
1168 }
1169
1170 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1174 where
1175 T: std::iter::IntoIterator<Item = V>,
1176 V: std::convert::Into<std::string::String>,
1177 {
1178 use std::iter::Iterator;
1179 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1180 self
1181 }
1182 }
1183
1184 #[doc(hidden)]
1185 impl gax::options::internal::RequestBuilder for TestIamPermissions {
1186 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1187 &mut self.0.options
1188 }
1189 }
1190
1191 #[derive(Clone, Debug)]
1213 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1214
1215 impl ListOperations {
1216 pub(crate) fn new(
1217 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1218 ) -> Self {
1219 Self(RequestBuilder::new(stub))
1220 }
1221
1222 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1224 mut self,
1225 v: V,
1226 ) -> Self {
1227 self.0.request = v.into();
1228 self
1229 }
1230
1231 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1233 self.0.options = v.into();
1234 self
1235 }
1236
1237 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1239 (*self.0.stub)
1240 .list_operations(self.0.request, self.0.options)
1241 .await
1242 .map(gax::response::Response::into_body)
1243 }
1244
1245 pub fn by_page(
1247 self,
1248 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1249 {
1250 use std::clone::Clone;
1251 let token = self.0.request.page_token.clone();
1252 let execute = move |token: String| {
1253 let mut builder = self.clone();
1254 builder.0.request = builder.0.request.set_page_token(token);
1255 builder.send()
1256 };
1257 gax::paginator::internal::new_paginator(token, execute)
1258 }
1259
1260 pub fn by_item(
1262 self,
1263 ) -> impl gax::paginator::ItemPaginator<
1264 longrunning::model::ListOperationsResponse,
1265 gax::error::Error,
1266 > {
1267 use gax::paginator::Paginator;
1268 self.by_page().items()
1269 }
1270
1271 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1273 self.0.request.name = v.into();
1274 self
1275 }
1276
1277 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1279 self.0.request.filter = v.into();
1280 self
1281 }
1282
1283 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1285 self.0.request.page_size = v.into();
1286 self
1287 }
1288
1289 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1291 self.0.request.page_token = v.into();
1292 self
1293 }
1294
1295 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1297 self.0.request.return_partial_success = v.into();
1298 self
1299 }
1300 }
1301
1302 #[doc(hidden)]
1303 impl gax::options::internal::RequestBuilder for ListOperations {
1304 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1305 &mut self.0.options
1306 }
1307 }
1308
1309 #[derive(Clone, Debug)]
1327 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1328
1329 impl GetOperation {
1330 pub(crate) fn new(
1331 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1332 ) -> Self {
1333 Self(RequestBuilder::new(stub))
1334 }
1335
1336 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1338 mut self,
1339 v: V,
1340 ) -> Self {
1341 self.0.request = v.into();
1342 self
1343 }
1344
1345 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1347 self.0.options = v.into();
1348 self
1349 }
1350
1351 pub async fn send(self) -> Result<longrunning::model::Operation> {
1353 (*self.0.stub)
1354 .get_operation(self.0.request, self.0.options)
1355 .await
1356 .map(gax::response::Response::into_body)
1357 }
1358
1359 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1361 self.0.request.name = v.into();
1362 self
1363 }
1364 }
1365
1366 #[doc(hidden)]
1367 impl gax::options::internal::RequestBuilder for GetOperation {
1368 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1369 &mut self.0.options
1370 }
1371 }
1372
1373 #[derive(Clone, Debug)]
1391 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1392
1393 impl DeleteOperation {
1394 pub(crate) fn new(
1395 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1396 ) -> Self {
1397 Self(RequestBuilder::new(stub))
1398 }
1399
1400 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1402 mut self,
1403 v: V,
1404 ) -> Self {
1405 self.0.request = v.into();
1406 self
1407 }
1408
1409 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1411 self.0.options = v.into();
1412 self
1413 }
1414
1415 pub async fn send(self) -> Result<()> {
1417 (*self.0.stub)
1418 .delete_operation(self.0.request, self.0.options)
1419 .await
1420 .map(gax::response::Response::into_body)
1421 }
1422
1423 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1425 self.0.request.name = v.into();
1426 self
1427 }
1428 }
1429
1430 #[doc(hidden)]
1431 impl gax::options::internal::RequestBuilder for DeleteOperation {
1432 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1433 &mut self.0.options
1434 }
1435 }
1436
1437 #[derive(Clone, Debug)]
1455 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1456
1457 impl CancelOperation {
1458 pub(crate) fn new(
1459 stub: std::sync::Arc<dyn super::super::stub::dynamic::ReachabilityService>,
1460 ) -> Self {
1461 Self(RequestBuilder::new(stub))
1462 }
1463
1464 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1466 mut self,
1467 v: V,
1468 ) -> Self {
1469 self.0.request = v.into();
1470 self
1471 }
1472
1473 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1475 self.0.options = v.into();
1476 self
1477 }
1478
1479 pub async fn send(self) -> Result<()> {
1481 (*self.0.stub)
1482 .cancel_operation(self.0.request, self.0.options)
1483 .await
1484 .map(gax::response::Response::into_body)
1485 }
1486
1487 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1489 self.0.request.name = v.into();
1490 self
1491 }
1492 }
1493
1494 #[doc(hidden)]
1495 impl gax::options::internal::RequestBuilder for CancelOperation {
1496 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1497 &mut self.0.options
1498 }
1499 }
1500}
1501
1502pub mod vpc_flow_logs_service {
1503 use crate::Result;
1504
1505 pub type ClientBuilder =
1519 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1520
1521 pub(crate) mod client {
1522 use super::super::super::client::VpcFlowLogsService;
1523 pub struct Factory;
1524 impl gax::client_builder::internal::ClientFactory for Factory {
1525 type Client = VpcFlowLogsService;
1526 type Credentials = gaxi::options::Credentials;
1527 async fn build(
1528 self,
1529 config: gaxi::options::ClientConfig,
1530 ) -> gax::client_builder::Result<Self::Client> {
1531 Self::Client::new(config).await
1532 }
1533 }
1534 }
1535
1536 #[derive(Clone, Debug)]
1538 pub(crate) struct RequestBuilder<R: std::default::Default> {
1539 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1540 request: R,
1541 options: gax::options::RequestOptions,
1542 }
1543
1544 impl<R> RequestBuilder<R>
1545 where
1546 R: std::default::Default,
1547 {
1548 pub(crate) fn new(
1549 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1550 ) -> Self {
1551 Self {
1552 stub,
1553 request: R::default(),
1554 options: gax::options::RequestOptions::default(),
1555 }
1556 }
1557 }
1558
1559 #[derive(Clone, Debug)]
1581 pub struct ListVpcFlowLogsConfigs(RequestBuilder<crate::model::ListVpcFlowLogsConfigsRequest>);
1582
1583 impl ListVpcFlowLogsConfigs {
1584 pub(crate) fn new(
1585 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1586 ) -> Self {
1587 Self(RequestBuilder::new(stub))
1588 }
1589
1590 pub fn with_request<V: Into<crate::model::ListVpcFlowLogsConfigsRequest>>(
1592 mut self,
1593 v: V,
1594 ) -> Self {
1595 self.0.request = v.into();
1596 self
1597 }
1598
1599 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1601 self.0.options = v.into();
1602 self
1603 }
1604
1605 pub async fn send(self) -> Result<crate::model::ListVpcFlowLogsConfigsResponse> {
1607 (*self.0.stub)
1608 .list_vpc_flow_logs_configs(self.0.request, self.0.options)
1609 .await
1610 .map(gax::response::Response::into_body)
1611 }
1612
1613 pub fn by_page(
1615 self,
1616 ) -> impl gax::paginator::Paginator<
1617 crate::model::ListVpcFlowLogsConfigsResponse,
1618 gax::error::Error,
1619 > {
1620 use std::clone::Clone;
1621 let token = self.0.request.page_token.clone();
1622 let execute = move |token: String| {
1623 let mut builder = self.clone();
1624 builder.0.request = builder.0.request.set_page_token(token);
1625 builder.send()
1626 };
1627 gax::paginator::internal::new_paginator(token, execute)
1628 }
1629
1630 pub fn by_item(
1632 self,
1633 ) -> impl gax::paginator::ItemPaginator<
1634 crate::model::ListVpcFlowLogsConfigsResponse,
1635 gax::error::Error,
1636 > {
1637 use gax::paginator::Paginator;
1638 self.by_page().items()
1639 }
1640
1641 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1645 self.0.request.parent = v.into();
1646 self
1647 }
1648
1649 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1651 self.0.request.page_size = v.into();
1652 self
1653 }
1654
1655 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1657 self.0.request.page_token = v.into();
1658 self
1659 }
1660
1661 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1663 self.0.request.filter = v.into();
1664 self
1665 }
1666
1667 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1669 self.0.request.order_by = v.into();
1670 self
1671 }
1672 }
1673
1674 #[doc(hidden)]
1675 impl gax::options::internal::RequestBuilder for ListVpcFlowLogsConfigs {
1676 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1677 &mut self.0.options
1678 }
1679 }
1680
1681 #[derive(Clone, Debug)]
1699 pub struct GetVpcFlowLogsConfig(RequestBuilder<crate::model::GetVpcFlowLogsConfigRequest>);
1700
1701 impl GetVpcFlowLogsConfig {
1702 pub(crate) fn new(
1703 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1704 ) -> Self {
1705 Self(RequestBuilder::new(stub))
1706 }
1707
1708 pub fn with_request<V: Into<crate::model::GetVpcFlowLogsConfigRequest>>(
1710 mut self,
1711 v: V,
1712 ) -> Self {
1713 self.0.request = v.into();
1714 self
1715 }
1716
1717 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1719 self.0.options = v.into();
1720 self
1721 }
1722
1723 pub async fn send(self) -> Result<crate::model::VpcFlowLogsConfig> {
1725 (*self.0.stub)
1726 .get_vpc_flow_logs_config(self.0.request, self.0.options)
1727 .await
1728 .map(gax::response::Response::into_body)
1729 }
1730
1731 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1735 self.0.request.name = v.into();
1736 self
1737 }
1738 }
1739
1740 #[doc(hidden)]
1741 impl gax::options::internal::RequestBuilder for GetVpcFlowLogsConfig {
1742 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1743 &mut self.0.options
1744 }
1745 }
1746
1747 #[derive(Clone, Debug)]
1766 pub struct CreateVpcFlowLogsConfig(
1767 RequestBuilder<crate::model::CreateVpcFlowLogsConfigRequest>,
1768 );
1769
1770 impl CreateVpcFlowLogsConfig {
1771 pub(crate) fn new(
1772 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1773 ) -> Self {
1774 Self(RequestBuilder::new(stub))
1775 }
1776
1777 pub fn with_request<V: Into<crate::model::CreateVpcFlowLogsConfigRequest>>(
1779 mut self,
1780 v: V,
1781 ) -> Self {
1782 self.0.request = v.into();
1783 self
1784 }
1785
1786 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1788 self.0.options = v.into();
1789 self
1790 }
1791
1792 pub async fn send(self) -> Result<longrunning::model::Operation> {
1799 (*self.0.stub)
1800 .create_vpc_flow_logs_config(self.0.request, self.0.options)
1801 .await
1802 .map(gax::response::Response::into_body)
1803 }
1804
1805 pub fn poller(
1807 self,
1808 ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
1809 {
1810 type Operation = lro::internal::Operation<
1811 crate::model::VpcFlowLogsConfig,
1812 crate::model::OperationMetadata,
1813 >;
1814 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1815 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1816
1817 let stub = self.0.stub.clone();
1818 let mut options = self.0.options.clone();
1819 options.set_retry_policy(gax::retry_policy::NeverRetry);
1820 let query = move |name| {
1821 let stub = stub.clone();
1822 let options = options.clone();
1823 async {
1824 let op = GetOperation::new(stub)
1825 .set_name(name)
1826 .with_options(options)
1827 .send()
1828 .await?;
1829 Ok(Operation::new(op))
1830 }
1831 };
1832
1833 let start = move || async {
1834 let op = self.send().await?;
1835 Ok(Operation::new(op))
1836 };
1837
1838 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1839 }
1840
1841 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1845 self.0.request.parent = v.into();
1846 self
1847 }
1848
1849 pub fn set_vpc_flow_logs_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1853 self.0.request.vpc_flow_logs_config_id = v.into();
1854 self
1855 }
1856
1857 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
1861 where
1862 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
1863 {
1864 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
1865 self
1866 }
1867
1868 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
1872 where
1873 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
1874 {
1875 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
1876 self
1877 }
1878 }
1879
1880 #[doc(hidden)]
1881 impl gax::options::internal::RequestBuilder for CreateVpcFlowLogsConfig {
1882 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1883 &mut self.0.options
1884 }
1885 }
1886
1887 #[derive(Clone, Debug)]
1906 pub struct UpdateVpcFlowLogsConfig(
1907 RequestBuilder<crate::model::UpdateVpcFlowLogsConfigRequest>,
1908 );
1909
1910 impl UpdateVpcFlowLogsConfig {
1911 pub(crate) fn new(
1912 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
1913 ) -> Self {
1914 Self(RequestBuilder::new(stub))
1915 }
1916
1917 pub fn with_request<V: Into<crate::model::UpdateVpcFlowLogsConfigRequest>>(
1919 mut self,
1920 v: V,
1921 ) -> Self {
1922 self.0.request = v.into();
1923 self
1924 }
1925
1926 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1928 self.0.options = v.into();
1929 self
1930 }
1931
1932 pub async fn send(self) -> Result<longrunning::model::Operation> {
1939 (*self.0.stub)
1940 .update_vpc_flow_logs_config(self.0.request, self.0.options)
1941 .await
1942 .map(gax::response::Response::into_body)
1943 }
1944
1945 pub fn poller(
1947 self,
1948 ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
1949 {
1950 type Operation = lro::internal::Operation<
1951 crate::model::VpcFlowLogsConfig,
1952 crate::model::OperationMetadata,
1953 >;
1954 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1955 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1956
1957 let stub = self.0.stub.clone();
1958 let mut options = self.0.options.clone();
1959 options.set_retry_policy(gax::retry_policy::NeverRetry);
1960 let query = move |name| {
1961 let stub = stub.clone();
1962 let options = options.clone();
1963 async {
1964 let op = GetOperation::new(stub)
1965 .set_name(name)
1966 .with_options(options)
1967 .send()
1968 .await?;
1969 Ok(Operation::new(op))
1970 }
1971 };
1972
1973 let start = move || async {
1974 let op = self.send().await?;
1975 Ok(Operation::new(op))
1976 };
1977
1978 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1979 }
1980
1981 pub fn set_update_mask<T>(mut self, v: T) -> Self
1985 where
1986 T: std::convert::Into<wkt::FieldMask>,
1987 {
1988 self.0.request.update_mask = std::option::Option::Some(v.into());
1989 self
1990 }
1991
1992 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1996 where
1997 T: std::convert::Into<wkt::FieldMask>,
1998 {
1999 self.0.request.update_mask = v.map(|x| x.into());
2000 self
2001 }
2002
2003 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
2007 where
2008 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
2009 {
2010 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
2011 self
2012 }
2013
2014 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
2018 where
2019 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
2020 {
2021 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
2022 self
2023 }
2024 }
2025
2026 #[doc(hidden)]
2027 impl gax::options::internal::RequestBuilder for UpdateVpcFlowLogsConfig {
2028 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2029 &mut self.0.options
2030 }
2031 }
2032
2033 #[derive(Clone, Debug)]
2052 pub struct DeleteVpcFlowLogsConfig(
2053 RequestBuilder<crate::model::DeleteVpcFlowLogsConfigRequest>,
2054 );
2055
2056 impl DeleteVpcFlowLogsConfig {
2057 pub(crate) fn new(
2058 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2059 ) -> Self {
2060 Self(RequestBuilder::new(stub))
2061 }
2062
2063 pub fn with_request<V: Into<crate::model::DeleteVpcFlowLogsConfigRequest>>(
2065 mut self,
2066 v: V,
2067 ) -> Self {
2068 self.0.request = v.into();
2069 self
2070 }
2071
2072 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2074 self.0.options = v.into();
2075 self
2076 }
2077
2078 pub async fn send(self) -> Result<longrunning::model::Operation> {
2085 (*self.0.stub)
2086 .delete_vpc_flow_logs_config(self.0.request, self.0.options)
2087 .await
2088 .map(gax::response::Response::into_body)
2089 }
2090
2091 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2093 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2094 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2095 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2096
2097 let stub = self.0.stub.clone();
2098 let mut options = self.0.options.clone();
2099 options.set_retry_policy(gax::retry_policy::NeverRetry);
2100 let query = move |name| {
2101 let stub = stub.clone();
2102 let options = options.clone();
2103 async {
2104 let op = GetOperation::new(stub)
2105 .set_name(name)
2106 .with_options(options)
2107 .send()
2108 .await?;
2109 Ok(Operation::new(op))
2110 }
2111 };
2112
2113 let start = move || async {
2114 let op = self.send().await?;
2115 Ok(Operation::new(op))
2116 };
2117
2118 lro::internal::new_unit_response_poller(
2119 polling_error_policy,
2120 polling_backoff_policy,
2121 start,
2122 query,
2123 )
2124 }
2125
2126 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2130 self.0.request.name = v.into();
2131 self
2132 }
2133 }
2134
2135 #[doc(hidden)]
2136 impl gax::options::internal::RequestBuilder for DeleteVpcFlowLogsConfig {
2137 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2138 &mut self.0.options
2139 }
2140 }
2141
2142 #[derive(Clone, Debug)]
2164 pub struct QueryOrgVpcFlowLogsConfigs(
2165 RequestBuilder<crate::model::QueryOrgVpcFlowLogsConfigsRequest>,
2166 );
2167
2168 impl QueryOrgVpcFlowLogsConfigs {
2169 pub(crate) fn new(
2170 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2171 ) -> Self {
2172 Self(RequestBuilder::new(stub))
2173 }
2174
2175 pub fn with_request<V: Into<crate::model::QueryOrgVpcFlowLogsConfigsRequest>>(
2177 mut self,
2178 v: V,
2179 ) -> Self {
2180 self.0.request = v.into();
2181 self
2182 }
2183
2184 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2186 self.0.options = v.into();
2187 self
2188 }
2189
2190 pub async fn send(self) -> Result<crate::model::QueryOrgVpcFlowLogsConfigsResponse> {
2192 (*self.0.stub)
2193 .query_org_vpc_flow_logs_configs(self.0.request, self.0.options)
2194 .await
2195 .map(gax::response::Response::into_body)
2196 }
2197
2198 pub fn by_page(
2200 self,
2201 ) -> impl gax::paginator::Paginator<
2202 crate::model::QueryOrgVpcFlowLogsConfigsResponse,
2203 gax::error::Error,
2204 > {
2205 use std::clone::Clone;
2206 let token = self.0.request.page_token.clone();
2207 let execute = move |token: String| {
2208 let mut builder = self.clone();
2209 builder.0.request = builder.0.request.set_page_token(token);
2210 builder.send()
2211 };
2212 gax::paginator::internal::new_paginator(token, execute)
2213 }
2214
2215 pub fn by_item(
2217 self,
2218 ) -> impl gax::paginator::ItemPaginator<
2219 crate::model::QueryOrgVpcFlowLogsConfigsResponse,
2220 gax::error::Error,
2221 > {
2222 use gax::paginator::Paginator;
2223 self.by_page().items()
2224 }
2225
2226 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2230 self.0.request.parent = v.into();
2231 self
2232 }
2233
2234 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2236 self.0.request.page_size = v.into();
2237 self
2238 }
2239
2240 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2242 self.0.request.page_token = v.into();
2243 self
2244 }
2245
2246 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2248 self.0.request.filter = v.into();
2249 self
2250 }
2251 }
2252
2253 #[doc(hidden)]
2254 impl gax::options::internal::RequestBuilder for QueryOrgVpcFlowLogsConfigs {
2255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2256 &mut self.0.options
2257 }
2258 }
2259
2260 #[derive(Clone, Debug)]
2282 pub struct ShowEffectiveFlowLogsConfigs(
2283 RequestBuilder<crate::model::ShowEffectiveFlowLogsConfigsRequest>,
2284 );
2285
2286 impl ShowEffectiveFlowLogsConfigs {
2287 pub(crate) fn new(
2288 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2289 ) -> Self {
2290 Self(RequestBuilder::new(stub))
2291 }
2292
2293 pub fn with_request<V: Into<crate::model::ShowEffectiveFlowLogsConfigsRequest>>(
2295 mut self,
2296 v: V,
2297 ) -> Self {
2298 self.0.request = v.into();
2299 self
2300 }
2301
2302 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2304 self.0.options = v.into();
2305 self
2306 }
2307
2308 pub async fn send(self) -> Result<crate::model::ShowEffectiveFlowLogsConfigsResponse> {
2310 (*self.0.stub)
2311 .show_effective_flow_logs_configs(self.0.request, self.0.options)
2312 .await
2313 .map(gax::response::Response::into_body)
2314 }
2315
2316 pub fn by_page(
2318 self,
2319 ) -> impl gax::paginator::Paginator<
2320 crate::model::ShowEffectiveFlowLogsConfigsResponse,
2321 gax::error::Error,
2322 > {
2323 use std::clone::Clone;
2324 let token = self.0.request.page_token.clone();
2325 let execute = move |token: String| {
2326 let mut builder = self.clone();
2327 builder.0.request = builder.0.request.set_page_token(token);
2328 builder.send()
2329 };
2330 gax::paginator::internal::new_paginator(token, execute)
2331 }
2332
2333 pub fn by_item(
2335 self,
2336 ) -> impl gax::paginator::ItemPaginator<
2337 crate::model::ShowEffectiveFlowLogsConfigsResponse,
2338 gax::error::Error,
2339 > {
2340 use gax::paginator::Paginator;
2341 self.by_page().items()
2342 }
2343
2344 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2348 self.0.request.parent = v.into();
2349 self
2350 }
2351
2352 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2356 self.0.request.resource = v.into();
2357 self
2358 }
2359
2360 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2362 self.0.request.page_size = v.into();
2363 self
2364 }
2365
2366 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2368 self.0.request.page_token = v.into();
2369 self
2370 }
2371
2372 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2374 self.0.request.filter = v.into();
2375 self
2376 }
2377 }
2378
2379 #[doc(hidden)]
2380 impl gax::options::internal::RequestBuilder for ShowEffectiveFlowLogsConfigs {
2381 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2382 &mut self.0.options
2383 }
2384 }
2385
2386 #[derive(Clone, Debug)]
2408 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2409
2410 impl ListLocations {
2411 pub(crate) fn new(
2412 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2413 ) -> Self {
2414 Self(RequestBuilder::new(stub))
2415 }
2416
2417 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2419 mut self,
2420 v: V,
2421 ) -> Self {
2422 self.0.request = v.into();
2423 self
2424 }
2425
2426 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2428 self.0.options = v.into();
2429 self
2430 }
2431
2432 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2434 (*self.0.stub)
2435 .list_locations(self.0.request, self.0.options)
2436 .await
2437 .map(gax::response::Response::into_body)
2438 }
2439
2440 pub fn by_page(
2442 self,
2443 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2444 {
2445 use std::clone::Clone;
2446 let token = self.0.request.page_token.clone();
2447 let execute = move |token: String| {
2448 let mut builder = self.clone();
2449 builder.0.request = builder.0.request.set_page_token(token);
2450 builder.send()
2451 };
2452 gax::paginator::internal::new_paginator(token, execute)
2453 }
2454
2455 pub fn by_item(
2457 self,
2458 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
2459 {
2460 use gax::paginator::Paginator;
2461 self.by_page().items()
2462 }
2463
2464 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2466 self.0.request.name = v.into();
2467 self
2468 }
2469
2470 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2472 self.0.request.filter = v.into();
2473 self
2474 }
2475
2476 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2478 self.0.request.page_size = v.into();
2479 self
2480 }
2481
2482 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2484 self.0.request.page_token = v.into();
2485 self
2486 }
2487 }
2488
2489 #[doc(hidden)]
2490 impl gax::options::internal::RequestBuilder for ListLocations {
2491 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2492 &mut self.0.options
2493 }
2494 }
2495
2496 #[derive(Clone, Debug)]
2514 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2515
2516 impl GetLocation {
2517 pub(crate) fn new(
2518 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2519 ) -> Self {
2520 Self(RequestBuilder::new(stub))
2521 }
2522
2523 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2525 self.0.request = v.into();
2526 self
2527 }
2528
2529 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2531 self.0.options = v.into();
2532 self
2533 }
2534
2535 pub async fn send(self) -> Result<location::model::Location> {
2537 (*self.0.stub)
2538 .get_location(self.0.request, self.0.options)
2539 .await
2540 .map(gax::response::Response::into_body)
2541 }
2542
2543 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2545 self.0.request.name = v.into();
2546 self
2547 }
2548 }
2549
2550 #[doc(hidden)]
2551 impl gax::options::internal::RequestBuilder for GetLocation {
2552 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2553 &mut self.0.options
2554 }
2555 }
2556
2557 #[derive(Clone, Debug)]
2575 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
2576
2577 impl SetIamPolicy {
2578 pub(crate) fn new(
2579 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2580 ) -> Self {
2581 Self(RequestBuilder::new(stub))
2582 }
2583
2584 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
2586 self.0.request = v.into();
2587 self
2588 }
2589
2590 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2592 self.0.options = v.into();
2593 self
2594 }
2595
2596 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2598 (*self.0.stub)
2599 .set_iam_policy(self.0.request, self.0.options)
2600 .await
2601 .map(gax::response::Response::into_body)
2602 }
2603
2604 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2608 self.0.request.resource = v.into();
2609 self
2610 }
2611
2612 pub fn set_policy<T>(mut self, v: T) -> Self
2616 where
2617 T: std::convert::Into<iam_v1::model::Policy>,
2618 {
2619 self.0.request.policy = std::option::Option::Some(v.into());
2620 self
2621 }
2622
2623 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2627 where
2628 T: std::convert::Into<iam_v1::model::Policy>,
2629 {
2630 self.0.request.policy = v.map(|x| x.into());
2631 self
2632 }
2633
2634 pub fn set_update_mask<T>(mut self, v: T) -> Self
2636 where
2637 T: std::convert::Into<wkt::FieldMask>,
2638 {
2639 self.0.request.update_mask = std::option::Option::Some(v.into());
2640 self
2641 }
2642
2643 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2645 where
2646 T: std::convert::Into<wkt::FieldMask>,
2647 {
2648 self.0.request.update_mask = v.map(|x| x.into());
2649 self
2650 }
2651 }
2652
2653 #[doc(hidden)]
2654 impl gax::options::internal::RequestBuilder for SetIamPolicy {
2655 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2656 &mut self.0.options
2657 }
2658 }
2659
2660 #[derive(Clone, Debug)]
2678 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
2679
2680 impl GetIamPolicy {
2681 pub(crate) fn new(
2682 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2683 ) -> Self {
2684 Self(RequestBuilder::new(stub))
2685 }
2686
2687 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
2689 self.0.request = v.into();
2690 self
2691 }
2692
2693 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2695 self.0.options = v.into();
2696 self
2697 }
2698
2699 pub async fn send(self) -> Result<iam_v1::model::Policy> {
2701 (*self.0.stub)
2702 .get_iam_policy(self.0.request, self.0.options)
2703 .await
2704 .map(gax::response::Response::into_body)
2705 }
2706
2707 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2711 self.0.request.resource = v.into();
2712 self
2713 }
2714
2715 pub fn set_options<T>(mut self, v: T) -> Self
2717 where
2718 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2719 {
2720 self.0.request.options = std::option::Option::Some(v.into());
2721 self
2722 }
2723
2724 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2726 where
2727 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
2728 {
2729 self.0.request.options = v.map(|x| x.into());
2730 self
2731 }
2732 }
2733
2734 #[doc(hidden)]
2735 impl gax::options::internal::RequestBuilder for GetIamPolicy {
2736 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2737 &mut self.0.options
2738 }
2739 }
2740
2741 #[derive(Clone, Debug)]
2759 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
2760
2761 impl TestIamPermissions {
2762 pub(crate) fn new(
2763 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2764 ) -> Self {
2765 Self(RequestBuilder::new(stub))
2766 }
2767
2768 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
2770 mut self,
2771 v: V,
2772 ) -> Self {
2773 self.0.request = v.into();
2774 self
2775 }
2776
2777 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2779 self.0.options = v.into();
2780 self
2781 }
2782
2783 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
2785 (*self.0.stub)
2786 .test_iam_permissions(self.0.request, self.0.options)
2787 .await
2788 .map(gax::response::Response::into_body)
2789 }
2790
2791 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2795 self.0.request.resource = v.into();
2796 self
2797 }
2798
2799 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2803 where
2804 T: std::iter::IntoIterator<Item = V>,
2805 V: std::convert::Into<std::string::String>,
2806 {
2807 use std::iter::Iterator;
2808 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2809 self
2810 }
2811 }
2812
2813 #[doc(hidden)]
2814 impl gax::options::internal::RequestBuilder for TestIamPermissions {
2815 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2816 &mut self.0.options
2817 }
2818 }
2819
2820 #[derive(Clone, Debug)]
2842 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2843
2844 impl ListOperations {
2845 pub(crate) fn new(
2846 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2847 ) -> Self {
2848 Self(RequestBuilder::new(stub))
2849 }
2850
2851 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2853 mut self,
2854 v: V,
2855 ) -> Self {
2856 self.0.request = v.into();
2857 self
2858 }
2859
2860 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2862 self.0.options = v.into();
2863 self
2864 }
2865
2866 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2868 (*self.0.stub)
2869 .list_operations(self.0.request, self.0.options)
2870 .await
2871 .map(gax::response::Response::into_body)
2872 }
2873
2874 pub fn by_page(
2876 self,
2877 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2878 {
2879 use std::clone::Clone;
2880 let token = self.0.request.page_token.clone();
2881 let execute = move |token: String| {
2882 let mut builder = self.clone();
2883 builder.0.request = builder.0.request.set_page_token(token);
2884 builder.send()
2885 };
2886 gax::paginator::internal::new_paginator(token, execute)
2887 }
2888
2889 pub fn by_item(
2891 self,
2892 ) -> impl gax::paginator::ItemPaginator<
2893 longrunning::model::ListOperationsResponse,
2894 gax::error::Error,
2895 > {
2896 use gax::paginator::Paginator;
2897 self.by_page().items()
2898 }
2899
2900 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2902 self.0.request.name = v.into();
2903 self
2904 }
2905
2906 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2908 self.0.request.filter = v.into();
2909 self
2910 }
2911
2912 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2914 self.0.request.page_size = v.into();
2915 self
2916 }
2917
2918 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2920 self.0.request.page_token = v.into();
2921 self
2922 }
2923
2924 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2926 self.0.request.return_partial_success = v.into();
2927 self
2928 }
2929 }
2930
2931 #[doc(hidden)]
2932 impl gax::options::internal::RequestBuilder for ListOperations {
2933 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2934 &mut self.0.options
2935 }
2936 }
2937
2938 #[derive(Clone, Debug)]
2956 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2957
2958 impl GetOperation {
2959 pub(crate) fn new(
2960 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
2961 ) -> Self {
2962 Self(RequestBuilder::new(stub))
2963 }
2964
2965 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2967 mut self,
2968 v: V,
2969 ) -> Self {
2970 self.0.request = v.into();
2971 self
2972 }
2973
2974 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2976 self.0.options = v.into();
2977 self
2978 }
2979
2980 pub async fn send(self) -> Result<longrunning::model::Operation> {
2982 (*self.0.stub)
2983 .get_operation(self.0.request, self.0.options)
2984 .await
2985 .map(gax::response::Response::into_body)
2986 }
2987
2988 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2990 self.0.request.name = v.into();
2991 self
2992 }
2993 }
2994
2995 #[doc(hidden)]
2996 impl gax::options::internal::RequestBuilder for GetOperation {
2997 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2998 &mut self.0.options
2999 }
3000 }
3001
3002 #[derive(Clone, Debug)]
3020 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3021
3022 impl DeleteOperation {
3023 pub(crate) fn new(
3024 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
3025 ) -> Self {
3026 Self(RequestBuilder::new(stub))
3027 }
3028
3029 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3031 mut self,
3032 v: V,
3033 ) -> Self {
3034 self.0.request = v.into();
3035 self
3036 }
3037
3038 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3040 self.0.options = v.into();
3041 self
3042 }
3043
3044 pub async fn send(self) -> Result<()> {
3046 (*self.0.stub)
3047 .delete_operation(self.0.request, self.0.options)
3048 .await
3049 .map(gax::response::Response::into_body)
3050 }
3051
3052 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3054 self.0.request.name = v.into();
3055 self
3056 }
3057 }
3058
3059 #[doc(hidden)]
3060 impl gax::options::internal::RequestBuilder for DeleteOperation {
3061 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3062 &mut self.0.options
3063 }
3064 }
3065
3066 #[derive(Clone, Debug)]
3084 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3085
3086 impl CancelOperation {
3087 pub(crate) fn new(
3088 stub: std::sync::Arc<dyn super::super::stub::dynamic::VpcFlowLogsService>,
3089 ) -> Self {
3090 Self(RequestBuilder::new(stub))
3091 }
3092
3093 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3095 mut self,
3096 v: V,
3097 ) -> Self {
3098 self.0.request = v.into();
3099 self
3100 }
3101
3102 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3104 self.0.options = v.into();
3105 self
3106 }
3107
3108 pub async fn send(self) -> Result<()> {
3110 (*self.0.stub)
3111 .cancel_operation(self.0.request, self.0.options)
3112 .await
3113 .map(gax::response::Response::into_body)
3114 }
3115
3116 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3118 self.0.request.name = v.into();
3119 self
3120 }
3121 }
3122
3123 #[doc(hidden)]
3124 impl gax::options::internal::RequestBuilder for CancelOperation {
3125 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3126 &mut self.0.options
3127 }
3128 }
3129}
3130
3131pub mod organization_vpc_flow_logs_service {
3132 use crate::Result;
3133
3134 pub type ClientBuilder =
3148 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3149
3150 pub(crate) mod client {
3151 use super::super::super::client::OrganizationVpcFlowLogsService;
3152 pub struct Factory;
3153 impl gax::client_builder::internal::ClientFactory for Factory {
3154 type Client = OrganizationVpcFlowLogsService;
3155 type Credentials = gaxi::options::Credentials;
3156 async fn build(
3157 self,
3158 config: gaxi::options::ClientConfig,
3159 ) -> gax::client_builder::Result<Self::Client> {
3160 Self::Client::new(config).await
3161 }
3162 }
3163 }
3164
3165 #[derive(Clone, Debug)]
3167 pub(crate) struct RequestBuilder<R: std::default::Default> {
3168 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3169 request: R,
3170 options: gax::options::RequestOptions,
3171 }
3172
3173 impl<R> RequestBuilder<R>
3174 where
3175 R: std::default::Default,
3176 {
3177 pub(crate) fn new(
3178 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3179 ) -> Self {
3180 Self {
3181 stub,
3182 request: R::default(),
3183 options: gax::options::RequestOptions::default(),
3184 }
3185 }
3186 }
3187
3188 #[derive(Clone, Debug)]
3210 pub struct ListVpcFlowLogsConfigs(RequestBuilder<crate::model::ListVpcFlowLogsConfigsRequest>);
3211
3212 impl ListVpcFlowLogsConfigs {
3213 pub(crate) fn new(
3214 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3215 ) -> Self {
3216 Self(RequestBuilder::new(stub))
3217 }
3218
3219 pub fn with_request<V: Into<crate::model::ListVpcFlowLogsConfigsRequest>>(
3221 mut self,
3222 v: V,
3223 ) -> Self {
3224 self.0.request = v.into();
3225 self
3226 }
3227
3228 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3230 self.0.options = v.into();
3231 self
3232 }
3233
3234 pub async fn send(self) -> Result<crate::model::ListVpcFlowLogsConfigsResponse> {
3236 (*self.0.stub)
3237 .list_vpc_flow_logs_configs(self.0.request, self.0.options)
3238 .await
3239 .map(gax::response::Response::into_body)
3240 }
3241
3242 pub fn by_page(
3244 self,
3245 ) -> impl gax::paginator::Paginator<
3246 crate::model::ListVpcFlowLogsConfigsResponse,
3247 gax::error::Error,
3248 > {
3249 use std::clone::Clone;
3250 let token = self.0.request.page_token.clone();
3251 let execute = move |token: String| {
3252 let mut builder = self.clone();
3253 builder.0.request = builder.0.request.set_page_token(token);
3254 builder.send()
3255 };
3256 gax::paginator::internal::new_paginator(token, execute)
3257 }
3258
3259 pub fn by_item(
3261 self,
3262 ) -> impl gax::paginator::ItemPaginator<
3263 crate::model::ListVpcFlowLogsConfigsResponse,
3264 gax::error::Error,
3265 > {
3266 use gax::paginator::Paginator;
3267 self.by_page().items()
3268 }
3269
3270 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3274 self.0.request.parent = v.into();
3275 self
3276 }
3277
3278 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3280 self.0.request.page_size = v.into();
3281 self
3282 }
3283
3284 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3286 self.0.request.page_token = v.into();
3287 self
3288 }
3289
3290 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3292 self.0.request.filter = v.into();
3293 self
3294 }
3295
3296 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3298 self.0.request.order_by = v.into();
3299 self
3300 }
3301 }
3302
3303 #[doc(hidden)]
3304 impl gax::options::internal::RequestBuilder for ListVpcFlowLogsConfigs {
3305 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3306 &mut self.0.options
3307 }
3308 }
3309
3310 #[derive(Clone, Debug)]
3328 pub struct GetVpcFlowLogsConfig(RequestBuilder<crate::model::GetVpcFlowLogsConfigRequest>);
3329
3330 impl GetVpcFlowLogsConfig {
3331 pub(crate) fn new(
3332 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3333 ) -> Self {
3334 Self(RequestBuilder::new(stub))
3335 }
3336
3337 pub fn with_request<V: Into<crate::model::GetVpcFlowLogsConfigRequest>>(
3339 mut self,
3340 v: V,
3341 ) -> Self {
3342 self.0.request = v.into();
3343 self
3344 }
3345
3346 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3348 self.0.options = v.into();
3349 self
3350 }
3351
3352 pub async fn send(self) -> Result<crate::model::VpcFlowLogsConfig> {
3354 (*self.0.stub)
3355 .get_vpc_flow_logs_config(self.0.request, self.0.options)
3356 .await
3357 .map(gax::response::Response::into_body)
3358 }
3359
3360 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3364 self.0.request.name = v.into();
3365 self
3366 }
3367 }
3368
3369 #[doc(hidden)]
3370 impl gax::options::internal::RequestBuilder for GetVpcFlowLogsConfig {
3371 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3372 &mut self.0.options
3373 }
3374 }
3375
3376 #[derive(Clone, Debug)]
3395 pub struct CreateVpcFlowLogsConfig(
3396 RequestBuilder<crate::model::CreateVpcFlowLogsConfigRequest>,
3397 );
3398
3399 impl CreateVpcFlowLogsConfig {
3400 pub(crate) fn new(
3401 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3402 ) -> Self {
3403 Self(RequestBuilder::new(stub))
3404 }
3405
3406 pub fn with_request<V: Into<crate::model::CreateVpcFlowLogsConfigRequest>>(
3408 mut self,
3409 v: V,
3410 ) -> Self {
3411 self.0.request = v.into();
3412 self
3413 }
3414
3415 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3417 self.0.options = v.into();
3418 self
3419 }
3420
3421 pub async fn send(self) -> Result<longrunning::model::Operation> {
3428 (*self.0.stub)
3429 .create_vpc_flow_logs_config(self.0.request, self.0.options)
3430 .await
3431 .map(gax::response::Response::into_body)
3432 }
3433
3434 pub fn poller(
3436 self,
3437 ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
3438 {
3439 type Operation = lro::internal::Operation<
3440 crate::model::VpcFlowLogsConfig,
3441 crate::model::OperationMetadata,
3442 >;
3443 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3444 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3445
3446 let stub = self.0.stub.clone();
3447 let mut options = self.0.options.clone();
3448 options.set_retry_policy(gax::retry_policy::NeverRetry);
3449 let query = move |name| {
3450 let stub = stub.clone();
3451 let options = options.clone();
3452 async {
3453 let op = GetOperation::new(stub)
3454 .set_name(name)
3455 .with_options(options)
3456 .send()
3457 .await?;
3458 Ok(Operation::new(op))
3459 }
3460 };
3461
3462 let start = move || async {
3463 let op = self.send().await?;
3464 Ok(Operation::new(op))
3465 };
3466
3467 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3468 }
3469
3470 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3474 self.0.request.parent = v.into();
3475 self
3476 }
3477
3478 pub fn set_vpc_flow_logs_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3482 self.0.request.vpc_flow_logs_config_id = v.into();
3483 self
3484 }
3485
3486 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
3490 where
3491 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3492 {
3493 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
3494 self
3495 }
3496
3497 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
3501 where
3502 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3503 {
3504 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
3505 self
3506 }
3507 }
3508
3509 #[doc(hidden)]
3510 impl gax::options::internal::RequestBuilder for CreateVpcFlowLogsConfig {
3511 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3512 &mut self.0.options
3513 }
3514 }
3515
3516 #[derive(Clone, Debug)]
3535 pub struct UpdateVpcFlowLogsConfig(
3536 RequestBuilder<crate::model::UpdateVpcFlowLogsConfigRequest>,
3537 );
3538
3539 impl UpdateVpcFlowLogsConfig {
3540 pub(crate) fn new(
3541 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3542 ) -> Self {
3543 Self(RequestBuilder::new(stub))
3544 }
3545
3546 pub fn with_request<V: Into<crate::model::UpdateVpcFlowLogsConfigRequest>>(
3548 mut self,
3549 v: V,
3550 ) -> Self {
3551 self.0.request = v.into();
3552 self
3553 }
3554
3555 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3557 self.0.options = v.into();
3558 self
3559 }
3560
3561 pub async fn send(self) -> Result<longrunning::model::Operation> {
3568 (*self.0.stub)
3569 .update_vpc_flow_logs_config(self.0.request, self.0.options)
3570 .await
3571 .map(gax::response::Response::into_body)
3572 }
3573
3574 pub fn poller(
3576 self,
3577 ) -> impl lro::Poller<crate::model::VpcFlowLogsConfig, crate::model::OperationMetadata>
3578 {
3579 type Operation = lro::internal::Operation<
3580 crate::model::VpcFlowLogsConfig,
3581 crate::model::OperationMetadata,
3582 >;
3583 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3584 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3585
3586 let stub = self.0.stub.clone();
3587 let mut options = self.0.options.clone();
3588 options.set_retry_policy(gax::retry_policy::NeverRetry);
3589 let query = move |name| {
3590 let stub = stub.clone();
3591 let options = options.clone();
3592 async {
3593 let op = GetOperation::new(stub)
3594 .set_name(name)
3595 .with_options(options)
3596 .send()
3597 .await?;
3598 Ok(Operation::new(op))
3599 }
3600 };
3601
3602 let start = move || async {
3603 let op = self.send().await?;
3604 Ok(Operation::new(op))
3605 };
3606
3607 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3608 }
3609
3610 pub fn set_update_mask<T>(mut self, v: T) -> Self
3614 where
3615 T: std::convert::Into<wkt::FieldMask>,
3616 {
3617 self.0.request.update_mask = std::option::Option::Some(v.into());
3618 self
3619 }
3620
3621 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3625 where
3626 T: std::convert::Into<wkt::FieldMask>,
3627 {
3628 self.0.request.update_mask = v.map(|x| x.into());
3629 self
3630 }
3631
3632 pub fn set_vpc_flow_logs_config<T>(mut self, v: T) -> Self
3636 where
3637 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3638 {
3639 self.0.request.vpc_flow_logs_config = std::option::Option::Some(v.into());
3640 self
3641 }
3642
3643 pub fn set_or_clear_vpc_flow_logs_config<T>(mut self, v: std::option::Option<T>) -> Self
3647 where
3648 T: std::convert::Into<crate::model::VpcFlowLogsConfig>,
3649 {
3650 self.0.request.vpc_flow_logs_config = v.map(|x| x.into());
3651 self
3652 }
3653 }
3654
3655 #[doc(hidden)]
3656 impl gax::options::internal::RequestBuilder for UpdateVpcFlowLogsConfig {
3657 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3658 &mut self.0.options
3659 }
3660 }
3661
3662 #[derive(Clone, Debug)]
3681 pub struct DeleteVpcFlowLogsConfig(
3682 RequestBuilder<crate::model::DeleteVpcFlowLogsConfigRequest>,
3683 );
3684
3685 impl DeleteVpcFlowLogsConfig {
3686 pub(crate) fn new(
3687 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3688 ) -> Self {
3689 Self(RequestBuilder::new(stub))
3690 }
3691
3692 pub fn with_request<V: Into<crate::model::DeleteVpcFlowLogsConfigRequest>>(
3694 mut self,
3695 v: V,
3696 ) -> Self {
3697 self.0.request = v.into();
3698 self
3699 }
3700
3701 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3703 self.0.options = v.into();
3704 self
3705 }
3706
3707 pub async fn send(self) -> Result<longrunning::model::Operation> {
3714 (*self.0.stub)
3715 .delete_vpc_flow_logs_config(self.0.request, self.0.options)
3716 .await
3717 .map(gax::response::Response::into_body)
3718 }
3719
3720 pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
3722 type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3723 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3724 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3725
3726 let stub = self.0.stub.clone();
3727 let mut options = self.0.options.clone();
3728 options.set_retry_policy(gax::retry_policy::NeverRetry);
3729 let query = move |name| {
3730 let stub = stub.clone();
3731 let options = options.clone();
3732 async {
3733 let op = GetOperation::new(stub)
3734 .set_name(name)
3735 .with_options(options)
3736 .send()
3737 .await?;
3738 Ok(Operation::new(op))
3739 }
3740 };
3741
3742 let start = move || async {
3743 let op = self.send().await?;
3744 Ok(Operation::new(op))
3745 };
3746
3747 lro::internal::new_unit_response_poller(
3748 polling_error_policy,
3749 polling_backoff_policy,
3750 start,
3751 query,
3752 )
3753 }
3754
3755 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3759 self.0.request.name = v.into();
3760 self
3761 }
3762 }
3763
3764 #[doc(hidden)]
3765 impl gax::options::internal::RequestBuilder for DeleteVpcFlowLogsConfig {
3766 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3767 &mut self.0.options
3768 }
3769 }
3770
3771 #[derive(Clone, Debug)]
3793 pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
3794
3795 impl ListLocations {
3796 pub(crate) fn new(
3797 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3798 ) -> Self {
3799 Self(RequestBuilder::new(stub))
3800 }
3801
3802 pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3804 mut self,
3805 v: V,
3806 ) -> Self {
3807 self.0.request = v.into();
3808 self
3809 }
3810
3811 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3813 self.0.options = v.into();
3814 self
3815 }
3816
3817 pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3819 (*self.0.stub)
3820 .list_locations(self.0.request, self.0.options)
3821 .await
3822 .map(gax::response::Response::into_body)
3823 }
3824
3825 pub fn by_page(
3827 self,
3828 ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3829 {
3830 use std::clone::Clone;
3831 let token = self.0.request.page_token.clone();
3832 let execute = move |token: String| {
3833 let mut builder = self.clone();
3834 builder.0.request = builder.0.request.set_page_token(token);
3835 builder.send()
3836 };
3837 gax::paginator::internal::new_paginator(token, execute)
3838 }
3839
3840 pub fn by_item(
3842 self,
3843 ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3844 {
3845 use gax::paginator::Paginator;
3846 self.by_page().items()
3847 }
3848
3849 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3851 self.0.request.name = v.into();
3852 self
3853 }
3854
3855 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3857 self.0.request.filter = v.into();
3858 self
3859 }
3860
3861 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3863 self.0.request.page_size = v.into();
3864 self
3865 }
3866
3867 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3869 self.0.request.page_token = v.into();
3870 self
3871 }
3872 }
3873
3874 #[doc(hidden)]
3875 impl gax::options::internal::RequestBuilder for ListLocations {
3876 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3877 &mut self.0.options
3878 }
3879 }
3880
3881 #[derive(Clone, Debug)]
3899 pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3900
3901 impl GetLocation {
3902 pub(crate) fn new(
3903 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3904 ) -> Self {
3905 Self(RequestBuilder::new(stub))
3906 }
3907
3908 pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3910 self.0.request = v.into();
3911 self
3912 }
3913
3914 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3916 self.0.options = v.into();
3917 self
3918 }
3919
3920 pub async fn send(self) -> Result<location::model::Location> {
3922 (*self.0.stub)
3923 .get_location(self.0.request, self.0.options)
3924 .await
3925 .map(gax::response::Response::into_body)
3926 }
3927
3928 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3930 self.0.request.name = v.into();
3931 self
3932 }
3933 }
3934
3935 #[doc(hidden)]
3936 impl gax::options::internal::RequestBuilder for GetLocation {
3937 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3938 &mut self.0.options
3939 }
3940 }
3941
3942 #[derive(Clone, Debug)]
3960 pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);
3961
3962 impl SetIamPolicy {
3963 pub(crate) fn new(
3964 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
3965 ) -> Self {
3966 Self(RequestBuilder::new(stub))
3967 }
3968
3969 pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
3971 self.0.request = v.into();
3972 self
3973 }
3974
3975 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3977 self.0.options = v.into();
3978 self
3979 }
3980
3981 pub async fn send(self) -> Result<iam_v1::model::Policy> {
3983 (*self.0.stub)
3984 .set_iam_policy(self.0.request, self.0.options)
3985 .await
3986 .map(gax::response::Response::into_body)
3987 }
3988
3989 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3993 self.0.request.resource = v.into();
3994 self
3995 }
3996
3997 pub fn set_policy<T>(mut self, v: T) -> Self
4001 where
4002 T: std::convert::Into<iam_v1::model::Policy>,
4003 {
4004 self.0.request.policy = std::option::Option::Some(v.into());
4005 self
4006 }
4007
4008 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4012 where
4013 T: std::convert::Into<iam_v1::model::Policy>,
4014 {
4015 self.0.request.policy = v.map(|x| x.into());
4016 self
4017 }
4018
4019 pub fn set_update_mask<T>(mut self, v: T) -> Self
4021 where
4022 T: std::convert::Into<wkt::FieldMask>,
4023 {
4024 self.0.request.update_mask = std::option::Option::Some(v.into());
4025 self
4026 }
4027
4028 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4030 where
4031 T: std::convert::Into<wkt::FieldMask>,
4032 {
4033 self.0.request.update_mask = v.map(|x| x.into());
4034 self
4035 }
4036 }
4037
4038 #[doc(hidden)]
4039 impl gax::options::internal::RequestBuilder for SetIamPolicy {
4040 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4041 &mut self.0.options
4042 }
4043 }
4044
4045 #[derive(Clone, Debug)]
4063 pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);
4064
4065 impl GetIamPolicy {
4066 pub(crate) fn new(
4067 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4068 ) -> Self {
4069 Self(RequestBuilder::new(stub))
4070 }
4071
4072 pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
4074 self.0.request = v.into();
4075 self
4076 }
4077
4078 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4080 self.0.options = v.into();
4081 self
4082 }
4083
4084 pub async fn send(self) -> Result<iam_v1::model::Policy> {
4086 (*self.0.stub)
4087 .get_iam_policy(self.0.request, self.0.options)
4088 .await
4089 .map(gax::response::Response::into_body)
4090 }
4091
4092 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4096 self.0.request.resource = v.into();
4097 self
4098 }
4099
4100 pub fn set_options<T>(mut self, v: T) -> Self
4102 where
4103 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4104 {
4105 self.0.request.options = std::option::Option::Some(v.into());
4106 self
4107 }
4108
4109 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4111 where
4112 T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
4113 {
4114 self.0.request.options = v.map(|x| x.into());
4115 self
4116 }
4117 }
4118
4119 #[doc(hidden)]
4120 impl gax::options::internal::RequestBuilder for GetIamPolicy {
4121 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4122 &mut self.0.options
4123 }
4124 }
4125
4126 #[derive(Clone, Debug)]
4144 pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);
4145
4146 impl TestIamPermissions {
4147 pub(crate) fn new(
4148 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4149 ) -> Self {
4150 Self(RequestBuilder::new(stub))
4151 }
4152
4153 pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
4155 mut self,
4156 v: V,
4157 ) -> Self {
4158 self.0.request = v.into();
4159 self
4160 }
4161
4162 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4164 self.0.options = v.into();
4165 self
4166 }
4167
4168 pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
4170 (*self.0.stub)
4171 .test_iam_permissions(self.0.request, self.0.options)
4172 .await
4173 .map(gax::response::Response::into_body)
4174 }
4175
4176 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4180 self.0.request.resource = v.into();
4181 self
4182 }
4183
4184 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4188 where
4189 T: std::iter::IntoIterator<Item = V>,
4190 V: std::convert::Into<std::string::String>,
4191 {
4192 use std::iter::Iterator;
4193 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4194 self
4195 }
4196 }
4197
4198 #[doc(hidden)]
4199 impl gax::options::internal::RequestBuilder for TestIamPermissions {
4200 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4201 &mut self.0.options
4202 }
4203 }
4204
4205 #[derive(Clone, Debug)]
4227 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4228
4229 impl ListOperations {
4230 pub(crate) fn new(
4231 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4232 ) -> Self {
4233 Self(RequestBuilder::new(stub))
4234 }
4235
4236 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4238 mut self,
4239 v: V,
4240 ) -> Self {
4241 self.0.request = v.into();
4242 self
4243 }
4244
4245 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4247 self.0.options = v.into();
4248 self
4249 }
4250
4251 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4253 (*self.0.stub)
4254 .list_operations(self.0.request, self.0.options)
4255 .await
4256 .map(gax::response::Response::into_body)
4257 }
4258
4259 pub fn by_page(
4261 self,
4262 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4263 {
4264 use std::clone::Clone;
4265 let token = self.0.request.page_token.clone();
4266 let execute = move |token: String| {
4267 let mut builder = self.clone();
4268 builder.0.request = builder.0.request.set_page_token(token);
4269 builder.send()
4270 };
4271 gax::paginator::internal::new_paginator(token, execute)
4272 }
4273
4274 pub fn by_item(
4276 self,
4277 ) -> impl gax::paginator::ItemPaginator<
4278 longrunning::model::ListOperationsResponse,
4279 gax::error::Error,
4280 > {
4281 use gax::paginator::Paginator;
4282 self.by_page().items()
4283 }
4284
4285 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4287 self.0.request.name = v.into();
4288 self
4289 }
4290
4291 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4293 self.0.request.filter = v.into();
4294 self
4295 }
4296
4297 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4299 self.0.request.page_size = v.into();
4300 self
4301 }
4302
4303 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4305 self.0.request.page_token = v.into();
4306 self
4307 }
4308
4309 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4311 self.0.request.return_partial_success = v.into();
4312 self
4313 }
4314 }
4315
4316 #[doc(hidden)]
4317 impl gax::options::internal::RequestBuilder for ListOperations {
4318 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4319 &mut self.0.options
4320 }
4321 }
4322
4323 #[derive(Clone, Debug)]
4341 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4342
4343 impl GetOperation {
4344 pub(crate) fn new(
4345 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4346 ) -> Self {
4347 Self(RequestBuilder::new(stub))
4348 }
4349
4350 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4352 mut self,
4353 v: V,
4354 ) -> Self {
4355 self.0.request = v.into();
4356 self
4357 }
4358
4359 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4361 self.0.options = v.into();
4362 self
4363 }
4364
4365 pub async fn send(self) -> Result<longrunning::model::Operation> {
4367 (*self.0.stub)
4368 .get_operation(self.0.request, self.0.options)
4369 .await
4370 .map(gax::response::Response::into_body)
4371 }
4372
4373 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4375 self.0.request.name = v.into();
4376 self
4377 }
4378 }
4379
4380 #[doc(hidden)]
4381 impl gax::options::internal::RequestBuilder for GetOperation {
4382 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4383 &mut self.0.options
4384 }
4385 }
4386
4387 #[derive(Clone, Debug)]
4405 pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
4406
4407 impl DeleteOperation {
4408 pub(crate) fn new(
4409 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4410 ) -> Self {
4411 Self(RequestBuilder::new(stub))
4412 }
4413
4414 pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
4416 mut self,
4417 v: V,
4418 ) -> Self {
4419 self.0.request = v.into();
4420 self
4421 }
4422
4423 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4425 self.0.options = v.into();
4426 self
4427 }
4428
4429 pub async fn send(self) -> Result<()> {
4431 (*self.0.stub)
4432 .delete_operation(self.0.request, self.0.options)
4433 .await
4434 .map(gax::response::Response::into_body)
4435 }
4436
4437 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4439 self.0.request.name = v.into();
4440 self
4441 }
4442 }
4443
4444 #[doc(hidden)]
4445 impl gax::options::internal::RequestBuilder for DeleteOperation {
4446 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4447 &mut self.0.options
4448 }
4449 }
4450
4451 #[derive(Clone, Debug)]
4469 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4470
4471 impl CancelOperation {
4472 pub(crate) fn new(
4473 stub: std::sync::Arc<dyn super::super::stub::dynamic::OrganizationVpcFlowLogsService>,
4474 ) -> Self {
4475 Self(RequestBuilder::new(stub))
4476 }
4477
4478 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4480 mut self,
4481 v: V,
4482 ) -> Self {
4483 self.0.request = v.into();
4484 self
4485 }
4486
4487 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4489 self.0.options = v.into();
4490 self
4491 }
4492
4493 pub async fn send(self) -> Result<()> {
4495 (*self.0.stub)
4496 .cancel_operation(self.0.request, self.0.options)
4497 .await
4498 .map(gax::response::Response::into_body)
4499 }
4500
4501 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4503 self.0.request.name = v.into();
4504 self
4505 }
4506 }
4507
4508 #[doc(hidden)]
4509 impl gax::options::internal::RequestBuilder for CancelOperation {
4510 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4511 &mut self.0.options
4512 }
4513 }
4514}