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)]
2737 pub struct DisableRapidCache(RequestBuilder<crate::model::DisableRapidCacheRequest>);
2738
2739 impl DisableRapidCache {
2740 pub(crate) fn new(
2741 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2742 ) -> Self {
2743 Self(RequestBuilder::new(stub))
2744 }
2745
2746 pub fn with_request<V: Into<crate::model::DisableRapidCacheRequest>>(
2748 mut self,
2749 v: V,
2750 ) -> Self {
2751 self.0.request = v.into();
2752 self
2753 }
2754
2755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2757 self.0.options = v.into();
2758 self
2759 }
2760
2761 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2768 (*self.0.stub)
2769 .disable_rapid_cache(self.0.request, self.0.options)
2770 .await
2771 .map(crate::Response::into_body)
2772 }
2773
2774 pub fn poller(
2776 self,
2777 ) -> impl google_cloud_lro::Poller<
2778 crate::model::RapidCache,
2779 crate::model::DisableRapidCacheMetadata,
2780 > {
2781 type Operation = google_cloud_lro::internal::Operation<
2782 crate::model::RapidCache,
2783 crate::model::DisableRapidCacheMetadata,
2784 >;
2785 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2786 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2787 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2788 if let Some(ref mut details) = poller_options.tracing {
2789 details.method_name =
2790 "google_cloud_storage::client::StorageControl::disable_rapid_cache::until_done";
2791 }
2792
2793 let stub = self.0.stub.clone();
2794 let mut options = self.0.options.clone();
2795 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2796 let query = move |name| {
2797 let stub = stub.clone();
2798 let options = options.clone();
2799 async {
2800 let op = GetOperation::new(stub)
2801 .set_name(name)
2802 .with_options(options)
2803 .send()
2804 .await?;
2805 Ok(Operation::new(op))
2806 }
2807 };
2808
2809 let start = move || async {
2810 let op = self.send().await?;
2811 Ok(Operation::new(op))
2812 };
2813
2814 use google_cloud_lro::internal::PollerExt;
2815 {
2816 google_cloud_lro::internal::new_poller(
2817 polling_error_policy,
2818 polling_backoff_policy,
2819 start,
2820 query,
2821 )
2822 }
2823 .with_options(poller_options)
2824 }
2825
2826 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2830 self.0.request.name = v.into();
2831 self
2832 }
2833
2834 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2836 self.0.request.request_id = v.into();
2837 self
2838 }
2839 }
2840
2841 #[doc(hidden)]
2842 impl crate::RequestBuilder for DisableRapidCache {
2843 fn request_options(&mut self) -> &mut crate::RequestOptions {
2844 &mut self.0.options
2845 }
2846 }
2847
2848 #[derive(Clone, Debug)]
2865 pub struct GetRapidCache(RequestBuilder<crate::model::GetRapidCacheRequest>);
2866
2867 impl GetRapidCache {
2868 pub(crate) fn new(
2869 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2870 ) -> Self {
2871 Self(RequestBuilder::new(stub))
2872 }
2873
2874 pub fn with_request<V: Into<crate::model::GetRapidCacheRequest>>(mut self, v: V) -> Self {
2876 self.0.request = v.into();
2877 self
2878 }
2879
2880 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2882 self.0.options = v.into();
2883 self
2884 }
2885
2886 pub async fn send(self) -> Result<crate::model::RapidCache> {
2888 (*self.0.stub)
2889 .get_rapid_cache(self.0.request, self.0.options)
2890 .await
2891 .map(crate::Response::into_body)
2892 }
2893
2894 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2898 self.0.request.name = v.into();
2899 self
2900 }
2901
2902 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2904 self.0.request.request_id = v.into();
2905 self
2906 }
2907 }
2908
2909 #[doc(hidden)]
2910 impl crate::RequestBuilder for GetRapidCache {
2911 fn request_options(&mut self) -> &mut crate::RequestOptions {
2912 &mut self.0.options
2913 }
2914 }
2915
2916 #[derive(Clone, Debug)]
2937 pub struct ListRapidCaches(RequestBuilder<crate::model::ListRapidCachesRequest>);
2938
2939 impl ListRapidCaches {
2940 pub(crate) fn new(
2941 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2942 ) -> Self {
2943 Self(RequestBuilder::new(stub))
2944 }
2945
2946 pub fn with_request<V: Into<crate::model::ListRapidCachesRequest>>(mut self, v: V) -> Self {
2948 self.0.request = v.into();
2949 self
2950 }
2951
2952 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2954 self.0.options = v.into();
2955 self
2956 }
2957
2958 pub async fn send(self) -> Result<crate::model::ListRapidCachesResponse> {
2960 (*self.0.stub)
2961 .list_rapid_caches(self.0.request, self.0.options)
2962 .await
2963 .map(crate::Response::into_body)
2964 }
2965
2966 pub fn by_page(
2968 self,
2969 ) -> impl google_cloud_gax::paginator::Paginator<
2970 crate::model::ListRapidCachesResponse,
2971 crate::Error,
2972 > {
2973 use std::clone::Clone;
2974 let token = self.0.request.page_token.clone();
2975 let execute = move |token: String| {
2976 let mut builder = self.clone();
2977 builder.0.request = builder.0.request.set_page_token(token);
2978 builder.send()
2979 };
2980 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2981 }
2982
2983 pub fn by_item(
2985 self,
2986 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2987 crate::model::ListRapidCachesResponse,
2988 crate::Error,
2989 > {
2990 use google_cloud_gax::paginator::Paginator;
2991 self.by_page().items()
2992 }
2993
2994 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2998 self.0.request.parent = v.into();
2999 self
3000 }
3001
3002 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3004 self.0.request.page_size = v.into();
3005 self
3006 }
3007
3008 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3010 self.0.request.page_token = v.into();
3011 self
3012 }
3013
3014 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3016 self.0.request.request_id = v.into();
3017 self
3018 }
3019 }
3020
3021 #[doc(hidden)]
3022 impl crate::RequestBuilder for ListRapidCaches {
3023 fn request_options(&mut self) -> &mut crate::RequestOptions {
3024 &mut self.0.options
3025 }
3026 }
3027
3028 #[derive(Clone, Debug)]
3045 pub struct GetProjectIntelligenceConfig(
3046 RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
3047 );
3048
3049 impl GetProjectIntelligenceConfig {
3050 pub(crate) fn new(
3051 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3052 ) -> Self {
3053 Self(RequestBuilder::new(stub))
3054 }
3055
3056 pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
3058 mut self,
3059 v: V,
3060 ) -> Self {
3061 self.0.request = v.into();
3062 self
3063 }
3064
3065 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3067 self.0.options = v.into();
3068 self
3069 }
3070
3071 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3073 (*self.0.stub)
3074 .get_project_intelligence_config(self.0.request, self.0.options)
3075 .await
3076 .map(crate::Response::into_body)
3077 }
3078
3079 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3083 self.0.request.name = v.into();
3084 self
3085 }
3086 }
3087
3088 #[doc(hidden)]
3089 impl crate::RequestBuilder for GetProjectIntelligenceConfig {
3090 fn request_options(&mut self) -> &mut crate::RequestOptions {
3091 &mut self.0.options
3092 }
3093 }
3094
3095 #[derive(Clone, Debug)]
3112 pub struct UpdateProjectIntelligenceConfig(
3113 RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
3114 );
3115
3116 impl UpdateProjectIntelligenceConfig {
3117 pub(crate) fn new(
3118 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3119 ) -> Self {
3120 Self(RequestBuilder::new(stub))
3121 }
3122
3123 pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
3125 mut self,
3126 v: V,
3127 ) -> Self {
3128 self.0.request = v.into();
3129 self
3130 }
3131
3132 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3134 self.0.options = v.into();
3135 self
3136 }
3137
3138 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3140 (*self.0.stub)
3141 .update_project_intelligence_config(self.0.request, self.0.options)
3142 .await
3143 .map(crate::Response::into_body)
3144 }
3145
3146 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3150 where
3151 T: std::convert::Into<crate::model::IntelligenceConfig>,
3152 {
3153 self.0.request.intelligence_config = std::option::Option::Some(v.into());
3154 self
3155 }
3156
3157 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3161 where
3162 T: std::convert::Into<crate::model::IntelligenceConfig>,
3163 {
3164 self.0.request.intelligence_config = v.map(|x| x.into());
3165 self
3166 }
3167
3168 pub fn set_update_mask<T>(mut self, v: T) -> Self
3172 where
3173 T: std::convert::Into<wkt::FieldMask>,
3174 {
3175 self.0.request.update_mask = std::option::Option::Some(v.into());
3176 self
3177 }
3178
3179 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3183 where
3184 T: std::convert::Into<wkt::FieldMask>,
3185 {
3186 self.0.request.update_mask = v.map(|x| x.into());
3187 self
3188 }
3189
3190 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3192 self.0.request.request_id = v.into();
3193 self
3194 }
3195 }
3196
3197 #[doc(hidden)]
3198 impl crate::RequestBuilder for UpdateProjectIntelligenceConfig {
3199 fn request_options(&mut self) -> &mut crate::RequestOptions {
3200 &mut self.0.options
3201 }
3202 }
3203
3204 #[derive(Clone, Debug)]
3221 pub struct GetFolderIntelligenceConfig(
3222 RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
3223 );
3224
3225 impl GetFolderIntelligenceConfig {
3226 pub(crate) fn new(
3227 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3228 ) -> Self {
3229 Self(RequestBuilder::new(stub))
3230 }
3231
3232 pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
3234 mut self,
3235 v: V,
3236 ) -> Self {
3237 self.0.request = v.into();
3238 self
3239 }
3240
3241 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3243 self.0.options = v.into();
3244 self
3245 }
3246
3247 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3249 (*self.0.stub)
3250 .get_folder_intelligence_config(self.0.request, self.0.options)
3251 .await
3252 .map(crate::Response::into_body)
3253 }
3254
3255 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3259 self.0.request.name = v.into();
3260 self
3261 }
3262 }
3263
3264 #[doc(hidden)]
3265 impl crate::RequestBuilder for GetFolderIntelligenceConfig {
3266 fn request_options(&mut self) -> &mut crate::RequestOptions {
3267 &mut self.0.options
3268 }
3269 }
3270
3271 #[derive(Clone, Debug)]
3288 pub struct UpdateFolderIntelligenceConfig(
3289 RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
3290 );
3291
3292 impl UpdateFolderIntelligenceConfig {
3293 pub(crate) fn new(
3294 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3295 ) -> Self {
3296 Self(RequestBuilder::new(stub))
3297 }
3298
3299 pub fn with_request<V: Into<crate::model::UpdateFolderIntelligenceConfigRequest>>(
3301 mut self,
3302 v: V,
3303 ) -> Self {
3304 self.0.request = v.into();
3305 self
3306 }
3307
3308 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3310 self.0.options = v.into();
3311 self
3312 }
3313
3314 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3316 (*self.0.stub)
3317 .update_folder_intelligence_config(self.0.request, self.0.options)
3318 .await
3319 .map(crate::Response::into_body)
3320 }
3321
3322 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3326 where
3327 T: std::convert::Into<crate::model::IntelligenceConfig>,
3328 {
3329 self.0.request.intelligence_config = std::option::Option::Some(v.into());
3330 self
3331 }
3332
3333 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3337 where
3338 T: std::convert::Into<crate::model::IntelligenceConfig>,
3339 {
3340 self.0.request.intelligence_config = v.map(|x| x.into());
3341 self
3342 }
3343
3344 pub fn set_update_mask<T>(mut self, v: T) -> Self
3348 where
3349 T: std::convert::Into<wkt::FieldMask>,
3350 {
3351 self.0.request.update_mask = std::option::Option::Some(v.into());
3352 self
3353 }
3354
3355 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3359 where
3360 T: std::convert::Into<wkt::FieldMask>,
3361 {
3362 self.0.request.update_mask = v.map(|x| x.into());
3363 self
3364 }
3365
3366 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3368 self.0.request.request_id = v.into();
3369 self
3370 }
3371 }
3372
3373 #[doc(hidden)]
3374 impl crate::RequestBuilder for UpdateFolderIntelligenceConfig {
3375 fn request_options(&mut self) -> &mut crate::RequestOptions {
3376 &mut self.0.options
3377 }
3378 }
3379
3380 #[derive(Clone, Debug)]
3397 pub struct GetOrganizationIntelligenceConfig(
3398 RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
3399 );
3400
3401 impl GetOrganizationIntelligenceConfig {
3402 pub(crate) fn new(
3403 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3404 ) -> Self {
3405 Self(RequestBuilder::new(stub))
3406 }
3407
3408 pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
3410 mut self,
3411 v: V,
3412 ) -> Self {
3413 self.0.request = v.into();
3414 self
3415 }
3416
3417 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3419 self.0.options = v.into();
3420 self
3421 }
3422
3423 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3425 (*self.0.stub)
3426 .get_organization_intelligence_config(self.0.request, self.0.options)
3427 .await
3428 .map(crate::Response::into_body)
3429 }
3430
3431 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3435 self.0.request.name = v.into();
3436 self
3437 }
3438 }
3439
3440 #[doc(hidden)]
3441 impl crate::RequestBuilder for GetOrganizationIntelligenceConfig {
3442 fn request_options(&mut self) -> &mut crate::RequestOptions {
3443 &mut self.0.options
3444 }
3445 }
3446
3447 #[derive(Clone, Debug)]
3464 pub struct UpdateOrganizationIntelligenceConfig(
3465 RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
3466 );
3467
3468 impl UpdateOrganizationIntelligenceConfig {
3469 pub(crate) fn new(
3470 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3471 ) -> Self {
3472 Self(RequestBuilder::new(stub))
3473 }
3474
3475 pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
3477 mut self,
3478 v: V,
3479 ) -> Self {
3480 self.0.request = v.into();
3481 self
3482 }
3483
3484 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3486 self.0.options = v.into();
3487 self
3488 }
3489
3490 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3492 (*self.0.stub)
3493 .update_organization_intelligence_config(self.0.request, self.0.options)
3494 .await
3495 .map(crate::Response::into_body)
3496 }
3497
3498 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3502 where
3503 T: std::convert::Into<crate::model::IntelligenceConfig>,
3504 {
3505 self.0.request.intelligence_config = std::option::Option::Some(v.into());
3506 self
3507 }
3508
3509 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3513 where
3514 T: std::convert::Into<crate::model::IntelligenceConfig>,
3515 {
3516 self.0.request.intelligence_config = v.map(|x| x.into());
3517 self
3518 }
3519
3520 pub fn set_update_mask<T>(mut self, v: T) -> Self
3524 where
3525 T: std::convert::Into<wkt::FieldMask>,
3526 {
3527 self.0.request.update_mask = std::option::Option::Some(v.into());
3528 self
3529 }
3530
3531 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3535 where
3536 T: std::convert::Into<wkt::FieldMask>,
3537 {
3538 self.0.request.update_mask = v.map(|x| x.into());
3539 self
3540 }
3541
3542 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3544 self.0.request.request_id = v.into();
3545 self
3546 }
3547 }
3548
3549 #[doc(hidden)]
3550 impl crate::RequestBuilder for UpdateOrganizationIntelligenceConfig {
3551 fn request_options(&mut self) -> &mut crate::RequestOptions {
3552 &mut self.0.options
3553 }
3554 }
3555
3556 #[derive(Clone, Debug)]
3573 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3574
3575 impl GetIamPolicy {
3576 pub(crate) fn new(
3577 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3578 ) -> Self {
3579 Self(RequestBuilder::new(stub))
3580 }
3581
3582 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3584 mut self,
3585 v: V,
3586 ) -> Self {
3587 self.0.request = v.into();
3588 self
3589 }
3590
3591 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3593 self.0.options = v.into();
3594 self
3595 }
3596
3597 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3599 (*self.0.stub)
3600 .get_iam_policy(self.0.request, self.0.options)
3601 .await
3602 .map(crate::Response::into_body)
3603 }
3604
3605 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3609 self.0.request.resource = v.into();
3610 self
3611 }
3612
3613 pub fn set_options<T>(mut self, v: T) -> Self
3615 where
3616 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3617 {
3618 self.0.request.options = std::option::Option::Some(v.into());
3619 self
3620 }
3621
3622 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3624 where
3625 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3626 {
3627 self.0.request.options = v.map(|x| x.into());
3628 self
3629 }
3630 }
3631
3632 #[doc(hidden)]
3633 impl crate::RequestBuilder for GetIamPolicy {
3634 fn request_options(&mut self) -> &mut crate::RequestOptions {
3635 &mut self.0.options
3636 }
3637 }
3638
3639 #[derive(Clone, Debug)]
3656 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3657
3658 impl SetIamPolicy {
3659 pub(crate) fn new(
3660 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3661 ) -> Self {
3662 Self(RequestBuilder::new(stub))
3663 }
3664
3665 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3667 mut self,
3668 v: V,
3669 ) -> Self {
3670 self.0.request = v.into();
3671 self
3672 }
3673
3674 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3676 self.0.options = v.into();
3677 self
3678 }
3679
3680 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3682 (*self.0.stub)
3683 .set_iam_policy(self.0.request, self.0.options)
3684 .await
3685 .map(crate::Response::into_body)
3686 }
3687
3688 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3692 self.0.request.resource = v.into();
3693 self
3694 }
3695
3696 pub fn set_policy<T>(mut self, v: T) -> Self
3700 where
3701 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3702 {
3703 self.0.request.policy = std::option::Option::Some(v.into());
3704 self
3705 }
3706
3707 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3711 where
3712 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3713 {
3714 self.0.request.policy = v.map(|x| x.into());
3715 self
3716 }
3717
3718 pub fn set_update_mask<T>(mut self, v: T) -> Self
3720 where
3721 T: std::convert::Into<wkt::FieldMask>,
3722 {
3723 self.0.request.update_mask = std::option::Option::Some(v.into());
3724 self
3725 }
3726
3727 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3729 where
3730 T: std::convert::Into<wkt::FieldMask>,
3731 {
3732 self.0.request.update_mask = v.map(|x| x.into());
3733 self
3734 }
3735 }
3736
3737 #[doc(hidden)]
3738 impl crate::RequestBuilder for SetIamPolicy {
3739 fn request_options(&mut self) -> &mut crate::RequestOptions {
3740 &mut self.0.options
3741 }
3742 }
3743
3744 #[derive(Clone, Debug)]
3761 pub struct TestIamPermissions(
3762 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3763 );
3764
3765 impl TestIamPermissions {
3766 pub(crate) fn new(
3767 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3768 ) -> Self {
3769 Self(RequestBuilder::new(stub))
3770 }
3771
3772 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3774 mut self,
3775 v: V,
3776 ) -> Self {
3777 self.0.request = v.into();
3778 self
3779 }
3780
3781 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3783 self.0.options = v.into();
3784 self
3785 }
3786
3787 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3789 (*self.0.stub)
3790 .test_iam_permissions(self.0.request, self.0.options)
3791 .await
3792 .map(crate::Response::into_body)
3793 }
3794
3795 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3799 self.0.request.resource = v.into();
3800 self
3801 }
3802
3803 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3807 where
3808 T: std::iter::IntoIterator<Item = V>,
3809 V: std::convert::Into<std::string::String>,
3810 {
3811 use std::iter::Iterator;
3812 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3813 self
3814 }
3815 }
3816
3817 #[doc(hidden)]
3818 impl crate::RequestBuilder for TestIamPermissions {
3819 fn request_options(&mut self) -> &mut crate::RequestOptions {
3820 &mut self.0.options
3821 }
3822 }
3823
3824 #[derive(Clone, Debug)]
3841 pub struct GetIntelligenceFinding(RequestBuilder<crate::model::GetIntelligenceFindingRequest>);
3842
3843 impl GetIntelligenceFinding {
3844 pub(crate) fn new(
3845 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3846 ) -> Self {
3847 Self(RequestBuilder::new(stub))
3848 }
3849
3850 pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRequest>>(
3852 mut self,
3853 v: V,
3854 ) -> Self {
3855 self.0.request = v.into();
3856 self
3857 }
3858
3859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3861 self.0.options = v.into();
3862 self
3863 }
3864
3865 pub async fn send(self) -> Result<crate::model::IntelligenceFinding> {
3867 (*self.0.stub)
3868 .get_intelligence_finding(self.0.request, self.0.options)
3869 .await
3870 .map(crate::Response::into_body)
3871 }
3872
3873 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3877 self.0.request.name = v.into();
3878 self
3879 }
3880 }
3881
3882 #[doc(hidden)]
3883 impl crate::RequestBuilder for GetIntelligenceFinding {
3884 fn request_options(&mut self) -> &mut crate::RequestOptions {
3885 &mut self.0.options
3886 }
3887 }
3888
3889 #[derive(Clone, Debug)]
3910 pub struct ListIntelligenceFindings(
3911 RequestBuilder<crate::model::ListIntelligenceFindingsRequest>,
3912 );
3913
3914 impl ListIntelligenceFindings {
3915 pub(crate) fn new(
3916 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3917 ) -> Self {
3918 Self(RequestBuilder::new(stub))
3919 }
3920
3921 pub fn with_request<V: Into<crate::model::ListIntelligenceFindingsRequest>>(
3923 mut self,
3924 v: V,
3925 ) -> Self {
3926 self.0.request = v.into();
3927 self
3928 }
3929
3930 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3932 self.0.options = v.into();
3933 self
3934 }
3935
3936 pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingsResponse> {
3938 (*self.0.stub)
3939 .list_intelligence_findings(self.0.request, self.0.options)
3940 .await
3941 .map(crate::Response::into_body)
3942 }
3943
3944 pub fn by_page(
3946 self,
3947 ) -> impl google_cloud_gax::paginator::Paginator<
3948 crate::model::ListIntelligenceFindingsResponse,
3949 crate::Error,
3950 > {
3951 use std::clone::Clone;
3952 let token = self.0.request.page_token.clone();
3953 let execute = move |token: String| {
3954 let mut builder = self.clone();
3955 builder.0.request = builder.0.request.set_page_token(token);
3956 builder.send()
3957 };
3958 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3959 }
3960
3961 pub fn by_item(
3963 self,
3964 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3965 crate::model::ListIntelligenceFindingsResponse,
3966 crate::Error,
3967 > {
3968 use google_cloud_gax::paginator::Paginator;
3969 self.by_page().items()
3970 }
3971
3972 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3976 self.0.request.parent = v.into();
3977 self
3978 }
3979
3980 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3982 self.0.request.filter = v.into();
3983 self
3984 }
3985
3986 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3988 self.0.request.page_size = v.into();
3989 self
3990 }
3991
3992 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3994 self.0.request.page_token = v.into();
3995 self
3996 }
3997 }
3998
3999 #[doc(hidden)]
4000 impl crate::RequestBuilder for ListIntelligenceFindings {
4001 fn request_options(&mut self) -> &mut crate::RequestOptions {
4002 &mut self.0.options
4003 }
4004 }
4005
4006 #[derive(Clone, Debug)]
4027 pub struct SummarizeIntelligenceFindings(
4028 RequestBuilder<crate::model::SummarizeIntelligenceFindingsRequest>,
4029 );
4030
4031 impl SummarizeIntelligenceFindings {
4032 pub(crate) fn new(
4033 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4034 ) -> Self {
4035 Self(RequestBuilder::new(stub))
4036 }
4037
4038 pub fn with_request<V: Into<crate::model::SummarizeIntelligenceFindingsRequest>>(
4040 mut self,
4041 v: V,
4042 ) -> Self {
4043 self.0.request = v.into();
4044 self
4045 }
4046
4047 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4049 self.0.options = v.into();
4050 self
4051 }
4052
4053 pub async fn send(self) -> Result<crate::model::SummarizeIntelligenceFindingsResponse> {
4055 (*self.0.stub)
4056 .summarize_intelligence_findings(self.0.request, self.0.options)
4057 .await
4058 .map(crate::Response::into_body)
4059 }
4060
4061 pub fn by_page(
4063 self,
4064 ) -> impl google_cloud_gax::paginator::Paginator<
4065 crate::model::SummarizeIntelligenceFindingsResponse,
4066 crate::Error,
4067 > {
4068 use std::clone::Clone;
4069 let token = self.0.request.page_token.clone();
4070 let execute = move |token: String| {
4071 let mut builder = self.clone();
4072 builder.0.request = builder.0.request.set_page_token(token);
4073 builder.send()
4074 };
4075 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4076 }
4077
4078 pub fn by_item(
4080 self,
4081 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4082 crate::model::SummarizeIntelligenceFindingsResponse,
4083 crate::Error,
4084 > {
4085 use google_cloud_gax::paginator::Paginator;
4086 self.by_page().items()
4087 }
4088
4089 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4093 self.0.request.parent = v.into();
4094 self
4095 }
4096
4097 pub fn set_resource_scope<
4099 T: Into<crate::model::summarize_intelligence_findings_request::ResourceScope>,
4100 >(
4101 mut self,
4102 v: T,
4103 ) -> Self {
4104 self.0.request.resource_scope = v.into();
4105 self
4106 }
4107
4108 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4110 self.0.request.filter = v.into();
4111 self
4112 }
4113
4114 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4116 self.0.request.page_size = v.into();
4117 self
4118 }
4119
4120 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4122 self.0.request.page_token = v.into();
4123 self
4124 }
4125 }
4126
4127 #[doc(hidden)]
4128 impl crate::RequestBuilder for SummarizeIntelligenceFindings {
4129 fn request_options(&mut self) -> &mut crate::RequestOptions {
4130 &mut self.0.options
4131 }
4132 }
4133
4134 #[derive(Clone, Debug)]
4151 pub struct GetIntelligenceFindingRevision(
4152 RequestBuilder<crate::model::GetIntelligenceFindingRevisionRequest>,
4153 );
4154
4155 impl GetIntelligenceFindingRevision {
4156 pub(crate) fn new(
4157 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4158 ) -> Self {
4159 Self(RequestBuilder::new(stub))
4160 }
4161
4162 pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRevisionRequest>>(
4164 mut self,
4165 v: V,
4166 ) -> Self {
4167 self.0.request = v.into();
4168 self
4169 }
4170
4171 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4173 self.0.options = v.into();
4174 self
4175 }
4176
4177 pub async fn send(self) -> Result<crate::model::IntelligenceFindingRevision> {
4179 (*self.0.stub)
4180 .get_intelligence_finding_revision(self.0.request, self.0.options)
4181 .await
4182 .map(crate::Response::into_body)
4183 }
4184
4185 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4189 self.0.request.name = v.into();
4190 self
4191 }
4192 }
4193
4194 #[doc(hidden)]
4195 impl crate::RequestBuilder for GetIntelligenceFindingRevision {
4196 fn request_options(&mut self) -> &mut crate::RequestOptions {
4197 &mut self.0.options
4198 }
4199 }
4200
4201 #[derive(Clone, Debug)]
4222 pub struct ListIntelligenceFindingRevisions(
4223 RequestBuilder<crate::model::ListIntelligenceFindingRevisionsRequest>,
4224 );
4225
4226 impl ListIntelligenceFindingRevisions {
4227 pub(crate) fn new(
4228 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4229 ) -> Self {
4230 Self(RequestBuilder::new(stub))
4231 }
4232
4233 pub fn with_request<V: Into<crate::model::ListIntelligenceFindingRevisionsRequest>>(
4235 mut self,
4236 v: V,
4237 ) -> Self {
4238 self.0.request = v.into();
4239 self
4240 }
4241
4242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4244 self.0.options = v.into();
4245 self
4246 }
4247
4248 pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingRevisionsResponse> {
4250 (*self.0.stub)
4251 .list_intelligence_finding_revisions(self.0.request, self.0.options)
4252 .await
4253 .map(crate::Response::into_body)
4254 }
4255
4256 pub fn by_page(
4258 self,
4259 ) -> impl google_cloud_gax::paginator::Paginator<
4260 crate::model::ListIntelligenceFindingRevisionsResponse,
4261 crate::Error,
4262 > {
4263 use std::clone::Clone;
4264 let token = self.0.request.page_token.clone();
4265 let execute = move |token: String| {
4266 let mut builder = self.clone();
4267 builder.0.request = builder.0.request.set_page_token(token);
4268 builder.send()
4269 };
4270 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4271 }
4272
4273 pub fn by_item(
4275 self,
4276 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4277 crate::model::ListIntelligenceFindingRevisionsResponse,
4278 crate::Error,
4279 > {
4280 use google_cloud_gax::paginator::Paginator;
4281 self.by_page().items()
4282 }
4283
4284 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4288 self.0.request.parent = v.into();
4289 self
4290 }
4291
4292 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4294 self.0.request.page_size = v.into();
4295 self
4296 }
4297
4298 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4300 self.0.request.page_token = v.into();
4301 self
4302 }
4303 }
4304
4305 #[doc(hidden)]
4306 impl crate::RequestBuilder for ListIntelligenceFindingRevisions {
4307 fn request_options(&mut self) -> &mut crate::RequestOptions {
4308 &mut self.0.options
4309 }
4310 }
4311
4312 #[derive(Clone, Debug)]
4329 pub struct ViewObjectFullContext(RequestBuilder<crate::model::ViewObjectFullContextRequest>);
4330
4331 impl ViewObjectFullContext {
4332 pub(crate) fn new(
4333 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4334 ) -> Self {
4335 Self(RequestBuilder::new(stub))
4336 }
4337
4338 pub fn with_request<V: Into<crate::model::ViewObjectFullContextRequest>>(
4340 mut self,
4341 v: V,
4342 ) -> Self {
4343 self.0.request = v.into();
4344 self
4345 }
4346
4347 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4349 self.0.options = v.into();
4350 self
4351 }
4352
4353 pub async fn send(self) -> Result<crate::model::ObjectFullContext> {
4355 (*self.0.stub)
4356 .view_object_full_context(self.0.request, self.0.options)
4357 .await
4358 .map(crate::Response::into_body)
4359 }
4360
4361 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
4363 self.0.request.generation = v.into();
4364 self
4365 }
4366
4367 pub fn set_context_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
4371 self.0.request.context_key = v.into();
4372 self
4373 }
4374
4375 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4379 self.0.request.name = v.into();
4380 self
4381 }
4382 }
4383
4384 #[doc(hidden)]
4385 impl crate::RequestBuilder for ViewObjectFullContext {
4386 fn request_options(&mut self) -> &mut crate::RequestOptions {
4387 &mut self.0.options
4388 }
4389 }
4390
4391 #[derive(Clone, Debug)]
4408 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4409
4410 impl GetOperation {
4411 pub(crate) fn new(
4412 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4413 ) -> Self {
4414 Self(RequestBuilder::new(stub))
4415 }
4416
4417 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4419 mut self,
4420 v: V,
4421 ) -> Self {
4422 self.0.request = v.into();
4423 self
4424 }
4425
4426 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4428 self.0.options = v.into();
4429 self
4430 }
4431
4432 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4434 (*self.0.stub)
4435 .get_operation(self.0.request, self.0.options)
4436 .await
4437 .map(crate::Response::into_body)
4438 }
4439
4440 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4442 self.0.request.name = v.into();
4443 self
4444 }
4445 }
4446
4447 #[doc(hidden)]
4448 impl crate::RequestBuilder for GetOperation {
4449 fn request_options(&mut self) -> &mut crate::RequestOptions {
4450 &mut self.0.options
4451 }
4452 }
4453}