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 let req = Self::auto_populate(self.0.request, false);
440 (*self.0.stub)
441 .list_folders(req, self.0.options)
442 .await
443 .map(crate::Response::into_body)
444 }
445
446 pub fn by_page(
448 self,
449 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListFoldersResponse, crate::Error>
450 {
451 use std::clone::Clone;
452 let token = self.0.request.page_token.clone();
453 let execute = move |token: String| {
454 let mut builder = self.clone();
455 let initial = builder.0.request.page_token == token;
456 builder.0.request = Self::auto_populate(builder.0.request, !initial);
457 builder.0.request = builder.0.request.set_page_token(token);
458 builder.send()
459 };
460 google_cloud_gax::paginator::internal::new_paginator(token, execute)
461 }
462
463 pub fn by_item(
465 self,
466 ) -> impl google_cloud_gax::paginator::ItemPaginator<
467 crate::model::ListFoldersResponse,
468 crate::Error,
469 > {
470 use google_cloud_gax::paginator::Paginator;
471 self.by_page().items()
472 }
473
474 fn auto_populate(
475 mut req: crate::model::ListFoldersRequest,
476 force: bool,
477 ) -> crate::model::ListFoldersRequest {
478 if force || req.request_id.is_empty() {
479 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
480 }
481 req
482 }
483
484 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
488 self.0.request.parent = v.into();
489 self
490 }
491
492 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
494 self.0.request.page_size = v.into();
495 self
496 }
497
498 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
500 self.0.request.page_token = v.into();
501 self
502 }
503
504 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
506 self.0.request.prefix = v.into();
507 self
508 }
509
510 pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
512 self.0.request.delimiter = v.into();
513 self
514 }
515
516 pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
518 self.0.request.lexicographic_start = v.into();
519 self
520 }
521
522 pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
524 self.0.request.lexicographic_end = v.into();
525 self
526 }
527
528 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
530 self.0.request.request_id = v.into();
531 self
532 }
533 }
534
535 #[doc(hidden)]
536 impl crate::RequestBuilder for ListFolders {
537 fn request_options(&mut self) -> &mut crate::RequestOptions {
538 &mut self.0.options
539 }
540 }
541
542 #[derive(Clone, Debug)]
560 pub struct RenameFolder(RequestBuilder<crate::model::RenameFolderRequest>);
561
562 impl RenameFolder {
563 pub(crate) fn new(
564 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
565 ) -> Self {
566 Self(RequestBuilder::new(stub))
567 }
568
569 pub fn with_request<V: Into<crate::model::RenameFolderRequest>>(mut self, v: V) -> Self {
571 self.0.request = v.into();
572 self
573 }
574
575 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
577 self.0.options = v.into();
578 self
579 }
580
581 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
588 let req = Self::auto_populate(self.0.request, false);
589 (*self.0.stub)
590 .rename_folder(req, self.0.options)
591 .await
592 .map(crate::Response::into_body)
593 }
594
595 pub fn poller(
597 self,
598 ) -> impl google_cloud_lro::Poller<crate::model::Folder, crate::model::RenameFolderMetadata>
599 {
600 type Operation = google_cloud_lro::internal::Operation<
601 crate::model::Folder,
602 crate::model::RenameFolderMetadata,
603 >;
604 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
605 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
606 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
607 if let Some(ref mut details) = poller_options.tracing {
608 details.method_name =
609 "google_cloud_storage::client::StorageControl::rename_folder::until_done";
610 }
611
612 let stub = self.0.stub.clone();
613 let mut options = self.0.options.clone();
614 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
615 let query = move |name| {
616 let stub = stub.clone();
617 let options = options.clone();
618 async {
619 let op = GetOperation::new(stub)
620 .set_name(name)
621 .with_options(options)
622 .send()
623 .await?;
624 Ok(Operation::new(op))
625 }
626 };
627
628 let start = move || async {
629 let op = self.send().await?;
630 Ok(Operation::new(op))
631 };
632
633 use google_cloud_lro::internal::PollerExt;
634 {
635 google_cloud_lro::internal::new_poller(
636 polling_error_policy,
637 polling_backoff_policy,
638 start,
639 query,
640 )
641 }
642 .with_options(poller_options)
643 }
644
645 fn auto_populate(
646 mut req: crate::model::RenameFolderRequest,
647 force: bool,
648 ) -> crate::model::RenameFolderRequest {
649 if force || req.request_id.is_empty() {
650 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
651 }
652 req
653 }
654
655 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
659 self.0.request.name = v.into();
660 self
661 }
662
663 pub fn set_destination_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
667 self.0.request.destination_folder_id = v.into();
668 self
669 }
670
671 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
673 where
674 T: std::convert::Into<i64>,
675 {
676 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
677 self
678 }
679
680 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
682 where
683 T: std::convert::Into<i64>,
684 {
685 self.0.request.if_metageneration_match = v.map(|x| x.into());
686 self
687 }
688
689 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
691 where
692 T: std::convert::Into<i64>,
693 {
694 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
695 self
696 }
697
698 pub fn set_or_clear_if_metageneration_not_match<T>(
700 mut self,
701 v: std::option::Option<T>,
702 ) -> Self
703 where
704 T: std::convert::Into<i64>,
705 {
706 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
707 self
708 }
709
710 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
712 self.0.request.request_id = v.into();
713 self
714 }
715 }
716
717 #[doc(hidden)]
718 impl crate::RequestBuilder for RenameFolder {
719 fn request_options(&mut self) -> &mut crate::RequestOptions {
720 &mut self.0.options
721 }
722 }
723
724 #[derive(Clone, Debug)]
742 pub struct DeleteFolderRecursive(RequestBuilder<crate::model::DeleteFolderRecursiveRequest>);
743
744 impl DeleteFolderRecursive {
745 pub(crate) fn new(
746 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
747 ) -> Self {
748 Self(RequestBuilder::new(stub))
749 }
750
751 pub fn with_request<V: Into<crate::model::DeleteFolderRecursiveRequest>>(
753 mut self,
754 v: V,
755 ) -> Self {
756 self.0.request = v.into();
757 self
758 }
759
760 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
762 self.0.options = v.into();
763 self
764 }
765
766 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
773 let req = Self::auto_populate(self.0.request, false);
774 (*self.0.stub)
775 .delete_folder_recursive(req, self.0.options)
776 .await
777 .map(crate::Response::into_body)
778 }
779
780 pub fn poller(
782 self,
783 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteFolderRecursiveMetadata>
784 {
785 type Operation = google_cloud_lro::internal::Operation<
786 wkt::Empty,
787 crate::model::DeleteFolderRecursiveMetadata,
788 >;
789 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
790 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
791 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
792 if let Some(ref mut details) = poller_options.tracing {
793 details.method_name = "google_cloud_storage::client::StorageControl::delete_folder_recursive::until_done";
794 }
795
796 let stub = self.0.stub.clone();
797 let mut options = self.0.options.clone();
798 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
799 let query = move |name| {
800 let stub = stub.clone();
801 let options = options.clone();
802 async {
803 let op = GetOperation::new(stub)
804 .set_name(name)
805 .with_options(options)
806 .send()
807 .await?;
808 Ok(Operation::new(op))
809 }
810 };
811
812 let start = move || async {
813 let op = self.send().await?;
814 Ok(Operation::new(op))
815 };
816
817 use google_cloud_lro::internal::PollerExt;
818 {
819 google_cloud_lro::internal::new_unit_response_poller(
820 polling_error_policy,
821 polling_backoff_policy,
822 start,
823 query,
824 )
825 }
826 .with_options(poller_options)
827 }
828
829 fn auto_populate(
830 mut req: crate::model::DeleteFolderRecursiveRequest,
831 force: bool,
832 ) -> crate::model::DeleteFolderRecursiveRequest {
833 if force || req.request_id.is_empty() {
834 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
835 }
836 req
837 }
838
839 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
843 self.0.request.name = v.into();
844 self
845 }
846
847 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
849 where
850 T: std::convert::Into<i64>,
851 {
852 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
853 self
854 }
855
856 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
858 where
859 T: std::convert::Into<i64>,
860 {
861 self.0.request.if_metageneration_match = v.map(|x| x.into());
862 self
863 }
864
865 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
867 where
868 T: std::convert::Into<i64>,
869 {
870 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
871 self
872 }
873
874 pub fn set_or_clear_if_metageneration_not_match<T>(
876 mut self,
877 v: std::option::Option<T>,
878 ) -> Self
879 where
880 T: std::convert::Into<i64>,
881 {
882 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
883 self
884 }
885
886 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
888 self.0.request.request_id = v.into();
889 self
890 }
891 }
892
893 #[doc(hidden)]
894 impl crate::RequestBuilder for DeleteFolderRecursive {
895 fn request_options(&mut self) -> &mut crate::RequestOptions {
896 &mut self.0.options
897 }
898 }
899
900 #[derive(Clone, Debug)]
917 pub struct GetStorageLayout(RequestBuilder<crate::model::GetStorageLayoutRequest>);
918
919 impl GetStorageLayout {
920 pub(crate) fn new(
921 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
922 ) -> Self {
923 Self(RequestBuilder::new(stub))
924 }
925
926 pub fn with_request<V: Into<crate::model::GetStorageLayoutRequest>>(
928 mut self,
929 v: V,
930 ) -> Self {
931 self.0.request = v.into();
932 self
933 }
934
935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
937 self.0.options = v.into();
938 self
939 }
940
941 pub async fn send(self) -> Result<crate::model::StorageLayout> {
943 let req = Self::auto_populate(self.0.request, false);
944 (*self.0.stub)
945 .get_storage_layout(req, self.0.options)
946 .await
947 .map(crate::Response::into_body)
948 }
949
950 fn auto_populate(
951 mut req: crate::model::GetStorageLayoutRequest,
952 force: bool,
953 ) -> crate::model::GetStorageLayoutRequest {
954 if force || req.request_id.is_empty() {
955 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
956 }
957 req
958 }
959
960 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
964 self.0.request.name = v.into();
965 self
966 }
967
968 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
970 self.0.request.prefix = v.into();
971 self
972 }
973
974 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
976 self.0.request.request_id = v.into();
977 self
978 }
979 }
980
981 #[doc(hidden)]
982 impl crate::RequestBuilder for GetStorageLayout {
983 fn request_options(&mut self) -> &mut crate::RequestOptions {
984 &mut self.0.options
985 }
986 }
987
988 #[derive(Clone, Debug)]
1005 pub struct CreateManagedFolder(RequestBuilder<crate::model::CreateManagedFolderRequest>);
1006
1007 impl CreateManagedFolder {
1008 pub(crate) fn new(
1009 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1010 ) -> Self {
1011 Self(RequestBuilder::new(stub))
1012 }
1013
1014 pub fn with_request<V: Into<crate::model::CreateManagedFolderRequest>>(
1016 mut self,
1017 v: V,
1018 ) -> Self {
1019 self.0.request = v.into();
1020 self
1021 }
1022
1023 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1025 self.0.options = v.into();
1026 self
1027 }
1028
1029 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1031 let req = Self::auto_populate(self.0.request, false);
1032 (*self.0.stub)
1033 .create_managed_folder(req, self.0.options)
1034 .await
1035 .map(crate::Response::into_body)
1036 }
1037
1038 fn auto_populate(
1039 mut req: crate::model::CreateManagedFolderRequest,
1040 force: bool,
1041 ) -> crate::model::CreateManagedFolderRequest {
1042 if force || req.request_id.is_empty() {
1043 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1044 }
1045 req
1046 }
1047
1048 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1052 self.0.request.parent = v.into();
1053 self
1054 }
1055
1056 pub fn set_managed_folder<T>(mut self, v: T) -> Self
1060 where
1061 T: std::convert::Into<crate::model::ManagedFolder>,
1062 {
1063 self.0.request.managed_folder = std::option::Option::Some(v.into());
1064 self
1065 }
1066
1067 pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
1071 where
1072 T: std::convert::Into<crate::model::ManagedFolder>,
1073 {
1074 self.0.request.managed_folder = v.map(|x| x.into());
1075 self
1076 }
1077
1078 pub fn set_managed_folder_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1082 self.0.request.managed_folder_id = v.into();
1083 self
1084 }
1085
1086 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1088 self.0.request.request_id = v.into();
1089 self
1090 }
1091 }
1092
1093 #[doc(hidden)]
1094 impl crate::RequestBuilder for CreateManagedFolder {
1095 fn request_options(&mut self) -> &mut crate::RequestOptions {
1096 &mut self.0.options
1097 }
1098 }
1099
1100 #[derive(Clone, Debug)]
1117 pub struct DeleteManagedFolder(RequestBuilder<crate::model::DeleteManagedFolderRequest>);
1118
1119 impl DeleteManagedFolder {
1120 pub(crate) fn new(
1121 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1122 ) -> Self {
1123 Self(RequestBuilder::new(stub))
1124 }
1125
1126 pub fn with_request<V: Into<crate::model::DeleteManagedFolderRequest>>(
1128 mut self,
1129 v: V,
1130 ) -> Self {
1131 self.0.request = v.into();
1132 self
1133 }
1134
1135 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1137 self.0.options = v.into();
1138 self
1139 }
1140
1141 pub async fn send(self) -> Result<()> {
1143 let req = Self::auto_populate(self.0.request, false);
1144 (*self.0.stub)
1145 .delete_managed_folder(req, self.0.options)
1146 .await
1147 .map(crate::Response::into_body)
1148 }
1149
1150 fn auto_populate(
1151 mut req: crate::model::DeleteManagedFolderRequest,
1152 force: bool,
1153 ) -> crate::model::DeleteManagedFolderRequest {
1154 if force || req.request_id.is_empty() {
1155 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1156 }
1157 req
1158 }
1159
1160 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1164 self.0.request.name = v.into();
1165 self
1166 }
1167
1168 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1170 where
1171 T: std::convert::Into<i64>,
1172 {
1173 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1174 self
1175 }
1176
1177 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1179 where
1180 T: std::convert::Into<i64>,
1181 {
1182 self.0.request.if_metageneration_match = v.map(|x| x.into());
1183 self
1184 }
1185
1186 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1188 where
1189 T: std::convert::Into<i64>,
1190 {
1191 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1192 self
1193 }
1194
1195 pub fn set_or_clear_if_metageneration_not_match<T>(
1197 mut self,
1198 v: std::option::Option<T>,
1199 ) -> Self
1200 where
1201 T: std::convert::Into<i64>,
1202 {
1203 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1204 self
1205 }
1206
1207 pub fn set_allow_non_empty<T: Into<bool>>(mut self, v: T) -> Self {
1209 self.0.request.allow_non_empty = v.into();
1210 self
1211 }
1212
1213 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1215 self.0.request.request_id = v.into();
1216 self
1217 }
1218 }
1219
1220 #[doc(hidden)]
1221 impl crate::RequestBuilder for DeleteManagedFolder {
1222 fn request_options(&mut self) -> &mut crate::RequestOptions {
1223 &mut self.0.options
1224 }
1225 }
1226
1227 #[derive(Clone, Debug)]
1244 pub struct GetManagedFolder(RequestBuilder<crate::model::GetManagedFolderRequest>);
1245
1246 impl GetManagedFolder {
1247 pub(crate) fn new(
1248 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1249 ) -> Self {
1250 Self(RequestBuilder::new(stub))
1251 }
1252
1253 pub fn with_request<V: Into<crate::model::GetManagedFolderRequest>>(
1255 mut self,
1256 v: V,
1257 ) -> Self {
1258 self.0.request = v.into();
1259 self
1260 }
1261
1262 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1264 self.0.options = v.into();
1265 self
1266 }
1267
1268 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1270 let req = Self::auto_populate(self.0.request, false);
1271 (*self.0.stub)
1272 .get_managed_folder(req, self.0.options)
1273 .await
1274 .map(crate::Response::into_body)
1275 }
1276
1277 fn auto_populate(
1278 mut req: crate::model::GetManagedFolderRequest,
1279 force: bool,
1280 ) -> crate::model::GetManagedFolderRequest {
1281 if force || req.request_id.is_empty() {
1282 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1283 }
1284 req
1285 }
1286
1287 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1291 self.0.request.name = v.into();
1292 self
1293 }
1294
1295 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1297 where
1298 T: std::convert::Into<i64>,
1299 {
1300 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1301 self
1302 }
1303
1304 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1306 where
1307 T: std::convert::Into<i64>,
1308 {
1309 self.0.request.if_metageneration_match = v.map(|x| x.into());
1310 self
1311 }
1312
1313 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1315 where
1316 T: std::convert::Into<i64>,
1317 {
1318 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1319 self
1320 }
1321
1322 pub fn set_or_clear_if_metageneration_not_match<T>(
1324 mut self,
1325 v: std::option::Option<T>,
1326 ) -> Self
1327 where
1328 T: std::convert::Into<i64>,
1329 {
1330 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1331 self
1332 }
1333
1334 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1336 self.0.request.request_id = v.into();
1337 self
1338 }
1339 }
1340
1341 #[doc(hidden)]
1342 impl crate::RequestBuilder for GetManagedFolder {
1343 fn request_options(&mut self) -> &mut crate::RequestOptions {
1344 &mut self.0.options
1345 }
1346 }
1347
1348 #[derive(Clone, Debug)]
1369 pub struct ListManagedFolders(RequestBuilder<crate::model::ListManagedFoldersRequest>);
1370
1371 impl ListManagedFolders {
1372 pub(crate) fn new(
1373 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1374 ) -> Self {
1375 Self(RequestBuilder::new(stub))
1376 }
1377
1378 pub fn with_request<V: Into<crate::model::ListManagedFoldersRequest>>(
1380 mut self,
1381 v: V,
1382 ) -> Self {
1383 self.0.request = v.into();
1384 self
1385 }
1386
1387 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1389 self.0.options = v.into();
1390 self
1391 }
1392
1393 pub async fn send(self) -> Result<crate::model::ListManagedFoldersResponse> {
1395 let req = Self::auto_populate(self.0.request, false);
1396 (*self.0.stub)
1397 .list_managed_folders(req, self.0.options)
1398 .await
1399 .map(crate::Response::into_body)
1400 }
1401
1402 pub fn by_page(
1404 self,
1405 ) -> impl google_cloud_gax::paginator::Paginator<
1406 crate::model::ListManagedFoldersResponse,
1407 crate::Error,
1408 > {
1409 use std::clone::Clone;
1410 let token = self.0.request.page_token.clone();
1411 let execute = move |token: String| {
1412 let mut builder = self.clone();
1413 let initial = builder.0.request.page_token == token;
1414 builder.0.request = Self::auto_populate(builder.0.request, !initial);
1415 builder.0.request = builder.0.request.set_page_token(token);
1416 builder.send()
1417 };
1418 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1419 }
1420
1421 pub fn by_item(
1423 self,
1424 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1425 crate::model::ListManagedFoldersResponse,
1426 crate::Error,
1427 > {
1428 use google_cloud_gax::paginator::Paginator;
1429 self.by_page().items()
1430 }
1431
1432 fn auto_populate(
1433 mut req: crate::model::ListManagedFoldersRequest,
1434 force: bool,
1435 ) -> crate::model::ListManagedFoldersRequest {
1436 if force || req.request_id.is_empty() {
1437 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1438 }
1439 req
1440 }
1441
1442 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1446 self.0.request.parent = v.into();
1447 self
1448 }
1449
1450 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1452 self.0.request.page_size = v.into();
1453 self
1454 }
1455
1456 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1458 self.0.request.page_token = v.into();
1459 self
1460 }
1461
1462 pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
1464 self.0.request.prefix = v.into();
1465 self
1466 }
1467
1468 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1470 self.0.request.request_id = v.into();
1471 self
1472 }
1473 }
1474
1475 #[doc(hidden)]
1476 impl crate::RequestBuilder for ListManagedFolders {
1477 fn request_options(&mut self) -> &mut crate::RequestOptions {
1478 &mut self.0.options
1479 }
1480 }
1481
1482 #[derive(Clone, Debug)]
1499 pub struct UpdateManagedFolder(RequestBuilder<crate::model::UpdateManagedFolderRequest>);
1500
1501 impl UpdateManagedFolder {
1502 pub(crate) fn new(
1503 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1504 ) -> Self {
1505 Self(RequestBuilder::new(stub))
1506 }
1507
1508 pub fn with_request<V: Into<crate::model::UpdateManagedFolderRequest>>(
1510 mut self,
1511 v: V,
1512 ) -> Self {
1513 self.0.request = v.into();
1514 self
1515 }
1516
1517 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1519 self.0.options = v.into();
1520 self
1521 }
1522
1523 pub async fn send(self) -> Result<crate::model::ManagedFolder> {
1525 let req = Self::auto_populate(self.0.request, false);
1526 (*self.0.stub)
1527 .update_managed_folder(req, self.0.options)
1528 .await
1529 .map(crate::Response::into_body)
1530 }
1531
1532 fn auto_populate(
1533 mut req: crate::model::UpdateManagedFolderRequest,
1534 force: bool,
1535 ) -> crate::model::UpdateManagedFolderRequest {
1536 if force || req.request_id.is_empty() {
1537 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1538 }
1539 req
1540 }
1541
1542 pub fn set_managed_folder<T>(mut self, v: T) -> Self
1546 where
1547 T: std::convert::Into<crate::model::ManagedFolder>,
1548 {
1549 self.0.request.managed_folder = std::option::Option::Some(v.into());
1550 self
1551 }
1552
1553 pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
1557 where
1558 T: std::convert::Into<crate::model::ManagedFolder>,
1559 {
1560 self.0.request.managed_folder = v.map(|x| x.into());
1561 self
1562 }
1563
1564 pub fn set_update_mask<T>(mut self, v: T) -> Self
1566 where
1567 T: std::convert::Into<wkt::FieldMask>,
1568 {
1569 self.0.request.update_mask = std::option::Option::Some(v.into());
1570 self
1571 }
1572
1573 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1575 where
1576 T: std::convert::Into<wkt::FieldMask>,
1577 {
1578 self.0.request.update_mask = v.map(|x| x.into());
1579 self
1580 }
1581
1582 pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1584 where
1585 T: std::convert::Into<i64>,
1586 {
1587 self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
1588 self
1589 }
1590
1591 pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1593 where
1594 T: std::convert::Into<i64>,
1595 {
1596 self.0.request.if_metageneration_match = v.map(|x| x.into());
1597 self
1598 }
1599
1600 pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1602 where
1603 T: std::convert::Into<i64>,
1604 {
1605 self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
1606 self
1607 }
1608
1609 pub fn set_or_clear_if_metageneration_not_match<T>(
1611 mut self,
1612 v: std::option::Option<T>,
1613 ) -> Self
1614 where
1615 T: std::convert::Into<i64>,
1616 {
1617 self.0.request.if_metageneration_not_match = v.map(|x| x.into());
1618 self
1619 }
1620
1621 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1623 self.0.request.request_id = v.into();
1624 self
1625 }
1626 }
1627
1628 #[doc(hidden)]
1629 impl crate::RequestBuilder for UpdateManagedFolder {
1630 fn request_options(&mut self) -> &mut crate::RequestOptions {
1631 &mut self.0.options
1632 }
1633 }
1634
1635 #[derive(Clone, Debug)]
1653 pub struct CreateAnywhereCache(RequestBuilder<crate::model::CreateAnywhereCacheRequest>);
1654
1655 impl CreateAnywhereCache {
1656 pub(crate) fn new(
1657 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1658 ) -> Self {
1659 Self(RequestBuilder::new(stub))
1660 }
1661
1662 pub fn with_request<V: Into<crate::model::CreateAnywhereCacheRequest>>(
1664 mut self,
1665 v: V,
1666 ) -> Self {
1667 self.0.request = v.into();
1668 self
1669 }
1670
1671 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1673 self.0.options = v.into();
1674 self
1675 }
1676
1677 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1684 let req = Self::auto_populate(self.0.request, false);
1685 (*self.0.stub)
1686 .create_anywhere_cache(req, self.0.options)
1687 .await
1688 .map(crate::Response::into_body)
1689 }
1690
1691 pub fn poller(
1693 self,
1694 ) -> impl google_cloud_lro::Poller<
1695 crate::model::AnywhereCache,
1696 crate::model::CreateAnywhereCacheMetadata,
1697 > {
1698 type Operation = google_cloud_lro::internal::Operation<
1699 crate::model::AnywhereCache,
1700 crate::model::CreateAnywhereCacheMetadata,
1701 >;
1702 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1703 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1704 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1705 if let Some(ref mut details) = poller_options.tracing {
1706 details.method_name = "google_cloud_storage::client::StorageControl::create_anywhere_cache::until_done";
1707 }
1708
1709 let stub = self.0.stub.clone();
1710 let mut options = self.0.options.clone();
1711 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1712 let query = move |name| {
1713 let stub = stub.clone();
1714 let options = options.clone();
1715 async {
1716 let op = GetOperation::new(stub)
1717 .set_name(name)
1718 .with_options(options)
1719 .send()
1720 .await?;
1721 Ok(Operation::new(op))
1722 }
1723 };
1724
1725 let start = move || async {
1726 let op = self.send().await?;
1727 Ok(Operation::new(op))
1728 };
1729
1730 use google_cloud_lro::internal::PollerExt;
1731 {
1732 google_cloud_lro::internal::new_poller(
1733 polling_error_policy,
1734 polling_backoff_policy,
1735 start,
1736 query,
1737 )
1738 }
1739 .with_options(poller_options)
1740 }
1741
1742 fn auto_populate(
1743 mut req: crate::model::CreateAnywhereCacheRequest,
1744 force: bool,
1745 ) -> crate::model::CreateAnywhereCacheRequest {
1746 if force || req.request_id.is_empty() {
1747 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1748 }
1749 req
1750 }
1751
1752 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1756 self.0.request.parent = v.into();
1757 self
1758 }
1759
1760 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1764 where
1765 T: std::convert::Into<crate::model::AnywhereCache>,
1766 {
1767 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1768 self
1769 }
1770
1771 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1775 where
1776 T: std::convert::Into<crate::model::AnywhereCache>,
1777 {
1778 self.0.request.anywhere_cache = v.map(|x| x.into());
1779 self
1780 }
1781
1782 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1784 self.0.request.request_id = v.into();
1785 self
1786 }
1787 }
1788
1789 #[doc(hidden)]
1790 impl crate::RequestBuilder for CreateAnywhereCache {
1791 fn request_options(&mut self) -> &mut crate::RequestOptions {
1792 &mut self.0.options
1793 }
1794 }
1795
1796 #[derive(Clone, Debug)]
1814 pub struct UpdateAnywhereCache(RequestBuilder<crate::model::UpdateAnywhereCacheRequest>);
1815
1816 impl UpdateAnywhereCache {
1817 pub(crate) fn new(
1818 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1819 ) -> Self {
1820 Self(RequestBuilder::new(stub))
1821 }
1822
1823 pub fn with_request<V: Into<crate::model::UpdateAnywhereCacheRequest>>(
1825 mut self,
1826 v: V,
1827 ) -> Self {
1828 self.0.request = v.into();
1829 self
1830 }
1831
1832 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1834 self.0.options = v.into();
1835 self
1836 }
1837
1838 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1845 let req = Self::auto_populate(self.0.request, false);
1846 (*self.0.stub)
1847 .update_anywhere_cache(req, self.0.options)
1848 .await
1849 .map(crate::Response::into_body)
1850 }
1851
1852 pub fn poller(
1854 self,
1855 ) -> impl google_cloud_lro::Poller<
1856 crate::model::AnywhereCache,
1857 crate::model::UpdateAnywhereCacheMetadata,
1858 > {
1859 type Operation = google_cloud_lro::internal::Operation<
1860 crate::model::AnywhereCache,
1861 crate::model::UpdateAnywhereCacheMetadata,
1862 >;
1863 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1864 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1865 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1866 if let Some(ref mut details) = poller_options.tracing {
1867 details.method_name = "google_cloud_storage::client::StorageControl::update_anywhere_cache::until_done";
1868 }
1869
1870 let stub = self.0.stub.clone();
1871 let mut options = self.0.options.clone();
1872 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1873 let query = move |name| {
1874 let stub = stub.clone();
1875 let options = options.clone();
1876 async {
1877 let op = GetOperation::new(stub)
1878 .set_name(name)
1879 .with_options(options)
1880 .send()
1881 .await?;
1882 Ok(Operation::new(op))
1883 }
1884 };
1885
1886 let start = move || async {
1887 let op = self.send().await?;
1888 Ok(Operation::new(op))
1889 };
1890
1891 use google_cloud_lro::internal::PollerExt;
1892 {
1893 google_cloud_lro::internal::new_poller(
1894 polling_error_policy,
1895 polling_backoff_policy,
1896 start,
1897 query,
1898 )
1899 }
1900 .with_options(poller_options)
1901 }
1902
1903 fn auto_populate(
1904 mut req: crate::model::UpdateAnywhereCacheRequest,
1905 force: bool,
1906 ) -> crate::model::UpdateAnywhereCacheRequest {
1907 if force || req.request_id.is_empty() {
1908 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
1909 }
1910 req
1911 }
1912
1913 pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1917 where
1918 T: std::convert::Into<crate::model::AnywhereCache>,
1919 {
1920 self.0.request.anywhere_cache = std::option::Option::Some(v.into());
1921 self
1922 }
1923
1924 pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1928 where
1929 T: std::convert::Into<crate::model::AnywhereCache>,
1930 {
1931 self.0.request.anywhere_cache = v.map(|x| x.into());
1932 self
1933 }
1934
1935 pub fn set_update_mask<T>(mut self, v: T) -> Self
1939 where
1940 T: std::convert::Into<wkt::FieldMask>,
1941 {
1942 self.0.request.update_mask = std::option::Option::Some(v.into());
1943 self
1944 }
1945
1946 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1950 where
1951 T: std::convert::Into<wkt::FieldMask>,
1952 {
1953 self.0.request.update_mask = v.map(|x| x.into());
1954 self
1955 }
1956
1957 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1959 self.0.request.request_id = v.into();
1960 self
1961 }
1962 }
1963
1964 #[doc(hidden)]
1965 impl crate::RequestBuilder for UpdateAnywhereCache {
1966 fn request_options(&mut self) -> &mut crate::RequestOptions {
1967 &mut self.0.options
1968 }
1969 }
1970
1971 #[derive(Clone, Debug)]
1988 pub struct DisableAnywhereCache(RequestBuilder<crate::model::DisableAnywhereCacheRequest>);
1989
1990 impl DisableAnywhereCache {
1991 pub(crate) fn new(
1992 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
1993 ) -> Self {
1994 Self(RequestBuilder::new(stub))
1995 }
1996
1997 pub fn with_request<V: Into<crate::model::DisableAnywhereCacheRequest>>(
1999 mut self,
2000 v: V,
2001 ) -> Self {
2002 self.0.request = v.into();
2003 self
2004 }
2005
2006 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2008 self.0.options = v.into();
2009 self
2010 }
2011
2012 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2014 let req = Self::auto_populate(self.0.request, false);
2015 (*self.0.stub)
2016 .disable_anywhere_cache(req, self.0.options)
2017 .await
2018 .map(crate::Response::into_body)
2019 }
2020
2021 fn auto_populate(
2022 mut req: crate::model::DisableAnywhereCacheRequest,
2023 force: bool,
2024 ) -> crate::model::DisableAnywhereCacheRequest {
2025 if force || req.request_id.is_empty() {
2026 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2027 }
2028 req
2029 }
2030
2031 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2035 self.0.request.name = v.into();
2036 self
2037 }
2038
2039 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2041 self.0.request.request_id = v.into();
2042 self
2043 }
2044 }
2045
2046 #[doc(hidden)]
2047 impl crate::RequestBuilder for DisableAnywhereCache {
2048 fn request_options(&mut self) -> &mut crate::RequestOptions {
2049 &mut self.0.options
2050 }
2051 }
2052
2053 #[derive(Clone, Debug)]
2070 pub struct PauseAnywhereCache(RequestBuilder<crate::model::PauseAnywhereCacheRequest>);
2071
2072 impl PauseAnywhereCache {
2073 pub(crate) fn new(
2074 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2075 ) -> Self {
2076 Self(RequestBuilder::new(stub))
2077 }
2078
2079 pub fn with_request<V: Into<crate::model::PauseAnywhereCacheRequest>>(
2081 mut self,
2082 v: V,
2083 ) -> Self {
2084 self.0.request = v.into();
2085 self
2086 }
2087
2088 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2090 self.0.options = v.into();
2091 self
2092 }
2093
2094 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2096 let req = Self::auto_populate(self.0.request, false);
2097 (*self.0.stub)
2098 .pause_anywhere_cache(req, self.0.options)
2099 .await
2100 .map(crate::Response::into_body)
2101 }
2102
2103 fn auto_populate(
2104 mut req: crate::model::PauseAnywhereCacheRequest,
2105 force: bool,
2106 ) -> crate::model::PauseAnywhereCacheRequest {
2107 if force || req.request_id.is_empty() {
2108 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2109 }
2110 req
2111 }
2112
2113 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2117 self.0.request.name = v.into();
2118 self
2119 }
2120
2121 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2123 self.0.request.request_id = v.into();
2124 self
2125 }
2126 }
2127
2128 #[doc(hidden)]
2129 impl crate::RequestBuilder for PauseAnywhereCache {
2130 fn request_options(&mut self) -> &mut crate::RequestOptions {
2131 &mut self.0.options
2132 }
2133 }
2134
2135 #[derive(Clone, Debug)]
2152 pub struct ResumeAnywhereCache(RequestBuilder<crate::model::ResumeAnywhereCacheRequest>);
2153
2154 impl ResumeAnywhereCache {
2155 pub(crate) fn new(
2156 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2157 ) -> Self {
2158 Self(RequestBuilder::new(stub))
2159 }
2160
2161 pub fn with_request<V: Into<crate::model::ResumeAnywhereCacheRequest>>(
2163 mut self,
2164 v: V,
2165 ) -> Self {
2166 self.0.request = v.into();
2167 self
2168 }
2169
2170 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2172 self.0.options = v.into();
2173 self
2174 }
2175
2176 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2178 let req = Self::auto_populate(self.0.request, false);
2179 (*self.0.stub)
2180 .resume_anywhere_cache(req, self.0.options)
2181 .await
2182 .map(crate::Response::into_body)
2183 }
2184
2185 fn auto_populate(
2186 mut req: crate::model::ResumeAnywhereCacheRequest,
2187 force: bool,
2188 ) -> crate::model::ResumeAnywhereCacheRequest {
2189 if force || req.request_id.is_empty() {
2190 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2191 }
2192 req
2193 }
2194
2195 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2199 self.0.request.name = v.into();
2200 self
2201 }
2202
2203 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2205 self.0.request.request_id = v.into();
2206 self
2207 }
2208 }
2209
2210 #[doc(hidden)]
2211 impl crate::RequestBuilder for ResumeAnywhereCache {
2212 fn request_options(&mut self) -> &mut crate::RequestOptions {
2213 &mut self.0.options
2214 }
2215 }
2216
2217 #[derive(Clone, Debug)]
2234 pub struct GetAnywhereCache(RequestBuilder<crate::model::GetAnywhereCacheRequest>);
2235
2236 impl GetAnywhereCache {
2237 pub(crate) fn new(
2238 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2239 ) -> Self {
2240 Self(RequestBuilder::new(stub))
2241 }
2242
2243 pub fn with_request<V: Into<crate::model::GetAnywhereCacheRequest>>(
2245 mut self,
2246 v: V,
2247 ) -> Self {
2248 self.0.request = v.into();
2249 self
2250 }
2251
2252 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2254 self.0.options = v.into();
2255 self
2256 }
2257
2258 pub async fn send(self) -> Result<crate::model::AnywhereCache> {
2260 let req = Self::auto_populate(self.0.request, false);
2261 (*self.0.stub)
2262 .get_anywhere_cache(req, self.0.options)
2263 .await
2264 .map(crate::Response::into_body)
2265 }
2266
2267 fn auto_populate(
2268 mut req: crate::model::GetAnywhereCacheRequest,
2269 force: bool,
2270 ) -> crate::model::GetAnywhereCacheRequest {
2271 if force || req.request_id.is_empty() {
2272 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2273 }
2274 req
2275 }
2276
2277 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2281 self.0.request.name = v.into();
2282 self
2283 }
2284
2285 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2287 self.0.request.request_id = v.into();
2288 self
2289 }
2290 }
2291
2292 #[doc(hidden)]
2293 impl crate::RequestBuilder for GetAnywhereCache {
2294 fn request_options(&mut self) -> &mut crate::RequestOptions {
2295 &mut self.0.options
2296 }
2297 }
2298
2299 #[derive(Clone, Debug)]
2320 pub struct ListAnywhereCaches(RequestBuilder<crate::model::ListAnywhereCachesRequest>);
2321
2322 impl ListAnywhereCaches {
2323 pub(crate) fn new(
2324 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2325 ) -> Self {
2326 Self(RequestBuilder::new(stub))
2327 }
2328
2329 pub fn with_request<V: Into<crate::model::ListAnywhereCachesRequest>>(
2331 mut self,
2332 v: V,
2333 ) -> Self {
2334 self.0.request = v.into();
2335 self
2336 }
2337
2338 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2340 self.0.options = v.into();
2341 self
2342 }
2343
2344 pub async fn send(self) -> Result<crate::model::ListAnywhereCachesResponse> {
2346 let req = Self::auto_populate(self.0.request, false);
2347 (*self.0.stub)
2348 .list_anywhere_caches(req, self.0.options)
2349 .await
2350 .map(crate::Response::into_body)
2351 }
2352
2353 pub fn by_page(
2355 self,
2356 ) -> impl google_cloud_gax::paginator::Paginator<
2357 crate::model::ListAnywhereCachesResponse,
2358 crate::Error,
2359 > {
2360 use std::clone::Clone;
2361 let token = self.0.request.page_token.clone();
2362 let execute = move |token: String| {
2363 let mut builder = self.clone();
2364 let initial = builder.0.request.page_token == token;
2365 builder.0.request = Self::auto_populate(builder.0.request, !initial);
2366 builder.0.request = builder.0.request.set_page_token(token);
2367 builder.send()
2368 };
2369 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2370 }
2371
2372 pub fn by_item(
2374 self,
2375 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2376 crate::model::ListAnywhereCachesResponse,
2377 crate::Error,
2378 > {
2379 use google_cloud_gax::paginator::Paginator;
2380 self.by_page().items()
2381 }
2382
2383 fn auto_populate(
2384 mut req: crate::model::ListAnywhereCachesRequest,
2385 force: bool,
2386 ) -> crate::model::ListAnywhereCachesRequest {
2387 if force || req.request_id.is_empty() {
2388 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2389 }
2390 req
2391 }
2392
2393 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2397 self.0.request.parent = v.into();
2398 self
2399 }
2400
2401 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2403 self.0.request.page_size = v.into();
2404 self
2405 }
2406
2407 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2409 self.0.request.page_token = v.into();
2410 self
2411 }
2412
2413 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2415 self.0.request.request_id = v.into();
2416 self
2417 }
2418 }
2419
2420 #[doc(hidden)]
2421 impl crate::RequestBuilder for ListAnywhereCaches {
2422 fn request_options(&mut self) -> &mut crate::RequestOptions {
2423 &mut self.0.options
2424 }
2425 }
2426
2427 #[derive(Clone, Debug)]
2445 pub struct CreateRapidCache(RequestBuilder<crate::model::CreateRapidCacheRequest>);
2446
2447 impl CreateRapidCache {
2448 pub(crate) fn new(
2449 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2450 ) -> Self {
2451 Self(RequestBuilder::new(stub))
2452 }
2453
2454 pub fn with_request<V: Into<crate::model::CreateRapidCacheRequest>>(
2456 mut self,
2457 v: V,
2458 ) -> Self {
2459 self.0.request = v.into();
2460 self
2461 }
2462
2463 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2465 self.0.options = v.into();
2466 self
2467 }
2468
2469 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2476 let req = Self::auto_populate(self.0.request, false);
2477 (*self.0.stub)
2478 .create_rapid_cache(req, self.0.options)
2479 .await
2480 .map(crate::Response::into_body)
2481 }
2482
2483 pub fn poller(
2485 self,
2486 ) -> impl google_cloud_lro::Poller<
2487 crate::model::RapidCache,
2488 crate::model::CreateRapidCacheMetadata,
2489 > {
2490 type Operation = google_cloud_lro::internal::Operation<
2491 crate::model::RapidCache,
2492 crate::model::CreateRapidCacheMetadata,
2493 >;
2494 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2495 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2496 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2497 if let Some(ref mut details) = poller_options.tracing {
2498 details.method_name =
2499 "google_cloud_storage::client::StorageControl::create_rapid_cache::until_done";
2500 }
2501
2502 let stub = self.0.stub.clone();
2503 let mut options = self.0.options.clone();
2504 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2505 let query = move |name| {
2506 let stub = stub.clone();
2507 let options = options.clone();
2508 async {
2509 let op = GetOperation::new(stub)
2510 .set_name(name)
2511 .with_options(options)
2512 .send()
2513 .await?;
2514 Ok(Operation::new(op))
2515 }
2516 };
2517
2518 let start = move || async {
2519 let op = self.send().await?;
2520 Ok(Operation::new(op))
2521 };
2522
2523 use google_cloud_lro::internal::PollerExt;
2524 {
2525 google_cloud_lro::internal::new_poller(
2526 polling_error_policy,
2527 polling_backoff_policy,
2528 start,
2529 query,
2530 )
2531 }
2532 .with_options(poller_options)
2533 }
2534
2535 fn auto_populate(
2536 mut req: crate::model::CreateRapidCacheRequest,
2537 force: bool,
2538 ) -> crate::model::CreateRapidCacheRequest {
2539 if force || req.request_id.is_empty() {
2540 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2541 }
2542 req
2543 }
2544
2545 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2549 self.0.request.parent = v.into();
2550 self
2551 }
2552
2553 pub fn set_rapid_cache<T>(mut self, v: T) -> Self
2557 where
2558 T: std::convert::Into<crate::model::RapidCache>,
2559 {
2560 self.0.request.rapid_cache = std::option::Option::Some(v.into());
2561 self
2562 }
2563
2564 pub fn set_or_clear_rapid_cache<T>(mut self, v: std::option::Option<T>) -> Self
2568 where
2569 T: std::convert::Into<crate::model::RapidCache>,
2570 {
2571 self.0.request.rapid_cache = v.map(|x| x.into());
2572 self
2573 }
2574
2575 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2577 self.0.request.request_id = v.into();
2578 self
2579 }
2580 }
2581
2582 #[doc(hidden)]
2583 impl crate::RequestBuilder for CreateRapidCache {
2584 fn request_options(&mut self) -> &mut crate::RequestOptions {
2585 &mut self.0.options
2586 }
2587 }
2588
2589 #[derive(Clone, Debug)]
2607 pub struct UpdateRapidCache(RequestBuilder<crate::model::UpdateRapidCacheRequest>);
2608
2609 impl UpdateRapidCache {
2610 pub(crate) fn new(
2611 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2612 ) -> Self {
2613 Self(RequestBuilder::new(stub))
2614 }
2615
2616 pub fn with_request<V: Into<crate::model::UpdateRapidCacheRequest>>(
2618 mut self,
2619 v: V,
2620 ) -> Self {
2621 self.0.request = v.into();
2622 self
2623 }
2624
2625 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2627 self.0.options = v.into();
2628 self
2629 }
2630
2631 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2638 let req = Self::auto_populate(self.0.request, false);
2639 (*self.0.stub)
2640 .update_rapid_cache(req, self.0.options)
2641 .await
2642 .map(crate::Response::into_body)
2643 }
2644
2645 pub fn poller(
2647 self,
2648 ) -> impl google_cloud_lro::Poller<
2649 crate::model::RapidCache,
2650 crate::model::UpdateRapidCacheMetadata,
2651 > {
2652 type Operation = google_cloud_lro::internal::Operation<
2653 crate::model::RapidCache,
2654 crate::model::UpdateRapidCacheMetadata,
2655 >;
2656 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2657 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2658 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2659 if let Some(ref mut details) = poller_options.tracing {
2660 details.method_name =
2661 "google_cloud_storage::client::StorageControl::update_rapid_cache::until_done";
2662 }
2663
2664 let stub = self.0.stub.clone();
2665 let mut options = self.0.options.clone();
2666 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2667 let query = move |name| {
2668 let stub = stub.clone();
2669 let options = options.clone();
2670 async {
2671 let op = GetOperation::new(stub)
2672 .set_name(name)
2673 .with_options(options)
2674 .send()
2675 .await?;
2676 Ok(Operation::new(op))
2677 }
2678 };
2679
2680 let start = move || async {
2681 let op = self.send().await?;
2682 Ok(Operation::new(op))
2683 };
2684
2685 use google_cloud_lro::internal::PollerExt;
2686 {
2687 google_cloud_lro::internal::new_poller(
2688 polling_error_policy,
2689 polling_backoff_policy,
2690 start,
2691 query,
2692 )
2693 }
2694 .with_options(poller_options)
2695 }
2696
2697 fn auto_populate(
2698 mut req: crate::model::UpdateRapidCacheRequest,
2699 force: bool,
2700 ) -> crate::model::UpdateRapidCacheRequest {
2701 if force || req.request_id.is_empty() {
2702 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2703 }
2704 req
2705 }
2706
2707 pub fn set_rapid_cache<T>(mut self, v: T) -> Self
2711 where
2712 T: std::convert::Into<crate::model::RapidCache>,
2713 {
2714 self.0.request.rapid_cache = std::option::Option::Some(v.into());
2715 self
2716 }
2717
2718 pub fn set_or_clear_rapid_cache<T>(mut self, v: std::option::Option<T>) -> Self
2722 where
2723 T: std::convert::Into<crate::model::RapidCache>,
2724 {
2725 self.0.request.rapid_cache = v.map(|x| x.into());
2726 self
2727 }
2728
2729 pub fn set_update_mask<T>(mut self, v: T) -> Self
2733 where
2734 T: std::convert::Into<wkt::FieldMask>,
2735 {
2736 self.0.request.update_mask = std::option::Option::Some(v.into());
2737 self
2738 }
2739
2740 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2744 where
2745 T: std::convert::Into<wkt::FieldMask>,
2746 {
2747 self.0.request.update_mask = v.map(|x| x.into());
2748 self
2749 }
2750
2751 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2753 self.0.request.request_id = v.into();
2754 self
2755 }
2756 }
2757
2758 #[doc(hidden)]
2759 impl crate::RequestBuilder for UpdateRapidCache {
2760 fn request_options(&mut self) -> &mut crate::RequestOptions {
2761 &mut self.0.options
2762 }
2763 }
2764
2765 #[derive(Clone, Debug)]
2783 pub struct DisableRapidCache(RequestBuilder<crate::model::DisableRapidCacheRequest>);
2784
2785 impl DisableRapidCache {
2786 pub(crate) fn new(
2787 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2788 ) -> Self {
2789 Self(RequestBuilder::new(stub))
2790 }
2791
2792 pub fn with_request<V: Into<crate::model::DisableRapidCacheRequest>>(
2794 mut self,
2795 v: V,
2796 ) -> Self {
2797 self.0.request = v.into();
2798 self
2799 }
2800
2801 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2803 self.0.options = v.into();
2804 self
2805 }
2806
2807 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2814 let req = Self::auto_populate(self.0.request, false);
2815 (*self.0.stub)
2816 .disable_rapid_cache(req, self.0.options)
2817 .await
2818 .map(crate::Response::into_body)
2819 }
2820
2821 pub fn poller(
2823 self,
2824 ) -> impl google_cloud_lro::Poller<
2825 crate::model::RapidCache,
2826 crate::model::DisableRapidCacheMetadata,
2827 > {
2828 type Operation = google_cloud_lro::internal::Operation<
2829 crate::model::RapidCache,
2830 crate::model::DisableRapidCacheMetadata,
2831 >;
2832 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2833 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2834 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2835 if let Some(ref mut details) = poller_options.tracing {
2836 details.method_name =
2837 "google_cloud_storage::client::StorageControl::disable_rapid_cache::until_done";
2838 }
2839
2840 let stub = self.0.stub.clone();
2841 let mut options = self.0.options.clone();
2842 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2843 let query = move |name| {
2844 let stub = stub.clone();
2845 let options = options.clone();
2846 async {
2847 let op = GetOperation::new(stub)
2848 .set_name(name)
2849 .with_options(options)
2850 .send()
2851 .await?;
2852 Ok(Operation::new(op))
2853 }
2854 };
2855
2856 let start = move || async {
2857 let op = self.send().await?;
2858 Ok(Operation::new(op))
2859 };
2860
2861 use google_cloud_lro::internal::PollerExt;
2862 {
2863 google_cloud_lro::internal::new_poller(
2864 polling_error_policy,
2865 polling_backoff_policy,
2866 start,
2867 query,
2868 )
2869 }
2870 .with_options(poller_options)
2871 }
2872
2873 fn auto_populate(
2874 mut req: crate::model::DisableRapidCacheRequest,
2875 force: bool,
2876 ) -> crate::model::DisableRapidCacheRequest {
2877 if force || req.request_id.is_empty() {
2878 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2879 }
2880 req
2881 }
2882
2883 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2887 self.0.request.name = v.into();
2888 self
2889 }
2890
2891 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2893 self.0.request.request_id = v.into();
2894 self
2895 }
2896 }
2897
2898 #[doc(hidden)]
2899 impl crate::RequestBuilder for DisableRapidCache {
2900 fn request_options(&mut self) -> &mut crate::RequestOptions {
2901 &mut self.0.options
2902 }
2903 }
2904
2905 #[derive(Clone, Debug)]
2922 pub struct GetRapidCache(RequestBuilder<crate::model::GetRapidCacheRequest>);
2923
2924 impl GetRapidCache {
2925 pub(crate) fn new(
2926 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
2927 ) -> Self {
2928 Self(RequestBuilder::new(stub))
2929 }
2930
2931 pub fn with_request<V: Into<crate::model::GetRapidCacheRequest>>(mut self, v: V) -> Self {
2933 self.0.request = v.into();
2934 self
2935 }
2936
2937 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2939 self.0.options = v.into();
2940 self
2941 }
2942
2943 pub async fn send(self) -> Result<crate::model::RapidCache> {
2945 let req = Self::auto_populate(self.0.request, false);
2946 (*self.0.stub)
2947 .get_rapid_cache(req, self.0.options)
2948 .await
2949 .map(crate::Response::into_body)
2950 }
2951
2952 fn auto_populate(
2953 mut req: crate::model::GetRapidCacheRequest,
2954 force: bool,
2955 ) -> crate::model::GetRapidCacheRequest {
2956 if force || req.request_id.is_empty() {
2957 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
2958 }
2959 req
2960 }
2961
2962 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2966 self.0.request.name = v.into();
2967 self
2968 }
2969
2970 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2972 self.0.request.request_id = v.into();
2973 self
2974 }
2975 }
2976
2977 #[doc(hidden)]
2978 impl crate::RequestBuilder for GetRapidCache {
2979 fn request_options(&mut self) -> &mut crate::RequestOptions {
2980 &mut self.0.options
2981 }
2982 }
2983
2984 #[derive(Clone, Debug)]
3005 pub struct ListRapidCaches(RequestBuilder<crate::model::ListRapidCachesRequest>);
3006
3007 impl ListRapidCaches {
3008 pub(crate) fn new(
3009 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3010 ) -> Self {
3011 Self(RequestBuilder::new(stub))
3012 }
3013
3014 pub fn with_request<V: Into<crate::model::ListRapidCachesRequest>>(mut self, v: V) -> Self {
3016 self.0.request = v.into();
3017 self
3018 }
3019
3020 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3022 self.0.options = v.into();
3023 self
3024 }
3025
3026 pub async fn send(self) -> Result<crate::model::ListRapidCachesResponse> {
3028 let req = Self::auto_populate(self.0.request, false);
3029 (*self.0.stub)
3030 .list_rapid_caches(req, self.0.options)
3031 .await
3032 .map(crate::Response::into_body)
3033 }
3034
3035 pub fn by_page(
3037 self,
3038 ) -> impl google_cloud_gax::paginator::Paginator<
3039 crate::model::ListRapidCachesResponse,
3040 crate::Error,
3041 > {
3042 use std::clone::Clone;
3043 let token = self.0.request.page_token.clone();
3044 let execute = move |token: String| {
3045 let mut builder = self.clone();
3046 let initial = builder.0.request.page_token == token;
3047 builder.0.request = Self::auto_populate(builder.0.request, !initial);
3048 builder.0.request = builder.0.request.set_page_token(token);
3049 builder.send()
3050 };
3051 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3052 }
3053
3054 pub fn by_item(
3056 self,
3057 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3058 crate::model::ListRapidCachesResponse,
3059 crate::Error,
3060 > {
3061 use google_cloud_gax::paginator::Paginator;
3062 self.by_page().items()
3063 }
3064
3065 fn auto_populate(
3066 mut req: crate::model::ListRapidCachesRequest,
3067 force: bool,
3068 ) -> crate::model::ListRapidCachesRequest {
3069 if force || req.request_id.is_empty() {
3070 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
3071 }
3072 req
3073 }
3074
3075 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3079 self.0.request.parent = v.into();
3080 self
3081 }
3082
3083 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3085 self.0.request.page_size = v.into();
3086 self
3087 }
3088
3089 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3091 self.0.request.page_token = v.into();
3092 self
3093 }
3094
3095 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3097 self.0.request.request_id = v.into();
3098 self
3099 }
3100 }
3101
3102 #[doc(hidden)]
3103 impl crate::RequestBuilder for ListRapidCaches {
3104 fn request_options(&mut self) -> &mut crate::RequestOptions {
3105 &mut self.0.options
3106 }
3107 }
3108
3109 #[derive(Clone, Debug)]
3126 pub struct GetProjectIntelligenceConfig(
3127 RequestBuilder<crate::model::GetProjectIntelligenceConfigRequest>,
3128 );
3129
3130 impl GetProjectIntelligenceConfig {
3131 pub(crate) fn new(
3132 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3133 ) -> Self {
3134 Self(RequestBuilder::new(stub))
3135 }
3136
3137 pub fn with_request<V: Into<crate::model::GetProjectIntelligenceConfigRequest>>(
3139 mut self,
3140 v: V,
3141 ) -> Self {
3142 self.0.request = v.into();
3143 self
3144 }
3145
3146 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3148 self.0.options = v.into();
3149 self
3150 }
3151
3152 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3154 (*self.0.stub)
3155 .get_project_intelligence_config(self.0.request, self.0.options)
3156 .await
3157 .map(crate::Response::into_body)
3158 }
3159
3160 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3164 self.0.request.name = v.into();
3165 self
3166 }
3167 }
3168
3169 #[doc(hidden)]
3170 impl crate::RequestBuilder for GetProjectIntelligenceConfig {
3171 fn request_options(&mut self) -> &mut crate::RequestOptions {
3172 &mut self.0.options
3173 }
3174 }
3175
3176 #[derive(Clone, Debug)]
3193 pub struct UpdateProjectIntelligenceConfig(
3194 RequestBuilder<crate::model::UpdateProjectIntelligenceConfigRequest>,
3195 );
3196
3197 impl UpdateProjectIntelligenceConfig {
3198 pub(crate) fn new(
3199 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3200 ) -> Self {
3201 Self(RequestBuilder::new(stub))
3202 }
3203
3204 pub fn with_request<V: Into<crate::model::UpdateProjectIntelligenceConfigRequest>>(
3206 mut self,
3207 v: V,
3208 ) -> Self {
3209 self.0.request = v.into();
3210 self
3211 }
3212
3213 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3215 self.0.options = v.into();
3216 self
3217 }
3218
3219 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3221 let req = Self::auto_populate(self.0.request, false);
3222 (*self.0.stub)
3223 .update_project_intelligence_config(req, self.0.options)
3224 .await
3225 .map(crate::Response::into_body)
3226 }
3227
3228 fn auto_populate(
3229 mut req: crate::model::UpdateProjectIntelligenceConfigRequest,
3230 force: bool,
3231 ) -> crate::model::UpdateProjectIntelligenceConfigRequest {
3232 if force || req.request_id.is_empty() {
3233 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
3234 }
3235 req
3236 }
3237
3238 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3242 where
3243 T: std::convert::Into<crate::model::IntelligenceConfig>,
3244 {
3245 self.0.request.intelligence_config = std::option::Option::Some(v.into());
3246 self
3247 }
3248
3249 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3253 where
3254 T: std::convert::Into<crate::model::IntelligenceConfig>,
3255 {
3256 self.0.request.intelligence_config = v.map(|x| x.into());
3257 self
3258 }
3259
3260 pub fn set_update_mask<T>(mut self, v: T) -> Self
3264 where
3265 T: std::convert::Into<wkt::FieldMask>,
3266 {
3267 self.0.request.update_mask = std::option::Option::Some(v.into());
3268 self
3269 }
3270
3271 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3275 where
3276 T: std::convert::Into<wkt::FieldMask>,
3277 {
3278 self.0.request.update_mask = v.map(|x| x.into());
3279 self
3280 }
3281
3282 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3284 self.0.request.request_id = v.into();
3285 self
3286 }
3287 }
3288
3289 #[doc(hidden)]
3290 impl crate::RequestBuilder for UpdateProjectIntelligenceConfig {
3291 fn request_options(&mut self) -> &mut crate::RequestOptions {
3292 &mut self.0.options
3293 }
3294 }
3295
3296 #[derive(Clone, Debug)]
3313 pub struct GetFolderIntelligenceConfig(
3314 RequestBuilder<crate::model::GetFolderIntelligenceConfigRequest>,
3315 );
3316
3317 impl GetFolderIntelligenceConfig {
3318 pub(crate) fn new(
3319 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3320 ) -> Self {
3321 Self(RequestBuilder::new(stub))
3322 }
3323
3324 pub fn with_request<V: Into<crate::model::GetFolderIntelligenceConfigRequest>>(
3326 mut self,
3327 v: V,
3328 ) -> Self {
3329 self.0.request = v.into();
3330 self
3331 }
3332
3333 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3335 self.0.options = v.into();
3336 self
3337 }
3338
3339 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3341 (*self.0.stub)
3342 .get_folder_intelligence_config(self.0.request, self.0.options)
3343 .await
3344 .map(crate::Response::into_body)
3345 }
3346
3347 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3351 self.0.request.name = v.into();
3352 self
3353 }
3354 }
3355
3356 #[doc(hidden)]
3357 impl crate::RequestBuilder for GetFolderIntelligenceConfig {
3358 fn request_options(&mut self) -> &mut crate::RequestOptions {
3359 &mut self.0.options
3360 }
3361 }
3362
3363 #[derive(Clone, Debug)]
3380 pub struct UpdateFolderIntelligenceConfig(
3381 RequestBuilder<crate::model::UpdateFolderIntelligenceConfigRequest>,
3382 );
3383
3384 impl UpdateFolderIntelligenceConfig {
3385 pub(crate) fn new(
3386 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3387 ) -> Self {
3388 Self(RequestBuilder::new(stub))
3389 }
3390
3391 pub fn with_request<V: Into<crate::model::UpdateFolderIntelligenceConfigRequest>>(
3393 mut self,
3394 v: V,
3395 ) -> Self {
3396 self.0.request = v.into();
3397 self
3398 }
3399
3400 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3402 self.0.options = v.into();
3403 self
3404 }
3405
3406 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3408 let req = Self::auto_populate(self.0.request, false);
3409 (*self.0.stub)
3410 .update_folder_intelligence_config(req, self.0.options)
3411 .await
3412 .map(crate::Response::into_body)
3413 }
3414
3415 fn auto_populate(
3416 mut req: crate::model::UpdateFolderIntelligenceConfigRequest,
3417 force: bool,
3418 ) -> crate::model::UpdateFolderIntelligenceConfigRequest {
3419 if force || req.request_id.is_empty() {
3420 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
3421 }
3422 req
3423 }
3424
3425 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3429 where
3430 T: std::convert::Into<crate::model::IntelligenceConfig>,
3431 {
3432 self.0.request.intelligence_config = std::option::Option::Some(v.into());
3433 self
3434 }
3435
3436 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3440 where
3441 T: std::convert::Into<crate::model::IntelligenceConfig>,
3442 {
3443 self.0.request.intelligence_config = v.map(|x| x.into());
3444 self
3445 }
3446
3447 pub fn set_update_mask<T>(mut self, v: T) -> Self
3451 where
3452 T: std::convert::Into<wkt::FieldMask>,
3453 {
3454 self.0.request.update_mask = std::option::Option::Some(v.into());
3455 self
3456 }
3457
3458 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3462 where
3463 T: std::convert::Into<wkt::FieldMask>,
3464 {
3465 self.0.request.update_mask = v.map(|x| x.into());
3466 self
3467 }
3468
3469 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3471 self.0.request.request_id = v.into();
3472 self
3473 }
3474 }
3475
3476 #[doc(hidden)]
3477 impl crate::RequestBuilder for UpdateFolderIntelligenceConfig {
3478 fn request_options(&mut self) -> &mut crate::RequestOptions {
3479 &mut self.0.options
3480 }
3481 }
3482
3483 #[derive(Clone, Debug)]
3500 pub struct GetOrganizationIntelligenceConfig(
3501 RequestBuilder<crate::model::GetOrganizationIntelligenceConfigRequest>,
3502 );
3503
3504 impl GetOrganizationIntelligenceConfig {
3505 pub(crate) fn new(
3506 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3507 ) -> Self {
3508 Self(RequestBuilder::new(stub))
3509 }
3510
3511 pub fn with_request<V: Into<crate::model::GetOrganizationIntelligenceConfigRequest>>(
3513 mut self,
3514 v: V,
3515 ) -> Self {
3516 self.0.request = v.into();
3517 self
3518 }
3519
3520 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3522 self.0.options = v.into();
3523 self
3524 }
3525
3526 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3528 (*self.0.stub)
3529 .get_organization_intelligence_config(self.0.request, self.0.options)
3530 .await
3531 .map(crate::Response::into_body)
3532 }
3533
3534 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3538 self.0.request.name = v.into();
3539 self
3540 }
3541 }
3542
3543 #[doc(hidden)]
3544 impl crate::RequestBuilder for GetOrganizationIntelligenceConfig {
3545 fn request_options(&mut self) -> &mut crate::RequestOptions {
3546 &mut self.0.options
3547 }
3548 }
3549
3550 #[derive(Clone, Debug)]
3567 pub struct UpdateOrganizationIntelligenceConfig(
3568 RequestBuilder<crate::model::UpdateOrganizationIntelligenceConfigRequest>,
3569 );
3570
3571 impl UpdateOrganizationIntelligenceConfig {
3572 pub(crate) fn new(
3573 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3574 ) -> Self {
3575 Self(RequestBuilder::new(stub))
3576 }
3577
3578 pub fn with_request<V: Into<crate::model::UpdateOrganizationIntelligenceConfigRequest>>(
3580 mut self,
3581 v: V,
3582 ) -> Self {
3583 self.0.request = v.into();
3584 self
3585 }
3586
3587 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3589 self.0.options = v.into();
3590 self
3591 }
3592
3593 pub async fn send(self) -> Result<crate::model::IntelligenceConfig> {
3595 let req = Self::auto_populate(self.0.request, false);
3596 (*self.0.stub)
3597 .update_organization_intelligence_config(req, self.0.options)
3598 .await
3599 .map(crate::Response::into_body)
3600 }
3601
3602 fn auto_populate(
3603 mut req: crate::model::UpdateOrganizationIntelligenceConfigRequest,
3604 force: bool,
3605 ) -> crate::model::UpdateOrganizationIntelligenceConfigRequest {
3606 if force || req.request_id.is_empty() {
3607 req = req.set_request_id(uuid::Uuid::new_v4().to_string())
3608 }
3609 req
3610 }
3611
3612 pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3616 where
3617 T: std::convert::Into<crate::model::IntelligenceConfig>,
3618 {
3619 self.0.request.intelligence_config = std::option::Option::Some(v.into());
3620 self
3621 }
3622
3623 pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3627 where
3628 T: std::convert::Into<crate::model::IntelligenceConfig>,
3629 {
3630 self.0.request.intelligence_config = v.map(|x| x.into());
3631 self
3632 }
3633
3634 pub fn set_update_mask<T>(mut self, v: T) -> Self
3638 where
3639 T: std::convert::Into<wkt::FieldMask>,
3640 {
3641 self.0.request.update_mask = std::option::Option::Some(v.into());
3642 self
3643 }
3644
3645 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3649 where
3650 T: std::convert::Into<wkt::FieldMask>,
3651 {
3652 self.0.request.update_mask = v.map(|x| x.into());
3653 self
3654 }
3655
3656 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3658 self.0.request.request_id = v.into();
3659 self
3660 }
3661 }
3662
3663 #[doc(hidden)]
3664 impl crate::RequestBuilder for UpdateOrganizationIntelligenceConfig {
3665 fn request_options(&mut self) -> &mut crate::RequestOptions {
3666 &mut self.0.options
3667 }
3668 }
3669
3670 #[derive(Clone, Debug)]
3687 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
3688
3689 impl GetIamPolicy {
3690 pub(crate) fn new(
3691 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3692 ) -> Self {
3693 Self(RequestBuilder::new(stub))
3694 }
3695
3696 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
3698 mut self,
3699 v: V,
3700 ) -> Self {
3701 self.0.request = v.into();
3702 self
3703 }
3704
3705 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3707 self.0.options = v.into();
3708 self
3709 }
3710
3711 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3713 (*self.0.stub)
3714 .get_iam_policy(self.0.request, self.0.options)
3715 .await
3716 .map(crate::Response::into_body)
3717 }
3718
3719 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3723 self.0.request.resource = v.into();
3724 self
3725 }
3726
3727 pub fn set_options<T>(mut self, v: T) -> Self
3729 where
3730 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3731 {
3732 self.0.request.options = std::option::Option::Some(v.into());
3733 self
3734 }
3735
3736 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
3738 where
3739 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
3740 {
3741 self.0.request.options = v.map(|x| x.into());
3742 self
3743 }
3744 }
3745
3746 #[doc(hidden)]
3747 impl crate::RequestBuilder for GetIamPolicy {
3748 fn request_options(&mut self) -> &mut crate::RequestOptions {
3749 &mut self.0.options
3750 }
3751 }
3752
3753 #[derive(Clone, Debug)]
3770 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
3771
3772 impl SetIamPolicy {
3773 pub(crate) fn new(
3774 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3775 ) -> Self {
3776 Self(RequestBuilder::new(stub))
3777 }
3778
3779 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
3781 mut self,
3782 v: V,
3783 ) -> Self {
3784 self.0.request = v.into();
3785 self
3786 }
3787
3788 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3790 self.0.options = v.into();
3791 self
3792 }
3793
3794 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
3796 (*self.0.stub)
3797 .set_iam_policy(self.0.request, self.0.options)
3798 .await
3799 .map(crate::Response::into_body)
3800 }
3801
3802 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3806 self.0.request.resource = v.into();
3807 self
3808 }
3809
3810 pub fn set_policy<T>(mut self, v: T) -> Self
3814 where
3815 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3816 {
3817 self.0.request.policy = std::option::Option::Some(v.into());
3818 self
3819 }
3820
3821 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
3825 where
3826 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
3827 {
3828 self.0.request.policy = v.map(|x| x.into());
3829 self
3830 }
3831
3832 pub fn set_update_mask<T>(mut self, v: T) -> Self
3834 where
3835 T: std::convert::Into<wkt::FieldMask>,
3836 {
3837 self.0.request.update_mask = std::option::Option::Some(v.into());
3838 self
3839 }
3840
3841 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3843 where
3844 T: std::convert::Into<wkt::FieldMask>,
3845 {
3846 self.0.request.update_mask = v.map(|x| x.into());
3847 self
3848 }
3849 }
3850
3851 #[doc(hidden)]
3852 impl crate::RequestBuilder for SetIamPolicy {
3853 fn request_options(&mut self) -> &mut crate::RequestOptions {
3854 &mut self.0.options
3855 }
3856 }
3857
3858 #[derive(Clone, Debug)]
3875 pub struct TestIamPermissions(
3876 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
3877 );
3878
3879 impl TestIamPermissions {
3880 pub(crate) fn new(
3881 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3882 ) -> Self {
3883 Self(RequestBuilder::new(stub))
3884 }
3885
3886 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
3888 mut self,
3889 v: V,
3890 ) -> Self {
3891 self.0.request = v.into();
3892 self
3893 }
3894
3895 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3897 self.0.options = v.into();
3898 self
3899 }
3900
3901 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
3903 (*self.0.stub)
3904 .test_iam_permissions(self.0.request, self.0.options)
3905 .await
3906 .map(crate::Response::into_body)
3907 }
3908
3909 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
3913 self.0.request.resource = v.into();
3914 self
3915 }
3916
3917 pub fn set_permissions<T, V>(mut self, v: T) -> Self
3921 where
3922 T: std::iter::IntoIterator<Item = V>,
3923 V: std::convert::Into<std::string::String>,
3924 {
3925 use std::iter::Iterator;
3926 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
3927 self
3928 }
3929 }
3930
3931 #[doc(hidden)]
3932 impl crate::RequestBuilder for TestIamPermissions {
3933 fn request_options(&mut self) -> &mut crate::RequestOptions {
3934 &mut self.0.options
3935 }
3936 }
3937
3938 #[derive(Clone, Debug)]
3955 pub struct GetIntelligenceFinding(RequestBuilder<crate::model::GetIntelligenceFindingRequest>);
3956
3957 impl GetIntelligenceFinding {
3958 pub(crate) fn new(
3959 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
3960 ) -> Self {
3961 Self(RequestBuilder::new(stub))
3962 }
3963
3964 pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRequest>>(
3966 mut self,
3967 v: V,
3968 ) -> Self {
3969 self.0.request = v.into();
3970 self
3971 }
3972
3973 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3975 self.0.options = v.into();
3976 self
3977 }
3978
3979 pub async fn send(self) -> Result<crate::model::IntelligenceFinding> {
3981 (*self.0.stub)
3982 .get_intelligence_finding(self.0.request, self.0.options)
3983 .await
3984 .map(crate::Response::into_body)
3985 }
3986
3987 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3991 self.0.request.name = v.into();
3992 self
3993 }
3994 }
3995
3996 #[doc(hidden)]
3997 impl crate::RequestBuilder for GetIntelligenceFinding {
3998 fn request_options(&mut self) -> &mut crate::RequestOptions {
3999 &mut self.0.options
4000 }
4001 }
4002
4003 #[derive(Clone, Debug)]
4024 pub struct ListIntelligenceFindings(
4025 RequestBuilder<crate::model::ListIntelligenceFindingsRequest>,
4026 );
4027
4028 impl ListIntelligenceFindings {
4029 pub(crate) fn new(
4030 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4031 ) -> Self {
4032 Self(RequestBuilder::new(stub))
4033 }
4034
4035 pub fn with_request<V: Into<crate::model::ListIntelligenceFindingsRequest>>(
4037 mut self,
4038 v: V,
4039 ) -> Self {
4040 self.0.request = v.into();
4041 self
4042 }
4043
4044 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4046 self.0.options = v.into();
4047 self
4048 }
4049
4050 pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingsResponse> {
4052 (*self.0.stub)
4053 .list_intelligence_findings(self.0.request, self.0.options)
4054 .await
4055 .map(crate::Response::into_body)
4056 }
4057
4058 pub fn by_page(
4060 self,
4061 ) -> impl google_cloud_gax::paginator::Paginator<
4062 crate::model::ListIntelligenceFindingsResponse,
4063 crate::Error,
4064 > {
4065 use std::clone::Clone;
4066 let token = self.0.request.page_token.clone();
4067 let execute = move |token: String| {
4068 let mut builder = self.clone();
4069 builder.0.request = builder.0.request.set_page_token(token);
4070 builder.send()
4071 };
4072 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4073 }
4074
4075 pub fn by_item(
4077 self,
4078 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4079 crate::model::ListIntelligenceFindingsResponse,
4080 crate::Error,
4081 > {
4082 use google_cloud_gax::paginator::Paginator;
4083 self.by_page().items()
4084 }
4085
4086 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4090 self.0.request.parent = v.into();
4091 self
4092 }
4093
4094 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4096 self.0.request.filter = v.into();
4097 self
4098 }
4099
4100 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4102 self.0.request.page_size = v.into();
4103 self
4104 }
4105
4106 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4108 self.0.request.page_token = v.into();
4109 self
4110 }
4111 }
4112
4113 #[doc(hidden)]
4114 impl crate::RequestBuilder for ListIntelligenceFindings {
4115 fn request_options(&mut self) -> &mut crate::RequestOptions {
4116 &mut self.0.options
4117 }
4118 }
4119
4120 #[derive(Clone, Debug)]
4141 pub struct SummarizeIntelligenceFindings(
4142 RequestBuilder<crate::model::SummarizeIntelligenceFindingsRequest>,
4143 );
4144
4145 impl SummarizeIntelligenceFindings {
4146 pub(crate) fn new(
4147 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4148 ) -> Self {
4149 Self(RequestBuilder::new(stub))
4150 }
4151
4152 pub fn with_request<V: Into<crate::model::SummarizeIntelligenceFindingsRequest>>(
4154 mut self,
4155 v: V,
4156 ) -> Self {
4157 self.0.request = v.into();
4158 self
4159 }
4160
4161 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4163 self.0.options = v.into();
4164 self
4165 }
4166
4167 pub async fn send(self) -> Result<crate::model::SummarizeIntelligenceFindingsResponse> {
4169 (*self.0.stub)
4170 .summarize_intelligence_findings(self.0.request, self.0.options)
4171 .await
4172 .map(crate::Response::into_body)
4173 }
4174
4175 pub fn by_page(
4177 self,
4178 ) -> impl google_cloud_gax::paginator::Paginator<
4179 crate::model::SummarizeIntelligenceFindingsResponse,
4180 crate::Error,
4181 > {
4182 use std::clone::Clone;
4183 let token = self.0.request.page_token.clone();
4184 let execute = move |token: String| {
4185 let mut builder = self.clone();
4186 builder.0.request = builder.0.request.set_page_token(token);
4187 builder.send()
4188 };
4189 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4190 }
4191
4192 pub fn by_item(
4194 self,
4195 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4196 crate::model::SummarizeIntelligenceFindingsResponse,
4197 crate::Error,
4198 > {
4199 use google_cloud_gax::paginator::Paginator;
4200 self.by_page().items()
4201 }
4202
4203 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4207 self.0.request.parent = v.into();
4208 self
4209 }
4210
4211 pub fn set_resource_scope<
4213 T: Into<crate::model::summarize_intelligence_findings_request::ResourceScope>,
4214 >(
4215 mut self,
4216 v: T,
4217 ) -> Self {
4218 self.0.request.resource_scope = v.into();
4219 self
4220 }
4221
4222 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4224 self.0.request.filter = v.into();
4225 self
4226 }
4227
4228 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4230 self.0.request.page_size = v.into();
4231 self
4232 }
4233
4234 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4236 self.0.request.page_token = v.into();
4237 self
4238 }
4239 }
4240
4241 #[doc(hidden)]
4242 impl crate::RequestBuilder for SummarizeIntelligenceFindings {
4243 fn request_options(&mut self) -> &mut crate::RequestOptions {
4244 &mut self.0.options
4245 }
4246 }
4247
4248 #[derive(Clone, Debug)]
4265 pub struct GetIntelligenceFindingRevision(
4266 RequestBuilder<crate::model::GetIntelligenceFindingRevisionRequest>,
4267 );
4268
4269 impl GetIntelligenceFindingRevision {
4270 pub(crate) fn new(
4271 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4272 ) -> Self {
4273 Self(RequestBuilder::new(stub))
4274 }
4275
4276 pub fn with_request<V: Into<crate::model::GetIntelligenceFindingRevisionRequest>>(
4278 mut self,
4279 v: V,
4280 ) -> Self {
4281 self.0.request = v.into();
4282 self
4283 }
4284
4285 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4287 self.0.options = v.into();
4288 self
4289 }
4290
4291 pub async fn send(self) -> Result<crate::model::IntelligenceFindingRevision> {
4293 (*self.0.stub)
4294 .get_intelligence_finding_revision(self.0.request, self.0.options)
4295 .await
4296 .map(crate::Response::into_body)
4297 }
4298
4299 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4303 self.0.request.name = v.into();
4304 self
4305 }
4306 }
4307
4308 #[doc(hidden)]
4309 impl crate::RequestBuilder for GetIntelligenceFindingRevision {
4310 fn request_options(&mut self) -> &mut crate::RequestOptions {
4311 &mut self.0.options
4312 }
4313 }
4314
4315 #[derive(Clone, Debug)]
4336 pub struct ListIntelligenceFindingRevisions(
4337 RequestBuilder<crate::model::ListIntelligenceFindingRevisionsRequest>,
4338 );
4339
4340 impl ListIntelligenceFindingRevisions {
4341 pub(crate) fn new(
4342 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4343 ) -> Self {
4344 Self(RequestBuilder::new(stub))
4345 }
4346
4347 pub fn with_request<V: Into<crate::model::ListIntelligenceFindingRevisionsRequest>>(
4349 mut self,
4350 v: V,
4351 ) -> Self {
4352 self.0.request = v.into();
4353 self
4354 }
4355
4356 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4358 self.0.options = v.into();
4359 self
4360 }
4361
4362 pub async fn send(self) -> Result<crate::model::ListIntelligenceFindingRevisionsResponse> {
4364 (*self.0.stub)
4365 .list_intelligence_finding_revisions(self.0.request, self.0.options)
4366 .await
4367 .map(crate::Response::into_body)
4368 }
4369
4370 pub fn by_page(
4372 self,
4373 ) -> impl google_cloud_gax::paginator::Paginator<
4374 crate::model::ListIntelligenceFindingRevisionsResponse,
4375 crate::Error,
4376 > {
4377 use std::clone::Clone;
4378 let token = self.0.request.page_token.clone();
4379 let execute = move |token: String| {
4380 let mut builder = self.clone();
4381 builder.0.request = builder.0.request.set_page_token(token);
4382 builder.send()
4383 };
4384 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4385 }
4386
4387 pub fn by_item(
4389 self,
4390 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4391 crate::model::ListIntelligenceFindingRevisionsResponse,
4392 crate::Error,
4393 > {
4394 use google_cloud_gax::paginator::Paginator;
4395 self.by_page().items()
4396 }
4397
4398 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4402 self.0.request.parent = v.into();
4403 self
4404 }
4405
4406 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4408 self.0.request.page_size = v.into();
4409 self
4410 }
4411
4412 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4414 self.0.request.page_token = v.into();
4415 self
4416 }
4417 }
4418
4419 #[doc(hidden)]
4420 impl crate::RequestBuilder for ListIntelligenceFindingRevisions {
4421 fn request_options(&mut self) -> &mut crate::RequestOptions {
4422 &mut self.0.options
4423 }
4424 }
4425
4426 #[derive(Clone, Debug)]
4443 pub struct ViewObjectFullContext(RequestBuilder<crate::model::ViewObjectFullContextRequest>);
4444
4445 impl ViewObjectFullContext {
4446 pub(crate) fn new(
4447 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4448 ) -> Self {
4449 Self(RequestBuilder::new(stub))
4450 }
4451
4452 pub fn with_request<V: Into<crate::model::ViewObjectFullContextRequest>>(
4454 mut self,
4455 v: V,
4456 ) -> Self {
4457 self.0.request = v.into();
4458 self
4459 }
4460
4461 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4463 self.0.options = v.into();
4464 self
4465 }
4466
4467 pub async fn send(self) -> Result<crate::model::ObjectFullContext> {
4469 (*self.0.stub)
4470 .view_object_full_context(self.0.request, self.0.options)
4471 .await
4472 .map(crate::Response::into_body)
4473 }
4474
4475 pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
4477 self.0.request.generation = v.into();
4478 self
4479 }
4480
4481 pub fn set_context_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
4485 self.0.request.context_key = v.into();
4486 self
4487 }
4488
4489 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4493 self.0.request.name = v.into();
4494 self
4495 }
4496 }
4497
4498 #[doc(hidden)]
4499 impl crate::RequestBuilder for ViewObjectFullContext {
4500 fn request_options(&mut self) -> &mut crate::RequestOptions {
4501 &mut self.0.options
4502 }
4503 }
4504
4505 #[derive(Clone, Debug)]
4522 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4523
4524 impl GetOperation {
4525 pub(crate) fn new(
4526 stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
4527 ) -> Self {
4528 Self(RequestBuilder::new(stub))
4529 }
4530
4531 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4533 mut self,
4534 v: V,
4535 ) -> Self {
4536 self.0.request = v.into();
4537 self
4538 }
4539
4540 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4542 self.0.options = v.into();
4543 self
4544 }
4545
4546 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4548 (*self.0.stub)
4549 .get_operation(self.0.request, self.0.options)
4550 .await
4551 .map(crate::Response::into_body)
4552 }
4553
4554 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4556 self.0.request.name = v.into();
4557 self
4558 }
4559 }
4560
4561 #[doc(hidden)]
4562 impl crate::RequestBuilder for GetOperation {
4563 fn request_options(&mut self) -> &mut crate::RequestOptions {
4564 &mut self.0.options
4565 }
4566 }
4567}