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)]
1487 pub struct CreateAnywhereCache(RequestBuilder<crate::model::CreateAnywhereCacheRequest>);
1488
1489 impl CreateAnywhereCache {
1490 pub(crate) fn new(
1491 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1492 ) -> Self {
1493 Self(RequestBuilder::new(stub))
1494 }
1495
1496 pub fn with_request<V: Into<crate::model::CreateAnywhereCacheRequest>>(
1498 mut self,
1499 v: V,
1500 ) -> Self {
1501 self.0.request = v.into();
1502 self
1503 }
1504
1505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1507 self.0.options = v.into();
1508 self
1509 }
1510
1511 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1518 let req = Self::auto_populate(self.0.request, false);
1519 (*self.0.stub)
1520 .create_anywhere_cache(req, self.0.options)
1521 .await
1522 .map(crate::Response::into_body)
1523 }
1524
1525 pub fn poller(
1527 self,
1528 ) -> impl google_cloud_lro::Poller<
1529 crate::model::AnywhereCache,
1530 crate::model::CreateAnywhereCacheMetadata,
1531 > {
1532 type Operation = google_cloud_lro::internal::Operation<
1533 crate::model::AnywhereCache,
1534 crate::model::CreateAnywhereCacheMetadata,
1535 >;
1536 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1537 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1538 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1539 if let Some(ref mut details) = poller_options.tracing {
1540 details.method_name = "google_cloud_storage::client::StorageControl::create_anywhere_cache::until_done";
1541 }
1542
1543 let stub = self.0.stub.clone();
1544 let mut options = self.0.options.clone();
1545 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1546 let query = move |name| {
1547 let stub = stub.clone();
1548 let options = options.clone();
1549 async {
1550 let op = GetOperation::new(stub)
1551 .set_name(name)
1552 .with_options(options)
1553 .send()
1554 .await?;
1555 Ok(Operation::new(op))
1556 }
1557 };
1558
1559 let start = move || async {
1560 let op = self.send().await?;
1561 Ok(Operation::new(op))
1562 };
1563
1564 use google_cloud_lro::internal::PollerExt;
1565 {
1566 google_cloud_lro::internal::new_poller(
1567 polling_error_policy,
1568 polling_backoff_policy,
1569 start,
1570 query,
1571 )
1572 }
1573 .with_options(poller_options)
1574 }
1575
1576 fn auto_populate(
1577 mut req: crate::model::CreateAnywhereCacheRequest,
1578 force: bool,
1579 ) -> crate::model::CreateAnywhereCacheRequest {
1580 if force || req.request_id.is_empty() {
1581 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1582 }
1583 req
1584 }
1585
1586 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1590 self.0.request.parent = v.into();
1591 self
1592 }
1593
1594 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1598 where
1599 T: std::convert::Into<crate::model::AnywhereCache>,
1600 {
1601 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1602 self
1603 }
1604
1605 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1609 where
1610 T: std::convert::Into<crate::model::AnywhereCache>,
1611 {
1612 self.0.request.anywhere_cache = v.map(|x| x.into());
1613 self
1614 }
1615
1616 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1618 self.0.request.request_id = v.into();
1619 self
1620 }
1621 }
1622
1623 #[doc(hidden)]
1624 impl crate::RequestBuilder for CreateAnywhereCache {
1625 fn request_options(&mut self) -> &mut crate::RequestOptions {
1626 &mut self.0.options
1627 }
1628 }
1629
1630 #[derive(Clone, Debug)]
1648 pub struct UpdateAnywhereCache(RequestBuilder<crate::model::UpdateAnywhereCacheRequest>);
1649
1650 impl UpdateAnywhereCache {
1651 pub(crate) fn new(
1652 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1653 ) -> Self {
1654 Self(RequestBuilder::new(stub))
1655 }
1656
1657 pub fn with_request<V: Into<crate::model::UpdateAnywhereCacheRequest>>(
1659 mut self,
1660 v: V,
1661 ) -> Self {
1662 self.0.request = v.into();
1663 self
1664 }
1665
1666 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1668 self.0.options = v.into();
1669 self
1670 }
1671
1672 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1679 let req = Self::auto_populate(self.0.request, false);
1680 (*self.0.stub)
1681 .update_anywhere_cache(req, self.0.options)
1682 .await
1683 .map(crate::Response::into_body)
1684 }
1685
1686 pub fn poller(
1688 self,
1689 ) -> impl google_cloud_lro::Poller<
1690 crate::model::AnywhereCache,
1691 crate::model::UpdateAnywhereCacheMetadata,
1692 > {
1693 type Operation = google_cloud_lro::internal::Operation<
1694 crate::model::AnywhereCache,
1695 crate::model::UpdateAnywhereCacheMetadata,
1696 >;
1697 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1698 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1699 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1700 if let Some(ref mut details) = poller_options.tracing {
1701 details.method_name = "google_cloud_storage::client::StorageControl::update_anywhere_cache::until_done";
1702 }
1703
1704 let stub = self.0.stub.clone();
1705 let mut options = self.0.options.clone();
1706 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1707 let query = move |name| {
1708 let stub = stub.clone();
1709 let options = options.clone();
1710 async {
1711 let op = GetOperation::new(stub)
1712 .set_name(name)
1713 .with_options(options)
1714 .send()
1715 .await?;
1716 Ok(Operation::new(op))
1717 }
1718 };
1719
1720 let start = move || async {
1721 let op = self.send().await?;
1722 Ok(Operation::new(op))
1723 };
1724
1725 use google_cloud_lro::internal::PollerExt;
1726 {
1727 google_cloud_lro::internal::new_poller(
1728 polling_error_policy,
1729 polling_backoff_policy,
1730 start,
1731 query,
1732 )
1733 }
1734 .with_options(poller_options)
1735 }
1736
1737 fn auto_populate(
1738 mut req: crate::model::UpdateAnywhereCacheRequest,
1739 force: bool,
1740 ) -> crate::model::UpdateAnywhereCacheRequest {
1741 if force || req.request_id.is_empty() {
1742 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1743 }
1744 req
1745 }
1746
1747 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1751 where
1752 T: std::convert::Into<crate::model::AnywhereCache>,
1753 {
1754 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1755 self
1756 }
1757
1758 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1762 where
1763 T: std::convert::Into<crate::model::AnywhereCache>,
1764 {
1765 self.0.request.anywhere_cache = v.map(|x| x.into());
1766 self
1767 }
1768
1769 pub fn set_update_mask<T>(mut self, v: T) -> Self
1773 where
1774 T: std::convert::Into<wkt::FieldMask>,
1775 {
1776 self.0.request.update_mask = std::option::Option::Some(v.into());
1777 self
1778 }
1779
1780 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1784 where
1785 T: std::convert::Into<wkt::FieldMask>,
1786 {
1787 self.0.request.update_mask = v.map(|x| x.into());
1788 self
1789 }
1790
1791 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1793 self.0.request.request_id = v.into();
1794 self
1795 }
1796 }
1797
1798 #[doc(hidden)]
1799 impl crate::RequestBuilder for UpdateAnywhereCache {
1800 fn request_options(&mut self) -> &mut crate::RequestOptions {
1801 &mut self.0.options
1802 }
1803 }
1804
1805 #[derive(Clone, Debug)]
1822 pub struct DisableAnywhereCache(RequestBuilder<crate::model::DisableAnywhereCacheRequest>);
1823
1824 impl DisableAnywhereCache {
1825 pub(crate) fn new(
1826 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1827 ) -> Self {
1828 Self(RequestBuilder::new(stub))
1829 }
1830
1831 pub fn with_request<V: Into<crate::model::DisableAnywhereCacheRequest>>(
1833 mut self,
1834 v: V,
1835 ) -> Self {
1836 self.0.request = v.into();
1837 self
1838 }
1839
1840 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1842 self.0.options = v.into();
1843 self
1844 }
1845
1846 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1848 let req = Self::auto_populate(self.0.request, false);
1849 (*self.0.stub)
1850 .disable_anywhere_cache(req, self.0.options)
1851 .await
1852 .map(crate::Response::into_body)
1853 }
1854
1855 fn auto_populate(
1856 mut req: crate::model::DisableAnywhereCacheRequest,
1857 force: bool,
1858 ) -> crate::model::DisableAnywhereCacheRequest {
1859 if force || req.request_id.is_empty() {
1860 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1861 }
1862 req
1863 }
1864
1865 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1869 self.0.request.name = v.into();
1870 self
1871 }
1872
1873 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1875 self.0.request.request_id = v.into();
1876 self
1877 }
1878 }
1879
1880 #[doc(hidden)]
1881 impl crate::RequestBuilder for DisableAnywhereCache {
1882 fn request_options(&mut self) -> &mut crate::RequestOptions {
1883 &mut self.0.options
1884 }
1885 }
1886
1887 #[derive(Clone, Debug)]
1904 pub struct PauseAnywhereCache(RequestBuilder<crate::model::PauseAnywhereCacheRequest>);
1905
1906 impl PauseAnywhereCache {
1907 pub(crate) fn new(
1908 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1909 ) -> Self {
1910 Self(RequestBuilder::new(stub))
1911 }
1912
1913 pub fn with_request<V: Into<crate::model::PauseAnywhereCacheRequest>>(
1915 mut self,
1916 v: V,
1917 ) -> Self {
1918 self.0.request = v.into();
1919 self
1920 }
1921
1922 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1924 self.0.options = v.into();
1925 self
1926 }
1927
1928 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
1930 let req = Self::auto_populate(self.0.request, false);
1931 (*self.0.stub)
1932 .pause_anywhere_cache(req, self.0.options)
1933 .await
1934 .map(crate::Response::into_body)
1935 }
1936
1937 fn auto_populate(
1938 mut req: crate::model::PauseAnywhereCacheRequest,
1939 force: bool,
1940 ) -> crate::model::PauseAnywhereCacheRequest {
1941 if force || req.request_id.is_empty() {
1942 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1943 }
1944 req
1945 }
1946
1947 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1951 self.0.request.name = v.into();
1952 self
1953 }
1954
1955 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1957 self.0.request.request_id = v.into();
1958 self
1959 }
1960 }
1961
1962 #[doc(hidden)]
1963 impl crate::RequestBuilder for PauseAnywhereCache {
1964 fn request_options(&mut self) -> &mut crate::RequestOptions {
1965 &mut self.0.options
1966 }
1967 }
1968
1969 #[derive(Clone, Debug)]
1986 pub struct ResumeAnywhereCache(RequestBuilder<crate::model::ResumeAnywhereCacheRequest>);
1987
1988 impl ResumeAnywhereCache {
1989 pub(crate) fn new(
1990 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1991 ) -> Self {
1992 Self(RequestBuilder::new(stub))
1993 }
1994
1995 pub fn with_request<V: Into<crate::model::ResumeAnywhereCacheRequest>>(
1997 mut self,
1998 v: V,
1999 ) -> Self {
2000 self.0.request = v.into();
2001 self
2002 }
2003
2004 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2006 self.0.options = v.into();
2007 self
2008 }
2009
2010 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2012 let req = Self::auto_populate(self.0.request, false);
2013 (*self.0.stub)
2014 .resume_anywhere_cache(req, self.0.options)
2015 .await
2016 .map(crate::Response::into_body)
2017 }
2018
2019 fn auto_populate(
2020 mut req: crate::model::ResumeAnywhereCacheRequest,
2021 force: bool,
2022 ) -> crate::model::ResumeAnywhereCacheRequest {
2023 if force || req.request_id.is_empty() {
2024 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2025 }
2026 req
2027 }
2028
2029 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2033 self.0.request.name = v.into();
2034 self
2035 }
2036
2037 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2039 self.0.request.request_id = v.into();
2040 self
2041 }
2042 }
2043
2044 #[doc(hidden)]
2045 impl crate::RequestBuilder for ResumeAnywhereCache {
2046 fn request_options(&mut self) -> &mut crate::RequestOptions {
2047 &mut self.0.options
2048 }
2049 }
2050
2051 #[derive(Clone, Debug)]
2068 pub struct GetAnywhereCache(RequestBuilder<crate::model::GetAnywhereCacheRequest>);
2069
2070 impl GetAnywhereCache {
2071 pub(crate) fn new(
2072 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2073 ) -> Self {
2074 Self(RequestBuilder::new(stub))
2075 }
2076
2077 pub fn with_request<V: Into<crate::model::GetAnywhereCacheRequest>>(
2079 mut self,
2080 v: V,
2081 ) -> Self {
2082 self.0.request = v.into();
2083 self
2084 }
2085
2086 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2088 self.0.options = v.into();
2089 self
2090 }
2091
2092 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2094 let req = Self::auto_populate(self.0.request, false);
2095 (*self.0.stub)
2096 .get_anywhere_cache(req, self.0.options)
2097 .await
2098 .map(crate::Response::into_body)
2099 }
2100
2101 fn auto_populate(
2102 mut req: crate::model::GetAnywhereCacheRequest,
2103 force: bool,
2104 ) -> crate::model::GetAnywhereCacheRequest {
2105 if force || req.request_id.is_empty() {
2106 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2107 }
2108 req
2109 }
2110
2111 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2115 self.0.request.name = v.into();
2116 self
2117 }
2118
2119 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2121 self.0.request.request_id = v.into();
2122 self
2123 }
2124 }
2125
2126 #[doc(hidden)]
2127 impl crate::RequestBuilder for GetAnywhereCache {
2128 fn request_options(&mut self) -> &mut crate::RequestOptions {
2129 &mut self.0.options
2130 }
2131 }
2132
2133 #[derive(Clone, Debug)]
2154 pub struct ListAnywhereCaches(RequestBuilder<crate::model::ListAnywhereCachesRequest>);
2155
2156 impl ListAnywhereCaches {
2157 pub(crate) fn new(
2158 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2159 ) -> Self {
2160 Self(RequestBuilder::new(stub))
2161 }
2162
2163 pub fn with_request<V: Into<crate::model::ListAnywhereCachesRequest>>(
2165 mut self,
2166 v: V,
2167 ) -> Self {
2168 self.0.request = v.into();
2169 self
2170 }
2171
2172 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2174 self.0.options = v.into();
2175 self
2176 }
2177
2178 pub async fn send(self) -> Result<crate::model::ListAnywhereCachesResponse> {
2180 let req = Self::auto_populate(self.0.request, false);
2181 (*self.0.stub)
2182 .list_anywhere_caches(req, self.0.options)
2183 .await
2184 .map(crate::Response::into_body)
2185 }
2186
2187 pub fn by_page(
2189 self,
2190 ) -> impl google_cloud_gax::paginator::Paginator<
2191 crate::model::ListAnywhereCachesResponse,
2192 crate::Error,
2193 > {
2194 use std::clone::Clone;
2195 let token = self.0.request.page_token.clone();
2196 let execute = move |token: String| {
2197 let mut builder = self.clone();
2198 let initial = builder.0.request.page_token == token;
2199 builder.0.request = Self::auto_populate(builder.0.request, !initial);
2200 builder.0.request = builder.0.request.set_page_token(token);
2201 builder.send()
2202 };
2203 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2204 }
2205
2206 pub fn by_item(
2208 self,
2209 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2210 crate::model::ListAnywhereCachesResponse,
2211 crate::Error,
2212 > {
2213 use google_cloud_gax::paginator::Paginator;
2214 self.by_page().items()
2215 }
2216
2217 fn auto_populate(
2218 mut req: crate::model::ListAnywhereCachesRequest,
2219 force: bool,
2220 ) -> crate::model::ListAnywhereCachesRequest {
2221 if force || req.request_id.is_empty() {
2222 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2223 }
2224 req
2225 }
2226
2227 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2231 self.0.request.parent = v.into();
2232 self
2233 }
2234
2235 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2237 self.0.request.page_size = v.into();
2238 self
2239 }
2240
2241 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2243 self.0.request.page_token = v.into();
2244 self
2245 }
2246
2247 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2249 self.0.request.request_id = v.into();
2250 self
2251 }
2252 }
2253
2254 #[doc(hidden)]
2255 impl crate::RequestBuilder for ListAnywhereCaches {
2256 fn request_options(&mut self) -> &mut crate::RequestOptions {
2257 &mut self.0.options
2258 }
2259 }
2260
2261 #[derive(Clone, Debug)]
2278 pub struct GetProjectIntelligenceConfig(
2279 RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
2280 );
2281
2282 impl GetProjectIntelligenceConfig {
2283 pub(crate) fn new(
2284 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2285 ) -> Self {
2286 Self(RequestBuilder::new(stub))
2287 }
2288
2289 pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
2291 mut self,
2292 v: V,
2293 ) -> Self {
2294 self.0.request = v.into();
2295 self
2296 }
2297
2298 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2300 self.0.options = v.into();
2301 self
2302 }
2303
2304 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2306 (*self.0.stub)
2307 .get_project_intelligence_config(self.0.request, self.0.options)
2308 .await
2309 .map(crate::Response::into_body)
2310 }
2311
2312 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2316 self.0.request.name = v.into();
2317 self
2318 }
2319 }
2320
2321 #[doc(hidden)]
2322 impl crate::RequestBuilder for GetProjectIntelligenceConfig {
2323 fn request_options(&mut self) -> &mut crate::RequestOptions {
2324 &mut self.0.options
2325 }
2326 }
2327
2328 #[derive(Clone, Debug)]
2345 pub struct UpdateProjectIntelligenceConfig(
2346 RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
2347 );
2348
2349 impl UpdateProjectIntelligenceConfig {
2350 pub(crate) fn new(
2351 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2352 ) -> Self {
2353 Self(RequestBuilder::new(stub))
2354 }
2355
2356 pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
2358 mut self,
2359 v: V,
2360 ) -> Self {
2361 self.0.request = v.into();
2362 self
2363 }
2364
2365 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2367 self.0.options = v.into();
2368 self
2369 }
2370
2371 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2373 (*self.0.stub)
2374 .update_project_intelligence_config(self.0.request, self.0.options)
2375 .await
2376 .map(crate::Response::into_body)
2377 }
2378
2379 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2383 where
2384 T: std::convert::Into<crate::model::IntelligenceConfig>,
2385 {
2386 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2387 self
2388 }
2389
2390 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2394 where
2395 T: std::convert::Into<crate::model::IntelligenceConfig>,
2396 {
2397 self.0.request.intelligence_config = v.map(|x| x.into());
2398 self
2399 }
2400
2401 pub fn set_update_mask<T>(mut self, v: T) -> Self
2405 where
2406 T: std::convert::Into<wkt::FieldMask>,
2407 {
2408 self.0.request.update_mask = std::option::Option::Some(v.into());
2409 self
2410 }
2411
2412 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2416 where
2417 T: std::convert::Into<wkt::FieldMask>,
2418 {
2419 self.0.request.update_mask = v.map(|x| x.into());
2420 self
2421 }
2422
2423 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2425 self.0.request.request_id = v.into();
2426 self
2427 }
2428 }
2429
2430 #[doc(hidden)]
2431 impl crate::RequestBuilder for UpdateProjectIntelligenceConfig {
2432 fn request_options(&mut self) -> &mut crate::RequestOptions {
2433 &mut self.0.options
2434 }
2435 }
2436
2437 #[derive(Clone, Debug)]
2454 pub struct GetFolderIntelligenceConfig(
2455 RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
2456 );
2457
2458 impl GetFolderIntelligenceConfig {
2459 pub(crate) fn new(
2460 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2461 ) -> Self {
2462 Self(RequestBuilder::new(stub))
2463 }
2464
2465 pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
2467 mut self,
2468 v: V,
2469 ) -> Self {
2470 self.0.request = v.into();
2471 self
2472 }
2473
2474 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2476 self.0.options = v.into();
2477 self
2478 }
2479
2480 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2482 (*self.0.stub)
2483 .get_folder_intelligence_config(self.0.request, self.0.options)
2484 .await
2485 .map(crate::Response::into_body)
2486 }
2487
2488 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2492 self.0.request.name = v.into();
2493 self
2494 }
2495 }
2496
2497 #[doc(hidden)]
2498 impl crate::RequestBuilder for GetFolderIntelligenceConfig {
2499 fn request_options(&mut self) -> &mut crate::RequestOptions {
2500 &mut self.0.options
2501 }
2502 }
2503
2504 #[derive(Clone, Debug)]
2521 pub struct UpdateFolderIntelligenceConfig(
2522 RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
2523 );
2524
2525 impl UpdateFolderIntelligenceConfig {
2526 pub(crate) fn new(
2527 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2528 ) -> Self {
2529 Self(RequestBuilder::new(stub))
2530 }
2531
2532 pub fn with_request<V: Into<crate::model::UpdateFolderIntelligenceConfigRequest>>(
2534 mut self,
2535 v: V,
2536 ) -> Self {
2537 self.0.request = v.into();
2538 self
2539 }
2540
2541 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2543 self.0.options = v.into();
2544 self
2545 }
2546
2547 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2549 (*self.0.stub)
2550 .update_folder_intelligence_config(self.0.request, self.0.options)
2551 .await
2552 .map(crate::Response::into_body)
2553 }
2554
2555 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2559 where
2560 T: std::convert::Into<crate::model::IntelligenceConfig>,
2561 {
2562 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2563 self
2564 }
2565
2566 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2570 where
2571 T: std::convert::Into<crate::model::IntelligenceConfig>,
2572 {
2573 self.0.request.intelligence_config = v.map(|x| x.into());
2574 self
2575 }
2576
2577 pub fn set_update_mask<T>(mut self, v: T) -> Self
2581 where
2582 T: std::convert::Into<wkt::FieldMask>,
2583 {
2584 self.0.request.update_mask = std::option::Option::Some(v.into());
2585 self
2586 }
2587
2588 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2592 where
2593 T: std::convert::Into<wkt::FieldMask>,
2594 {
2595 self.0.request.update_mask = v.map(|x| x.into());
2596 self
2597 }
2598
2599 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2601 self.0.request.request_id = v.into();
2602 self
2603 }
2604 }
2605
2606 #[doc(hidden)]
2607 impl crate::RequestBuilder for UpdateFolderIntelligenceConfig {
2608 fn request_options(&mut self) -> &mut crate::RequestOptions {
2609 &mut self.0.options
2610 }
2611 }
2612
2613 #[derive(Clone, Debug)]
2630 pub struct GetOrganizationIntelligenceConfig(
2631 RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
2632 );
2633
2634 impl GetOrganizationIntelligenceConfig {
2635 pub(crate) fn new(
2636 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2637 ) -> Self {
2638 Self(RequestBuilder::new(stub))
2639 }
2640
2641 pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
2643 mut self,
2644 v: V,
2645 ) -> Self {
2646 self.0.request = v.into();
2647 self
2648 }
2649
2650 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2652 self.0.options = v.into();
2653 self
2654 }
2655
2656 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2658 (*self.0.stub)
2659 .get_organization_intelligence_config(self.0.request, self.0.options)
2660 .await
2661 .map(crate::Response::into_body)
2662 }
2663
2664 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2668 self.0.request.name = v.into();
2669 self
2670 }
2671 }
2672
2673 #[doc(hidden)]
2674 impl crate::RequestBuilder for GetOrganizationIntelligenceConfig {
2675 fn request_options(&mut self) -> &mut crate::RequestOptions {
2676 &mut self.0.options
2677 }
2678 }
2679
2680 #[derive(Clone, Debug)]
2697 pub struct UpdateOrganizationIntelligenceConfig(
2698 RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
2699 );
2700
2701 impl UpdateOrganizationIntelligenceConfig {
2702 pub(crate) fn new(
2703 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2704 ) -> Self {
2705 Self(RequestBuilder::new(stub))
2706 }
2707
2708 pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
2710 mut self,
2711 v: V,
2712 ) -> Self {
2713 self.0.request = v.into();
2714 self
2715 }
2716
2717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2719 self.0.options = v.into();
2720 self
2721 }
2722
2723 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
2725 (*self.0.stub)
2726 .update_organization_intelligence_config(self.0.request, self.0.options)
2727 .await
2728 .map(crate::Response::into_body)
2729 }
2730
2731 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
2735 where
2736 T: std::convert::Into<crate::model::IntelligenceConfig>,
2737 {
2738 self.0.request.intelligence_config = std::option::Option::Some(v.into());
2739 self
2740 }
2741
2742 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
2746 where
2747 T: std::convert::Into<crate::model::IntelligenceConfig>,
2748 {
2749 self.0.request.intelligence_config = v.map(|x| x.into());
2750 self
2751 }
2752
2753 pub fn set_update_mask<T>(mut self, v: T) -> Self
2757 where
2758 T: std::convert::Into<wkt::FieldMask>,
2759 {
2760 self.0.request.update_mask = std::option::Option::Some(v.into());
2761 self
2762 }
2763
2764 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2768 where
2769 T: std::convert::Into<wkt::FieldMask>,
2770 {
2771 self.0.request.update_mask = v.map(|x| x.into());
2772 self
2773 }
2774
2775 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2777 self.0.request.request_id = v.into();
2778 self
2779 }
2780 }
2781
2782 #[doc(hidden)]
2783 impl crate::RequestBuilder for UpdateOrganizationIntelligenceConfig {
2784 fn request_options(&mut self) -> &mut crate::RequestOptions {
2785 &mut self.0.options
2786 }
2787 }
2788
2789 #[derive(Clone, Debug)]
2806 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2807
2808 impl GetIamPolicy {
2809 pub(crate) fn new(
2810 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2811 ) -> Self {
2812 Self(RequestBuilder::new(stub))
2813 }
2814
2815 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2817 mut self,
2818 v: V,
2819 ) -> Self {
2820 self.0.request = v.into();
2821 self
2822 }
2823
2824 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2826 self.0.options = v.into();
2827 self
2828 }
2829
2830 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2832 (*self.0.stub)
2833 .get_iam_policy(self.0.request, self.0.options)
2834 .await
2835 .map(crate::Response::into_body)
2836 }
2837
2838 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2842 self.0.request.resource = v.into();
2843 self
2844 }
2845
2846 pub fn set_options<T>(mut self, v: T) -> Self
2848 where
2849 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2850 {
2851 self.0.request.options = std::option::Option::Some(v.into());
2852 self
2853 }
2854
2855 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2857 where
2858 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2859 {
2860 self.0.request.options = v.map(|x| x.into());
2861 self
2862 }
2863 }
2864
2865 #[doc(hidden)]
2866 impl crate::RequestBuilder for GetIamPolicy {
2867 fn request_options(&mut self) -> &mut crate::RequestOptions {
2868 &mut self.0.options
2869 }
2870 }
2871
2872 #[derive(Clone, Debug)]
2889 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2890
2891 impl SetIamPolicy {
2892 pub(crate) fn new(
2893 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2894 ) -> Self {
2895 Self(RequestBuilder::new(stub))
2896 }
2897
2898 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2900 mut self,
2901 v: V,
2902 ) -> Self {
2903 self.0.request = v.into();
2904 self
2905 }
2906
2907 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2909 self.0.options = v.into();
2910 self
2911 }
2912
2913 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2915 (*self.0.stub)
2916 .set_iam_policy(self.0.request, self.0.options)
2917 .await
2918 .map(crate::Response::into_body)
2919 }
2920
2921 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2925 self.0.request.resource = v.into();
2926 self
2927 }
2928
2929 pub fn set_policy<T>(mut self, v: T) -> Self
2933 where
2934 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2935 {
2936 self.0.request.policy = std::option::Option::Some(v.into());
2937 self
2938 }
2939
2940 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2944 where
2945 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2946 {
2947 self.0.request.policy = v.map(|x| x.into());
2948 self
2949 }
2950
2951 pub fn set_update_mask<T>(mut self, v: T) -> Self
2953 where
2954 T: std::convert::Into<wkt::FieldMask>,
2955 {
2956 self.0.request.update_mask = std::option::Option::Some(v.into());
2957 self
2958 }
2959
2960 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2962 where
2963 T: std::convert::Into<wkt::FieldMask>,
2964 {
2965 self.0.request.update_mask = v.map(|x| x.into());
2966 self
2967 }
2968 }
2969
2970 #[doc(hidden)]
2971 impl crate::RequestBuilder for SetIamPolicy {
2972 fn request_options(&mut self) -> &mut crate::RequestOptions {
2973 &mut self.0.options
2974 }
2975 }
2976
2977 #[derive(Clone, Debug)]
2994 pub struct TestIamPermissions(
2995 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2996 );
2997
2998 impl TestIamPermissions {
2999 pub(crate) fn new(
3000 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3001 ) -> Self {
3002 Self(RequestBuilder::new(stub))
3003 }
3004
3005 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3007 mut self,
3008 v: V,
3009 ) -> Self {
3010 self.0.request = v.into();
3011 self
3012 }
3013
3014 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3016 self.0.options = v.into();
3017 self
3018 }
3019
3020 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3022 (*self.0.stub)
3023 .test_iam_permissions(self.0.request, self.0.options)
3024 .await
3025 .map(crate::Response::into_body)
3026 }
3027
3028 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3032 self.0.request.resource = v.into();
3033 self
3034 }
3035
3036 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3040 where
3041 T: std::iter::IntoIterator<Item = V>,
3042 V: std::convert::Into<std::string::String>,
3043 {
3044 use std::iter::Iterator;
3045 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3046 self
3047 }
3048 }
3049
3050 #[doc(hidden)]
3051 impl crate::RequestBuilder for TestIamPermissions {
3052 fn request_options(&mut self) -> &mut crate::RequestOptions {
3053 &mut self.0.options
3054 }
3055 }
3056
3057 #[derive(Clone, Debug)]
3074 pub struct GetIntelligenceFinding(RequestBuilder<crate::model::GetIntelligenceFindingRequest>);
3075
3076 impl GetIntelligenceFinding {
3077 pub(crate) fn new(
3078 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3079 ) -> Self {
3080 Self(RequestBuilder::new(stub))
3081 }
3082
3083 pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRequest>>(
3085 mut self,
3086 v: V,
3087 ) -> Self {
3088 self.0.request = v.into();
3089 self
3090 }
3091
3092 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3094 self.0.options = v.into();
3095 self
3096 }
3097
3098 pub async fn send(self) -> Result<crate::model::IntelligenceFinding> {
3100 (*self.0.stub)
3101 .get_intelligence_finding(self.0.request, self.0.options)
3102 .await
3103 .map(crate::Response::into_body)
3104 }
3105
3106 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3110 self.0.request.name = v.into();
3111 self
3112 }
3113 }
3114
3115 #[doc(hidden)]
3116 impl crate::RequestBuilder for GetIntelligenceFinding {
3117 fn request_options(&mut self) -> &mut crate::RequestOptions {
3118 &mut self.0.options
3119 }
3120 }
3121
3122 #[derive(Clone, Debug)]
3143 pub struct ListIntelligenceFindings(
3144 RequestBuilder<crate::model::ListIntelligenceFindingsRequest>,
3145 );
3146
3147 impl ListIntelligenceFindings {
3148 pub(crate) fn new(
3149 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3150 ) -> Self {
3151 Self(RequestBuilder::new(stub))
3152 }
3153
3154 pub fn with_request<V: Into<crate::model::ListIntelligenceFindingsRequest>>(
3156 mut self,
3157 v: V,
3158 ) -> Self {
3159 self.0.request = v.into();
3160 self
3161 }
3162
3163 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3165 self.0.options = v.into();
3166 self
3167 }
3168
3169 pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingsResponse> {
3171 (*self.0.stub)
3172 .list_intelligence_findings(self.0.request, self.0.options)
3173 .await
3174 .map(crate::Response::into_body)
3175 }
3176
3177 pub fn by_page(
3179 self,
3180 ) -> impl google_cloud_gax::paginator::Paginator<
3181 crate::model::ListIntelligenceFindingsResponse,
3182 crate::Error,
3183 > {
3184 use std::clone::Clone;
3185 let token = self.0.request.page_token.clone();
3186 let execute = move |token: String| {
3187 let mut builder = self.clone();
3188 builder.0.request = builder.0.request.set_page_token(token);
3189 builder.send()
3190 };
3191 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3192 }
3193
3194 pub fn by_item(
3196 self,
3197 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3198 crate::model::ListIntelligenceFindingsResponse,
3199 crate::Error,
3200 > {
3201 use google_cloud_gax::paginator::Paginator;
3202 self.by_page().items()
3203 }
3204
3205 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3209 self.0.request.parent = v.into();
3210 self
3211 }
3212
3213 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3215 self.0.request.filter = v.into();
3216 self
3217 }
3218
3219 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3221 self.0.request.page_size = v.into();
3222 self
3223 }
3224
3225 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3227 self.0.request.page_token = v.into();
3228 self
3229 }
3230 }
3231
3232 #[doc(hidden)]
3233 impl crate::RequestBuilder for ListIntelligenceFindings {
3234 fn request_options(&mut self) -> &mut crate::RequestOptions {
3235 &mut self.0.options
3236 }
3237 }
3238
3239 #[derive(Clone, Debug)]
3260 pub struct SummarizeIntelligenceFindings(
3261 RequestBuilder<crate::model::SummarizeIntelligenceFindingsRequest>,
3262 );
3263
3264 impl SummarizeIntelligenceFindings {
3265 pub(crate) fn new(
3266 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3267 ) -> Self {
3268 Self(RequestBuilder::new(stub))
3269 }
3270
3271 pub fn with_request<V: Into<crate::model::SummarizeIntelligenceFindingsRequest>>(
3273 mut self,
3274 v: V,
3275 ) -> Self {
3276 self.0.request = v.into();
3277 self
3278 }
3279
3280 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3282 self.0.options = v.into();
3283 self
3284 }
3285
3286 pub async fn send(self) -> Result<crate::model::SummarizeIntelligenceFindingsResponse> {
3288 (*self.0.stub)
3289 .summarize_intelligence_findings(self.0.request, self.0.options)
3290 .await
3291 .map(crate::Response::into_body)
3292 }
3293
3294 pub fn by_page(
3296 self,
3297 ) -> impl google_cloud_gax::paginator::Paginator<
3298 crate::model::SummarizeIntelligenceFindingsResponse,
3299 crate::Error,
3300 > {
3301 use std::clone::Clone;
3302 let token = self.0.request.page_token.clone();
3303 let execute = move |token: String| {
3304 let mut builder = self.clone();
3305 builder.0.request = builder.0.request.set_page_token(token);
3306 builder.send()
3307 };
3308 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3309 }
3310
3311 pub fn by_item(
3313 self,
3314 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3315 crate::model::SummarizeIntelligenceFindingsResponse,
3316 crate::Error,
3317 > {
3318 use google_cloud_gax::paginator::Paginator;
3319 self.by_page().items()
3320 }
3321
3322 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3326 self.0.request.parent = v.into();
3327 self
3328 }
3329
3330 pub fn set_resource_scope<
3332 T: Into<crate::model::summarize_intelligence_findings_request::ResourceScope>,
3333 >(
3334 mut self,
3335 v: T,
3336 ) -> Self {
3337 self.0.request.resource_scope = v.into();
3338 self
3339 }
3340
3341 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3343 self.0.request.filter = v.into();
3344 self
3345 }
3346
3347 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3349 self.0.request.page_size = v.into();
3350 self
3351 }
3352
3353 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3355 self.0.request.page_token = v.into();
3356 self
3357 }
3358 }
3359
3360 #[doc(hidden)]
3361 impl crate::RequestBuilder for SummarizeIntelligenceFindings {
3362 fn request_options(&mut self) -> &mut crate::RequestOptions {
3363 &mut self.0.options
3364 }
3365 }
3366
3367 #[derive(Clone, Debug)]
3384 pub struct GetIntelligenceFindingRevision(
3385 RequestBuilder<crate::model::GetIntelligenceFindingRevisionRequest>,
3386 );
3387
3388 impl GetIntelligenceFindingRevision {
3389 pub(crate) fn new(
3390 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3391 ) -> Self {
3392 Self(RequestBuilder::new(stub))
3393 }
3394
3395 pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRevisionRequest>>(
3397 mut self,
3398 v: V,
3399 ) -> Self {
3400 self.0.request = v.into();
3401 self
3402 }
3403
3404 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3406 self.0.options = v.into();
3407 self
3408 }
3409
3410 pub async fn send(self) -> Result<crate::model::IntelligenceFindingRevision> {
3412 (*self.0.stub)
3413 .get_intelligence_finding_revision(self.0.request, self.0.options)
3414 .await
3415 .map(crate::Response::into_body)
3416 }
3417
3418 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3422 self.0.request.name = v.into();
3423 self
3424 }
3425 }
3426
3427 #[doc(hidden)]
3428 impl crate::RequestBuilder for GetIntelligenceFindingRevision {
3429 fn request_options(&mut self) -> &mut crate::RequestOptions {
3430 &mut self.0.options
3431 }
3432 }
3433
3434 #[derive(Clone, Debug)]
3455 pub struct ListIntelligenceFindingRevisions(
3456 RequestBuilder<crate::model::ListIntelligenceFindingRevisionsRequest>,
3457 );
3458
3459 impl ListIntelligenceFindingRevisions {
3460 pub(crate) fn new(
3461 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3462 ) -> Self {
3463 Self(RequestBuilder::new(stub))
3464 }
3465
3466 pub fn with_request<V: Into<crate::model::ListIntelligenceFindingRevisionsRequest>>(
3468 mut self,
3469 v: V,
3470 ) -> Self {
3471 self.0.request = v.into();
3472 self
3473 }
3474
3475 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3477 self.0.options = v.into();
3478 self
3479 }
3480
3481 pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingRevisionsResponse> {
3483 (*self.0.stub)
3484 .list_intelligence_finding_revisions(self.0.request, self.0.options)
3485 .await
3486 .map(crate::Response::into_body)
3487 }
3488
3489 pub fn by_page(
3491 self,
3492 ) -> impl google_cloud_gax::paginator::Paginator<
3493 crate::model::ListIntelligenceFindingRevisionsResponse,
3494 crate::Error,
3495 > {
3496 use std::clone::Clone;
3497 let token = self.0.request.page_token.clone();
3498 let execute = move |token: String| {
3499 let mut builder = self.clone();
3500 builder.0.request = builder.0.request.set_page_token(token);
3501 builder.send()
3502 };
3503 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3504 }
3505
3506 pub fn by_item(
3508 self,
3509 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3510 crate::model::ListIntelligenceFindingRevisionsResponse,
3511 crate::Error,
3512 > {
3513 use google_cloud_gax::paginator::Paginator;
3514 self.by_page().items()
3515 }
3516
3517 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3521 self.0.request.parent = v.into();
3522 self
3523 }
3524
3525 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3527 self.0.request.page_size = v.into();
3528 self
3529 }
3530
3531 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3533 self.0.request.page_token = v.into();
3534 self
3535 }
3536 }
3537
3538 #[doc(hidden)]
3539 impl crate::RequestBuilder for ListIntelligenceFindingRevisions {
3540 fn request_options(&mut self) -> &mut crate::RequestOptions {
3541 &mut self.0.options
3542 }
3543 }
3544
3545 #[derive(Clone, Debug)]
3562 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3563
3564 impl GetOperation {
3565 pub(crate) fn new(
3566 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3567 ) -> Self {
3568 Self(RequestBuilder::new(stub))
3569 }
3570
3571 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3573 mut self,
3574 v: V,
3575 ) -> Self {
3576 self.0.request = v.into();
3577 self
3578 }
3579
3580 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3582 self.0.options = v.into();
3583 self
3584 }
3585
3586 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3588 (*self.0.stub)
3589 .get_operation(self.0.request, self.0.options)
3590 .await
3591 .map(crate::Response::into_body)
3592 }
3593
3594 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3596 self.0.request.name = v.into();
3597 self
3598 }
3599 }
3600
3601 #[doc(hidden)]
3602 impl crate::RequestBuilder for GetOperation {
3603 fn request_options(&mut self) -> &mut crate::RequestOptions {
3604 &mut self.0.options
3605 }
3606 }
3607}