1pub mod storage_control {
19 use crate::Result;
20
21 #[derive(Clone, Debug)]
23 pub(crate) struct RequestBuilder<R: std::default::Default> {
24 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
25 request: R,
26 options: crate::RequestOptions,
27 }
28
29 impl<R> RequestBuilder<R>
30 where
31 R: std::default::Default,
32 {
33 pub(crate) fn new(
34 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
35 ) -> Self {
36 Self {
37 stub,
38 request: R::default(),
39 options: crate::RequestOptions::default(),
40 }
41 }
42 }
43
44 #[derive(Clone, Debug)]
61 pub struct CreateFolder(RequestBuilder<crate::model::CreateFolderRequest>);
62
63 impl CreateFolder {
64 pub(crate) fn new(
65 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
66 ) -> Self {
67 Self(RequestBuilder::new(stub))
68 }
69
70 pub fn with_request<V: Into<crate::model::CreateFolderRequest>>(mut self, v: V) -> Self {
72 self.0.request = v.into();
73 self
74 }
75
76 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
78 self.0.options = v.into();
79 self
80 }
81
82 pub async fn send(self) -> Result<crate::model::Folder> {
84 let req = Self::auto_populate(self.0.request, false);
85 (*self.0.stub)
86 .create_folder(req, self.0.options)
87 .await
88 .map(crate::Response::into_body)
89 }
90
91 fn auto_populate(
92 mut req: crate::model::CreateFolderRequest,
93 force: bool,
94 ) -> crate::model::CreateFolderRequest {
95 if force || req.request_id.is_empty() {
96 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
97 }
98 req
99 }
100
101 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
105 self.0.request.parent = v.into();
106 self
107 }
108
109 pub fn set_folder<T>(mut self, v: T) -> Self
113 where
114 T: std::convert::Into<crate::model::Folder>,
115 {
116 self.0.request.folder = std::option::Option::Some(v.into());
117 self
118 }
119
120 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
124 where
125 T: std::convert::Into<crate::model::Folder>,
126 {
127 self.0.request.folder = v.map(|x| x.into());
128 self
129 }
130
131 pub fn set_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
135 self.0.request.folder_id = v.into();
136 self
137 }
138
139 pub fn set_recursive<T: Into<bool>>(mut self, v: T) -> Self {
141 self.0.request.recursive = v.into();
142 self
143 }
144
145 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
147 self.0.request.request_id = v.into();
148 self
149 }
150 }
151
152 #[doc(hidden)]
153 impl crate::RequestBuilder for CreateFolder {
154 fn request_options(&mut self) -> &mut crate::RequestOptions {
155 &mut self.0.options
156 }
157 }
158
159 #[derive(Clone, Debug)]
176 pub struct DeleteFolder(RequestBuilder<crate::model::DeleteFolderRequest>);
177
178 impl DeleteFolder {
179 pub(crate) fn new(
180 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
181 ) -> Self {
182 Self(RequestBuilder::new(stub))
183 }
184
185 pub fn with_request<V: Into<crate::model::DeleteFolderRequest>>(mut self, v: V) -> Self {
187 self.0.request = v.into();
188 self
189 }
190
191 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
193 self.0.options = v.into();
194 self
195 }
196
197 pub async fn send(self) -> Result<()> {
199 let req = Self::auto_populate(self.0.request, false);
200 (*self.0.stub)
201 .delete_folder(req, self.0.options)
202 .await
203 .map(crate::Response::into_body)
204 }
205
206 fn auto_populate(
207 mut req: crate::model::DeleteFolderRequest,
208 force: bool,
209 ) -> crate::model::DeleteFolderRequest {
210 if force || req.request_id.is_empty() {
211 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
212 }
213 req
214 }
215
216 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
220 self.0.request.name = v.into();
221 self
222 }
223
224 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
226 where
227 T: std::convert::Into<i64>,
228 {
229 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
230 self
231 }
232
233 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
235 where
236 T: std::convert::Into<i64>,
237 {
238 self.0.request.if_metageneration_match = v.map(|x| x.into());
239 self
240 }
241
242 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
244 where
245 T: std::convert::Into<i64>,
246 {
247 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
248 self
249 }
250
251 pub fn set_or_clear_if_metageneration_not_match<T>(
253 mut self,
254 v: std::option::Option<T>,
255 ) -> Self
256 where
257 T: std::convert::Into<i64>,
258 {
259 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
260 self
261 }
262
263 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
265 self.0.request.request_id = v.into();
266 self
267 }
268 }
269
270 #[doc(hidden)]
271 impl crate::RequestBuilder for DeleteFolder {
272 fn request_options(&mut self) -> &mut crate::RequestOptions {
273 &mut self.0.options
274 }
275 }
276
277 #[derive(Clone, Debug)]
294 pub struct GetFolder(RequestBuilder<crate::model::GetFolderRequest>);
295
296 impl GetFolder {
297 pub(crate) fn new(
298 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
299 ) -> Self {
300 Self(RequestBuilder::new(stub))
301 }
302
303 pub fn with_request<V: Into<crate::model::GetFolderRequest>>(mut self, v: V) -> Self {
305 self.0.request = v.into();
306 self
307 }
308
309 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
311 self.0.options = v.into();
312 self
313 }
314
315 pub async fn send(self) -> Result<crate::model::Folder> {
317 let req = Self::auto_populate(self.0.request, false);
318 (*self.0.stub)
319 .get_folder(req, self.0.options)
320 .await
321 .map(crate::Response::into_body)
322 }
323
324 fn auto_populate(
325 mut req: crate::model::GetFolderRequest,
326 force: bool,
327 ) -> crate::model::GetFolderRequest {
328 if force || req.request_id.is_empty() {
329 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
330 }
331 req
332 }
333
334 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
338 self.0.request.name = v.into();
339 self
340 }
341
342 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
344 where
345 T: std::convert::Into<i64>,
346 {
347 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
348 self
349 }
350
351 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
353 where
354 T: std::convert::Into<i64>,
355 {
356 self.0.request.if_metageneration_match = v.map(|x| x.into());
357 self
358 }
359
360 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
362 where
363 T: std::convert::Into<i64>,
364 {
365 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
366 self
367 }
368
369 pub fn set_or_clear_if_metageneration_not_match<T>(
371 mut self,
372 v: std::option::Option<T>,
373 ) -> Self
374 where
375 T: std::convert::Into<i64>,
376 {
377 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
378 self
379 }
380
381 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
383 self.0.request.request_id = v.into();
384 self
385 }
386 }
387
388 #[doc(hidden)]
389 impl crate::RequestBuilder for GetFolder {
390 fn request_options(&mut self) -> &mut crate::RequestOptions {
391 &mut self.0.options
392 }
393 }
394
395 #[derive(Clone, Debug)]
416 pub struct ListFolders(RequestBuilder<crate::model::ListFoldersRequest>);
417
418 impl ListFolders {
419 pub(crate) fn new(
420 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
421 ) -> Self {
422 Self(RequestBuilder::new(stub))
423 }
424
425 pub fn with_request<V: Into<crate::model::ListFoldersRequest>>(mut self, v: V) -> Self {
427 self.0.request = v.into();
428 self
429 }
430
431 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
433 self.0.options = v.into();
434 self
435 }
436
437 pub async fn send(self) -> Result<crate::model::ListFoldersResponse> {
439 (*self.0.stub)
440 .list_folders(self.0.request, self.0.options)
441 .await
442 .map(crate::Response::into_body)
443 }
444
445 pub fn by_page(
447 self,
448 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListFoldersResponse, crate::Error>
449 {
450 use std::clone::Clone;
451 let token = self.0.request.page_token.clone();
452 let execute = move |token: String| {
453 let mut builder = self.clone();
454 builder.0.request = builder.0.request.set_page_token(token);
455 builder.send()
456 };
457 google_cloud_gax::paginator::internal::new_paginator(token, execute)
458 }
459
460 pub fn by_item(
462 self,
463 ) -> impl google_cloud_gax::paginator::ItemPaginator<
464 crate::model::ListFoldersResponse,
465 crate::Error,
466 > {
467 use google_cloud_gax::paginator::Paginator;
468 self.by_page().items()
469 }
470
471 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
475 self.0.request.parent = v.into();
476 self
477 }
478
479 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
481 self.0.request.page_size = v.into();
482 self
483 }
484
485 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
487 self.0.request.page_token = v.into();
488 self
489 }
490
491 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
493 self.0.request.prefix = v.into();
494 self
495 }
496
497 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
499 self.0.request.delimiter = v.into();
500 self
501 }
502
503 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
505 self.0.request.lexicographic_start = v.into();
506 self
507 }
508
509 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
511 self.0.request.lexicographic_end = v.into();
512 self
513 }
514
515 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
517 self.0.request.request_id = v.into();
518 self
519 }
520 }
521
522 #[doc(hidden)]
523 impl crate::RequestBuilder for ListFolders {
524 fn request_options(&mut self) -> &mut crate::RequestOptions {
525 &mut self.0.options
526 }
527 }
528
529 #[derive(Clone, Debug)]
547 pub struct RenameFolder(RequestBuilder<crate::model::RenameFolderRequest>);
548
549 impl RenameFolder {
550 pub(crate) fn new(
551 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
552 ) -> Self {
553 Self(RequestBuilder::new(stub))
554 }
555
556 pub fn with_request<V: Into<crate::model::RenameFolderRequest>>(mut self, v: V) -> Self {
558 self.0.request = v.into();
559 self
560 }
561
562 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
564 self.0.options = v.into();
565 self
566 }
567
568 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
575 let req = Self::auto_populate(self.0.request, false);
576 (*self.0.stub)
577 .rename_folder(req, self.0.options)
578 .await
579 .map(crate::Response::into_body)
580 }
581
582 pub fn poller(
584 self,
585 ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::RenameFolderMetadata>
586 {
587 type Operation = google_cloud_lro::internal::Operation<
588 crate::model::Folder,
589 crate::model::RenameFolderMetadata,
590 >;
591 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
592 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
593 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
594 if let Some(ref mut details) = poller_options.tracing {
595 details.method_name =
596 "google_cloud_storage::client::StorageControl::rename_folder::until_done";
597 }
598
599 let stub = self.0.stub.clone();
600 let mut options = self.0.options.clone();
601 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
602 let query = move |name| {
603 let stub = stub.clone();
604 let options = options.clone();
605 async {
606 let op = GetOperation::new(stub)
607 .set_name(name)
608 .with_options(options)
609 .send()
610 .await?;
611 Ok(Operation::new(op))
612 }
613 };
614
615 let start = move || async {
616 let op = self.send().await?;
617 Ok(Operation::new(op))
618 };
619
620 use google_cloud_lro::internal::PollerExt;
621 {
622 google_cloud_lro::internal::new_poller(
623 polling_error_policy,
624 polling_backoff_policy,
625 start,
626 query,
627 )
628 }
629 .with_options(poller_options)
630 }
631
632 fn auto_populate(
633 mut req: crate::model::RenameFolderRequest,
634 force: bool,
635 ) -> crate::model::RenameFolderRequest {
636 if force || req.request_id.is_empty() {
637 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
638 }
639 req
640 }
641
642 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
646 self.0.request.name = v.into();
647 self
648 }
649
650 pub fn set_destination_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
654 self.0.request.destination_folder_id = v.into();
655 self
656 }
657
658 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
660 where
661 T: std::convert::Into<i64>,
662 {
663 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
664 self
665 }
666
667 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
669 where
670 T: std::convert::Into<i64>,
671 {
672 self.0.request.if_metageneration_match = v.map(|x| x.into());
673 self
674 }
675
676 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
678 where
679 T: std::convert::Into<i64>,
680 {
681 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
682 self
683 }
684
685 pub fn set_or_clear_if_metageneration_not_match<T>(
687 mut self,
688 v: std::option::Option<T>,
689 ) -> Self
690 where
691 T: std::convert::Into<i64>,
692 {
693 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
694 self
695 }
696
697 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
699 self.0.request.request_id = v.into();
700 self
701 }
702 }
703
704 #[doc(hidden)]
705 impl crate::RequestBuilder for RenameFolder {
706 fn request_options(&mut self) -> &mut crate::RequestOptions {
707 &mut self.0.options
708 }
709 }
710
711 #[derive(Clone, Debug)]
729 pub struct DeleteFolderRecursive(RequestBuilder<crate::model::DeleteFolderRecursiveRequest>);
730
731 impl DeleteFolderRecursive {
732 pub(crate) fn new(
733 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
734 ) -> Self {
735 Self(RequestBuilder::new(stub))
736 }
737
738 pub fn with_request<V: Into<crate::model::DeleteFolderRecursiveRequest>>(
740 mut self,
741 v: V,
742 ) -> Self {
743 self.0.request = v.into();
744 self
745 }
746
747 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
749 self.0.options = v.into();
750 self
751 }
752
753 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
760 let req = Self::auto_populate(self.0.request, false);
761 (*self.0.stub)
762 .delete_folder_recursive(req, self.0.options)
763 .await
764 .map(crate::Response::into_body)
765 }
766
767 pub fn poller(
769 self,
770 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteFolderRecursiveMetadata>
771 {
772 type Operation = google_cloud_lro::internal::Operation<
773 wkt::Empty,
774 crate::model::DeleteFolderRecursiveMetadata,
775 >;
776 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
777 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
778 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
779 if let Some(ref mut details) = poller_options.tracing {
780 details.method_name = "google_cloud_storage::client::StorageControl::delete_folder_recursive::until_done";
781 }
782
783 let stub = self.0.stub.clone();
784 let mut options = self.0.options.clone();
785 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
786 let query = move |name| {
787 let stub = stub.clone();
788 let options = options.clone();
789 async {
790 let op = GetOperation::new(stub)
791 .set_name(name)
792 .with_options(options)
793 .send()
794 .await?;
795 Ok(Operation::new(op))
796 }
797 };
798
799 let start = move || async {
800 let op = self.send().await?;
801 Ok(Operation::new(op))
802 };
803
804 use google_cloud_lro::internal::PollerExt;
805 {
806 google_cloud_lro::internal::new_unit_response_poller(
807 polling_error_policy,
808 polling_backoff_policy,
809 start,
810 query,
811 )
812 }
813 .with_options(poller_options)
814 }
815
816 fn auto_populate(
817 mut req: crate::model::DeleteFolderRecursiveRequest,
818 force: bool,
819 ) -> crate::model::DeleteFolderRecursiveRequest {
820 if force || req.request_id.is_empty() {
821 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
822 }
823 req
824 }
825
826 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
830 self.0.request.name = v.into();
831 self
832 }
833
834 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
836 where
837 T: std::convert::Into<i64>,
838 {
839 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
840 self
841 }
842
843 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
845 where
846 T: std::convert::Into<i64>,
847 {
848 self.0.request.if_metageneration_match = v.map(|x| x.into());
849 self
850 }
851
852 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
854 where
855 T: std::convert::Into<i64>,
856 {
857 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
858 self
859 }
860
861 pub fn set_or_clear_if_metageneration_not_match<T>(
863 mut self,
864 v: std::option::Option<T>,
865 ) -> Self
866 where
867 T: std::convert::Into<i64>,
868 {
869 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
870 self
871 }
872
873 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
875 self.0.request.request_id = v.into();
876 self
877 }
878 }
879
880 #[doc(hidden)]
881 impl crate::RequestBuilder for DeleteFolderRecursive {
882 fn request_options(&mut self) -> &mut crate::RequestOptions {
883 &mut self.0.options
884 }
885 }
886
887 #[derive(Clone, Debug)]
904 pub struct GetStorageLayout(RequestBuilder<crate::model::GetStorageLayoutRequest>);
905
906 impl GetStorageLayout {
907 pub(crate) fn new(
908 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
909 ) -> Self {
910 Self(RequestBuilder::new(stub))
911 }
912
913 pub fn with_request<V: Into<crate::model::GetStorageLayoutRequest>>(
915 mut self,
916 v: V,
917 ) -> Self {
918 self.0.request = v.into();
919 self
920 }
921
922 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
924 self.0.options = v.into();
925 self
926 }
927
928 pub async fn send(self) -> Result<crate::model::StorageLayout> {
930 let req = Self::auto_populate(self.0.request, false);
931 (*self.0.stub)
932 .get_storage_layout(req, self.0.options)
933 .await
934 .map(crate::Response::into_body)
935 }
936
937 fn auto_populate(
938 mut req: crate::model::GetStorageLayoutRequest,
939 force: bool,
940 ) -> crate::model::GetStorageLayoutRequest {
941 if force || req.request_id.is_empty() {
942 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
943 }
944 req
945 }
946
947 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
951 self.0.request.name = v.into();
952 self
953 }
954
955 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
957 self.0.request.prefix = v.into();
958 self
959 }
960
961 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
963 self.0.request.request_id = v.into();
964 self
965 }
966 }
967
968 #[doc(hidden)]
969 impl crate::RequestBuilder for GetStorageLayout {
970 fn request_options(&mut self) -> &mut crate::RequestOptions {
971 &mut self.0.options
972 }
973 }
974
975 #[derive(Clone, Debug)]
992 pub struct CreateManagedFolder(RequestBuilder<crate::model::CreateManagedFolderRequest>);
993
994 impl CreateManagedFolder {
995 pub(crate) fn new(
996 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
997 ) -> Self {
998 Self(RequestBuilder::new(stub))
999 }
1000
1001 pub fn with_request<V: Into<crate::model::CreateManagedFolderRequest>>(
1003 mut self,
1004 v: V,
1005 ) -> Self {
1006 self.0.request = v.into();
1007 self
1008 }
1009
1010 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1012 self.0.options = v.into();
1013 self
1014 }
1015
1016 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1018 let req = Self::auto_populate(self.0.request, false);
1019 (*self.0.stub)
1020 .create_managed_folder(req, self.0.options)
1021 .await
1022 .map(crate::Response::into_body)
1023 }
1024
1025 fn auto_populate(
1026 mut req: crate::model::CreateManagedFolderRequest,
1027 force: bool,
1028 ) -> crate::model::CreateManagedFolderRequest {
1029 if force || req.request_id.is_empty() {
1030 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1031 }
1032 req
1033 }
1034
1035 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1039 self.0.request.parent = v.into();
1040 self
1041 }
1042
1043 pub fn set_managed_folder<T>(mut self, v: T) -> Self
1047 where
1048 T: std::convert::Into<crate::model::ManagedFolder>,
1049 {
1050 self.0.request.managed_folder = std::option::Option::Some(v.into());
1051 self
1052 }
1053
1054 pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
1058 where
1059 T: std::convert::Into<crate::model::ManagedFolder>,
1060 {
1061 self.0.request.managed_folder = v.map(|x| x.into());
1062 self
1063 }
1064
1065 pub fn set_managed_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1069 self.0.request.managed_folder_id = v.into();
1070 self
1071 }
1072
1073 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1075 self.0.request.request_id = v.into();
1076 self
1077 }
1078 }
1079
1080 #[doc(hidden)]
1081 impl crate::RequestBuilder for CreateManagedFolder {
1082 fn request_options(&mut self) -> &mut crate::RequestOptions {
1083 &mut self.0.options
1084 }
1085 }
1086
1087 #[derive(Clone, Debug)]
1104 pub struct DeleteManagedFolder(RequestBuilder<crate::model::DeleteManagedFolderRequest>);
1105
1106 impl DeleteManagedFolder {
1107 pub(crate) fn new(
1108 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1109 ) -> Self {
1110 Self(RequestBuilder::new(stub))
1111 }
1112
1113 pub fn with_request<V: Into<crate::model::DeleteManagedFolderRequest>>(
1115 mut self,
1116 v: V,
1117 ) -> Self {
1118 self.0.request = v.into();
1119 self
1120 }
1121
1122 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1124 self.0.options = v.into();
1125 self
1126 }
1127
1128 pub async fn send(self) -> Result<()> {
1130 let req = Self::auto_populate(self.0.request, false);
1131 (*self.0.stub)
1132 .delete_managed_folder(req, self.0.options)
1133 .await
1134 .map(crate::Response::into_body)
1135 }
1136
1137 fn auto_populate(
1138 mut req: crate::model::DeleteManagedFolderRequest,
1139 force: bool,
1140 ) -> crate::model::DeleteManagedFolderRequest {
1141 if force || req.request_id.is_empty() {
1142 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1143 }
1144 req
1145 }
1146
1147 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1151 self.0.request.name = v.into();
1152 self
1153 }
1154
1155 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1157 where
1158 T: std::convert::Into<i64>,
1159 {
1160 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1161 self
1162 }
1163
1164 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1166 where
1167 T: std::convert::Into<i64>,
1168 {
1169 self.0.request.if_metageneration_match = v.map(|x| x.into());
1170 self
1171 }
1172
1173 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1175 where
1176 T: std::convert::Into<i64>,
1177 {
1178 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1179 self
1180 }
1181
1182 pub fn set_or_clear_if_metageneration_not_match<T>(
1184 mut self,
1185 v: std::option::Option<T>,
1186 ) -> Self
1187 where
1188 T: std::convert::Into<i64>,
1189 {
1190 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1191 self
1192 }
1193
1194 pub fn set_allow_non_empty<T: Into<bool>>(mut self, v: T) -> Self {
1196 self.0.request.allow_non_empty = v.into();
1197 self
1198 }
1199
1200 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1202 self.0.request.request_id = v.into();
1203 self
1204 }
1205 }
1206
1207 #[doc(hidden)]
1208 impl crate::RequestBuilder for DeleteManagedFolder {
1209 fn request_options(&mut self) -> &mut crate::RequestOptions {
1210 &mut self.0.options
1211 }
1212 }
1213
1214 #[derive(Clone, Debug)]
1231 pub struct GetManagedFolder(RequestBuilder<crate::model::GetManagedFolderRequest>);
1232
1233 impl GetManagedFolder {
1234 pub(crate) fn new(
1235 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1236 ) -> Self {
1237 Self(RequestBuilder::new(stub))
1238 }
1239
1240 pub fn with_request<V: Into<crate::model::GetManagedFolderRequest>>(
1242 mut self,
1243 v: V,
1244 ) -> Self {
1245 self.0.request = v.into();
1246 self
1247 }
1248
1249 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1251 self.0.options = v.into();
1252 self
1253 }
1254
1255 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1257 let req = Self::auto_populate(self.0.request, false);
1258 (*self.0.stub)
1259 .get_managed_folder(req, self.0.options)
1260 .await
1261 .map(crate::Response::into_body)
1262 }
1263
1264 fn auto_populate(
1265 mut req: crate::model::GetManagedFolderRequest,
1266 force: bool,
1267 ) -> crate::model::GetManagedFolderRequest {
1268 if force || req.request_id.is_empty() {
1269 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1270 }
1271 req
1272 }
1273
1274 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1278 self.0.request.name = v.into();
1279 self
1280 }
1281
1282 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1284 where
1285 T: std::convert::Into<i64>,
1286 {
1287 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1288 self
1289 }
1290
1291 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1293 where
1294 T: std::convert::Into<i64>,
1295 {
1296 self.0.request.if_metageneration_match = v.map(|x| x.into());
1297 self
1298 }
1299
1300 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1302 where
1303 T: std::convert::Into<i64>,
1304 {
1305 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1306 self
1307 }
1308
1309 pub fn set_or_clear_if_metageneration_not_match<T>(
1311 mut self,
1312 v: std::option::Option<T>,
1313 ) -> Self
1314 where
1315 T: std::convert::Into<i64>,
1316 {
1317 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1318 self
1319 }
1320
1321 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1323 self.0.request.request_id = v.into();
1324 self
1325 }
1326 }
1327
1328 #[doc(hidden)]
1329 impl crate::RequestBuilder for GetManagedFolder {
1330 fn request_options(&mut self) -> &mut crate::RequestOptions {
1331 &mut self.0.options
1332 }
1333 }
1334
1335 #[derive(Clone, Debug)]
1356 pub struct ListManagedFolders(RequestBuilder<crate::model::ListManagedFoldersRequest>);
1357
1358 impl ListManagedFolders {
1359 pub(crate) fn new(
1360 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1361 ) -> Self {
1362 Self(RequestBuilder::new(stub))
1363 }
1364
1365 pub fn with_request<V: Into<crate::model::ListManagedFoldersRequest>>(
1367 mut self,
1368 v: V,
1369 ) -> Self {
1370 self.0.request = v.into();
1371 self
1372 }
1373
1374 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1376 self.0.options = v.into();
1377 self
1378 }
1379
1380 pub async fn send(self) -> Result<crate::model::ListManagedFoldersResponse> {
1382 let req = Self::auto_populate(self.0.request, false);
1383 (*self.0.stub)
1384 .list_managed_folders(req, self.0.options)
1385 .await
1386 .map(crate::Response::into_body)
1387 }
1388
1389 pub fn by_page(
1391 self,
1392 ) -> impl google_cloud_gax::paginator::Paginator<
1393 crate::model::ListManagedFoldersResponse,
1394 crate::Error,
1395 > {
1396 use std::clone::Clone;
1397 let token = self.0.request.page_token.clone();
1398 let execute = move |token: String| {
1399 let mut builder = self.clone();
1400 let initial = builder.0.request.page_token == token;
1401 builder.0.request = Self::auto_populate(builder.0.request, !initial);
1402 builder.0.request = builder.0.request.set_page_token(token);
1403 builder.send()
1404 };
1405 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1406 }
1407
1408 pub fn by_item(
1410 self,
1411 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1412 crate::model::ListManagedFoldersResponse,
1413 crate::Error,
1414 > {
1415 use google_cloud_gax::paginator::Paginator;
1416 self.by_page().items()
1417 }
1418
1419 fn auto_populate(
1420 mut req: crate::model::ListManagedFoldersRequest,
1421 force: bool,
1422 ) -> crate::model::ListManagedFoldersRequest {
1423 if force || req.request_id.is_empty() {
1424 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1425 }
1426 req
1427 }
1428
1429 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1433 self.0.request.parent = v.into();
1434 self
1435 }
1436
1437 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1439 self.0.request.page_size = v.into();
1440 self
1441 }
1442
1443 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1445 self.0.request.page_token = v.into();
1446 self
1447 }
1448
1449 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1451 self.0.request.prefix = v.into();
1452 self
1453 }
1454
1455 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1457 self.0.request.request_id = v.into();
1458 self
1459 }
1460 }
1461
1462 #[doc(hidden)]
1463 impl crate::RequestBuilder for ListManagedFolders {
1464 fn request_options(&mut self) -> &mut crate::RequestOptions {
1465 &mut self.0.options
1466 }
1467 }
1468
1469 #[derive(Clone, Debug)]
1486 pub struct UpdateManagedFolder(RequestBuilder<crate::model::UpdateManagedFolderRequest>);
1487
1488 impl UpdateManagedFolder {
1489 pub(crate) fn new(
1490 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1491 ) -> Self {
1492 Self(RequestBuilder::new(stub))
1493 }
1494
1495 pub fn with_request<V: Into<crate::model::UpdateManagedFolderRequest>>(
1497 mut self,
1498 v: V,
1499 ) -> Self {
1500 self.0.request = v.into();
1501 self
1502 }
1503
1504 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1506 self.0.options = v.into();
1507 self
1508 }
1509
1510 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1512 (*self.0.stub)
1513 .update_managed_folder(self.0.request, self.0.options)
1514 .await
1515 .map(crate::Response::into_body)
1516 }
1517
1518 pub fn set_managed_folder<T>(mut self, v: T) -> Self
1522 where
1523 T: std::convert::Into<crate::model::ManagedFolder>,
1524 {
1525 self.0.request.managed_folder = std::option::Option::Some(v.into());
1526 self
1527 }
1528
1529 pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
1533 where
1534 T: std::convert::Into<crate::model::ManagedFolder>,
1535 {
1536 self.0.request.managed_folder = v.map(|x| x.into());
1537 self
1538 }
1539
1540 pub fn set_update_mask<T>(mut self, v: T) -> Self
1542 where
1543 T: std::convert::Into<wkt::FieldMask>,
1544 {
1545 self.0.request.update_mask = std::option::Option::Some(v.into());
1546 self
1547 }
1548
1549 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1551 where
1552 T: std::convert::Into<wkt::FieldMask>,
1553 {
1554 self.0.request.update_mask = v.map(|x| x.into());
1555 self
1556 }
1557
1558 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1560 where
1561 T: std::convert::Into<i64>,
1562 {
1563 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1564 self
1565 }
1566
1567 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1569 where
1570 T: std::convert::Into<i64>,
1571 {
1572 self.0.request.if_metageneration_match = v.map(|x| x.into());
1573 self
1574 }
1575
1576 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1578 where
1579 T: std::convert::Into<i64>,
1580 {
1581 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1582 self
1583 }
1584
1585 pub fn set_or_clear_if_metageneration_not_match<T>(
1587 mut self,
1588 v: std::option::Option<T>,
1589 ) -> Self
1590 where
1591 T: std::convert::Into<i64>,
1592 {
1593 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1594 self
1595 }
1596
1597 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1599 self.0.request.request_id = v.into();
1600 self
1601 }
1602 }
1603
1604 #[doc(hidden)]
1605 impl crate::RequestBuilder for UpdateManagedFolder {
1606 fn request_options(&mut self) -> &mut crate::RequestOptions {
1607 &mut self.0.options
1608 }
1609 }
1610
1611 #[derive(Clone, Debug)]
1629 pub struct CreateAnywhereCache(RequestBuilder<crate::model::CreateAnywhereCacheRequest>);
1630
1631 impl CreateAnywhereCache {
1632 pub(crate) fn new(
1633 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1634 ) -> Self {
1635 Self(RequestBuilder::new(stub))
1636 }
1637
1638 pub fn with_request<V: Into<crate::model::CreateAnywhereCacheRequest>>(
1640 mut self,
1641 v: V,
1642 ) -> Self {
1643 self.0.request = v.into();
1644 self
1645 }
1646
1647 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1649 self.0.options = v.into();
1650 self
1651 }
1652
1653 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1660 let req = Self::auto_populate(self.0.request, false);
1661 (*self.0.stub)
1662 .create_anywhere_cache(req, self.0.options)
1663 .await
1664 .map(crate::Response::into_body)
1665 }
1666
1667 pub fn poller(
1669 self,
1670 ) -> impl google_cloud_lro::Poller<
1671 crate::model::AnywhereCache,
1672 crate::model::CreateAnywhereCacheMetadata,
1673 > {
1674 type Operation = google_cloud_lro::internal::Operation<
1675 crate::model::AnywhereCache,
1676 crate::model::CreateAnywhereCacheMetadata,
1677 >;
1678 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1679 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1680 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1681 if let Some(ref mut details) = poller_options.tracing {
1682 details.method_name = "google_cloud_storage::client::StorageControl::create_anywhere_cache::until_done";
1683 }
1684
1685 let stub = self.0.stub.clone();
1686 let mut options = self.0.options.clone();
1687 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1688 let query = move |name| {
1689 let stub = stub.clone();
1690 let options = options.clone();
1691 async {
1692 let op = GetOperation::new(stub)
1693 .set_name(name)
1694 .with_options(options)
1695 .send()
1696 .await?;
1697 Ok(Operation::new(op))
1698 }
1699 };
1700
1701 let start = move || async {
1702 let op = self.send().await?;
1703 Ok(Operation::new(op))
1704 };
1705
1706 use google_cloud_lro::internal::PollerExt;
1707 {
1708 google_cloud_lro::internal::new_poller(
1709 polling_error_policy,
1710 polling_backoff_policy,
1711 start,
1712 query,
1713 )
1714 }
1715 .with_options(poller_options)
1716 }
1717
1718 fn auto_populate(
1719 mut req: crate::model::CreateAnywhereCacheRequest,
1720 force: bool,
1721 ) -> crate::model::CreateAnywhereCacheRequest {
1722 if force || req.request_id.is_empty() {
1723 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1724 }
1725 req
1726 }
1727
1728 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1732 self.0.request.parent = v.into();
1733 self
1734 }
1735
1736 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1740 where
1741 T: std::convert::Into<crate::model::AnywhereCache>,
1742 {
1743 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1744 self
1745 }
1746
1747 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1751 where
1752 T: std::convert::Into<crate::model::AnywhereCache>,
1753 {
1754 self.0.request.anywhere_cache = v.map(|x| x.into());
1755 self
1756 }
1757
1758 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1760 self.0.request.request_id = v.into();
1761 self
1762 }
1763 }
1764
1765 #[doc(hidden)]
1766 impl crate::RequestBuilder for CreateAnywhereCache {
1767 fn request_options(&mut self) -> &mut crate::RequestOptions {
1768 &mut self.0.options
1769 }
1770 }
1771
1772 #[derive(Clone, Debug)]
1790 pub struct UpdateAnywhereCache(RequestBuilder<crate::model::UpdateAnywhereCacheRequest>);
1791
1792 impl UpdateAnywhereCache {
1793 pub(crate) fn new(
1794 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1795 ) -> Self {
1796 Self(RequestBuilder::new(stub))
1797 }
1798
1799 pub fn with_request<V: Into<crate::model::UpdateAnywhereCacheRequest>>(
1801 mut self,
1802 v: V,
1803 ) -> Self {
1804 self.0.request = v.into();
1805 self
1806 }
1807
1808 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1810 self.0.options = v.into();
1811 self
1812 }
1813
1814 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1821 let req = Self::auto_populate(self.0.request, false);
1822 (*self.0.stub)
1823 .update_anywhere_cache(req, self.0.options)
1824 .await
1825 .map(crate::Response::into_body)
1826 }
1827
1828 pub fn poller(
1830 self,
1831 ) -> impl google_cloud_lro::Poller<
1832 crate::model::AnywhereCache,
1833 crate::model::UpdateAnywhereCacheMetadata,
1834 > {
1835 type Operation = google_cloud_lro::internal::Operation<
1836 crate::model::AnywhereCache,
1837 crate::model::UpdateAnywhereCacheMetadata,
1838 >;
1839 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1840 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1841 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1842 if let Some(ref mut details) = poller_options.tracing {
1843 details.method_name = "google_cloud_storage::client::StorageControl::update_anywhere_cache::until_done";
1844 }
1845
1846 let stub = self.0.stub.clone();
1847 let mut options = self.0.options.clone();
1848 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1849 let query = move |name| {
1850 let stub = stub.clone();
1851 let options = options.clone();
1852 async {
1853 let op = GetOperation::new(stub)
1854 .set_name(name)
1855 .with_options(options)
1856 .send()
1857 .await?;
1858 Ok(Operation::new(op))
1859 }
1860 };
1861
1862 let start = move || async {
1863 let op = self.send().await?;
1864 Ok(Operation::new(op))
1865 };
1866
1867 use google_cloud_lro::internal::PollerExt;
1868 {
1869 google_cloud_lro::internal::new_poller(
1870 polling_error_policy,
1871 polling_backoff_policy,
1872 start,
1873 query,
1874 )
1875 }
1876 .with_options(poller_options)
1877 }
1878
1879 fn auto_populate(
1880 mut req: crate::model::UpdateAnywhereCacheRequest,
1881 force: bool,
1882 ) -> crate::model::UpdateAnywhereCacheRequest {
1883 if force || req.request_id.is_empty() {
1884 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1885 }
1886 req
1887 }
1888
1889 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1893 where
1894 T: std::convert::Into<crate::model::AnywhereCache>,
1895 {
1896 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1897 self
1898 }
1899
1900 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1904 where
1905 T: std::convert::Into<crate::model::AnywhereCache>,
1906 {
1907 self.0.request.anywhere_cache = v.map(|x| x.into());
1908 self
1909 }
1910
1911 pub fn set_update_mask<T>(mut self, v: T) -> Self
1915 where
1916 T: std::convert::Into<wkt::FieldMask>,
1917 {
1918 self.0.request.update_mask = std::option::Option::Some(v.into());
1919 self
1920 }
1921
1922 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1926 where
1927 T: std::convert::Into<wkt::FieldMask>,
1928 {
1929 self.0.request.update_mask = v.map(|x| x.into());
1930 self
1931 }
1932
1933 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1935 self.0.request.request_id = v.into();
1936 self
1937 }
1938 }
1939
1940 #[doc(hidden)]
1941 impl crate::RequestBuilder for UpdateAnywhereCache {
1942 fn request_options(&mut self) -> &mut crate::RequestOptions {
1943 &mut self.0.options
1944 }
1945 }
1946
1947 #[derive(Clone, Debug)]
1964 pub struct DisableAnywhereCache(RequestBuilder<crate::model::DisableAnywhereCacheRequest>);
1965
1966 impl DisableAnywhereCache {
1967 pub(crate) fn new(
1968 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1969 ) -> Self {
1970 Self(RequestBuilder::new(stub))
1971 }
1972
1973 pub fn with_request<V: Into<crate::model::DisableAnywhereCacheRequest>>(
1975 mut self,
1976 v: V,
1977 ) -> Self {
1978 self.0.request = v.into();
1979 self
1980 }
1981
1982 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1984 self.0.options = v.into();
1985 self
1986 }
1987
1988 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1990 let req = Self::auto_populate(self.0.request, false);
1991 (*self.0.stub)
1992 .disable_anywhere_cache(req, self.0.options)
1993 .await
1994 .map(crate::Response::into_body)
1995 }
1996
1997 fn auto_populate(
1998 mut req: crate::model::DisableAnywhereCacheRequest,
1999 force: bool,
2000 ) -> crate::model::DisableAnywhereCacheRequest {
2001 if force || req.request_id.is_empty() {
2002 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2003 }
2004 req
2005 }
2006
2007 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2011 self.0.request.name = v.into();
2012 self
2013 }
2014
2015 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2017 self.0.request.request_id = v.into();
2018 self
2019 }
2020 }
2021
2022 #[doc(hidden)]
2023 impl crate::RequestBuilder for DisableAnywhereCache {
2024 fn request_options(&mut self) -> &mut crate::RequestOptions {
2025 &mut self.0.options
2026 }
2027 }
2028
2029 #[derive(Clone, Debug)]
2046 pub struct PauseAnywhereCache(RequestBuilder<crate::model::PauseAnywhereCacheRequest>);
2047
2048 impl PauseAnywhereCache {
2049 pub(crate) fn new(
2050 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2051 ) -> Self {
2052 Self(RequestBuilder::new(stub))
2053 }
2054
2055 pub fn with_request<V: Into<crate::model::PauseAnywhereCacheRequest>>(
2057 mut self,
2058 v: V,
2059 ) -> Self {
2060 self.0.request = v.into();
2061 self
2062 }
2063
2064 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2066 self.0.options = v.into();
2067 self
2068 }
2069
2070 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2072 let req = Self::auto_populate(self.0.request, false);
2073 (*self.0.stub)
2074 .pause_anywhere_cache(req, self.0.options)
2075 .await
2076 .map(crate::Response::into_body)
2077 }
2078
2079 fn auto_populate(
2080 mut req: crate::model::PauseAnywhereCacheRequest,
2081 force: bool,
2082 ) -> crate::model::PauseAnywhereCacheRequest {
2083 if force || req.request_id.is_empty() {
2084 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2085 }
2086 req
2087 }
2088
2089 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2093 self.0.request.name = v.into();
2094 self
2095 }
2096
2097 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2099 self.0.request.request_id = v.into();
2100 self
2101 }
2102 }
2103
2104 #[doc(hidden)]
2105 impl crate::RequestBuilder for PauseAnywhereCache {
2106 fn request_options(&mut self) -> &mut crate::RequestOptions {
2107 &mut self.0.options
2108 }
2109 }
2110
2111 #[derive(Clone, Debug)]
2128 pub struct ResumeAnywhereCache(RequestBuilder<crate::model::ResumeAnywhereCacheRequest>);
2129
2130 impl ResumeAnywhereCache {
2131 pub(crate) fn new(
2132 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2133 ) -> Self {
2134 Self(RequestBuilder::new(stub))
2135 }
2136
2137 pub fn with_request<V: Into<crate::model::ResumeAnywhereCacheRequest>>(
2139 mut self,
2140 v: V,
2141 ) -> Self {
2142 self.0.request = v.into();
2143 self
2144 }
2145
2146 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2148 self.0.options = v.into();
2149 self
2150 }
2151
2152 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2154 let req = Self::auto_populate(self.0.request, false);
2155 (*self.0.stub)
2156 .resume_anywhere_cache(req, self.0.options)
2157 .await
2158 .map(crate::Response::into_body)
2159 }
2160
2161 fn auto_populate(
2162 mut req: crate::model::ResumeAnywhereCacheRequest,
2163 force: bool,
2164 ) -> crate::model::ResumeAnywhereCacheRequest {
2165 if force || req.request_id.is_empty() {
2166 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2167 }
2168 req
2169 }
2170
2171 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2175 self.0.request.name = v.into();
2176 self
2177 }
2178
2179 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2181 self.0.request.request_id = v.into();
2182 self
2183 }
2184 }
2185
2186 #[doc(hidden)]
2187 impl crate::RequestBuilder for ResumeAnywhereCache {
2188 fn request_options(&mut self) -> &mut crate::RequestOptions {
2189 &mut self.0.options
2190 }
2191 }
2192
2193 #[derive(Clone, Debug)]
2210 pub struct GetAnywhereCache(RequestBuilder<crate::model::GetAnywhereCacheRequest>);
2211
2212 impl GetAnywhereCache {
2213 pub(crate) fn new(
2214 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2215 ) -> Self {
2216 Self(RequestBuilder::new(stub))
2217 }
2218
2219 pub fn with_request<V: Into<crate::model::GetAnywhereCacheRequest>>(
2221 mut self,
2222 v: V,
2223 ) -> Self {
2224 self.0.request = v.into();
2225 self
2226 }
2227
2228 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2230 self.0.options = v.into();
2231 self
2232 }
2233
2234 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2236 let req = Self::auto_populate(self.0.request, false);
2237 (*self.0.stub)
2238 .get_anywhere_cache(req, self.0.options)
2239 .await
2240 .map(crate::Response::into_body)
2241 }
2242
2243 fn auto_populate(
2244 mut req: crate::model::GetAnywhereCacheRequest,
2245 force: bool,
2246 ) -> crate::model::GetAnywhereCacheRequest {
2247 if force || req.request_id.is_empty() {
2248 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2249 }
2250 req
2251 }
2252
2253 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2257 self.0.request.name = v.into();
2258 self
2259 }
2260
2261 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2263 self.0.request.request_id = v.into();
2264 self
2265 }
2266 }
2267
2268 #[doc(hidden)]
2269 impl crate::RequestBuilder for GetAnywhereCache {
2270 fn request_options(&mut self) -> &mut crate::RequestOptions {
2271 &mut self.0.options
2272 }
2273 }
2274
2275 #[derive(Clone, Debug)]
2296 pub struct ListAnywhereCaches(RequestBuilder<crate::model::ListAnywhereCachesRequest>);
2297
2298 impl ListAnywhereCaches {
2299 pub(crate) fn new(
2300 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2301 ) -> Self {
2302 Self(RequestBuilder::new(stub))
2303 }
2304
2305 pub fn with_request<V: Into<crate::model::ListAnywhereCachesRequest>>(
2307 mut self,
2308 v: V,
2309 ) -> Self {
2310 self.0.request = v.into();
2311 self
2312 }
2313
2314 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2316 self.0.options = v.into();
2317 self
2318 }
2319
2320 pub async fn send(self) -> Result<crate::model::ListAnywhereCachesResponse> {
2322 let req = Self::auto_populate(self.0.request, false);
2323 (*self.0.stub)
2324 .list_anywhere_caches(req, self.0.options)
2325 .await
2326 .map(crate::Response::into_body)
2327 }
2328
2329 pub fn by_page(
2331 self,
2332 ) -> impl google_cloud_gax::paginator::Paginator<
2333 crate::model::ListAnywhereCachesResponse,
2334 crate::Error,
2335 > {
2336 use std::clone::Clone;
2337 let token = self.0.request.page_token.clone();
2338 let execute = move |token: String| {
2339 let mut builder = self.clone();
2340 let initial = builder.0.request.page_token == token;
2341 builder.0.request = Self::auto_populate(builder.0.request, !initial);
2342 builder.0.request = builder.0.request.set_page_token(token);
2343 builder.send()
2344 };
2345 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2346 }
2347
2348 pub fn by_item(
2350 self,
2351 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2352 crate::model::ListAnywhereCachesResponse,
2353 crate::Error,
2354 > {
2355 use google_cloud_gax::paginator::Paginator;
2356 self.by_page().items()
2357 }
2358
2359 fn auto_populate(
2360 mut req: crate::model::ListAnywhereCachesRequest,
2361 force: bool,
2362 ) -> crate::model::ListAnywhereCachesRequest {
2363 if force || req.request_id.is_empty() {
2364 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2365 }
2366 req
2367 }
2368
2369 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2373 self.0.request.parent = v.into();
2374 self
2375 }
2376
2377 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2379 self.0.request.page_size = v.into();
2380 self
2381 }
2382
2383 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2385 self.0.request.page_token = v.into();
2386 self
2387 }
2388
2389 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2391 self.0.request.request_id = v.into();
2392 self
2393 }
2394 }
2395
2396 #[doc(hidden)]
2397 impl crate::RequestBuilder for ListAnywhereCaches {
2398 fn request_options(&mut self) -> &mut crate::RequestOptions {
2399 &mut self.0.options
2400 }
2401 }
2402
2403 #[derive(Clone, Debug)]
2421 pub struct CreateRapidCache(RequestBuilder<crate::model::CreateRapidCacheRequest>);
2422
2423 impl CreateRapidCache {
2424 pub(crate) fn new(
2425 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2426 ) -> Self {
2427 Self(RequestBuilder::new(stub))
2428 }
2429
2430 pub fn with_request<V: Into<crate::model::CreateRapidCacheRequest>>(
2432 mut self,
2433 v: V,
2434 ) -> Self {
2435 self.0.request = v.into();
2436 self
2437 }
2438
2439 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2441 self.0.options = v.into();
2442 self
2443 }
2444
2445 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2452 (*self.0.stub)
2453 .create_rapid_cache(self.0.request, self.0.options)
2454 .await
2455 .map(crate::Response::into_body)
2456 }
2457
2458 pub fn poller(
2460 self,
2461 ) -> impl google_cloud_lro::Poller<
2462 crate::model::RapidCache,
2463 crate::model::CreateRapidCacheMetadata,
2464 > {
2465 type Operation = google_cloud_lro::internal::Operation<
2466 crate::model::RapidCache,
2467 crate::model::CreateRapidCacheMetadata,
2468 >;
2469 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2470 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2471 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2472 if let Some(ref mut details) = poller_options.tracing {
2473 details.method_name =
2474 "google_cloud_storage::client::StorageControl::create_rapid_cache::until_done";
2475 }
2476
2477 let stub = self.0.stub.clone();
2478 let mut options = self.0.options.clone();
2479 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2480 let query = move |name| {
2481 let stub = stub.clone();
2482 let options = options.clone();
2483 async {
2484 let op = GetOperation::new(stub)
2485 .set_name(name)
2486 .with_options(options)
2487 .send()
2488 .await?;
2489 Ok(Operation::new(op))
2490 }
2491 };
2492
2493 let start = move || async {
2494 let op = self.send().await?;
2495 Ok(Operation::new(op))
2496 };
2497
2498 use google_cloud_lro::internal::PollerExt;
2499 {
2500 google_cloud_lro::internal::new_poller(
2501 polling_error_policy,
2502 polling_backoff_policy,
2503 start,
2504 query,
2505 )
2506 }
2507 .with_options(poller_options)
2508 }
2509
2510 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2514 self.0.request.parent = v.into();
2515 self
2516 }
2517
2518 pub fn set_rapid_cache<T>(mut self, v: T) -> Self
2522 where
2523 T: std::convert::Into<crate::model::RapidCache>,
2524 {
2525 self.0.request.rapid_cache = std::option::Option::Some(v.into());
2526 self
2527 }
2528
2529 pub fn set_or_clear_rapid_cache<T>(mut self, v: std::option::Option<T>) -> Self
2533 where
2534 T: std::convert::Into<crate::model::RapidCache>,
2535 {
2536 self.0.request.rapid_cache = v.map(|x| x.into());
2537 self
2538 }
2539
2540 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2542 self.0.request.request_id = v.into();
2543 self
2544 }
2545 }
2546
2547 #[doc(hidden)]
2548 impl crate::RequestBuilder for CreateRapidCache {
2549 fn request_options(&mut self) -> &mut crate::RequestOptions {
2550 &mut self.0.options
2551 }
2552 }
2553
2554 #[derive(Clone, Debug)]
2572 pub struct UpdateRapidCache(RequestBuilder<crate::model::UpdateRapidCacheRequest>);
2573
2574 impl UpdateRapidCache {
2575 pub(crate) fn new(
2576 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2577 ) -> Self {
2578 Self(RequestBuilder::new(stub))
2579 }
2580
2581 pub fn with_request<V: Into<crate::model::UpdateRapidCacheRequest>>(
2583 mut self,
2584 v: V,
2585 ) -> Self {
2586 self.0.request = v.into();
2587 self
2588 }
2589
2590 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2592 self.0.options = v.into();
2593 self
2594 }
2595
2596 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2603 (*self.0.stub)
2604 .update_rapid_cache(self.0.request, self.0.options)
2605 .await
2606 .map(crate::Response::into_body)
2607 }
2608
2609 pub fn poller(
2611 self,
2612 ) -> impl google_cloud_lro::Poller<
2613 crate::model::RapidCache,
2614 crate::model::UpdateRapidCacheMetadata,
2615 > {
2616 type Operation = google_cloud_lro::internal::Operation<
2617 crate::model::RapidCache,
2618 crate::model::UpdateRapidCacheMetadata,
2619 >;
2620 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2621 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2622 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2623 if let Some(ref mut details) = poller_options.tracing {
2624 details.method_name =
2625 "google_cloud_storage::client::StorageControl::update_rapid_cache::until_done";
2626 }
2627
2628 let stub = self.0.stub.clone();
2629 let mut options = self.0.options.clone();
2630 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2631 let query = move |name| {
2632 let stub = stub.clone();
2633 let options = options.clone();
2634 async {
2635 let op = GetOperation::new(stub)
2636 .set_name(name)
2637 .with_options(options)
2638 .send()
2639 .await?;
2640 Ok(Operation::new(op))
2641 }
2642 };
2643
2644 let start = move || async {
2645 let op = self.send().await?;
2646 Ok(Operation::new(op))
2647 };
2648
2649 use google_cloud_lro::internal::PollerExt;
2650 {
2651 google_cloud_lro::internal::new_poller(
2652 polling_error_policy,
2653 polling_backoff_policy,
2654 start,
2655 query,
2656 )
2657 }
2658 .with_options(poller_options)
2659 }
2660
2661 pub fn set_rapid_cache<T>(mut self, v: T) -> Self
2665 where
2666 T: std::convert::Into<crate::model::RapidCache>,
2667 {
2668 self.0.request.rapid_cache = std::option::Option::Some(v.into());
2669 self
2670 }
2671
2672 pub fn set_or_clear_rapid_cache<T>(mut self, v: std::option::Option<T>) -> Self
2676 where
2677 T: std::convert::Into<crate::model::RapidCache>,
2678 {
2679 self.0.request.rapid_cache = v.map(|x| x.into());
2680 self
2681 }
2682
2683 pub fn set_update_mask<T>(mut self, v: T) -> Self
2687 where
2688 T: std::convert::Into<wkt::FieldMask>,
2689 {
2690 self.0.request.update_mask = std::option::Option::Some(v.into());
2691 self
2692 }
2693
2694 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2698 where
2699 T: std::convert::Into<wkt::FieldMask>,
2700 {
2701 self.0.request.update_mask = v.map(|x| x.into());
2702 self
2703 }
2704
2705 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2707 self.0.request.request_id = v.into();
2708 self
2709 }
2710 }
2711
2712 #[doc(hidden)]
2713 impl crate::RequestBuilder for UpdateRapidCache {
2714 fn request_options(&mut self) -> &mut crate::RequestOptions {
2715 &mut self.0.options
2716 }
2717 }
2718
2719 #[derive(Clone, Debug)]
2736 pub struct GetRapidCache(RequestBuilder<crate::model::GetRapidCacheRequest>);
2737
2738 impl GetRapidCache {
2739 pub(crate) fn new(
2740 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2741 ) -> Self {
2742 Self(RequestBuilder::new(stub))
2743 }
2744
2745 pub fn with_request<V: Into<crate::model::GetRapidCacheRequest>>(mut self, v: V) -> Self {
2747 self.0.request = v.into();
2748 self
2749 }
2750
2751 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2753 self.0.options = v.into();
2754 self
2755 }
2756
2757 pub async fn send(self) -> Result<crate::model::RapidCache> {
2759 (*self.0.stub)
2760 .get_rapid_cache(self.0.request, self.0.options)
2761 .await
2762 .map(crate::Response::into_body)
2763 }
2764
2765 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2769 self.0.request.name = v.into();
2770 self
2771 }
2772
2773 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2775 self.0.request.request_id = v.into();
2776 self
2777 }
2778 }
2779
2780 #[doc(hidden)]
2781 impl crate::RequestBuilder for GetRapidCache {
2782 fn request_options(&mut self) -> &mut crate::RequestOptions {
2783 &mut self.0.options
2784 }
2785 }
2786
2787 #[derive(Clone, Debug)]
2808 pub struct ListRapidCaches(RequestBuilder<crate::model::ListRapidCachesRequest>);
2809
2810 impl ListRapidCaches {
2811 pub(crate) fn new(
2812 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2813 ) -> Self {
2814 Self(RequestBuilder::new(stub))
2815 }
2816
2817 pub fn with_request<V: Into<crate::model::ListRapidCachesRequest>>(mut self, v: V) -> Self {
2819 self.0.request = v.into();
2820 self
2821 }
2822
2823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2825 self.0.options = v.into();
2826 self
2827 }
2828
2829 pub async fn send(self) -> Result<crate::model::ListRapidCachesResponse> {
2831 (*self.0.stub)
2832 .list_rapid_caches(self.0.request, self.0.options)
2833 .await
2834 .map(crate::Response::into_body)
2835 }
2836
2837 pub fn by_page(
2839 self,
2840 ) -> impl google_cloud_gax::paginator::Paginator<
2841 crate::model::ListRapidCachesResponse,
2842 crate::Error,
2843 > {
2844 use std::clone::Clone;
2845 let token = self.0.request.page_token.clone();
2846 let execute = move |token: String| {
2847 let mut builder = self.clone();
2848 builder.0.request = builder.0.request.set_page_token(token);
2849 builder.send()
2850 };
2851 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2852 }
2853
2854 pub fn by_item(
2856 self,
2857 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2858 crate::model::ListRapidCachesResponse,
2859 crate::Error,
2860 > {
2861 use google_cloud_gax::paginator::Paginator;
2862 self.by_page().items()
2863 }
2864
2865 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2869 self.0.request.parent = v.into();
2870 self
2871 }
2872
2873 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2875 self.0.request.page_size = v.into();
2876 self
2877 }
2878
2879 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2881 self.0.request.page_token = v.into();
2882 self
2883 }
2884
2885 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2887 self.0.request.request_id = v.into();
2888 self
2889 }
2890 }
2891
2892 #[doc(hidden)]
2893 impl crate::RequestBuilder for ListRapidCaches {
2894 fn request_options(&mut self) -> &mut crate::RequestOptions {
2895 &mut self.0.options
2896 }
2897 }
2898
2899 #[derive(Clone, Debug)]
2916 pub struct GetProjectIntelligenceConfig(
2917 RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
2918 );
2919
2920 impl GetProjectIntelligenceConfig {
2921 pub(crate) fn new(
2922 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2923 ) -> Self {
2924 Self(RequestBuilder::new(stub))
2925 }
2926
2927 pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
2929 mut self,
2930 v: V,
2931 ) -> Self {
2932 self.0.request = v.into();
2933 self
2934 }
2935
2936 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2938 self.0.options = v.into();
2939 self
2940 }
2941
2942 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2944 (*self.0.stub)
2945 .get_project_intelligence_config(self.0.request, self.0.options)
2946 .await
2947 .map(crate::Response::into_body)
2948 }
2949
2950 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2954 self.0.request.name = v.into();
2955 self
2956 }
2957 }
2958
2959 #[doc(hidden)]
2960 impl crate::RequestBuilder for GetProjectIntelligenceConfig {
2961 fn request_options(&mut self) -> &mut crate::RequestOptions {
2962 &mut self.0.options
2963 }
2964 }
2965
2966 #[derive(Clone, Debug)]
2983 pub struct UpdateProjectIntelligenceConfig(
2984 RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
2985 );
2986
2987 impl UpdateProjectIntelligenceConfig {
2988 pub(crate) fn new(
2989 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2990 ) -> Self {
2991 Self(RequestBuilder::new(stub))
2992 }
2993
2994 pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
2996 mut self,
2997 v: V,
2998 ) -> Self {
2999 self.0.request = v.into();
3000 self
3001 }
3002
3003 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3005 self.0.options = v.into();
3006 self
3007 }
3008
3009 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3011 (*self.0.stub)
3012 .update_project_intelligence_config(self.0.request, self.0.options)
3013 .await
3014 .map(crate::Response::into_body)
3015 }
3016
3017 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3021 where
3022 T: std::convert::Into<crate::model::IntelligenceConfig>,
3023 {
3024 self.0.request.intelligence_config = std::option::Option::Some(v.into());
3025 self
3026 }
3027
3028 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3032 where
3033 T: std::convert::Into<crate::model::IntelligenceConfig>,
3034 {
3035 self.0.request.intelligence_config = v.map(|x| x.into());
3036 self
3037 }
3038
3039 pub fn set_update_mask<T>(mut self, v: T) -> Self
3043 where
3044 T: std::convert::Into<wkt::FieldMask>,
3045 {
3046 self.0.request.update_mask = std::option::Option::Some(v.into());
3047 self
3048 }
3049
3050 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3054 where
3055 T: std::convert::Into<wkt::FieldMask>,
3056 {
3057 self.0.request.update_mask = v.map(|x| x.into());
3058 self
3059 }
3060
3061 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3063 self.0.request.request_id = v.into();
3064 self
3065 }
3066 }
3067
3068 #[doc(hidden)]
3069 impl crate::RequestBuilder for UpdateProjectIntelligenceConfig {
3070 fn request_options(&mut self) -> &mut crate::RequestOptions {
3071 &mut self.0.options
3072 }
3073 }
3074
3075 #[derive(Clone, Debug)]
3092 pub struct GetFolderIntelligenceConfig(
3093 RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
3094 );
3095
3096 impl GetFolderIntelligenceConfig {
3097 pub(crate) fn new(
3098 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3099 ) -> Self {
3100 Self(RequestBuilder::new(stub))
3101 }
3102
3103 pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
3105 mut self,
3106 v: V,
3107 ) -> Self {
3108 self.0.request = v.into();
3109 self
3110 }
3111
3112 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3114 self.0.options = v.into();
3115 self
3116 }
3117
3118 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3120 (*self.0.stub)
3121 .get_folder_intelligence_config(self.0.request, self.0.options)
3122 .await
3123 .map(crate::Response::into_body)
3124 }
3125
3126 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3130 self.0.request.name = v.into();
3131 self
3132 }
3133 }
3134
3135 #[doc(hidden)]
3136 impl crate::RequestBuilder for GetFolderIntelligenceConfig {
3137 fn request_options(&mut self) -> &mut crate::RequestOptions {
3138 &mut self.0.options
3139 }
3140 }
3141
3142 #[derive(Clone, Debug)]
3159 pub struct UpdateFolderIntelligenceConfig(
3160 RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
3161 );
3162
3163 impl UpdateFolderIntelligenceConfig {
3164 pub(crate) fn new(
3165 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3166 ) -> Self {
3167 Self(RequestBuilder::new(stub))
3168 }
3169
3170 pub fn with_request<V: Into<crate::model::UpdateFolderIntelligenceConfigRequest>>(
3172 mut self,
3173 v: V,
3174 ) -> Self {
3175 self.0.request = v.into();
3176 self
3177 }
3178
3179 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3181 self.0.options = v.into();
3182 self
3183 }
3184
3185 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3187 (*self.0.stub)
3188 .update_folder_intelligence_config(self.0.request, self.0.options)
3189 .await
3190 .map(crate::Response::into_body)
3191 }
3192
3193 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3197 where
3198 T: std::convert::Into<crate::model::IntelligenceConfig>,
3199 {
3200 self.0.request.intelligence_config = std::option::Option::Some(v.into());
3201 self
3202 }
3203
3204 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3208 where
3209 T: std::convert::Into<crate::model::IntelligenceConfig>,
3210 {
3211 self.0.request.intelligence_config = v.map(|x| x.into());
3212 self
3213 }
3214
3215 pub fn set_update_mask<T>(mut self, v: T) -> Self
3219 where
3220 T: std::convert::Into<wkt::FieldMask>,
3221 {
3222 self.0.request.update_mask = std::option::Option::Some(v.into());
3223 self
3224 }
3225
3226 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3230 where
3231 T: std::convert::Into<wkt::FieldMask>,
3232 {
3233 self.0.request.update_mask = v.map(|x| x.into());
3234 self
3235 }
3236
3237 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3239 self.0.request.request_id = v.into();
3240 self
3241 }
3242 }
3243
3244 #[doc(hidden)]
3245 impl crate::RequestBuilder for UpdateFolderIntelligenceConfig {
3246 fn request_options(&mut self) -> &mut crate::RequestOptions {
3247 &mut self.0.options
3248 }
3249 }
3250
3251 #[derive(Clone, Debug)]
3268 pub struct GetOrganizationIntelligenceConfig(
3269 RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
3270 );
3271
3272 impl GetOrganizationIntelligenceConfig {
3273 pub(crate) fn new(
3274 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3275 ) -> Self {
3276 Self(RequestBuilder::new(stub))
3277 }
3278
3279 pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
3281 mut self,
3282 v: V,
3283 ) -> Self {
3284 self.0.request = v.into();
3285 self
3286 }
3287
3288 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3290 self.0.options = v.into();
3291 self
3292 }
3293
3294 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3296 (*self.0.stub)
3297 .get_organization_intelligence_config(self.0.request, self.0.options)
3298 .await
3299 .map(crate::Response::into_body)
3300 }
3301
3302 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3306 self.0.request.name = v.into();
3307 self
3308 }
3309 }
3310
3311 #[doc(hidden)]
3312 impl crate::RequestBuilder for GetOrganizationIntelligenceConfig {
3313 fn request_options(&mut self) -> &mut crate::RequestOptions {
3314 &mut self.0.options
3315 }
3316 }
3317
3318 #[derive(Clone, Debug)]
3335 pub struct UpdateOrganizationIntelligenceConfig(
3336 RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
3337 );
3338
3339 impl UpdateOrganizationIntelligenceConfig {
3340 pub(crate) fn new(
3341 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3342 ) -> Self {
3343 Self(RequestBuilder::new(stub))
3344 }
3345
3346 pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
3348 mut self,
3349 v: V,
3350 ) -> Self {
3351 self.0.request = v.into();
3352 self
3353 }
3354
3355 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3357 self.0.options = v.into();
3358 self
3359 }
3360
3361 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3363 (*self.0.stub)
3364 .update_organization_intelligence_config(self.0.request, self.0.options)
3365 .await
3366 .map(crate::Response::into_body)
3367 }
3368
3369 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3373 where
3374 T: std::convert::Into<crate::model::IntelligenceConfig>,
3375 {
3376 self.0.request.intelligence_config = std::option::Option::Some(v.into());
3377 self
3378 }
3379
3380 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3384 where
3385 T: std::convert::Into<crate::model::IntelligenceConfig>,
3386 {
3387 self.0.request.intelligence_config = v.map(|x| x.into());
3388 self
3389 }
3390
3391 pub fn set_update_mask<T>(mut self, v: T) -> Self
3395 where
3396 T: std::convert::Into<wkt::FieldMask>,
3397 {
3398 self.0.request.update_mask = std::option::Option::Some(v.into());
3399 self
3400 }
3401
3402 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3406 where
3407 T: std::convert::Into<wkt::FieldMask>,
3408 {
3409 self.0.request.update_mask = v.map(|x| x.into());
3410 self
3411 }
3412
3413 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3415 self.0.request.request_id = v.into();
3416 self
3417 }
3418 }
3419
3420 #[doc(hidden)]
3421 impl crate::RequestBuilder for UpdateOrganizationIntelligenceConfig {
3422 fn request_options(&mut self) -> &mut crate::RequestOptions {
3423 &mut self.0.options
3424 }
3425 }
3426
3427 #[derive(Clone, Debug)]
3444 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3445
3446 impl GetIamPolicy {
3447 pub(crate) fn new(
3448 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3449 ) -> Self {
3450 Self(RequestBuilder::new(stub))
3451 }
3452
3453 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3455 mut self,
3456 v: V,
3457 ) -> Self {
3458 self.0.request = v.into();
3459 self
3460 }
3461
3462 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3464 self.0.options = v.into();
3465 self
3466 }
3467
3468 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3470 (*self.0.stub)
3471 .get_iam_policy(self.0.request, self.0.options)
3472 .await
3473 .map(crate::Response::into_body)
3474 }
3475
3476 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3480 self.0.request.resource = v.into();
3481 self
3482 }
3483
3484 pub fn set_options<T>(mut self, v: T) -> Self
3486 where
3487 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3488 {
3489 self.0.request.options = std::option::Option::Some(v.into());
3490 self
3491 }
3492
3493 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3495 where
3496 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3497 {
3498 self.0.request.options = v.map(|x| x.into());
3499 self
3500 }
3501 }
3502
3503 #[doc(hidden)]
3504 impl crate::RequestBuilder for GetIamPolicy {
3505 fn request_options(&mut self) -> &mut crate::RequestOptions {
3506 &mut self.0.options
3507 }
3508 }
3509
3510 #[derive(Clone, Debug)]
3527 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3528
3529 impl SetIamPolicy {
3530 pub(crate) fn new(
3531 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3532 ) -> Self {
3533 Self(RequestBuilder::new(stub))
3534 }
3535
3536 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3538 mut self,
3539 v: V,
3540 ) -> Self {
3541 self.0.request = v.into();
3542 self
3543 }
3544
3545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3547 self.0.options = v.into();
3548 self
3549 }
3550
3551 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3553 (*self.0.stub)
3554 .set_iam_policy(self.0.request, self.0.options)
3555 .await
3556 .map(crate::Response::into_body)
3557 }
3558
3559 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3563 self.0.request.resource = v.into();
3564 self
3565 }
3566
3567 pub fn set_policy<T>(mut self, v: T) -> Self
3571 where
3572 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3573 {
3574 self.0.request.policy = std::option::Option::Some(v.into());
3575 self
3576 }
3577
3578 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3582 where
3583 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3584 {
3585 self.0.request.policy = v.map(|x| x.into());
3586 self
3587 }
3588
3589 pub fn set_update_mask<T>(mut self, v: T) -> Self
3591 where
3592 T: std::convert::Into<wkt::FieldMask>,
3593 {
3594 self.0.request.update_mask = std::option::Option::Some(v.into());
3595 self
3596 }
3597
3598 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3600 where
3601 T: std::convert::Into<wkt::FieldMask>,
3602 {
3603 self.0.request.update_mask = v.map(|x| x.into());
3604 self
3605 }
3606 }
3607
3608 #[doc(hidden)]
3609 impl crate::RequestBuilder for SetIamPolicy {
3610 fn request_options(&mut self) -> &mut crate::RequestOptions {
3611 &mut self.0.options
3612 }
3613 }
3614
3615 #[derive(Clone, Debug)]
3632 pub struct TestIamPermissions(
3633 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3634 );
3635
3636 impl TestIamPermissions {
3637 pub(crate) fn new(
3638 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3639 ) -> Self {
3640 Self(RequestBuilder::new(stub))
3641 }
3642
3643 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3645 mut self,
3646 v: V,
3647 ) -> Self {
3648 self.0.request = v.into();
3649 self
3650 }
3651
3652 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3654 self.0.options = v.into();
3655 self
3656 }
3657
3658 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3660 (*self.0.stub)
3661 .test_iam_permissions(self.0.request, self.0.options)
3662 .await
3663 .map(crate::Response::into_body)
3664 }
3665
3666 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3670 self.0.request.resource = v.into();
3671 self
3672 }
3673
3674 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3678 where
3679 T: std::iter::IntoIterator<Item = V>,
3680 V: std::convert::Into<std::string::String>,
3681 {
3682 use std::iter::Iterator;
3683 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3684 self
3685 }
3686 }
3687
3688 #[doc(hidden)]
3689 impl crate::RequestBuilder for TestIamPermissions {
3690 fn request_options(&mut self) -> &mut crate::RequestOptions {
3691 &mut self.0.options
3692 }
3693 }
3694
3695 #[derive(Clone, Debug)]
3712 pub struct GetIntelligenceFinding(RequestBuilder<crate::model::GetIntelligenceFindingRequest>);
3713
3714 impl GetIntelligenceFinding {
3715 pub(crate) fn new(
3716 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3717 ) -> Self {
3718 Self(RequestBuilder::new(stub))
3719 }
3720
3721 pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRequest>>(
3723 mut self,
3724 v: V,
3725 ) -> Self {
3726 self.0.request = v.into();
3727 self
3728 }
3729
3730 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3732 self.0.options = v.into();
3733 self
3734 }
3735
3736 pub async fn send(self) -> Result<crate::model::IntelligenceFinding> {
3738 (*self.0.stub)
3739 .get_intelligence_finding(self.0.request, self.0.options)
3740 .await
3741 .map(crate::Response::into_body)
3742 }
3743
3744 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3748 self.0.request.name = v.into();
3749 self
3750 }
3751 }
3752
3753 #[doc(hidden)]
3754 impl crate::RequestBuilder for GetIntelligenceFinding {
3755 fn request_options(&mut self) -> &mut crate::RequestOptions {
3756 &mut self.0.options
3757 }
3758 }
3759
3760 #[derive(Clone, Debug)]
3781 pub struct ListIntelligenceFindings(
3782 RequestBuilder<crate::model::ListIntelligenceFindingsRequest>,
3783 );
3784
3785 impl ListIntelligenceFindings {
3786 pub(crate) fn new(
3787 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3788 ) -> Self {
3789 Self(RequestBuilder::new(stub))
3790 }
3791
3792 pub fn with_request<V: Into<crate::model::ListIntelligenceFindingsRequest>>(
3794 mut self,
3795 v: V,
3796 ) -> Self {
3797 self.0.request = v.into();
3798 self
3799 }
3800
3801 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3803 self.0.options = v.into();
3804 self
3805 }
3806
3807 pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingsResponse> {
3809 (*self.0.stub)
3810 .list_intelligence_findings(self.0.request, self.0.options)
3811 .await
3812 .map(crate::Response::into_body)
3813 }
3814
3815 pub fn by_page(
3817 self,
3818 ) -> impl google_cloud_gax::paginator::Paginator<
3819 crate::model::ListIntelligenceFindingsResponse,
3820 crate::Error,
3821 > {
3822 use std::clone::Clone;
3823 let token = self.0.request.page_token.clone();
3824 let execute = move |token: String| {
3825 let mut builder = self.clone();
3826 builder.0.request = builder.0.request.set_page_token(token);
3827 builder.send()
3828 };
3829 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3830 }
3831
3832 pub fn by_item(
3834 self,
3835 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3836 crate::model::ListIntelligenceFindingsResponse,
3837 crate::Error,
3838 > {
3839 use google_cloud_gax::paginator::Paginator;
3840 self.by_page().items()
3841 }
3842
3843 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3847 self.0.request.parent = v.into();
3848 self
3849 }
3850
3851 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3853 self.0.request.filter = v.into();
3854 self
3855 }
3856
3857 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3859 self.0.request.page_size = v.into();
3860 self
3861 }
3862
3863 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3865 self.0.request.page_token = v.into();
3866 self
3867 }
3868 }
3869
3870 #[doc(hidden)]
3871 impl crate::RequestBuilder for ListIntelligenceFindings {
3872 fn request_options(&mut self) -> &mut crate::RequestOptions {
3873 &mut self.0.options
3874 }
3875 }
3876
3877 #[derive(Clone, Debug)]
3898 pub struct SummarizeIntelligenceFindings(
3899 RequestBuilder<crate::model::SummarizeIntelligenceFindingsRequest>,
3900 );
3901
3902 impl SummarizeIntelligenceFindings {
3903 pub(crate) fn new(
3904 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3905 ) -> Self {
3906 Self(RequestBuilder::new(stub))
3907 }
3908
3909 pub fn with_request<V: Into<crate::model::SummarizeIntelligenceFindingsRequest>>(
3911 mut self,
3912 v: V,
3913 ) -> Self {
3914 self.0.request = v.into();
3915 self
3916 }
3917
3918 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3920 self.0.options = v.into();
3921 self
3922 }
3923
3924 pub async fn send(self) -> Result<crate::model::SummarizeIntelligenceFindingsResponse> {
3926 (*self.0.stub)
3927 .summarize_intelligence_findings(self.0.request, self.0.options)
3928 .await
3929 .map(crate::Response::into_body)
3930 }
3931
3932 pub fn by_page(
3934 self,
3935 ) -> impl google_cloud_gax::paginator::Paginator<
3936 crate::model::SummarizeIntelligenceFindingsResponse,
3937 crate::Error,
3938 > {
3939 use std::clone::Clone;
3940 let token = self.0.request.page_token.clone();
3941 let execute = move |token: String| {
3942 let mut builder = self.clone();
3943 builder.0.request = builder.0.request.set_page_token(token);
3944 builder.send()
3945 };
3946 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3947 }
3948
3949 pub fn by_item(
3951 self,
3952 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3953 crate::model::SummarizeIntelligenceFindingsResponse,
3954 crate::Error,
3955 > {
3956 use google_cloud_gax::paginator::Paginator;
3957 self.by_page().items()
3958 }
3959
3960 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3964 self.0.request.parent = v.into();
3965 self
3966 }
3967
3968 pub fn set_resource_scope<
3970 T: Into<crate::model::summarize_intelligence_findings_request::ResourceScope>,
3971 >(
3972 mut self,
3973 v: T,
3974 ) -> Self {
3975 self.0.request.resource_scope = v.into();
3976 self
3977 }
3978
3979 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3981 self.0.request.filter = v.into();
3982 self
3983 }
3984
3985 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3987 self.0.request.page_size = v.into();
3988 self
3989 }
3990
3991 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3993 self.0.request.page_token = v.into();
3994 self
3995 }
3996 }
3997
3998 #[doc(hidden)]
3999 impl crate::RequestBuilder for SummarizeIntelligenceFindings {
4000 fn request_options(&mut self) -> &mut crate::RequestOptions {
4001 &mut self.0.options
4002 }
4003 }
4004
4005 #[derive(Clone, Debug)]
4022 pub struct GetIntelligenceFindingRevision(
4023 RequestBuilder<crate::model::GetIntelligenceFindingRevisionRequest>,
4024 );
4025
4026 impl GetIntelligenceFindingRevision {
4027 pub(crate) fn new(
4028 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4029 ) -> Self {
4030 Self(RequestBuilder::new(stub))
4031 }
4032
4033 pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRevisionRequest>>(
4035 mut self,
4036 v: V,
4037 ) -> Self {
4038 self.0.request = v.into();
4039 self
4040 }
4041
4042 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4044 self.0.options = v.into();
4045 self
4046 }
4047
4048 pub async fn send(self) -> Result<crate::model::IntelligenceFindingRevision> {
4050 (*self.0.stub)
4051 .get_intelligence_finding_revision(self.0.request, self.0.options)
4052 .await
4053 .map(crate::Response::into_body)
4054 }
4055
4056 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4060 self.0.request.name = v.into();
4061 self
4062 }
4063 }
4064
4065 #[doc(hidden)]
4066 impl crate::RequestBuilder for GetIntelligenceFindingRevision {
4067 fn request_options(&mut self) -> &mut crate::RequestOptions {
4068 &mut self.0.options
4069 }
4070 }
4071
4072 #[derive(Clone, Debug)]
4093 pub struct ListIntelligenceFindingRevisions(
4094 RequestBuilder<crate::model::ListIntelligenceFindingRevisionsRequest>,
4095 );
4096
4097 impl ListIntelligenceFindingRevisions {
4098 pub(crate) fn new(
4099 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4100 ) -> Self {
4101 Self(RequestBuilder::new(stub))
4102 }
4103
4104 pub fn with_request<V: Into<crate::model::ListIntelligenceFindingRevisionsRequest>>(
4106 mut self,
4107 v: V,
4108 ) -> Self {
4109 self.0.request = v.into();
4110 self
4111 }
4112
4113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4115 self.0.options = v.into();
4116 self
4117 }
4118
4119 pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingRevisionsResponse> {
4121 (*self.0.stub)
4122 .list_intelligence_finding_revisions(self.0.request, self.0.options)
4123 .await
4124 .map(crate::Response::into_body)
4125 }
4126
4127 pub fn by_page(
4129 self,
4130 ) -> impl google_cloud_gax::paginator::Paginator<
4131 crate::model::ListIntelligenceFindingRevisionsResponse,
4132 crate::Error,
4133 > {
4134 use std::clone::Clone;
4135 let token = self.0.request.page_token.clone();
4136 let execute = move |token: String| {
4137 let mut builder = self.clone();
4138 builder.0.request = builder.0.request.set_page_token(token);
4139 builder.send()
4140 };
4141 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4142 }
4143
4144 pub fn by_item(
4146 self,
4147 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4148 crate::model::ListIntelligenceFindingRevisionsResponse,
4149 crate::Error,
4150 > {
4151 use google_cloud_gax::paginator::Paginator;
4152 self.by_page().items()
4153 }
4154
4155 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4159 self.0.request.parent = v.into();
4160 self
4161 }
4162
4163 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4165 self.0.request.page_size = v.into();
4166 self
4167 }
4168
4169 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4171 self.0.request.page_token = v.into();
4172 self
4173 }
4174 }
4175
4176 #[doc(hidden)]
4177 impl crate::RequestBuilder for ListIntelligenceFindingRevisions {
4178 fn request_options(&mut self) -> &mut crate::RequestOptions {
4179 &mut self.0.options
4180 }
4181 }
4182
4183 #[derive(Clone, Debug)]
4200 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4201
4202 impl GetOperation {
4203 pub(crate) fn new(
4204 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4205 ) -> Self {
4206 Self(RequestBuilder::new(stub))
4207 }
4208
4209 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4211 mut self,
4212 v: V,
4213 ) -> Self {
4214 self.0.request = v.into();
4215 self
4216 }
4217
4218 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4220 self.0.options = v.into();
4221 self
4222 }
4223
4224 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4226 (*self.0.stub)
4227 .get_operation(self.0.request, self.0.options)
4228 .await
4229 .map(crate::Response::into_body)
4230 }
4231
4232 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4234 self.0.request.name = v.into();
4235 self
4236 }
4237 }
4238
4239 #[doc(hidden)]
4240 impl crate::RequestBuilder for GetOperation {
4241 fn request_options(&mut self) -> &mut crate::RequestOptions {
4242 &mut self.0.options
4243 }
4244 }
4245}