1pub mod asset_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::AssetService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = AssetService;
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::AssetService>,
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::AssetService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
93 pub struct ExportAssets(RequestBuilder<crate::model::ExportAssetsRequest>);
94
95 impl ExportAssets {
96 pub(crate) fn new(
97 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
98 ) -> Self {
99 Self(RequestBuilder::new(stub))
100 }
101
102 pub fn with_request<V: Into<crate::model::ExportAssetsRequest>>(mut self, v: V) -> Self {
104 self.0.request = v.into();
105 self
106 }
107
108 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
110 self.0.options = v.into();
111 self
112 }
113
114 pub async fn send(self) -> Result<longrunning::model::Operation> {
121 (*self.0.stub)
122 .export_assets(self.0.request, self.0.options)
123 .await
124 .map(gax::response::Response::into_body)
125 }
126
127 pub fn poller(
129 self,
130 ) -> impl lro::Poller<crate::model::ExportAssetsResponse, crate::model::ExportAssetsRequest>
131 {
132 type Operation = lro::internal::Operation<
133 crate::model::ExportAssetsResponse,
134 crate::model::ExportAssetsRequest,
135 >;
136 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
137 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
138
139 let stub = self.0.stub.clone();
140 let mut options = self.0.options.clone();
141 options.set_retry_policy(gax::retry_policy::NeverRetry);
142 let query = move |name| {
143 let stub = stub.clone();
144 let options = options.clone();
145 async {
146 let op = GetOperation::new(stub)
147 .set_name(name)
148 .with_options(options)
149 .send()
150 .await?;
151 Ok(Operation::new(op))
152 }
153 };
154
155 let start = move || async {
156 let op = self.send().await?;
157 Ok(Operation::new(op))
158 };
159
160 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
161 }
162
163 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
167 self.0.request.parent = v.into();
168 self
169 }
170
171 pub fn set_read_time<T>(mut self, v: T) -> Self
173 where
174 T: std::convert::Into<wkt::Timestamp>,
175 {
176 self.0.request.read_time = std::option::Option::Some(v.into());
177 self
178 }
179
180 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
182 where
183 T: std::convert::Into<wkt::Timestamp>,
184 {
185 self.0.request.read_time = v.map(|x| x.into());
186 self
187 }
188
189 pub fn set_asset_types<T, V>(mut self, v: T) -> Self
191 where
192 T: std::iter::IntoIterator<Item = V>,
193 V: std::convert::Into<std::string::String>,
194 {
195 use std::iter::Iterator;
196 self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
197 self
198 }
199
200 pub fn set_content_type<T: Into<crate::model::ContentType>>(mut self, v: T) -> Self {
202 self.0.request.content_type = v.into();
203 self
204 }
205
206 pub fn set_output_config<T>(mut self, v: T) -> Self
210 where
211 T: std::convert::Into<crate::model::OutputConfig>,
212 {
213 self.0.request.output_config = std::option::Option::Some(v.into());
214 self
215 }
216
217 pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
221 where
222 T: std::convert::Into<crate::model::OutputConfig>,
223 {
224 self.0.request.output_config = v.map(|x| x.into());
225 self
226 }
227
228 pub fn set_relationship_types<T, V>(mut self, v: T) -> Self
230 where
231 T: std::iter::IntoIterator<Item = V>,
232 V: std::convert::Into<std::string::String>,
233 {
234 use std::iter::Iterator;
235 self.0.request.relationship_types = v.into_iter().map(|i| i.into()).collect();
236 self
237 }
238 }
239
240 #[doc(hidden)]
241 impl gax::options::internal::RequestBuilder for ExportAssets {
242 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
243 &mut self.0.options
244 }
245 }
246
247 #[derive(Clone, Debug)]
269 pub struct ListAssets(RequestBuilder<crate::model::ListAssetsRequest>);
270
271 impl ListAssets {
272 pub(crate) fn new(
273 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
274 ) -> Self {
275 Self(RequestBuilder::new(stub))
276 }
277
278 pub fn with_request<V: Into<crate::model::ListAssetsRequest>>(mut self, v: V) -> Self {
280 self.0.request = v.into();
281 self
282 }
283
284 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
286 self.0.options = v.into();
287 self
288 }
289
290 pub async fn send(self) -> Result<crate::model::ListAssetsResponse> {
292 (*self.0.stub)
293 .list_assets(self.0.request, self.0.options)
294 .await
295 .map(gax::response::Response::into_body)
296 }
297
298 pub fn by_page(
300 self,
301 ) -> impl gax::paginator::Paginator<crate::model::ListAssetsResponse, gax::error::Error>
302 {
303 use std::clone::Clone;
304 let token = self.0.request.page_token.clone();
305 let execute = move |token: String| {
306 let mut builder = self.clone();
307 builder.0.request = builder.0.request.set_page_token(token);
308 builder.send()
309 };
310 gax::paginator::internal::new_paginator(token, execute)
311 }
312
313 pub fn by_item(
315 self,
316 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAssetsResponse, gax::error::Error>
317 {
318 use gax::paginator::Paginator;
319 self.by_page().items()
320 }
321
322 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
326 self.0.request.parent = v.into();
327 self
328 }
329
330 pub fn set_read_time<T>(mut self, v: T) -> Self
332 where
333 T: std::convert::Into<wkt::Timestamp>,
334 {
335 self.0.request.read_time = std::option::Option::Some(v.into());
336 self
337 }
338
339 pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
341 where
342 T: std::convert::Into<wkt::Timestamp>,
343 {
344 self.0.request.read_time = v.map(|x| x.into());
345 self
346 }
347
348 pub fn set_asset_types<T, V>(mut self, v: T) -> Self
350 where
351 T: std::iter::IntoIterator<Item = V>,
352 V: std::convert::Into<std::string::String>,
353 {
354 use std::iter::Iterator;
355 self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
356 self
357 }
358
359 pub fn set_content_type<T: Into<crate::model::ContentType>>(mut self, v: T) -> Self {
361 self.0.request.content_type = v.into();
362 self
363 }
364
365 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
367 self.0.request.page_size = v.into();
368 self
369 }
370
371 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
373 self.0.request.page_token = v.into();
374 self
375 }
376
377 pub fn set_relationship_types<T, V>(mut self, v: T) -> Self
379 where
380 T: std::iter::IntoIterator<Item = V>,
381 V: std::convert::Into<std::string::String>,
382 {
383 use std::iter::Iterator;
384 self.0.request.relationship_types = v.into_iter().map(|i| i.into()).collect();
385 self
386 }
387 }
388
389 #[doc(hidden)]
390 impl gax::options::internal::RequestBuilder for ListAssets {
391 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
392 &mut self.0.options
393 }
394 }
395
396 #[derive(Clone, Debug)]
414 pub struct BatchGetAssetsHistory(RequestBuilder<crate::model::BatchGetAssetsHistoryRequest>);
415
416 impl BatchGetAssetsHistory {
417 pub(crate) fn new(
418 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
419 ) -> Self {
420 Self(RequestBuilder::new(stub))
421 }
422
423 pub fn with_request<V: Into<crate::model::BatchGetAssetsHistoryRequest>>(
425 mut self,
426 v: V,
427 ) -> Self {
428 self.0.request = v.into();
429 self
430 }
431
432 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
434 self.0.options = v.into();
435 self
436 }
437
438 pub async fn send(self) -> Result<crate::model::BatchGetAssetsHistoryResponse> {
440 (*self.0.stub)
441 .batch_get_assets_history(self.0.request, self.0.options)
442 .await
443 .map(gax::response::Response::into_body)
444 }
445
446 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
450 self.0.request.parent = v.into();
451 self
452 }
453
454 pub fn set_asset_names<T, V>(mut self, v: T) -> Self
456 where
457 T: std::iter::IntoIterator<Item = V>,
458 V: std::convert::Into<std::string::String>,
459 {
460 use std::iter::Iterator;
461 self.0.request.asset_names = v.into_iter().map(|i| i.into()).collect();
462 self
463 }
464
465 pub fn set_content_type<T: Into<crate::model::ContentType>>(mut self, v: T) -> Self {
467 self.0.request.content_type = v.into();
468 self
469 }
470
471 pub fn set_read_time_window<T>(mut self, v: T) -> Self
473 where
474 T: std::convert::Into<crate::model::TimeWindow>,
475 {
476 self.0.request.read_time_window = std::option::Option::Some(v.into());
477 self
478 }
479
480 pub fn set_or_clear_read_time_window<T>(mut self, v: std::option::Option<T>) -> Self
482 where
483 T: std::convert::Into<crate::model::TimeWindow>,
484 {
485 self.0.request.read_time_window = v.map(|x| x.into());
486 self
487 }
488
489 pub fn set_relationship_types<T, V>(mut self, v: T) -> Self
491 where
492 T: std::iter::IntoIterator<Item = V>,
493 V: std::convert::Into<std::string::String>,
494 {
495 use std::iter::Iterator;
496 self.0.request.relationship_types = v.into_iter().map(|i| i.into()).collect();
497 self
498 }
499 }
500
501 #[doc(hidden)]
502 impl gax::options::internal::RequestBuilder for BatchGetAssetsHistory {
503 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
504 &mut self.0.options
505 }
506 }
507
508 #[derive(Clone, Debug)]
526 pub struct CreateFeed(RequestBuilder<crate::model::CreateFeedRequest>);
527
528 impl CreateFeed {
529 pub(crate) fn new(
530 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
531 ) -> Self {
532 Self(RequestBuilder::new(stub))
533 }
534
535 pub fn with_request<V: Into<crate::model::CreateFeedRequest>>(mut self, v: V) -> Self {
537 self.0.request = v.into();
538 self
539 }
540
541 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
543 self.0.options = v.into();
544 self
545 }
546
547 pub async fn send(self) -> Result<crate::model::Feed> {
549 (*self.0.stub)
550 .create_feed(self.0.request, self.0.options)
551 .await
552 .map(gax::response::Response::into_body)
553 }
554
555 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
559 self.0.request.parent = v.into();
560 self
561 }
562
563 pub fn set_feed_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
567 self.0.request.feed_id = v.into();
568 self
569 }
570
571 pub fn set_feed<T>(mut self, v: T) -> Self
575 where
576 T: std::convert::Into<crate::model::Feed>,
577 {
578 self.0.request.feed = std::option::Option::Some(v.into());
579 self
580 }
581
582 pub fn set_or_clear_feed<T>(mut self, v: std::option::Option<T>) -> Self
586 where
587 T: std::convert::Into<crate::model::Feed>,
588 {
589 self.0.request.feed = v.map(|x| x.into());
590 self
591 }
592 }
593
594 #[doc(hidden)]
595 impl gax::options::internal::RequestBuilder for CreateFeed {
596 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
597 &mut self.0.options
598 }
599 }
600
601 #[derive(Clone, Debug)]
619 pub struct GetFeed(RequestBuilder<crate::model::GetFeedRequest>);
620
621 impl GetFeed {
622 pub(crate) fn new(
623 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
624 ) -> Self {
625 Self(RequestBuilder::new(stub))
626 }
627
628 pub fn with_request<V: Into<crate::model::GetFeedRequest>>(mut self, v: V) -> Self {
630 self.0.request = v.into();
631 self
632 }
633
634 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
636 self.0.options = v.into();
637 self
638 }
639
640 pub async fn send(self) -> Result<crate::model::Feed> {
642 (*self.0.stub)
643 .get_feed(self.0.request, self.0.options)
644 .await
645 .map(gax::response::Response::into_body)
646 }
647
648 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
652 self.0.request.name = v.into();
653 self
654 }
655 }
656
657 #[doc(hidden)]
658 impl gax::options::internal::RequestBuilder for GetFeed {
659 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
660 &mut self.0.options
661 }
662 }
663
664 #[derive(Clone, Debug)]
682 pub struct ListFeeds(RequestBuilder<crate::model::ListFeedsRequest>);
683
684 impl ListFeeds {
685 pub(crate) fn new(
686 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
687 ) -> Self {
688 Self(RequestBuilder::new(stub))
689 }
690
691 pub fn with_request<V: Into<crate::model::ListFeedsRequest>>(mut self, v: V) -> Self {
693 self.0.request = v.into();
694 self
695 }
696
697 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
699 self.0.options = v.into();
700 self
701 }
702
703 pub async fn send(self) -> Result<crate::model::ListFeedsResponse> {
705 (*self.0.stub)
706 .list_feeds(self.0.request, self.0.options)
707 .await
708 .map(gax::response::Response::into_body)
709 }
710
711 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
715 self.0.request.parent = v.into();
716 self
717 }
718 }
719
720 #[doc(hidden)]
721 impl gax::options::internal::RequestBuilder for ListFeeds {
722 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
723 &mut self.0.options
724 }
725 }
726
727 #[derive(Clone, Debug)]
745 pub struct UpdateFeed(RequestBuilder<crate::model::UpdateFeedRequest>);
746
747 impl UpdateFeed {
748 pub(crate) fn new(
749 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
750 ) -> Self {
751 Self(RequestBuilder::new(stub))
752 }
753
754 pub fn with_request<V: Into<crate::model::UpdateFeedRequest>>(mut self, v: V) -> Self {
756 self.0.request = v.into();
757 self
758 }
759
760 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
762 self.0.options = v.into();
763 self
764 }
765
766 pub async fn send(self) -> Result<crate::model::Feed> {
768 (*self.0.stub)
769 .update_feed(self.0.request, self.0.options)
770 .await
771 .map(gax::response::Response::into_body)
772 }
773
774 pub fn set_feed<T>(mut self, v: T) -> Self
778 where
779 T: std::convert::Into<crate::model::Feed>,
780 {
781 self.0.request.feed = std::option::Option::Some(v.into());
782 self
783 }
784
785 pub fn set_or_clear_feed<T>(mut self, v: std::option::Option<T>) -> Self
789 where
790 T: std::convert::Into<crate::model::Feed>,
791 {
792 self.0.request.feed = v.map(|x| x.into());
793 self
794 }
795
796 pub fn set_update_mask<T>(mut self, v: T) -> Self
800 where
801 T: std::convert::Into<wkt::FieldMask>,
802 {
803 self.0.request.update_mask = std::option::Option::Some(v.into());
804 self
805 }
806
807 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
811 where
812 T: std::convert::Into<wkt::FieldMask>,
813 {
814 self.0.request.update_mask = v.map(|x| x.into());
815 self
816 }
817 }
818
819 #[doc(hidden)]
820 impl gax::options::internal::RequestBuilder for UpdateFeed {
821 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
822 &mut self.0.options
823 }
824 }
825
826 #[derive(Clone, Debug)]
844 pub struct DeleteFeed(RequestBuilder<crate::model::DeleteFeedRequest>);
845
846 impl DeleteFeed {
847 pub(crate) fn new(
848 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
849 ) -> Self {
850 Self(RequestBuilder::new(stub))
851 }
852
853 pub fn with_request<V: Into<crate::model::DeleteFeedRequest>>(mut self, v: V) -> Self {
855 self.0.request = v.into();
856 self
857 }
858
859 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
861 self.0.options = v.into();
862 self
863 }
864
865 pub async fn send(self) -> Result<()> {
867 (*self.0.stub)
868 .delete_feed(self.0.request, self.0.options)
869 .await
870 .map(gax::response::Response::into_body)
871 }
872
873 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
877 self.0.request.name = v.into();
878 self
879 }
880 }
881
882 #[doc(hidden)]
883 impl gax::options::internal::RequestBuilder for DeleteFeed {
884 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
885 &mut self.0.options
886 }
887 }
888
889 #[derive(Clone, Debug)]
911 pub struct SearchAllResources(RequestBuilder<crate::model::SearchAllResourcesRequest>);
912
913 impl SearchAllResources {
914 pub(crate) fn new(
915 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
916 ) -> Self {
917 Self(RequestBuilder::new(stub))
918 }
919
920 pub fn with_request<V: Into<crate::model::SearchAllResourcesRequest>>(
922 mut self,
923 v: V,
924 ) -> Self {
925 self.0.request = v.into();
926 self
927 }
928
929 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
931 self.0.options = v.into();
932 self
933 }
934
935 pub async fn send(self) -> Result<crate::model::SearchAllResourcesResponse> {
937 (*self.0.stub)
938 .search_all_resources(self.0.request, self.0.options)
939 .await
940 .map(gax::response::Response::into_body)
941 }
942
943 pub fn by_page(
945 self,
946 ) -> impl gax::paginator::Paginator<crate::model::SearchAllResourcesResponse, gax::error::Error>
947 {
948 use std::clone::Clone;
949 let token = self.0.request.page_token.clone();
950 let execute = move |token: String| {
951 let mut builder = self.clone();
952 builder.0.request = builder.0.request.set_page_token(token);
953 builder.send()
954 };
955 gax::paginator::internal::new_paginator(token, execute)
956 }
957
958 pub fn by_item(
960 self,
961 ) -> impl gax::paginator::ItemPaginator<
962 crate::model::SearchAllResourcesResponse,
963 gax::error::Error,
964 > {
965 use gax::paginator::Paginator;
966 self.by_page().items()
967 }
968
969 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
973 self.0.request.scope = v.into();
974 self
975 }
976
977 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
979 self.0.request.query = v.into();
980 self
981 }
982
983 pub fn set_asset_types<T, V>(mut self, v: T) -> Self
985 where
986 T: std::iter::IntoIterator<Item = V>,
987 V: std::convert::Into<std::string::String>,
988 {
989 use std::iter::Iterator;
990 self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
991 self
992 }
993
994 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
996 self.0.request.page_size = v.into();
997 self
998 }
999
1000 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1002 self.0.request.page_token = v.into();
1003 self
1004 }
1005
1006 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1008 self.0.request.order_by = v.into();
1009 self
1010 }
1011
1012 pub fn set_read_mask<T>(mut self, v: T) -> Self
1014 where
1015 T: std::convert::Into<wkt::FieldMask>,
1016 {
1017 self.0.request.read_mask = std::option::Option::Some(v.into());
1018 self
1019 }
1020
1021 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1023 where
1024 T: std::convert::Into<wkt::FieldMask>,
1025 {
1026 self.0.request.read_mask = v.map(|x| x.into());
1027 self
1028 }
1029 }
1030
1031 #[doc(hidden)]
1032 impl gax::options::internal::RequestBuilder for SearchAllResources {
1033 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1034 &mut self.0.options
1035 }
1036 }
1037
1038 #[derive(Clone, Debug)]
1060 pub struct SearchAllIamPolicies(RequestBuilder<crate::model::SearchAllIamPoliciesRequest>);
1061
1062 impl SearchAllIamPolicies {
1063 pub(crate) fn new(
1064 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1065 ) -> Self {
1066 Self(RequestBuilder::new(stub))
1067 }
1068
1069 pub fn with_request<V: Into<crate::model::SearchAllIamPoliciesRequest>>(
1071 mut self,
1072 v: V,
1073 ) -> Self {
1074 self.0.request = v.into();
1075 self
1076 }
1077
1078 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1080 self.0.options = v.into();
1081 self
1082 }
1083
1084 pub async fn send(self) -> Result<crate::model::SearchAllIamPoliciesResponse> {
1086 (*self.0.stub)
1087 .search_all_iam_policies(self.0.request, self.0.options)
1088 .await
1089 .map(gax::response::Response::into_body)
1090 }
1091
1092 pub fn by_page(
1094 self,
1095 ) -> impl gax::paginator::Paginator<crate::model::SearchAllIamPoliciesResponse, gax::error::Error>
1096 {
1097 use std::clone::Clone;
1098 let token = self.0.request.page_token.clone();
1099 let execute = move |token: String| {
1100 let mut builder = self.clone();
1101 builder.0.request = builder.0.request.set_page_token(token);
1102 builder.send()
1103 };
1104 gax::paginator::internal::new_paginator(token, execute)
1105 }
1106
1107 pub fn by_item(
1109 self,
1110 ) -> impl gax::paginator::ItemPaginator<
1111 crate::model::SearchAllIamPoliciesResponse,
1112 gax::error::Error,
1113 > {
1114 use gax::paginator::Paginator;
1115 self.by_page().items()
1116 }
1117
1118 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
1122 self.0.request.scope = v.into();
1123 self
1124 }
1125
1126 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1128 self.0.request.query = v.into();
1129 self
1130 }
1131
1132 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1134 self.0.request.page_size = v.into();
1135 self
1136 }
1137
1138 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1140 self.0.request.page_token = v.into();
1141 self
1142 }
1143
1144 pub fn set_asset_types<T, V>(mut self, v: T) -> Self
1146 where
1147 T: std::iter::IntoIterator<Item = V>,
1148 V: std::convert::Into<std::string::String>,
1149 {
1150 use std::iter::Iterator;
1151 self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
1152 self
1153 }
1154
1155 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1157 self.0.request.order_by = v.into();
1158 self
1159 }
1160 }
1161
1162 #[doc(hidden)]
1163 impl gax::options::internal::RequestBuilder for SearchAllIamPolicies {
1164 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1165 &mut self.0.options
1166 }
1167 }
1168
1169 #[derive(Clone, Debug)]
1187 pub struct AnalyzeIamPolicy(RequestBuilder<crate::model::AnalyzeIamPolicyRequest>);
1188
1189 impl AnalyzeIamPolicy {
1190 pub(crate) fn new(
1191 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1192 ) -> Self {
1193 Self(RequestBuilder::new(stub))
1194 }
1195
1196 pub fn with_request<V: Into<crate::model::AnalyzeIamPolicyRequest>>(
1198 mut self,
1199 v: V,
1200 ) -> Self {
1201 self.0.request = v.into();
1202 self
1203 }
1204
1205 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1207 self.0.options = v.into();
1208 self
1209 }
1210
1211 pub async fn send(self) -> Result<crate::model::AnalyzeIamPolicyResponse> {
1213 (*self.0.stub)
1214 .analyze_iam_policy(self.0.request, self.0.options)
1215 .await
1216 .map(gax::response::Response::into_body)
1217 }
1218
1219 pub fn set_analysis_query<T>(mut self, v: T) -> Self
1223 where
1224 T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
1225 {
1226 self.0.request.analysis_query = std::option::Option::Some(v.into());
1227 self
1228 }
1229
1230 pub fn set_or_clear_analysis_query<T>(mut self, v: std::option::Option<T>) -> Self
1234 where
1235 T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
1236 {
1237 self.0.request.analysis_query = v.map(|x| x.into());
1238 self
1239 }
1240
1241 pub fn set_saved_analysis_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1243 self.0.request.saved_analysis_query = v.into();
1244 self
1245 }
1246
1247 pub fn set_execution_timeout<T>(mut self, v: T) -> Self
1249 where
1250 T: std::convert::Into<wkt::Duration>,
1251 {
1252 self.0.request.execution_timeout = std::option::Option::Some(v.into());
1253 self
1254 }
1255
1256 pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1258 where
1259 T: std::convert::Into<wkt::Duration>,
1260 {
1261 self.0.request.execution_timeout = v.map(|x| x.into());
1262 self
1263 }
1264 }
1265
1266 #[doc(hidden)]
1267 impl gax::options::internal::RequestBuilder for AnalyzeIamPolicy {
1268 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1269 &mut self.0.options
1270 }
1271 }
1272
1273 #[derive(Clone, Debug)]
1292 pub struct AnalyzeIamPolicyLongrunning(
1293 RequestBuilder<crate::model::AnalyzeIamPolicyLongrunningRequest>,
1294 );
1295
1296 impl AnalyzeIamPolicyLongrunning {
1297 pub(crate) fn new(
1298 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1299 ) -> Self {
1300 Self(RequestBuilder::new(stub))
1301 }
1302
1303 pub fn with_request<V: Into<crate::model::AnalyzeIamPolicyLongrunningRequest>>(
1305 mut self,
1306 v: V,
1307 ) -> Self {
1308 self.0.request = v.into();
1309 self
1310 }
1311
1312 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1314 self.0.options = v.into();
1315 self
1316 }
1317
1318 pub async fn send(self) -> Result<longrunning::model::Operation> {
1325 (*self.0.stub)
1326 .analyze_iam_policy_longrunning(self.0.request, self.0.options)
1327 .await
1328 .map(gax::response::Response::into_body)
1329 }
1330
1331 pub fn poller(
1333 self,
1334 ) -> impl lro::Poller<
1335 crate::model::AnalyzeIamPolicyLongrunningResponse,
1336 crate::model::AnalyzeIamPolicyLongrunningMetadata,
1337 > {
1338 type Operation = lro::internal::Operation<
1339 crate::model::AnalyzeIamPolicyLongrunningResponse,
1340 crate::model::AnalyzeIamPolicyLongrunningMetadata,
1341 >;
1342 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1343 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1344
1345 let stub = self.0.stub.clone();
1346 let mut options = self.0.options.clone();
1347 options.set_retry_policy(gax::retry_policy::NeverRetry);
1348 let query = move |name| {
1349 let stub = stub.clone();
1350 let options = options.clone();
1351 async {
1352 let op = GetOperation::new(stub)
1353 .set_name(name)
1354 .with_options(options)
1355 .send()
1356 .await?;
1357 Ok(Operation::new(op))
1358 }
1359 };
1360
1361 let start = move || async {
1362 let op = self.send().await?;
1363 Ok(Operation::new(op))
1364 };
1365
1366 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1367 }
1368
1369 pub fn set_analysis_query<T>(mut self, v: T) -> Self
1373 where
1374 T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
1375 {
1376 self.0.request.analysis_query = std::option::Option::Some(v.into());
1377 self
1378 }
1379
1380 pub fn set_or_clear_analysis_query<T>(mut self, v: std::option::Option<T>) -> Self
1384 where
1385 T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
1386 {
1387 self.0.request.analysis_query = v.map(|x| x.into());
1388 self
1389 }
1390
1391 pub fn set_saved_analysis_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1393 self.0.request.saved_analysis_query = v.into();
1394 self
1395 }
1396
1397 pub fn set_output_config<T>(mut self, v: T) -> Self
1401 where
1402 T: std::convert::Into<crate::model::IamPolicyAnalysisOutputConfig>,
1403 {
1404 self.0.request.output_config = std::option::Option::Some(v.into());
1405 self
1406 }
1407
1408 pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
1412 where
1413 T: std::convert::Into<crate::model::IamPolicyAnalysisOutputConfig>,
1414 {
1415 self.0.request.output_config = v.map(|x| x.into());
1416 self
1417 }
1418 }
1419
1420 #[doc(hidden)]
1421 impl gax::options::internal::RequestBuilder for AnalyzeIamPolicyLongrunning {
1422 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1423 &mut self.0.options
1424 }
1425 }
1426
1427 #[derive(Clone, Debug)]
1445 pub struct AnalyzeMove(RequestBuilder<crate::model::AnalyzeMoveRequest>);
1446
1447 impl AnalyzeMove {
1448 pub(crate) fn new(
1449 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1450 ) -> Self {
1451 Self(RequestBuilder::new(stub))
1452 }
1453
1454 pub fn with_request<V: Into<crate::model::AnalyzeMoveRequest>>(mut self, v: V) -> Self {
1456 self.0.request = v.into();
1457 self
1458 }
1459
1460 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1462 self.0.options = v.into();
1463 self
1464 }
1465
1466 pub async fn send(self) -> Result<crate::model::AnalyzeMoveResponse> {
1468 (*self.0.stub)
1469 .analyze_move(self.0.request, self.0.options)
1470 .await
1471 .map(gax::response::Response::into_body)
1472 }
1473
1474 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1478 self.0.request.resource = v.into();
1479 self
1480 }
1481
1482 pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1486 self.0.request.destination_parent = v.into();
1487 self
1488 }
1489
1490 pub fn set_view<T: Into<crate::model::analyze_move_request::AnalysisView>>(
1492 mut self,
1493 v: T,
1494 ) -> Self {
1495 self.0.request.view = v.into();
1496 self
1497 }
1498 }
1499
1500 #[doc(hidden)]
1501 impl gax::options::internal::RequestBuilder for AnalyzeMove {
1502 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1503 &mut self.0.options
1504 }
1505 }
1506
1507 #[derive(Clone, Debug)]
1525 pub struct QueryAssets(RequestBuilder<crate::model::QueryAssetsRequest>);
1526
1527 impl QueryAssets {
1528 pub(crate) fn new(
1529 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1530 ) -> Self {
1531 Self(RequestBuilder::new(stub))
1532 }
1533
1534 pub fn with_request<V: Into<crate::model::QueryAssetsRequest>>(mut self, v: V) -> Self {
1536 self.0.request = v.into();
1537 self
1538 }
1539
1540 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1542 self.0.options = v.into();
1543 self
1544 }
1545
1546 pub async fn send(self) -> Result<crate::model::QueryAssetsResponse> {
1548 (*self.0.stub)
1549 .query_assets(self.0.request, self.0.options)
1550 .await
1551 .map(gax::response::Response::into_body)
1552 }
1553
1554 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1558 self.0.request.parent = v.into();
1559 self
1560 }
1561
1562 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1564 self.0.request.page_size = v.into();
1565 self
1566 }
1567
1568 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1570 self.0.request.page_token = v.into();
1571 self
1572 }
1573
1574 pub fn set_timeout<T>(mut self, v: T) -> Self
1576 where
1577 T: std::convert::Into<wkt::Duration>,
1578 {
1579 self.0.request.timeout = std::option::Option::Some(v.into());
1580 self
1581 }
1582
1583 pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
1585 where
1586 T: std::convert::Into<wkt::Duration>,
1587 {
1588 self.0.request.timeout = v.map(|x| x.into());
1589 self
1590 }
1591
1592 pub fn set_output_config<T>(mut self, v: T) -> Self
1594 where
1595 T: std::convert::Into<crate::model::QueryAssetsOutputConfig>,
1596 {
1597 self.0.request.output_config = std::option::Option::Some(v.into());
1598 self
1599 }
1600
1601 pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
1603 where
1604 T: std::convert::Into<crate::model::QueryAssetsOutputConfig>,
1605 {
1606 self.0.request.output_config = v.map(|x| x.into());
1607 self
1608 }
1609
1610 pub fn set_query<T: Into<Option<crate::model::query_assets_request::Query>>>(
1615 mut self,
1616 v: T,
1617 ) -> Self {
1618 self.0.request.query = v.into();
1619 self
1620 }
1621
1622 pub fn set_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1628 self.0.request = self.0.request.set_statement(v);
1629 self
1630 }
1631
1632 pub fn set_job_reference<T: std::convert::Into<std::string::String>>(
1638 mut self,
1639 v: T,
1640 ) -> Self {
1641 self.0.request = self.0.request.set_job_reference(v);
1642 self
1643 }
1644
1645 pub fn set_time<T: Into<Option<crate::model::query_assets_request::Time>>>(
1650 mut self,
1651 v: T,
1652 ) -> Self {
1653 self.0.request.time = v.into();
1654 self
1655 }
1656
1657 pub fn set_read_time_window<
1663 T: std::convert::Into<std::boxed::Box<crate::model::TimeWindow>>,
1664 >(
1665 mut self,
1666 v: T,
1667 ) -> Self {
1668 self.0.request = self.0.request.set_read_time_window(v);
1669 self
1670 }
1671
1672 pub fn set_read_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
1678 mut self,
1679 v: T,
1680 ) -> Self {
1681 self.0.request = self.0.request.set_read_time(v);
1682 self
1683 }
1684 }
1685
1686 #[doc(hidden)]
1687 impl gax::options::internal::RequestBuilder for QueryAssets {
1688 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1689 &mut self.0.options
1690 }
1691 }
1692
1693 #[derive(Clone, Debug)]
1711 pub struct CreateSavedQuery(RequestBuilder<crate::model::CreateSavedQueryRequest>);
1712
1713 impl CreateSavedQuery {
1714 pub(crate) fn new(
1715 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1716 ) -> Self {
1717 Self(RequestBuilder::new(stub))
1718 }
1719
1720 pub fn with_request<V: Into<crate::model::CreateSavedQueryRequest>>(
1722 mut self,
1723 v: V,
1724 ) -> Self {
1725 self.0.request = v.into();
1726 self
1727 }
1728
1729 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1731 self.0.options = v.into();
1732 self
1733 }
1734
1735 pub async fn send(self) -> Result<crate::model::SavedQuery> {
1737 (*self.0.stub)
1738 .create_saved_query(self.0.request, self.0.options)
1739 .await
1740 .map(gax::response::Response::into_body)
1741 }
1742
1743 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1747 self.0.request.parent = v.into();
1748 self
1749 }
1750
1751 pub fn set_saved_query<T>(mut self, v: T) -> Self
1755 where
1756 T: std::convert::Into<crate::model::SavedQuery>,
1757 {
1758 self.0.request.saved_query = std::option::Option::Some(v.into());
1759 self
1760 }
1761
1762 pub fn set_or_clear_saved_query<T>(mut self, v: std::option::Option<T>) -> Self
1766 where
1767 T: std::convert::Into<crate::model::SavedQuery>,
1768 {
1769 self.0.request.saved_query = v.map(|x| x.into());
1770 self
1771 }
1772
1773 pub fn set_saved_query_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1777 self.0.request.saved_query_id = v.into();
1778 self
1779 }
1780 }
1781
1782 #[doc(hidden)]
1783 impl gax::options::internal::RequestBuilder for CreateSavedQuery {
1784 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1785 &mut self.0.options
1786 }
1787 }
1788
1789 #[derive(Clone, Debug)]
1807 pub struct GetSavedQuery(RequestBuilder<crate::model::GetSavedQueryRequest>);
1808
1809 impl GetSavedQuery {
1810 pub(crate) fn new(
1811 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1812 ) -> Self {
1813 Self(RequestBuilder::new(stub))
1814 }
1815
1816 pub fn with_request<V: Into<crate::model::GetSavedQueryRequest>>(mut self, v: V) -> Self {
1818 self.0.request = v.into();
1819 self
1820 }
1821
1822 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1824 self.0.options = v.into();
1825 self
1826 }
1827
1828 pub async fn send(self) -> Result<crate::model::SavedQuery> {
1830 (*self.0.stub)
1831 .get_saved_query(self.0.request, self.0.options)
1832 .await
1833 .map(gax::response::Response::into_body)
1834 }
1835
1836 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1840 self.0.request.name = v.into();
1841 self
1842 }
1843 }
1844
1845 #[doc(hidden)]
1846 impl gax::options::internal::RequestBuilder for GetSavedQuery {
1847 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1848 &mut self.0.options
1849 }
1850 }
1851
1852 #[derive(Clone, Debug)]
1874 pub struct ListSavedQueries(RequestBuilder<crate::model::ListSavedQueriesRequest>);
1875
1876 impl ListSavedQueries {
1877 pub(crate) fn new(
1878 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1879 ) -> Self {
1880 Self(RequestBuilder::new(stub))
1881 }
1882
1883 pub fn with_request<V: Into<crate::model::ListSavedQueriesRequest>>(
1885 mut self,
1886 v: V,
1887 ) -> Self {
1888 self.0.request = v.into();
1889 self
1890 }
1891
1892 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1894 self.0.options = v.into();
1895 self
1896 }
1897
1898 pub async fn send(self) -> Result<crate::model::ListSavedQueriesResponse> {
1900 (*self.0.stub)
1901 .list_saved_queries(self.0.request, self.0.options)
1902 .await
1903 .map(gax::response::Response::into_body)
1904 }
1905
1906 pub fn by_page(
1908 self,
1909 ) -> impl gax::paginator::Paginator<crate::model::ListSavedQueriesResponse, gax::error::Error>
1910 {
1911 use std::clone::Clone;
1912 let token = self.0.request.page_token.clone();
1913 let execute = move |token: String| {
1914 let mut builder = self.clone();
1915 builder.0.request = builder.0.request.set_page_token(token);
1916 builder.send()
1917 };
1918 gax::paginator::internal::new_paginator(token, execute)
1919 }
1920
1921 pub fn by_item(
1923 self,
1924 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSavedQueriesResponse, gax::error::Error>
1925 {
1926 use gax::paginator::Paginator;
1927 self.by_page().items()
1928 }
1929
1930 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1934 self.0.request.parent = v.into();
1935 self
1936 }
1937
1938 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1940 self.0.request.filter = v.into();
1941 self
1942 }
1943
1944 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1946 self.0.request.page_size = v.into();
1947 self
1948 }
1949
1950 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1952 self.0.request.page_token = v.into();
1953 self
1954 }
1955 }
1956
1957 #[doc(hidden)]
1958 impl gax::options::internal::RequestBuilder for ListSavedQueries {
1959 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1960 &mut self.0.options
1961 }
1962 }
1963
1964 #[derive(Clone, Debug)]
1982 pub struct UpdateSavedQuery(RequestBuilder<crate::model::UpdateSavedQueryRequest>);
1983
1984 impl UpdateSavedQuery {
1985 pub(crate) fn new(
1986 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
1987 ) -> Self {
1988 Self(RequestBuilder::new(stub))
1989 }
1990
1991 pub fn with_request<V: Into<crate::model::UpdateSavedQueryRequest>>(
1993 mut self,
1994 v: V,
1995 ) -> Self {
1996 self.0.request = v.into();
1997 self
1998 }
1999
2000 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2002 self.0.options = v.into();
2003 self
2004 }
2005
2006 pub async fn send(self) -> Result<crate::model::SavedQuery> {
2008 (*self.0.stub)
2009 .update_saved_query(self.0.request, self.0.options)
2010 .await
2011 .map(gax::response::Response::into_body)
2012 }
2013
2014 pub fn set_saved_query<T>(mut self, v: T) -> Self
2018 where
2019 T: std::convert::Into<crate::model::SavedQuery>,
2020 {
2021 self.0.request.saved_query = std::option::Option::Some(v.into());
2022 self
2023 }
2024
2025 pub fn set_or_clear_saved_query<T>(mut self, v: std::option::Option<T>) -> Self
2029 where
2030 T: std::convert::Into<crate::model::SavedQuery>,
2031 {
2032 self.0.request.saved_query = v.map(|x| x.into());
2033 self
2034 }
2035
2036 pub fn set_update_mask<T>(mut self, v: T) -> Self
2040 where
2041 T: std::convert::Into<wkt::FieldMask>,
2042 {
2043 self.0.request.update_mask = std::option::Option::Some(v.into());
2044 self
2045 }
2046
2047 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2051 where
2052 T: std::convert::Into<wkt::FieldMask>,
2053 {
2054 self.0.request.update_mask = v.map(|x| x.into());
2055 self
2056 }
2057 }
2058
2059 #[doc(hidden)]
2060 impl gax::options::internal::RequestBuilder for UpdateSavedQuery {
2061 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2062 &mut self.0.options
2063 }
2064 }
2065
2066 #[derive(Clone, Debug)]
2084 pub struct DeleteSavedQuery(RequestBuilder<crate::model::DeleteSavedQueryRequest>);
2085
2086 impl DeleteSavedQuery {
2087 pub(crate) fn new(
2088 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2089 ) -> Self {
2090 Self(RequestBuilder::new(stub))
2091 }
2092
2093 pub fn with_request<V: Into<crate::model::DeleteSavedQueryRequest>>(
2095 mut self,
2096 v: V,
2097 ) -> Self {
2098 self.0.request = v.into();
2099 self
2100 }
2101
2102 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2104 self.0.options = v.into();
2105 self
2106 }
2107
2108 pub async fn send(self) -> Result<()> {
2110 (*self.0.stub)
2111 .delete_saved_query(self.0.request, self.0.options)
2112 .await
2113 .map(gax::response::Response::into_body)
2114 }
2115
2116 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2120 self.0.request.name = v.into();
2121 self
2122 }
2123 }
2124
2125 #[doc(hidden)]
2126 impl gax::options::internal::RequestBuilder for DeleteSavedQuery {
2127 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2128 &mut self.0.options
2129 }
2130 }
2131
2132 #[derive(Clone, Debug)]
2150 pub struct BatchGetEffectiveIamPolicies(
2151 RequestBuilder<crate::model::BatchGetEffectiveIamPoliciesRequest>,
2152 );
2153
2154 impl BatchGetEffectiveIamPolicies {
2155 pub(crate) fn new(
2156 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2157 ) -> Self {
2158 Self(RequestBuilder::new(stub))
2159 }
2160
2161 pub fn with_request<V: Into<crate::model::BatchGetEffectiveIamPoliciesRequest>>(
2163 mut self,
2164 v: V,
2165 ) -> Self {
2166 self.0.request = v.into();
2167 self
2168 }
2169
2170 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2172 self.0.options = v.into();
2173 self
2174 }
2175
2176 pub async fn send(self) -> Result<crate::model::BatchGetEffectiveIamPoliciesResponse> {
2178 (*self.0.stub)
2179 .batch_get_effective_iam_policies(self.0.request, self.0.options)
2180 .await
2181 .map(gax::response::Response::into_body)
2182 }
2183
2184 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
2188 self.0.request.scope = v.into();
2189 self
2190 }
2191
2192 pub fn set_names<T, V>(mut self, v: T) -> Self
2196 where
2197 T: std::iter::IntoIterator<Item = V>,
2198 V: std::convert::Into<std::string::String>,
2199 {
2200 use std::iter::Iterator;
2201 self.0.request.names = v.into_iter().map(|i| i.into()).collect();
2202 self
2203 }
2204 }
2205
2206 #[doc(hidden)]
2207 impl gax::options::internal::RequestBuilder for BatchGetEffectiveIamPolicies {
2208 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2209 &mut self.0.options
2210 }
2211 }
2212
2213 #[derive(Clone, Debug)]
2235 pub struct AnalyzeOrgPolicies(RequestBuilder<crate::model::AnalyzeOrgPoliciesRequest>);
2236
2237 impl AnalyzeOrgPolicies {
2238 pub(crate) fn new(
2239 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2240 ) -> Self {
2241 Self(RequestBuilder::new(stub))
2242 }
2243
2244 pub fn with_request<V: Into<crate::model::AnalyzeOrgPoliciesRequest>>(
2246 mut self,
2247 v: V,
2248 ) -> Self {
2249 self.0.request = v.into();
2250 self
2251 }
2252
2253 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2255 self.0.options = v.into();
2256 self
2257 }
2258
2259 pub async fn send(self) -> Result<crate::model::AnalyzeOrgPoliciesResponse> {
2261 (*self.0.stub)
2262 .analyze_org_policies(self.0.request, self.0.options)
2263 .await
2264 .map(gax::response::Response::into_body)
2265 }
2266
2267 pub fn by_page(
2269 self,
2270 ) -> impl gax::paginator::Paginator<crate::model::AnalyzeOrgPoliciesResponse, gax::error::Error>
2271 {
2272 use std::clone::Clone;
2273 let token = self.0.request.page_token.clone();
2274 let execute = move |token: String| {
2275 let mut builder = self.clone();
2276 builder.0.request = builder.0.request.set_page_token(token);
2277 builder.send()
2278 };
2279 gax::paginator::internal::new_paginator(token, execute)
2280 }
2281
2282 pub fn by_item(
2284 self,
2285 ) -> impl gax::paginator::ItemPaginator<
2286 crate::model::AnalyzeOrgPoliciesResponse,
2287 gax::error::Error,
2288 > {
2289 use gax::paginator::Paginator;
2290 self.by_page().items()
2291 }
2292
2293 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
2297 self.0.request.scope = v.into();
2298 self
2299 }
2300
2301 pub fn set_constraint<T: Into<std::string::String>>(mut self, v: T) -> Self {
2305 self.0.request.constraint = v.into();
2306 self
2307 }
2308
2309 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2311 self.0.request.filter = v.into();
2312 self
2313 }
2314
2315 pub fn set_page_size<T>(mut self, v: T) -> Self
2317 where
2318 T: std::convert::Into<i32>,
2319 {
2320 self.0.request.page_size = std::option::Option::Some(v.into());
2321 self
2322 }
2323
2324 pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
2326 where
2327 T: std::convert::Into<i32>,
2328 {
2329 self.0.request.page_size = v.map(|x| x.into());
2330 self
2331 }
2332
2333 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2335 self.0.request.page_token = v.into();
2336 self
2337 }
2338 }
2339
2340 #[doc(hidden)]
2341 impl gax::options::internal::RequestBuilder for AnalyzeOrgPolicies {
2342 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2343 &mut self.0.options
2344 }
2345 }
2346
2347 #[derive(Clone, Debug)]
2369 pub struct AnalyzeOrgPolicyGovernedContainers(
2370 RequestBuilder<crate::model::AnalyzeOrgPolicyGovernedContainersRequest>,
2371 );
2372
2373 impl AnalyzeOrgPolicyGovernedContainers {
2374 pub(crate) fn new(
2375 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2376 ) -> Self {
2377 Self(RequestBuilder::new(stub))
2378 }
2379
2380 pub fn with_request<V: Into<crate::model::AnalyzeOrgPolicyGovernedContainersRequest>>(
2382 mut self,
2383 v: V,
2384 ) -> Self {
2385 self.0.request = v.into();
2386 self
2387 }
2388
2389 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2391 self.0.options = v.into();
2392 self
2393 }
2394
2395 pub async fn send(
2397 self,
2398 ) -> Result<crate::model::AnalyzeOrgPolicyGovernedContainersResponse> {
2399 (*self.0.stub)
2400 .analyze_org_policy_governed_containers(self.0.request, self.0.options)
2401 .await
2402 .map(gax::response::Response::into_body)
2403 }
2404
2405 pub fn by_page(
2407 self,
2408 ) -> impl gax::paginator::Paginator<
2409 crate::model::AnalyzeOrgPolicyGovernedContainersResponse,
2410 gax::error::Error,
2411 > {
2412 use std::clone::Clone;
2413 let token = self.0.request.page_token.clone();
2414 let execute = move |token: String| {
2415 let mut builder = self.clone();
2416 builder.0.request = builder.0.request.set_page_token(token);
2417 builder.send()
2418 };
2419 gax::paginator::internal::new_paginator(token, execute)
2420 }
2421
2422 pub fn by_item(
2424 self,
2425 ) -> impl gax::paginator::ItemPaginator<
2426 crate::model::AnalyzeOrgPolicyGovernedContainersResponse,
2427 gax::error::Error,
2428 > {
2429 use gax::paginator::Paginator;
2430 self.by_page().items()
2431 }
2432
2433 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
2437 self.0.request.scope = v.into();
2438 self
2439 }
2440
2441 pub fn set_constraint<T: Into<std::string::String>>(mut self, v: T) -> Self {
2445 self.0.request.constraint = v.into();
2446 self
2447 }
2448
2449 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2451 self.0.request.filter = v.into();
2452 self
2453 }
2454
2455 pub fn set_page_size<T>(mut self, v: T) -> Self
2457 where
2458 T: std::convert::Into<i32>,
2459 {
2460 self.0.request.page_size = std::option::Option::Some(v.into());
2461 self
2462 }
2463
2464 pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
2466 where
2467 T: std::convert::Into<i32>,
2468 {
2469 self.0.request.page_size = v.map(|x| x.into());
2470 self
2471 }
2472
2473 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2475 self.0.request.page_token = v.into();
2476 self
2477 }
2478 }
2479
2480 #[doc(hidden)]
2481 impl gax::options::internal::RequestBuilder for AnalyzeOrgPolicyGovernedContainers {
2482 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2483 &mut self.0.options
2484 }
2485 }
2486
2487 #[derive(Clone, Debug)]
2509 pub struct AnalyzeOrgPolicyGovernedAssets(
2510 RequestBuilder<crate::model::AnalyzeOrgPolicyGovernedAssetsRequest>,
2511 );
2512
2513 impl AnalyzeOrgPolicyGovernedAssets {
2514 pub(crate) fn new(
2515 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2516 ) -> Self {
2517 Self(RequestBuilder::new(stub))
2518 }
2519
2520 pub fn with_request<V: Into<crate::model::AnalyzeOrgPolicyGovernedAssetsRequest>>(
2522 mut self,
2523 v: V,
2524 ) -> 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<crate::model::AnalyzeOrgPolicyGovernedAssetsResponse> {
2537 (*self.0.stub)
2538 .analyze_org_policy_governed_assets(self.0.request, self.0.options)
2539 .await
2540 .map(gax::response::Response::into_body)
2541 }
2542
2543 pub fn by_page(
2545 self,
2546 ) -> impl gax::paginator::Paginator<
2547 crate::model::AnalyzeOrgPolicyGovernedAssetsResponse,
2548 gax::error::Error,
2549 > {
2550 use std::clone::Clone;
2551 let token = self.0.request.page_token.clone();
2552 let execute = move |token: String| {
2553 let mut builder = self.clone();
2554 builder.0.request = builder.0.request.set_page_token(token);
2555 builder.send()
2556 };
2557 gax::paginator::internal::new_paginator(token, execute)
2558 }
2559
2560 pub fn by_item(
2562 self,
2563 ) -> impl gax::paginator::ItemPaginator<
2564 crate::model::AnalyzeOrgPolicyGovernedAssetsResponse,
2565 gax::error::Error,
2566 > {
2567 use gax::paginator::Paginator;
2568 self.by_page().items()
2569 }
2570
2571 pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
2575 self.0.request.scope = v.into();
2576 self
2577 }
2578
2579 pub fn set_constraint<T: Into<std::string::String>>(mut self, v: T) -> Self {
2583 self.0.request.constraint = v.into();
2584 self
2585 }
2586
2587 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2589 self.0.request.filter = v.into();
2590 self
2591 }
2592
2593 pub fn set_page_size<T>(mut self, v: T) -> Self
2595 where
2596 T: std::convert::Into<i32>,
2597 {
2598 self.0.request.page_size = std::option::Option::Some(v.into());
2599 self
2600 }
2601
2602 pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
2604 where
2605 T: std::convert::Into<i32>,
2606 {
2607 self.0.request.page_size = v.map(|x| x.into());
2608 self
2609 }
2610
2611 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2613 self.0.request.page_token = v.into();
2614 self
2615 }
2616 }
2617
2618 #[doc(hidden)]
2619 impl gax::options::internal::RequestBuilder for AnalyzeOrgPolicyGovernedAssets {
2620 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2621 &mut self.0.options
2622 }
2623 }
2624
2625 #[derive(Clone, Debug)]
2643 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2644
2645 impl GetOperation {
2646 pub(crate) fn new(
2647 stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
2648 ) -> Self {
2649 Self(RequestBuilder::new(stub))
2650 }
2651
2652 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2654 mut self,
2655 v: V,
2656 ) -> Self {
2657 self.0.request = v.into();
2658 self
2659 }
2660
2661 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2663 self.0.options = v.into();
2664 self
2665 }
2666
2667 pub async fn send(self) -> Result<longrunning::model::Operation> {
2669 (*self.0.stub)
2670 .get_operation(self.0.request, self.0.options)
2671 .await
2672 .map(gax::response::Response::into_body)
2673 }
2674
2675 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2677 self.0.request.name = v.into();
2678 self
2679 }
2680 }
2681
2682 #[doc(hidden)]
2683 impl gax::options::internal::RequestBuilder for GetOperation {
2684 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2685 &mut self.0.options
2686 }
2687 }
2688}